mcpField
R
Robrain

Robrain

Local
robrain.devMemory & Knowledge81Updated 1d ago

About Robrain

RoBrain is a shared decision-memory server for teams and AI agents, storing decisions and rejected alternatives in PostgreSQL. It passively captures sessions and scans the corpus for contradictions and drift, with self-hosted and Rory Plans cloud options.

Key features

  1. 01Passive capture of decisions
  2. 02Structured rejected alternatives
  3. 03Shared PostgreSQL memory
  4. 04Corpus-wide contradiction and drift scans
  5. 05Warnings about previously rejected paths
  6. 06Self-hosted or managed cloud

Use cases

  1. 01Share decisions across coding agents
  2. 02Warn agents against rejected approaches
  3. 03Review conflicting or drifting decisions
  4. 04Keep decision memory on local infrastructure

MCP support

RoBrain exposes its memory capabilities through the Sensing MCP integration, which editors and AI agents can connect to. Connected agents can capture and recall shared decisions and receive veto-aware warnings.

Configuration

Local server config is the same for every client. Copy it into your client’s MCP config file.

mcp.json · Universal config
{
"mcpServers": {
"robrain": {
"command": "npx",
"args": [
"-y",
"robrain"
],
"env": {
"PERCEPTION_API_URL": "<PERCEPTION_API_URL>",
"PERCEPTION_API_KEY": "<PERCEPTION_API_KEY>"
}
}
}
}
Run commandnpx -y robrain
Environment variables to set
PERCEPTION_API_URLPerception API URL. Optional — read from ~/.robrain/config.json after `npx robrain up`.
PERCEPTION_API_KEYSecretPerception API key. Optional — read from ~/.robrain/config.json after `npx robrain up`.

Local servers need a runtime on your machine (e.g. Node.js 18+). Config file locations differ by client; see your client’s docs.

Packages
npmrobrain2.5.0

Tools

4

Saved tool list · updated 3w ago

ParameterTypeRequiredDescription
project_idstringYesRepository name or path hash identifying the project
session_idstring|nullNoUnique id for this session. Omit, use null, or "" to let the server generate one (recommended). Otherwise supply a fresh id per chat (e.g. ISO timestamp + 4 hex chars).

Details

From the project README

RoBrain

VetoBench

Shared memory across your team and your AI agents — with judgment!

RoBrain isn't just another memory layer — it's the brain that helps you and your agents make better decisions and avoid costly mistakes.

Self-hosted on your own Postgres. Passive capture, structured vetoes, corpus-wide contradiction scans — nothing leaves your machine. Works with Claude Code, Cursor, GitHub Copilot (VS Code), Codex CLI, Hermes and more.

Measured: without decision memory, a coding agent re-proposes an approach your team already rejected in up to 9 of 10 tasks. Through RoBrain's full pipeline: 0 of 50, across five archived runs — VetoBench.

What it is

RoBrain records what your team and its agents decide — and the alternatives they ruled out — without anyone tagging anything by hand. Sensing captures session turns; Perception extracts each decision into Postgres, where every row can carry a structured rejected[] field.

Most agent-memory tools stop at capture: they store what happened and hope you query it later. RoBrain adds judgment. Batch Synthesis reads the whole corpus to flag contradictions, stance drift, and recurring entities that no single session could see.

The point is the handoff. Someone makes a deliberate call in Cursor on Tuesday — say, keeping Perception on Hono instead of porting to Express. A new teammate opens Claude Code on Wednesday with no memory of it and asks to make exactly that change. RoBrain surfaces the recorded rationale before the agent steers down a path you already rejected — same Postgres store, same vetoes, captured passively.

The cost of forgetting a rejection isn't inefficiency. It's the auth bypass you already patched, the migration you already rolled back, the dependency you already removed for a CVE — re-suggested by an agent with no memory of why you said no.

Coding is the first vertical because the feedback loops are tight — reverts, incidents, and rework make the cost of a forgotten rejection measurable. The same architecture applies wherever agents make decisions that outlast a session.

How it works, the two pillars (capture + judgment), and the full walkthrough: docs/concepts.md.

