
Local, Git-aware memory for coding agents that flags lessons when linked code changes.
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent β or use 1-click editor setup below.
We haven't yet run this listing's install command through our automated sandbox check. This isn't a red flag β we're steadily working through the catalog.
π‘ Paste into ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows)
Inspect callable tools, capabilities, and parameters exposed to AI agents by Robo Cortex.
Git-aware knowledge integrity for AI coding agents.
Your AI agent debugs a bug, learns the lesson, and forgets it by next week β or worse, keeps citing a "lesson" that the code has since made false. robo-cortex is a local knowledge base built for that specific failure mode: memories are anchored to git blob hashes, so when the code they're about changes, the memory is automatically flagged for review instead of being silently trusted or silently lost. In other words: drift detection and stale-memory detection for AI agent memory, done deterministically from git history β not an LLM guess, not an embedding-similarity heuristic.
Most agent-memory tools are embeddings + a vector database + a cloud dependency. robo-cortex is deliberately none of that. Four things it does that a generic key-value memory store doesn't:
needs_review on the next retrieve/search/affected call β and a committed revert automatically heals it back. The healing requires three conditions: (a) the revert must be committed (git blob hash must match HEAD again), (b) the memory must have been flagged by the system (not manually via change_status), and (c) you must run a lazy trigger (retrieve/search/affected) after the revert to scan for changes. Few memory tools tie themselves to your actual code's history this deterministically β no embedding similarity, no LLM judgment call, just a git blob hash matching or not.provisional memory only becomes active once real evidence backs it, or a human explicitly promotes it..cortex/memory.db is just a file β inspect it with sqlite3 any time.active β superseded β archived, etc.) requires a --reason, permanently recorded. Nothing disappears silently; wrong lessons are marked invalidated, not deleted.A 30-session benchmark (3 real historical bugs from this repo, re-introduced and solved 10Γ each by a small model β Claude Haiku 4.5 β with and without a robo-cortex memory pack) measured, at identical fix quality (30/30 correct, zero disqualifications): ~12% fewer fresh tokens and ~15% lower API-equivalent cost (medians of paired per-task deltas), scaling up to β26% tokens / β39% cost on the task whose fix was hardest to locate unaided. Recording a lesson was itself metered: a memory pays for itself after ~1β6 sessions that reuse it (median β 5). We make no wall-clock claim β time differences were noise-dominated. Full methodology, per-run raw evidence (usage logs, diffs, prompts), and the reusable harness are in the repo: docs/benchmark-results.md, benchmark-results-20260718/, scripts/benchmark/. Known limits, stated plainly: one subject model (small β an earlier n=3 pilot on a larger model measured a smaller 2.7% effect, see EVALUATION.md Β§9), one well-documented codebase (likely compresses the effect), 3 task types. We'd rather publish a modest number we measured than a dramatic one we didn't.
Prerequisite: robo-cortex requires a git repository (staleness detection needs git history to compare against):
If pip install refuses with error: externally-managed-environment (common on recent Debian/Ubuntu), use a virtual environment or pipx:
If you plan to use robo-cortex with an MCP-capable agent (Claude Desktop/Code, etc.), install the MCP extra instead:
--path links a memory to a file, but only accepts a path that already exists at HEAD (no memory is ever born pointing at a dead link). For code you just wrote but haven't committed yet: record the memory without --path now, commit, then attach the path afterward:
Reusable lessons (not specific to this project) use scope=global and require --assumptions β the conditions under which the lesson applies, so it doesn't get suggested everywhere by accident:
Global-scope commands (record --scope global, show, search, status, link, evidence, list) work from anywhere, including outside any git repository β the global store (~/.cortex/global.db) isn't tied to a project. retrieve is the one exception: it's local-repo-aware by design, so it still requires an initialized repo.
Installs a git pre-commit hook: if the commit touches code linked to a memory that's active/provisional/needs_review, the commit is blocked with the memory's id and a review prompt, until you've reviewed it or bypassed explicitly. Example, for a memory linked to src/scanner.py when that file is part of the commit:
The bypass is real and documented β git commit --no-verify skips it, same as any git hook. This is "enforcement by default, bypass explicit," not "impossible to skip." See roco hooks --help for uninstall/status. For a CI-level check on pull requests instead of (or in addition to) local commits, see docs/ci-example.yml.
There's also an optional post-commit hook, purely informational (it never blocks β the commit it reports on already happened by the time it runs):
It runs roco affected --diff-range HEAD~1..HEAD after each commit and reports anything at risk, so a flag shows up immediately instead of waiting for the next retrieve/search/affected call. --post-commit also works with uninstall/status, independently of the pre-commit hook.
rocoBoth robo-cortex and roco are identical commands (same binary, two script entry points). Use whichever fits your fingers:
Name collision note: PyPI already has an unrelated package named roco ("Runtime Config Generator"). If that package is also installed in the same environment, whichever was installed last wins the roco command β use the full robo-cortex name to be unambiguous, or check roco --version to confirm which one you're actually running.
Completes subcommand names and each subcommand's own flags (not flag values, and not nested sub-subcommands like hooks install). It's a static script generated from the installed version β re-run the command after upgrading to pick up new commands or flags.
| Scenario | Best method | Why |
|---|---|---|
| One-off CLI commands (shell, scripts, manual testing) | CLI: roco retrieve --task "..." | Simplest, no dependencies, immediate |
| Python agent or script running your own code | Python SDK: from robo_cortex import retrieve, record | In-process (no subprocess), real exceptions, not string-parsed errors |
| LLM agent (Claude Code, or any MCP client) with tool-calling | MCP server: add to your MCP config | Agent decides when to call; tool descriptions ship with the package |
All three call the same underlying robo_cortex.core functions β pick based on what the calling code already uses.
Available tools: retrieve_context, record_memory, search_memory, attach_evidence, verify_evidence, change_status, get_memory, list_affected. Full contract in MCP_TOOLS.md.
Full API, including the RoboCortex class for multiple calls against the same repo, in PYTHON_SDK.md.
Every memory has a status that reflects its confidence and applicability. New memories start provisional; manual review or evidence changes their status:
| Status | Meaning | Can transition to |
|---|---|---|
| provisional | New memory, not yet validated | active, needs_review, abandoned |
| active | Confident, applicable to future work | needs_review, superseded, invalidated, archived, abandoned |
| needs_review | Suspect or context-dependent; needs human judgment | active, superseded, invalidated |
| superseded | Replaced by a better solution (must link to replacement ID) | archived |
| invalidated | Proven false or no longer applicable | archived |
| abandoned | Lesson that went nowhere; dead-end exploration | archived |
| archived | Terminal state (read-only) | β |
provisional β active: happens automatically when you attach evidence to a memory (roco evidence add) β the first supporting data promotes the memory to trusted.Use roco status <id> <verb> --reason "..." to change status manually:
--reason is mandatory and permanent β it becomes part of the memory's audit history and cannot be edited.
Use scope=repo for project-specific learnings:
Use scope=global for reusable lessons:
scope=global requires assumptions β the preconditions under which the lesson applies:
Import is idempotent (re-importing the same file skips duplicates by id+scope) and validated exactly like record β a scope=global line missing assumptions, or an invalid type/confidence, is skipped with a warning, not silently inserted or a raw database error.
Two projects that learned independently can converge with roco merge:
De-duplicates by ID+scope; conflicts resolved by confidence (higher wins), tie-broken by timestamp. See EXPORT_IMPORT.md for the full workflow, including team-KB and backup use cases.
Do not point ROBO_CORTEX_GLOBAL_DB at a network filesystem (NFS/SMB) for "shared team memory." SQLite is not safe for concurrent writers over a network mount and can corrupt the database. Share via export/import through git instead β it's versioned and auditable, which a live-shared file isn't.
Q: Do I need a git repository?
A: Yes. Staleness detection, path linking, and affected all compare against git history. Without git, you can still use export/import/merge to move knowledge between machines, but the git-aware features won't work.
Q: What if I (or my agent) forget to check memory?
A: roco hooks install blocks a commit that touches code linked to an unreviewed memory β but the bypass (git commit --no-verify) is real and always available, same as any git hook. This is enforcement-by-default with an explicit escape hatch, not an unconditional guarantee.
Q: Stale notes are dangerous.
A: Memories auto-flag needs_review when their linked code changes. You review before trusting, or mark as superseded. Nothing silently misleads.
Q: Sharing memory across teams? A: Two approaches:
ROBO_CORTEX_GLOBAL_DB=/path/to/shared/global.db on a local path all roco invocations can reach β not a network mount (see warning above).Q: Offline?
A: Yes. Everything is local SQLite. Zero network calls unless you explicitly configure Gitea evidence verification (ROBO_CORTEX_GITEA_URL).
Q: Wrong lesson?
A: Mark as invalidated with a reason. Preserved in history, never suggested going forward.
Q: Read-only database?
A: retrieve/search/affected degrade gracefully on a read-only .cortex/memory.db (read-only checkouts, some CI setups). Reads return their result, writes (staleness refresh, usage tracking) are skipped, and meta includes a warning. The memory core still works, just without incidental writes that don't affect correctness.
Q: How do I opt out of the global store?
A: Set ROBO_CORTEX_NO_GLOBAL=1. CLI and MCP both skip opening ~/.cortex/global.db entirely β retrieve/search scopes strictly to the current repo, with no cross-project knowledge channel. Useful if you want strict per-project isolation.
Q: What's the expected scale? A: robo-cortex is designed and tested for thousands of memories per store (repo-scoped and global combined). Performance degrades gracefully beyond that β scoring stays O(n) per candidate, and FTS candidate set is capped at 200 for each store. If you have significantly more memories than that, consider splitting into multiple projects or archiving old memories. See ARCHITECTURE.md for details.
No embeddings. No cloud. Just SQLite, git awareness, and an explicit enforcement layer you can inspect (.git/hooks/pre-commit is plain shell, readable in five seconds).
Free to use. Made available by Robotel Limited UK (https://robotel.top).
The architecture was designed with Anthropic's Claude (Fable) on July 2026 as an AI development agent, applying the expertise of Robotel Limitedβs developers, who bring over three years of hands-on experience building and operating AI coding agents in production.
MIT License. Open source. No telemetry. No vendor lock-in.
Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.
[](https://allmcps.com/mcp/robotel-limited-robo-cortex)<a href="https://allmcps.com/mcp/robotel-limited-robo-cortex"><img src="https://allmcps.com/api/badge/robotel-limited-robo-cortex?style=directory" alt="Robo Cortex on AllMCPs" /></a>