roampal-core
以下摘录自该仓库的 README(片段) · 在 GitHub 读完整 README →
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 Target a specific tool: roampal init --claude-code or roampal init --opencode
Platform Differences
The core loop is identical — both platforms inject context, capture exchanges, and score outcomes. The delivery mechanism differs:
| | Claude Code | OpenCode |
|--|-------------|----------|
| Context injection | Hooks (stdout) | Plugin (system prompt) |
| Exchange capture | Stop hook | Plugin session.idle event |
| Scoring | Main LLM via score_memories tool | Independent sidecar (your chosen model, disabled by default until configured) |
| Self-healing | Hooks auto-restart server on failure | Plugin auto-restarts server on failure |
Claude Code prompts the main LLM to score each exchange via the score_memories tool. OpenCode never self-scores — an independent sidecar (a separate API call) reviews each exchange as a third party, removing self-assessment bias. The score_memories tool is not registered on OpenCode. Scoring is disabled by default until you explicitly configure it via roampal sidecar setup. During setup, Roampal detects local models (Ollama, LM Studio, etc.) and lets you choose a scoring model. Zen free models are available as an explicit opt-in choice for users without a local model or API key — they route through OpenCode's proxy which may log data. A cheap or local model works great — scoring doesn't need a powerful model.
> **v0.6.0:** Server lifecycle + per-directory profile binding + a dedup safety net. The 4,700-line roampal/cli.py monolith is now a roampal/cli/ package split into per-domain modules, guarded by golden-output snapshots, dispatch-table invariants, and a byte-identical equivalence suite. User-visible changes on top: per-request profile routing (hooks/MCP/plugin always name their profile; an unregistered name now fails explicitly with a "Create it first" 404 instead of silently writing to the default store); roampal profile switch no longer kills the running server (every session picks the new profile up on its next exchange); spawned servers run with -E [-P] isolation and a neutral cwd (a project containing a local roampal/ directory can no longer shadow the install — and user-site installs, e.g. Microsoft Store Python, work again — an earlier draft of this spawn hardening used the isolated -I flag, which also hides the user site-packages directory); status reports a hanging port as stopped, not error; shared servers retire themselves after 30 idle minutes (a foreground roampal start is exempt); and roampal start --profile X survives idle respawn via a persisted launch pin. New roampal profile bind / unbind pin a directory (and its subdirectories) to a profile — "this project always uses profile X" is one command instead of hand-editing env JSON. A dedup regression guard test (3 distinct facts through the real store_memory_bank path, plus recorded real-model vectors and a negative control that re-creates the v0.5.9 broken regime both ways) makes any future embedder swap or distance-constant change fail the suite at the first touch instead of silently collapsing writes. **Privacy fix (OpenCode):** since v0.3.7 the OpenCode plugin sent exchange text to Zen (opencode.ai) whenever no scoring model was chosen — including after "Skip" and roampal sidecar disable — breaking v0.5.3's "nothing leaves your machine without an explicit choice" rule, which had only been applied server-side. v0.6.0 enforces it in the plugin: Zen only after an explicit opt-in, and no scoring calls at all until a model is chosen. If you use OpenCode and never picked a scoring model, scoring is now off until you run roampal sidecar setup (or --list to choose without the menu). No RAM change — the v0.5.9 footprint and model state carry over unchanged.