Install

Two ways to run RoBrain — pick one:

  • Option 1 · Self-hosted (free, open source): everything runs on your machine — your Postgres, your API keys, nothing leaves your laptop.
  • Option 2 · Rory Plans cloud (managed): nothing to host, no keys — included with every paid Rory Plans plan.
Option 1 · Self-hosted (free, open source)

No clone needed — robrain up pulls the published Perception image and generates credentials into ~/.robrain/stack/.env.

Default path uses Anthropic (extraction) + OpenAI (embeddings). Other setups (OpenAI-only, Gemini, other embeddings, fully local) — Concepts — Prefer a different provider setup?.

export ANTHROPIC_API_KEY=... OPENAI_API_KEY=...   # or add them to ~/.robrain/stack/.env after the first run
npx robrain@latest up                             # start Postgres + Perception from ghcr.io
npx robrain install --self-hosted                 # wire Sensing MCP into your editors
From a clone instead (development, or building the image yourself)

First pnpm docker:up auto-creates .env and fills PERCEPTION_API_KEY / POSTGRES_PASSWORD. Perception still needs your LLM + embedding keys before it stays up.

git clone https://github.com/adelinamart/robrain
cd robrain
pnpm install && pnpm build
pnpm docker:up                 # first run: creates .env; Perception won't start yet
# open .env, add LLM + embedding keys for the provider path you chose (default: ANTHROPIC_API_KEY + OPENAI_API_KEY)
pnpm docker:up                 # second run: Perception now boots
pnpm robrain install --self-hosted --repo-root "$(pwd)"

pnpm robrain runs the CLI you just built (node packages/cli/bin/robrain.js). Use it instead of npx robrain everywhere in this clone — npx resolves to the published package or a stale global install, not your working tree.

Upgrading a self-hosted install

No-clone stack: re-run npx robrain@latest up (pulls the new Perception image and applies startup DB migrations) then npx robrain@latest install --self-hosted. From a clone: git pull → pnpm install && pnpm build → pnpm docker:up:build → pnpm robrain install --self-hosted --repo-root "$(pwd)" → fully restart editors. Full checklist: CLI reference — Upgrading.

Claude Code plugin (self-hosted)

Claude Code users on the self-hosted stack can add hook-based capture and pre-task warnings about previously rejected approaches — no CLAUDE.md protocol needed:

claude plugin marketplace add adelinamart/robrain
claude plugin install robrain@robrain

Details: plugins/claude-code. robrain init-project also recommends the plugin to collaborators via the project's .claude/settings.json, so teammates get an install prompt from Claude Code itself (opt out with --skip-claude-plugin).

Option 2 · Rory Plans cloud (managed)

On any paid Rory Plans plan, RoBrain runs without hosting anything:

npx robrain install          # no flags — cloud mode

Sign in at roryplans.ai, create an API token on your profile page, and paste it when the installer asks. That's the whole setup: no Docker, no database, no LLM or embedding keys — extraction and search run on our side. Your editors (Claude Code, Cursor, Copilot, Codex CLI) are wired automatically, and teammates on your Rory Plans team share the same memory.

Every paid plan qualifies — individual standard or annual, Teams, and enterprise. Solo subscribers get a private memory space; teams share one. Self-hosting stays free and fully supported (see Install above); the comparison table shows what each tier adds.

Quickstart

After either install (self-hosted or cloud):

# Wire capture into an application project (run inside the repo)
cd /path/to/your/project
npx robrain init-project          # writes CLAUDE.md, AGENTS.md, .cursor/rules/robrain.mdc

# Capture and recall are automatic from here:
#   - every session turn is classified, no tagging
#   - prior decisions load at session start via the always-on summary

# Explain any file's decision history
npx robrain explain path/to/file

# Inspect / approve captured rows (both modes)
npx robrain review

# Run corpus judgment — self-hosted only; cloud runs judgment server-side
npx robrain synth                 # drift, contradictions, entity promotion

After init-project, every repo gets CLAUDE.md and AGENTS.md (Codex CLI), and Cursor also gets .cursor/rules/robrain.mdc with alwaysApply: true. If captures don't land, run npx robrain doctor — see Troubleshooting.

