Back to work
Open Source · Local AI Memory

neoBrain

neoBrain is an open-source local memory daemon for AI coding agents — durable memory in SQLite, deterministic rank-based forgetting, nightly dreams and a self-authored soul. One local daemon, one dashboard; memories never leave the machine.

Creator & Maintainer·2026·Project site
PythonTypeScriptFastAPISQLiteVector EmbeddingsMCPOpenCode
Open source
License
One SQLite file, portable & inspectable
Store
Local by default, no cloud account
Privacy

neoBrain answers the question "what does my agent already know, across sessions?" It runs as a local daemon binding to 127.0.0.1:9192, serving both a JSON API and the Observatory dashboard.

Unlike append-only memory, neoBrain treats memory as a living structure: atomic facts, decisions and lessons (atoms) grouped into themes (hubs) connected by typed edges (derived-from, caused-by, supersedes).

Forgetting is deliberate and safe — a bounded formula demotes low-value atoms to ignored or archived, but nothing is ever deleted automatically. Recall blends lexical and semantic scoring with a feedback signal, so relevance dominates.

An OpenCode plugin wires the daemon into the agent: it injects a wake-up pack and standing directives, and exposes memory tools for per-turn recall. When the daemon is down the plugin is a no-op, so nothing breaks.

The challenge

  • AI coding agents are stateless — every session forgets its decisions, dead ends and reasoning, so users re-explain themselves constantly.
  • Existing "agent memory" is usually append-only logs or vector databases bolted onto a prompt, with no concept of forgetting or consolidation.
  • Teams don’t want their most sensitive context (code, sessions, memory) shipped to someone else’s cloud.

My approach

  • Designed a "mind model" — atoms, hubs and typed edges in a single SQLite database — instead of a chat log.
  • Built deterministic, rank-based forgetting (quality = feedback × decay(recency) × connectivity) that demotes but never deletes.
  • Added hybrid recall blending lexical and semantic search, with on-host embeddings by default so memory text never leaves the machine.
  • Implemented a nightly dream life-loop that consolidates experience, plus a self-authored soul (IDENTITY.md / SOUL.md).
What I learned
  • Real agent memory is closer to a mind than a database — consolidation and forgetting matter as much as recall.
  • Local-first is a genuine selling point for agent infrastructure; privacy is a feature users care about.

Related work