RA

roampal-ai/roampal-core

Developer tools
50 stars 0 forks Quality 35 Trend 35

Outcome-Based Persistent Memory MCP Server

Overview

Outcome-Based Persistent Memory MCP Server

README

roampal-core

Outcome-Based Persistent Memory MCP Server

Two commands. Your AI coding assistant gets outcome-based memory. Works with Claude Code and OpenCode.


Benchmarks

85.8% on the corrected LoCoMo benchmark (non-adversarial, end-to-end answer accuracy) — validated on 1,986 questions across 10 conversations with dual grading. All figures in this section are sourced from the paper and roampal-labs (see citations at the bottom of this section).

Result Score
Conversational learning vs raw ingestion +23 points (76.6% vs 53.0%, p<0.0001)
Architecture vs model effect Architecture ~10x larger contributor
Poison resilience (1,135 adversarial memories) -2.6 to -4.2 points only
TagCascade retrieval (tags-first + CE rerank) +1.9 Hit@1 vs pure CE (p<0.0001)

Benchmark pipeline runs on a single GPU with no cloud dependencies. Roampal itself runs on CPU — no GPU required. Full methodology, data, and evaluation scripts: roampal-labs

Paper: “Beyond Ingestion: What Conversational Memory Learning Reveals on a Corrected LoCoMo Benchmark” (Logan Teague, April 2026)


Quick Start

pip install roampal
roampal init

Auto-detects installed tools. Restart your editor and start chatting.

Target a specific tool: roampal init --claude-code or roampal init --opencode

How It Works

When you type a message, Roampal automatically injects relevant context before your AI sees it:

You type:

fix the auth bug

Your AI sees:

═══ KNOWN CONTEXT ═══
• JWT refresh pattern fixed auth loop [id:patterns_a1b2] (3d, 90% proven, patterns)
• User prefers: never stage git changes [id:mb_c3d4] (memory_bank)
═══ END CONTEXT ═══

fix the auth bug

No manual calls. No workflow changes. It just works.

The Loop

  1. You type a message
  2. Roampal injects relevant context automatically (hooks in Claude Code, plugin in OpenCode)
  3. AI responds with full awareness of your history, preferences, and what worked before
  4. Outcome scored — good advice gets promoted, bad advice gets demoted
  5. Repeat — the system gets smarter every exchange

Five Memory Collections

Collection Purpose Lifetime
working Current session context 24h — promotes if useful, deleted otherwise
history Past conversations 30 days, outcome-scored
patterns Proven solutions Persistent while useful, promoted from history
memory_bank Identity, preferences, goals Permanent
books Uploaded reference docs Permanent

Commands

roampal init                # Auto-detect and configure installed tools
roampal init --claude-code  # Configure Claude Code explicitly
roampal init --opencode     # Configure OpenCode explicitly
roampal init --no-input     # Non-interactive setup (CI/scripts)
roampal start               # Start the HTTP server manually
roampal stop                # Stop the HTTP server
roampal status              # Check if server is running
roampal status --json       # Machine-readable status (for scripting)
roampal stats               # View memory statistics
roampal stats --json        # Machine-readable statistics (for scripting)
roampal doctor              # Diagnose installation issues
roampal summarize           # Summarize long memories (retroactive cleanup)
roampal score               # Score the last exchange (manual/testing)
roampal context             # Output recent exchange context
roampal ingest        # Add documents to books collection
roampal books               # List all ingested books
roampal remove       # Remove a book by title
roampal sidecar status      # Check scoring model configuration (OpenCode)
roampal sidecar setup       # Configure scoring model (OpenCode)
roampal sidecar test        # Test scoring model response format (OpenCode)
roampal retag               # Re-extract tags on memories using sidecar LLM
roampal sidecar disable     # Disable scoring (removes config, retrieval still works)