Tune what gets captured

By default the classifier stores decisions and the alternatives you rejected, and nothing else. When a project wants more, less, or something different, tell it in plain language. The settings are stored per project on Perception, so every teammate's sessions capture the same way:

npx robrain capture show
npx robrain capture set --instructions "Skip anything about the marketing site. Treat naming conventions as decisions."
npx robrain capture set --min-confidence 0.75                      # less noise
npx robrain capture set --mode broad                               # every turn reaches the model, not only keyword hits
npx robrain capture set --add-kind "run: The outcome of an agent run: what ran, when, and whether it succeeded."
npx robrain capture test --file sample-turns.jsonl --compare       # dry run before you commit to it

Extra kinds of memory sit beside decisions: each entry names a subject, and a newer entry about the same subject replaces the older one, so a kind can hold changing state (the last run of an agent) as well as rules. Only decisions carry vetoes. Flags and formats: CLI reference.

Synthesis

Synthesis runs three passes over the full decisions table — drift (stance moving without an explicit reversal), contradictions (incompatible decisions from different sessions), and entity promotion (recurring tools/patterns condensed into planning_blocks). It writes flags and edges into your DB; it does not capture new decisions — it judges the corpus you already have.

pnpm synthesis:build && pnpm synthesis:run
# or: npx robrain synth

Review what it finds with npx robrain review. Deep dive (three passes, cron, env vars): Concepts — Synthesis.

Editor integration

One cross-tool setup covers Claude Code, Cursor, GitHub Copilot (VS Code), and Codex CLI against the same Postgres store. The classifier LLM is your choice — Anthropic Haiku or OpenAI. Decisions carry a lifecycle (active / superseded / invalidated) and a graph (conflicts_with / extends / related_to).

Codex CLI / IDE also gets hook-based capture and pre-task veto warnings — the same lifecycle hooks as the Claude Code plugin, wired automatically by robrain install into ~/.codex/config.toml (Codex asks you to trust them on first run). Docs: plugins/codex.

Running Hermes? npx robrain install --hermes drops a standalone memory-provider plugin into ~/.hermes/plugins/ — passive capture and veto-aware recall through the same Perception API. Docs: integrations/hermes.

Decision ledger for git (opt-in):

npx robrain export-memory --ledger
# custom path: npx robrain export-memory --ledger docs/decisions.md

Common questions

How do I stop an AI coding agent from re-proposing something my team already rejected?

Record the rejection once — RoBrain captures it passively from the session where it happened — and every connected agent gets a veto warning before steering down that path again: the decision, the rejected option, and the original reason. See Editor integration and the Claude Code plugin.

How do I share memory across Claude Code, Cursor, Copilot, and Codex?

One npx robrain install --self-hosted wires every detected editor to the same Postgres store; npx robrain init-project registers a repo once. A decision made in Cursor on Tuesday reaches a teammate's Claude Code on Wednesday.

Is the data stored in files or a database — and does it leave my machine?

Everything lives in PostgreSQL (with pgvector for embeddings) — structured rows, not flat files. Self-hosted, the database runs in Docker on your machine, and nothing leaves it except calls to the LLM/embedding provider you configure (a local model works too). In Rory Plans cloud, only extracted decision objects are stored; raw conversation text is not retained after extraction.

How is RoBrain different from a vector database or RAG?

A vector store retrieves what is similar; RoBrain also knows what was rejected. Rejections are first-class structured data (rejected[]), surfaced as warnings before the agent acts — and the corpus is actively judged: contradiction scans, drift detection, and git-outcome feedback that sinks decisions reality has already reverted. VetoBench measures the difference.

When should I use Rory Plans cloud instead of self-hosting?

Self-host when you want everything on your own infrastructure, free. Choose Rory Plans cloud when you want nothing to host and no API keys to manage — included with every paid Rory Plans plan, with memory shared across your team's org.

How does RoBrain relate to Rory Plans?

Rory Plans is the Cloud Office for humans and AI agents — where workflows are designed and humans and agents are orchestrated together. RoBrain is its open-source memory layer: standalone and self-hostable forever, managed as part of Rory Plans for teams.

