Labsco
roampal-ai logo

roampal-core

β˜… 45

from roampal-ai

Persistent memory for Claude Code with outcome-based learning. Tracks what helped vs failed, auto-injects context via hooks.

πŸ”₯πŸ”₯πŸ”₯πŸ”₯βœ“ VerifiedFreeQuick setup
<h1 align="center">roampal-core</h1> <p align="center"><strong>Outcome-Based Persistent Memory MCP Server</strong></p> <p align="center"> <a href="https://github.com/roampal-ai/roampal-core/actions/workflows/tests.yml"><img src="https://img.shields.io/github/actions/workflow/status/roampal-ai/roampal-core/tests.yml?branch=main&style=flat-square&label=tests" alt="Tests"></a> <a href="https://pypi.org/project/roampal/"><img src="https://img.shields.io/pypi/v/roampal?color=blue&style=flat-square" alt="PyPI"></a> <a href="https://github.com/roampal-ai/roampal-core/releases/latest"><img src="https://img.shields.io/github/v/release/roampal-ai/roampal-core?label=latest&color=blue&style=flat-square" alt="Latest release"></a> <a href="https://pypi.org/project/roampal/"><img src="https://img.shields.io/pypi/dm/roampal?color=blue&style=flat-square" alt="Downloads"></a> <a href="https://github.com/roampal-ai/roampal-core/stargazers"><img src="https://img.shields.io/github/stars/roampal-ai/roampal-core?color=blue&style=flat-square" alt="Stars"></a> <a href="https://github.com/roampal-ai/roampal-core/blob/main/LICENSE"><img src="https://img.shields.io/badge/license-Apache%202.0-blue?style=flat-square" alt="License"></a> <a href="https://www.python.org/downloads/"><img src="https://img.shields.io/badge/python-3.10+-blue?style=flat-square" alt="Python"></a> <a href="https://discord.com/invite/F87za86R3v"><img src="https://img.shields.io/badge/discord-join-blue?style=flat-square" alt="Discord"></a> </p> <p align="center"> <strong>Two commands. Your AI coding assistant gets outcome-based memory.</strong><br> Works with <strong>Claude Code</strong> and <strong>OpenCode</strong>. </p>

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).

ResultScore
Conversational learning vs raw ingestion+23 points (76.6% vs 53.0%, p<0.0001)
Architecture vs model effectArchitecture ~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)


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

CollectionPurposeLifetime
workingCurrent session context24h β€” promotes if useful, deleted otherwise
historyPast conversations30 days, outcome-scored
patternsProven solutionsPersistent while useful, promoted from history
memory_bankIdentity, preferences, goalsPermanent
booksUploaded reference docsPermanent

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 <file>       # Add documents to books collection
roampal books               # List all ingested books
roampal remove <title>      # 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 <name>                # Create auto-located profile
roampal profile register <name> --path <dir> # Register an existing directory
roampal profile use <name>                   # Persist as user-global default
roampal profile unuse                        # Clear persistence
roampal profile switch <name>                # Persist + kill running server
roampal profile delete <name>                # Remove from registry
roampal start --profile <name>               # 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 <appdata>/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 <name> flag
  2. ROAMPAL_PROFILE=<name> env var (set per-project in opencode.json or .claude.json env: {})
  3. roampal profile use <name> persisted default
  4. "default" fallback

MCP Tools

Your AI gets these memory tools:

ToolDescriptionPlatforms
search_memoryDeep search across all collectionsBoth
add_to_memory_bankStore permanent facts (identity, preferences, goals)Both
update_memoryCorrect or update existing memoriesBoth
delete_memoryRemove outdated infoBoth
score_memoriesScore previous exchange outcomesClaude Code
record_responseStore key takeaways from significant exchangesBoth

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

FeatureRoampal CoreClaude Code built-in (CLAUDE.md / auto memory)OpenCode built-in
Learns from outcomesYes β€” bad advice demoted, good advice promotedNoNo
Semantic retrievalYes β€” TagCascade + cross-encoder rerankingNo β€” files loaded in full, no searchNo memory system
Context injectionAutomatic β€” relevant memories per queryFull CLAUDE.md every session, auto memory on demandNone
Atomic fact extractionYes β€” summaries + facts, two-lane retrievalNo β€” saves what Claude decides is usefulNo
Works across projectsYes β€” shared memory across all projectsPer-project only (per git repo)No memory
Scales with historyYes β€” 5 collections, promotion/demotion/decayCLAUDE.md unbounded, auto memory first 200 linesNo memory
Fully local / privateYes β€” ChromaDB on your machineYesYes
<details> <summary><strong>Architecture</strong></summary>
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  pip install roampal && roampal init                    β”‚
β”‚    Claude Code: hooks + MCP β†’ ~/.claude/                β”‚
β”‚    OpenCode:    plugin + MCP β†’ ~/.config/opencode/      β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                         β”‚
                         β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  HTTP Hook Server (port 27182)                          β”‚
β”‚    Auto-started on first use, self-heals on failure     β”‚
β”‚    Manual control: roampal start / roampal stop         β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                         β”‚
                         β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  User types message                                     β”‚
β”‚    β†’ Hook/plugin calls HTTP server for context          β”‚
β”‚    β†’ AI sees relevant memories, responds                β”‚
β”‚    β†’ Exchange stored, scored (hooks or sidecar)         β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                         β”‚
                         β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  Single-Writer Backend                                  β”‚
β”‚    FastAPI β†’ UnifiedMemorySystem β†’ ChromaDB             β”‚
β”‚    All clients share one server, isolated by session    β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

See dev/docs/ for full technical details.

</details>

Support

Roampal Core is completely free and open source.

<p align="center"> <a href="https://glama.ai/mcp/servers/roampal-ai/roampal-core"><img src="https://glama.ai/mcp/servers/roampal-ai/roampal-core/badges/card.svg" alt="roampal-core MCP server"></a> </p>

License

Apache 2.0