
brain-server
by markfietje
Brain Server
A local-first semantic-memory and knowledge-graph server for AI agents. Runs on a 4 GB ARM device drawing < 5 W — no GPU, no cloud, no per-query cost.
Static (no-neural-net) embeddings via model2vec / minishlab/potion-retrieval-32M make recall essentially free on CPU. Designed for edge hardware (Jetson Nano, Raspberry Pi 5, mini PC) but runs anywhere Rust compiles. The competitive wedge vs. cloud memory services (Zep, Mem0, Letta Cloud): zero per-query cost, zero data egress, zero network latency on recall.
| Version | 1.10.0 "Procedural" (ordered-step procedures, deterministic categorize/decide) |
| Model | minishlab/potion-retrieval-32M (512-dim, static, ~120 MiB RSS) |
| Stack | Rust 2021 · Axum · rusqlite (WAL) · r2d2 · tokio |
| Power envelope | < 5 W idle on Jetson Nano (the selling point) |
| Latency | sub-50ms p99 recall on the reference device |
| Documentation | API Contract · GET /openapi.yaml live · Technical Spec |
Features
- Hybrid retrieval — vector KNN (
vec0) + lexical FTS5 (BM25) fused via Reciprocal Rank Fusion, with deterministic PRF query expansion and full per-result provenance. - Structured query —
QueryDocwithLexSpec(phrases, exclusions, code paths), multi-source OR scope, temporalsince/as_ofpredicates. - Temporal evidence — every ingest stamps
observed_at/valid_from/valid_to/authority. Point-in-time recall returns the revision active at a timestamp.RecallHit.conflictflags contradictory/superseded hits. - Knowledge graph — entities and relationships extracted from
[[relation::entity]]syntax in markdown. Traverse, query, and follow links. Multi-hop explanations via/graph/traverse?explain=true(structured hop chains); edge-type filter via?kind=. - Source lifecycle — every chunk carries provenance (
source+ immutablerevision). Connectors backfill external sources through a supervised pipeline;POST /reconcilesweeps orphans from deleted sources. - Connectors — supervised ingesters (GitHub issues via App auth) that backfill through the existing source/revision pipeline. Extensible connector contract.
- Prompt-injection quarantine — suspicious content stored but excluded from retrieval until reviewed.
- Append-only audit log — ingest and auth-denial events recorded hash-only.
- Encrypted backup/restore — AES-256-GCM, checksummed backups.
- OpenAI-compatible embeddings —
POST /v1/embeddings. - MCP server —
mcpbinary exposes search/recall/ingest as MCP tools. - Calibrated abstention (v1.5) — when retrieval quality is too low to support a claim,
/recallreturns{decision: "low_confidence", hits: []}instead of top-1 garbage. - Span verification (v1.5) —
POST /verifychecks whether a claim is supported by a chunk's actual text (deterministic lexical match, no LLM). - Self-correction (v1.6) — operator-approved
supersedeslinks atomically expire the prior fact; historical recall (?at=<past>) still returns it.brain resolve+brain check-consistencysurface action items. - Reviewable proposals (v1.8) —
/consolidate/proposedetects exact duplicates, subject conflicts, unresolved contradictions, stale sources (deleted vault files), and near-duplicates (cosine > 0.95).brain undo-resolvereverses prior resolutions without retrieval regression. - Opt-in anticipation (v1.9) —
POST /suggestreturns related-but-not-surfaced chunks (taggedreason: "anticipated");POST /suggest/feedbackrecords accept/dismiss;GET /suggest/metricsreports the false-positive rate. No push, no decay, no hidden personalization — the agent asks explicitly.BRAIN_SUGGEST_ENABLED=falsedisables the surface.
Quick start
# Build all binaries
cargo build --release --features bench
# or: cargo build --release --features bench,connector-github
# Run the server
Related servers

n8n
Updated todayby n8n-io
Fair-code workflow automation platform with native AI capabilities. Combine visual building with custom code, self-host or cloud, 400+ integrations.

mcp-server-fetch
OfficialUpdated todayA Model Context Protocol server providing tools to fetch and convert web content for usage by LLMs

@modelcontextprotocol/server-filesystem
OfficialUpdated todayMCP server for filesystem access