honeyground / local brain

A LOCAL MEMORY FOR CODING AGENTS

A memory
of your own.

Your memory. Your stack.
Combine vector recall and graph connections. Change the engines, keep the knowledge.

Open source · Apache-2.0 · Free for everyone

FIG. 01 / THE MEMORY FIELD
SELECT A MEMORY TO RECALL↙
PRIVATE BY DEFAULT. USEFUL BY CONTEXT.SCROLL TO CONNECT ↓

A new session.
The same you.

A model brings intelligence. You bring the history. Local Brain connects your memory files, project docs and notes through adapters, so the context you built can return across sessions.

Agent alone

Agent + Local Brain

Session 01 → 05 · Starting context across sessions. Conceptual illustration, not a performance benchmark.

01

Keep what matters.

Decisions, notes, and lessons stay in your files. A local index connects the pieces.

NOTES → LOCAL INDEX
02

Recall in the moment.

Host hooks surface relevant memories as you type. Guidance returns before matching risky actions.

CONTEXT → ACTION
03

Learn what works.

Calibrate against your own corpus. Compare retrieval with grep and the agent working alone.

MEASURE → CALIBRATE

Memory, right when
it matters.

Three illustrative terminal scenes: automatic recall, an exact trigger phrase, and guidance before a risky action. Example memories, not a live agent.

agent sessionLOCAL BRAIN

Let’s continue the payments refactor.

Related memories, found automatically

memories / payments.md

Phase 2 stopped at the webhook retry. Tests live in tests/payments.

memories / idempotency.md

Every retry carries an idempotency key.

01

As you type

A host hook reads your prompt and attaches only memories above your corpus’s retrieval threshold.

02

Trigger phrase

Declare a phrase in a memory’s front matter. Type it to bring that context back directly, without a relevance score.

03

Before an action

Your guidance appears before push, rebase or migration. Discover rules from your own tool history.

brain rules --discover

And when the agent asks: eight MCP tools.

recallrememberneighborsbrain_statusbrain_suggestbrain_feedbackreindextimeline

One memory.
Your choice of engines.

The core stays the same. Hosts, AI engines, sources, databases and schedulers plug in around it. Vector search and graph traversal work together — Qdrant + Neo4j is a combined setup, not an either/or choice.

Vector database

Qdrant

Similarity search

Chroma · pgvector · Milvus

Graph database

Neo4j

Connected context

Memgraph
01Agent host
Claude Code · Codex · Any MCP client
02AI engine · optional
Gemini · OpenAI · Anthropic · OpenAI-compatible servers (including local Ollama), or no AI engine
03Data sources
Memory files · project docs · Obsidian / wikis · any folder brain add
04Vector database
Built-in local copy (SQLite, default) · Qdrant · Chroma · pgvector · Milvus
05Graph database
Built-in local copy (SQLite, default) · Neo4j · Memgraph
06Scheduler
launchd · cron

Swap the databases.
Keep your data.

Memories remain plain Markdown files. The built-in local copy is canonical; dedicated databases are serving indexes. Switching means syncing, not re-embedding. A ledger sends only changes. Before sync, or if a database is unavailable, the local copy answers.

Ask both stores the same questions and verify matching answers. Move your memory between machines with brain export / brain import.

brain stores --checkbrain exportbrain import

MEASURED · AUTHOR’S CORPUS · 2026-10-07

Similarity search · Qdrant

188ms→12ms

All-document, one-hop neighbors · Neo4j

3.4s→0.48s

1,909 documents · 9,590 chunks · 3,376 links. Matching answers on every compared query. These are corpus-specific measurements, not promised speeds for your setup.

README ↗
127.0.0.1

Bring up both databases with Docker.

Install by role with pinned images. Ports bind only to 127.0.0.1. Data lives in ordinary folders under the brain home, not Docker volumes, and survives reinstalling. Database usage reporting is disabled and verified by measurement.

./install.sh --stores dockerbrain stores --docker

Look inside.
Measure everything.

01

Calibrated to your corpus

Retrieval thresholds are measured on your documents. A Kalman filter learns the safety margin as feedback accumulates.

Kalman
02

A comparison, not a promise

Compare accuracy, recall, text read and speed against grep and an agent alone. Every test runs the controls first.

brain score --compare
03

Private at the core

Lexical search opens no sockets. AI engines are opt-in. Secret-shaped values are masked before they can become context.

brain privacy
04

Eight tools. No restart.

Your agent can ask through MCP. The server picks up new code without restarting, keeping the connection alive.

MCP
05

A small, inspectable core

Zero third-party dependencies in the core. Python 3.8+ standard library. Add engines and dedicated databases only when you need them.

Python 3.8+
06

See how it is doing

An HTML dashboard shows status and performance comparisons. Six interface languages. Your memories travel with export and import.

brain dashboard

The next session
starts here.

Open source. Apache-2.0. Free for everyone.
Read the code, make it yours, build on it.

01

Start entirely local

Clone, then install recall hooks and the action guard. Or give SETUP-PROMPT.md to your agent and let it guide installation.

TERMINAL / PYTHON 3.8+
git clone https://github.com/honeyground-org/local-brain ~/tools/local-brain
cd ~/tools/local-brain && ./install.sh --with-hook --with-guard
02

Connect both databases

Optional: install Qdrant for vectors and Neo4j for graph connections together with Docker. An existing install can use brain stores --docker.

TERMINAL / PYTHON 3.8+
./install.sh --all --stores docker
03

Choose an embedding engine

Optional: point the OpenAI-compatible adapter at a local Ollama server with nomic-embed-text available. No AI engine is required for lexical search.

TERMINAL / PYTHON 3.8+
brain engines --set embed=openai --base-url http://localhost:11434/v1 --model nomic-embed-text