brain_context_packLABSCO SUMMARY
A contradiction is recorded, not overwritten.
Most agent memory silently replaces a fact when a new one arrives; here the old fact is closed and weakened but kept, with the supersession written to an audited ledger you can read back. Combined with per-relationship distinct-source counting — ten chunks of one document corroborate nothing — that is what makes the confidence number mean something. Everything runs keyless if you want it to: full-text search, local embeddings and local extraction all have no hosted dependency.
What it is
A persistent memory server for AI agents, self-hosted on plain Postgres tables. Its contract is the opposite of letting an LLM maintain its own notes: the model proposes, deterministic rules decide what becomes a fact, and you set the bar — from corroboration-gated auto-promotion by default to human review of every fact.
What you get
- 13 MCP tools —
brain_context_pack,brain_search,brain_why,brain_neighbors,brain_ingest,brain_propose_fact,brain_annotate,brain_save_memory,brain_recall_memory,brain_get_related,brain_stats,brain_set_mode,brain_self_check - Provenance on demand —
brain_whyreturns a fact's distinct source count, its confidence trend over time, and any superseded history - Compounding confidence: an independent source agreeing raises a fact's confidence, and a confident contradiction on a single-valued relationship supersedes the old one, which is closed and weakened but kept, with the supersession recorded in an audited claims ledger
- Full-text BM25 search working immediately with no key; semantic search through local Ollama embeddings or OpenAI; a knowledge graph through local extraction or Anthropic for the most accurate result
- A usage contract shipped over MCP's
instructionschannel, so a connected agent knows when to recall, save and cite without per-project prompting - Your ChatGPT or Claude data export imported as provenance-tracked, deduplicated memory, one document per conversation
- A schema that grows — the extraction worker proposes entity kinds and relationship types your catalog does not have, and promotion is yours by default
Requirements
DATABASE_URL is the only hard requirement — a Postgres connection string. The Docker quickstart needs nothing else: docker compose up -d starts Postgres 16 with pgvector, the MCP server and the extraction worker, with seeded localdev credentials. Connect with claude mcp add myco-brain --env DATABASE_URL=… --env BRAIN_API_KEY=… -- npx -y @mycobrain/mcp-server, or the equivalent mcpServers block. BRAIN_EMBED_PROVIDER=ollama turns on keyless local semantic search; BRAIN_ANTHROPIC_API_KEY gives the most accurate graph. Governance dials: BRAIN_REQUIRE_HUMAN_REVIEW and BRAIN_SCHEMA_AUTO_PROMOTE, both 0 by default. Run mycobrain-doctor to confirm the setup — it live-verifies the Ollama path rather than only checking that variables are set. Apache-2.0.
Setup effort
Follow the published steps — git clone https://github.com/thegoodguysla/myco-brain.git
USE CASES
Asking why the assistant believes something
Pull the provenance for the fact — its distinct sources, its confidence trend, and anything it superseded.
Making a decision survive the session ending
Save it as memory, then recall it days later in a different client backed by the same database.
Loading your history so it knows you on day one
Ingest a repository or your exported ChatGPT and Claude conversations as deduplicated, source-traced memory.
Curating strictly instead of trusting the model
Turn on required human review so nothing the LLM proposes enters the graph without a decision from you.
Pulling the right context before a task
Ask for a context pack up front rather than searching mid-task, which is what the shipped usage contract tells the agent to do.
13 tools
Listed in project docs. Your client may show a different list.
brain_searchbrain_whybrain_neighborsbrain_ingestbrain_propose_factbrain_annotatebrain_save_memorybrain_recall_memorybrain_get_relatedbrain_statsbrain_set_modebrain_self_checkBEFORE YOU INSTALL
What to know first
Tools you get
13 tools named in the project's documentation.
Requires
- Docker with Compose (the quickstart stack: Postgres 16 + pgvector, the MCP server and the extraction worker)
- npx on PATH
Where it runs
All 4 documented clients run the server on your machine.
INSTALLATION
Connect your client
Server setup
git clone https://github.com/thegoodguysla/myco-brain.git
cd myco-brain
docker compose up -d
npx -y -p @mycobrain/mcp-server mycobrain-setupThe guided setup wires up Claude Code, Claude Desktop, Cursor, Codex or Windsurf. To connect by hand instead, use the configuration under MCP Clients — it uses the quickstart stack's seeded local database (brain:brain on localhost:5432) and localdev key.
MCP Clients
Claude Code
claude mcp add myco-brain --env DATABASE_URL=postgresql://brain:brain@localhost:5432/brain --env BRAIN_API_KEY=brain_00000000-0000-0000-0000-000000000001_00000000-0000-0000-0000-0000000000a1_localdev -- npx -y @mycobrain/mcp-serverClaude Desktop, Cursor, Windsurf
{
"mcpServers": {
"myco-brain": {
"command": "npx",
"args": [
"-y",
"@mycobrain/mcp-server"
],
"env": {
"DATABASE_URL": "postgresql://brain:brain@localhost:5432/brain",
"BRAIN_WORKSPACE_ID": "00000000-0000-0000-0000-000000000001",
"BRAIN_API_KEY": "brain_00000000-0000-0000-0000-000000000001_00000000-0000-0000-0000-0000000000a1_localdev"
}
}
}
}