Skip to content

Developer Docs

Myco Brain 1.3.0 documentation

Everything you need to go from nothing to agents that remember, then, if you want it, to a document engine with a knowledge graph. Self-hosted and open source under the Apache-2.0 license: no account, no login, and no API keys.

GitHub repo · @mycobrain/mcp-server on npm

1. Memory quickstart

One command sets up local Postgres (or Supabase, or any Postgres connection string), a starter template, hooks for Claude Code and Codex (recall at session start and on every prompt, capture of finished sessions), and MCP for Cursor, Windsurf and Claude Desktop. Needs Node.js 20 or later, no API keys.

npm install -g @mycobrain/mcp-server
mycobrain-setup memory
Open the Quickstart

2. Memory CLI and tools

mycobrain-memory manages houses (clients), entities, scoped bindings, history, the background worker and Dream. Agents use 2 MCP tools; in a memory-only install these are the only tools the server lists.

  • brain_memory_contextRecalls the facts that matter for a question, scoped to the houses (clients) the calling agent may read. Matches on words, and on meaning when Ollama is running.
  • brain_memory_writeRecords a durable fact with its source. A changed fact supersedes the old one, and the history and the reason are kept.
Memory CLI reference on GitHub

3. Background worker and Dream

The worker reads finished sessions for durable facts using your own Claude or Codex subscription, embeds new facts locally with Ollama, and delivers writes saved while the database was down. Dream proposes merges of duplicates, per-client dossiers and patterns; it is off by default and nothing changes until you approve it.

Memory quickstart on GitHub

4. Engine quickstart (optional)

The document engine, from a fresh clone: git clone, then docker compose up -d boots Postgres 16 + pgvector, the engine MCP server, and the extraction worker with zero configuration, no API keys required for the first run.

Engine steps in the Quickstart

5. All 15 MCP tools

With the engine configured, the server lists 15 brain_* tools: the 2 memory tools above and the engine tools below. Tool contracts are stable within a major version.

  • brain_context_packAssembles a token-budgeted context pack for your prompt, the primary retrieval tool.
  • brain_searchSearches memory with filters, keyless BM25 full-text, plus semantic vector search via local Ollama embeddings (keyless) or OpenAI.
  • brain_whyInspects the provenance chain behind a fact, source documents, extraction model, and evidence.
  • brain_neighborsTraverses the knowledge graph from an entity to its connected entities.
  • brain_ingestIngests files, URLs, or raw text into memory.
  • brain_propose_factLets agents propose facts, proposals don't silently become truth.
  • brain_annotateLeaves agent breadcrumb notes on existing memory.
  • brain_save_memorySimplified memory ingestion for agents.
  • brain_recall_memoryAgent-scoped semantic recall of saved memories.
  • brain_get_relatedQueries relational context, with provenance attached.
  • brain_statsReturns a workspace memory-health snapshot.
  • brain_set_modeSets the surfacing mode (silent, ambient, or audit) for how proactively Myco shares what it knows.
  • brain_self_checkPull-only health check that reports what is working, what needs approval, and any problem with a fix.
Full API reference on GitHub

6. Knowledge graph

Entity extraction, entity resolution, and entity-to-entity relationships. Run it fully local with Ollama, no API key, nothing leaves your machine, or set BRAIN_ANTHROPIC_API_KEY for the most accurate graph.

Setup options on GitHub

7. Bulk ingest

Pull a local folder or a whole GitHub repo into memory with one command: mycobrain-ingest ./docs or mycobrain-ingest github:owner/repo. No API key required, set GITHUB_TOKEN only for private repos.

View @mycobrain/mcp-server on npm

8. Architecture

How the pieces fit: Postgres is the source of truth, the LLM is an advisor, writes are deterministic, deduplicated, and traceable, and your data stays in plain Postgres tables.

Explore the architecture

9. Roadmap

What ships today, what's next, and the bigger bets, including the managed cloud, which is currently waitlist-only. Direction, not a contract.

See the roadmap

Ready to run it?

Run mycobrain-setup memory and your agents remember from the next session on. Add the engine later with one docker compose up -d.

Docs, Myco Brain