# Sidecar scope flags (v0.5.3+) — OpenCode merges project-local over user-global config:
roampal sidecar setup --scope user       # Write only to user-global config (~/.config/opencode/)
roampal sidecar setup --scope project    # Write only to project-local opencode.json in cwd ancestry
roampal sidecar setup                    # Auto-detects: uses project-local if shadow exists, otherwise user-global

# Sidecar scope flags for disable (v0.5.3+):
roampal sidecar disable --scope user       # Clear only from user-global config
roampal sidecar disable --scope project    # Clear only from project-local opencode.json
roampal sidecar disable                    # Auto-detects scope same as setup

# Named memory profiles (v0.5.1) — isolate memory per project, per client, etc.
roampal profile list                         # List registered profiles
roampal profile show                         # Show active profile and its path
roampal profile create                 # Create auto-located profile
roampal profile register  --path  # Register an existing directory
roampal profile use                    # Persist as user-global default
roampal profile unuse                        # Clear persistence
roampal profile switch                 # Persist + kill running server
roampal profile delete                 # Remove from registry
roampal start --profile                # One-off launch on a profile

Named Memory Profiles (v0.5.1)

Run separate memory stores for different contexts — per project, per client (Claude Code vs OpenCode), work vs home. Profiles are managed entirely through the CLI; no config files to hand-edit.

roampal profile create work          # auto-located at /Roampal/data/work/
roampal profile switch work          # persist + kill running server
# next MCP tool call spawns a fresh server on 'work'

Register an existing directory as a profile (no data migration):

roampal profile register project-a --path /existing/custom/path

Precedence (highest wins):

  1. --profile flag
  2. ROAMPAL_PROFILE= env var (set per-project in opencode.json or .claude.json env: {})
  3. roampal profile use persisted default
  4. "default" fallback

MCP Tools

Your AI gets these memory tools:

Tool Description Platforms
search_memory Deep search across all collections Both
add_to_memory_bank Store permanent facts (identity, preferences, goals) Both
update_memory Correct or update existing memories Both
delete_memory Remove outdated info Both
score_memories Score previous exchange outcomes Claude Code
record_response Store key takeaways from significant exchanges Both

How scoring works: Claude Code’s hooks prompt the main LLM to call score_memories every turn. OpenCode uses an independent sidecar that scores silently in the background — the model never sees a scoring prompt and score_memories is not registered as a tool. If the sidecar is unavailable, a warning prompts the user to run roampal sidecar setup. Choose your scoring model during roampal init or via roampal sidecar setup.

How Roampal Compares

Feature Roampal Core Claude Code built-in (CLAUDE.md / auto memory) OpenCode built-in
Learns from outcomes Yes — bad advice demoted, good advice promoted No No
Semantic retrieval Yes — TagCascade + cross-encoder reranking No — files loaded in full, no search No memory system
Context injection Automatic — relevant memories per query Full CLAUDE.md every session, auto memory on demand None
Atomic fact extraction Yes — summaries + facts, two-lane retrieval No — saves what Claude decides is useful No
Works across projects Yes — shared memory across all projects Per-project only (per git repo) No memory
Scales with history Yes — 5 collections, promotion/demotion/decay CLAUDE.md unbounded, auto memory first 200 lines No memory
Fully local / private Yes — ChromaDB on your machine Yes Yes

Requirements

  • Python 3.10+
  • One of: Claude Code or OpenCode
  • Platforms: Windows, macOS, Linux (primarily developed and tested on Windows)
  • RAM: ~800MB available (cross-encoder reranker + embeddings + ChromaDB)
  • Disk: ~500MB for models (multilingual embedding + reranker, downloaded automatically on first use)
  • CPU: Any modern x86-64 processor with AVX2 (Intel Haswell 2013+ / AMD Excavator 2015+)
  • GPU: Not required — all inference runs on CPU via ONNX Runtime

Troubleshooting

Still stuck? Ask your AI for help — it can read logs and debug Roampal issues directly.

Support

Roampal Core is completely free and open source.

License

Apache 2.0

View this README on GitHub

Install

This server does not publish a one-line install command.

Open the repository installation guide