Compared to other tools

Versus Mem0, Cloudflare Agent Memory, and Claude Code Auto-Memory: only RoBrain stores rejected alternatives as structured fields and runs corpus-wide contradiction scans (manual or cron). And we measured what that difference costs: VetoBench found Mem0's ingestion dropped the recorded rejection from 38% of retrieved contexts on identical input. Full comparison →

Self-hosted vs Rory Plans cloud
FeatureFree / self-hostedRory Plans cloud
Passive session capture✓✓
rejected[] field as structured data✓✓
Decision lifecycle (active / superseded / invalidated)✓✓
Cross-tool MCP — Claude Code, Cursor, Copilot, Codex CLI, Hermes✓✓
Classifier LLM choice — Anthropic Haiku or OpenAI✓✓
Always-on summary at session start✓✓
npx robrain review / inject / explain / export-memory✓✓
Synthesis — drift, contradictions, entity promotion✓✓
Synthesis prompt rubrics — per-project overrides (.robrain/rubrics/)✓✓
Decision graph (conflicts_with / extends / related_to)✓✓
Provenance on every memory — source session, turn, excerpt; compiled blocks carry source decision ids✓✓
Memory quality feedback — used/ignored counters, auto-demotion✓✓ richer: helpful/pushback per injection
Outcome linking — git reverts feed back into memory rank✓✓
Secrets redaction at capture and ingest✓✓
Memory interchange export (robrain-memory/v1 JSONL)✓✓
Open retrieval eval + VetoBench gates in CI✓same scorer
Self-host on your infrastructure✓—
Your data stays local✓processed remotely
Fully-local mode — LLM + embeddings on Ollama/LM Studio/vLLM✓—
Calibrated extraction prompt (fewer false positives)—✓
Calibrated 4-way contradiction taxonomy—✓
Automatic injection at task boundaries—✓
Deterministic veto scan (POST /veto-scan)✓—
Pre-task rejected[] warningClaude Code (plugin) + Codex (hooks) + Hermes (provider)✓ everywhere
Disengagement protocol (⚠ acknowledgement)—✓
Pre-commit conflict verdict (/dry-run structured check)—✓
5-signal relevance scorer✓ on retrieval (GET /decisions?query=)✓ applied automatically per task
Conflict auto-resolution (guard-railed) + dashboard visualizations—✓
Vetoes survive supersession — rejection history follows the newest decision✓✓ full history merge
Write-time supersession detection — "we switched X→Y" never dedups away—✓
Decision lineage timeline (API + dashboard)—✓
Team memory — orgs, API keys, roles, scoped isolation—✓
Web dashboard—✓

Self-hosted gives capture, judgment batch jobs, outcomes feedback, and session-start recall; you pull focused context with inject when needed. Cloud adds Planning + Control so vetoes and conflicts surface automatically at task boundaries — same CLI surface, wire-compatible with Sensing capture. Details: Concepts — Free / self-hosted vs Rory Plans cloud.

VetoBench

Memory benchmarks usually ask "did the right item come back?" VetoBench asks what that misses: given a task that invites an approach the team already rejected, does the agent propose it again?

Memory conditionRe-proposed a rejected approachCould cite the prior rejection
No memory8–9 of 10 tasks0–10%
Conventions file (choices only — what most teams have today)1–2 of 1080–90%, but inferred: the reasons aren't there
Mem0 — full pipeline, 5 archived runs0–2 of 10 per run50–90%
RoBrain — full pipeline, 5 archived runs0 of 10, every run100%

(claude-haiku-4-5, 2026-07-07/08; every condition measured as a five-run archived series, ranges because runs vary. Mem0 and RoBrain ingested byte-identical transcripts, each through its own real production extraction.)

Two findings behind the table. Mem0's ingestion dropped the recorded rejection from 38% of retrieved contexts, and violations concentrated exactly there — 26% when the veto was absent vs 3% when present: the agent avoided Express in all five runs but could never say why, and where the axios veto was lost it re-proposed axios outright in 3 of 5 runs. RoBrain's production extractor, on the same input, kept 100/100 vetoes — keeping the veto is the extraction prompt's job, not a side effect of fact summarization.

