CABRAIN

MEMORY FOR AI AGENTS · OVER MCP

CaBrain

A memory organ for AI agents. Long-term recall and an entity graph that any agent reaches over MCP — so what one session learns, the next one already knows.

claude — cabrain
❯ memory_recall{ namespace: "fadymondy", query: "why is /docs scoped?" }
hybrid recall · vector + BM25 · RRF · reranked
✓ 3 memories, 41ms — hot tier
❯ memory_retain{ content: "docs are per-site", source_kind: "claude_code" }
salience gate → retained · ADD
✓ consolidation scheduled
togo install togo-framework/brain
  • MCP tools for any client
  • Postgres · pgvector · BM25
  • Redis L1 cache
  • Hot and cold tiers
  • Providers ship as plugins
  • MIT licensed

Features

Hybrid recall, not just vectors

Vector similarity and BM25 fused with reciprocal rank, then reranked. A name or an exact phrase is found by the half of the search that is good at names.

Hot and cold, like a brain

A hippocampal hot tier answers fast; a cortical cold tier keeps everything. Salience-gated consolidation moves what matters between them while you are not looking.

Reconsolidation on recall

Remembering something changes it — recall strengthens a memory and lets it be corrected, rather than leaving a stale fact to be retrieved for ever.

Any client, one protocol

Claude Desktop and Code, Codex, Gemini and Cursor connect through one CLI that is both the MCP server and its installer.

What an agent can call

  • memory_recall
  • memory_retain
  • memory_get
  • memory_edit
  • memory_forget
  • graph_neighbors
  • graph_traverse
  • brain_chat

What it is built on

01

Store

  • togo-postgres
  • pgvector
  • VectorChord
  • BM25
02

Cache

  • Redis
03

Providers

  • brain-tei
  • brain-cognee

Get started

  1. 01

    Install the plugin

    togo install togo-framework/brain
  2. 02

    Connect your AI client

    cabrain connect claude-code
  3. 03

    Give it a namespace

    cabrain namespace create my-project

Status

Live. The console and the MCP API run at cabrain-app.fadymondy.com on togo-postgres with VectorChord and BM25, embedding and reranking through TEI — retain, recall and the entity graph are in daily use.

Community

GitHubmaintained

Give your agents a memory.

Open the console to create a brain, mint a scoped token and connect Claude Code, Cursor or any MCP client.