DEV Community

Cover image for Teaching My AI Agents to Push Back: Why I Built RoBrain
Adeline
Adeline

Posted on

Teaching My AI Agents to Push Back: Why I Built RoBrain

Claude Code’s auto-memory is a game-changer for solo coding, but it hits a wall the second you add a teammate. Memory is trapped in local files (e.g., ~/.claude/projects/.../memory/), meaning my agent is oblivious to what my teammate's agent has learned. Furthermore, if she switches to Cursor or Copilot, that knowledge silo becomes even deeper.

To solve this, I built RoBrain—a shared institutional memory for AI teams. It keeps the "passive capture" magic (no manual note-taking required) but moves the storage to a shared Postgres instance accessible via MCP, working seamlessly across Claude Code, Cursor, and Copilot.

  1. Capturing the "Why Not": The rejected[] Field Most memory systems only record what you did. RoBrain records what you ruled out. Every decision includes a structured rejected[] field:

JSON
{
"decision": "Use Zustand for state management",
"rejected": [
{ "option": "Redux", "reason": "re-render perf issues in cart" }
]
}
Six weeks later, when an agent suggests Redux, RoBrain doesn't just say "we use Zustand"—it pushes back with: "You already considered Redux and ruled it out because of performance issues". Decisions also have a lifecycle; when you switch technologies, the old record is linked and invalidated rather than deleted, preserving the "why" behind your team's evolution.

  1. The "Always-On" Cross-Tool Summary Shared memory is only useful if it’s available the moment you start typing. At the start of every session, the MCP server automatically fetches and injects a pre-compressed summary of your project’s approved decisions.

Tuesday's Cursor decision is automatically known by Wednesday's Claude Code session.

No manual copy-pasting or specific "inject" commands are required for the default path.

  1. Background "Synthesis": The System’s Sleep Cycle While capture is reactive and isolated, RoBrain periodically runs a "synthesis" pass to reconcile the entire corpus. This batch job performs three critical functions that reactive systems miss:

Contradiction Scanning: It flags sessions that provide conflicting instructions (e.g., "idempotent API calls" vs. "fire-and-forget webhooks").

Drift Detection: It notices when your team’s stance on architecture is silently shifting across unrelated files.

Entity Promotion: It identifies recurring proper nouns and elevates them into first-class planning blocks.

Honest Tradeoffs
Heavier Setup: Requires Docker, Postgres, and two API keys.

Triage Needed: Passive capture can have false positives; you'll occasionally need to use robrain review.

Scale Dependent: Synthesis provides the most value once you hit the 100+ decision mark.

RoBrain is Apache 2.0 and fully self-hostable.

I’d love your thoughts: Does a background reconciliation pass for agent memory feel like the right approach, or is it overengineered? And what would make you trust an automated rejected[] field in your daily workflow?

Check it out here: https://github.com/adelinamart/robrain

Top comments (0)