Meta Muse Spark 1.1 (2026-07-14, five archived runs). Meta's newly launched agentic flagship, via Vercel AI Gateway. Without memory it re-proposed rejected approaches in 4–6 of 9 tasks per run — Redux, Prisma, Jest, and GraphQL in all five runs. With RoBrain decision memory: 0 violations in all 45 cells, naming the prior rejection every time — quoting the recorded reason and date verbatim where it elaborated. The cleanest cell: asked to cut mobile overfetching, the no-memory run proposed a full GraphQL rollout (the approach the team had ruled out) five runs out of five; with RoBrain in context it proposed REST sparse fieldsets and quoted the recorded rejection. Honest notes: this is not a Muse Spark problem — every frontier model we baselined violates without memory on the same nine scenarios (claude-opus-4.8: 3–4, gpt-5.5: 5, gemini-3-pro-preview: 6–7, Haiku 7–8; Prisma and Jest fell to every model in every run — and with RoBrain context those same three models went 0 violations in 54/54 cells, for 99/99 across four vendors — receipts), a bare conventions file also prevented violations for this model at this corpus size (the RoBrain delta is verbatim citations vs inferences, automatic capture, and retrieval at scale), and one scenario is excluded (n=9) because Meta's content filter deterministically blocks a benign session-caching prompt. Receipts and caveats: results/muse-spark-1.1-series/ · write-up: docs/blog/2026-07-14-muse-spark-forgets-your-vetoes.md.

Every retrieved context, agent reply, and verdict is committed in packages/vetobench/results/ — check the work before quoting it. The retrieval layer runs offline with no API key and gates CI (pnpm --filter @robrain/vetobench bench); judging is deterministic — no LLM judge. Any memory system plugs in through one adapter interface; PRs welcome, including ones that make us look bad. Methodology, honesty caveats, and fixtures: packages/vetobench/README.md.

Security

The memory corpus is guarded by PERCEPTION_API_KEY — a random secret in the repo-root .env that every client (Sensing MCP, CLI, Synthesis) sends as a Bearer token and Perception verifies on every request except /health. It is not issued by any service: pnpm docker:up generates one automatically on first run, or set your own (e.g. openssl rand -hex 32). Installing (pnpm robrain install --self-hosted from a clone, npx robrain install --self-hosted otherwise) copies the same value into your editor configs so clients authenticate.

Perception refuses to start when the key is empty — running unauthenticated requires an explicit opt-in. Upgrading from a version that ran without a key: add one to .env (or re-run pnpm docker:up to auto-fill it), then re-run install (pnpm robrain install --self-hosted from a clone, npx robrain install --self-hosted otherwise) so editors pick it up. Details and the opt-in flag are documented in .env.example.

Also on by default: secrets redaction (API keys, tokens, private keys, connection-string passwords are scrubbed at capture and again at ingest, before anything is embedded or stored), and a fully-local mode where extraction and embeddings run on an OpenAI-compatible local server (Ollama / LM Studio / vLLM) — see CLI — Fully-local LLM and .env.example.

What's next

robrain outcomes feeds git reverts back into memory quality on both tiers; next is widening that to incidents and cycle time, so RoBrain can surface when a team is optimizing for the wrong thing in its own codebase.

Requirements

  • Docker + Docker Compose (runs Postgres and Perception locally)
  • Node.js with pnpm (build and CLI)
  • An LLM key for the classifier — Anthropic Haiku or OpenAI — or a local OpenAI-compatible server (see Fully-local LLM)
  • An embedding key (e.g. OpenAI) — or the same local server for embeddings
  • No data leaves your machine in self-hosted mode

Docs

Contributing

Apache 2.0. PRs welcome for extraction accuracy, new editor integrations, and embedding providers. See Concepts — Reference for tradeoffs and schema.

License

Apache 2.0 — see LICENSE

Built by Rory Plans

Comments

Markdown supported

New to MCP?

From what the protocol is to installing your first server, these answers cover most first questions.

An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.