Octobrain
Memory serverOfficial Muvon project
Created by Muvon
Published in Muvon/octobrain. Publisher page
20 GitHub stars
What it is
Persistent memory for AI assistants — semantic search, knowledge graph, and MCP server integration. Built in Rust.
AutoGineer overview, from the brain’s own files
Octobrain provides long-term memory for AI assistants by storing insights, architecture decisions, and project knowledge. It functions as a CLI tool or an MCP server, allowing AI agents to persist context across sessions. The system uses vector embeddings for semantic search and supports hybrid search by combining vector similarity with BM25 full-text search. It includes features for auto-linking memories, managing knowledge bases via indexed files and URLs, and consolidating goal-related memories into summaries. The system is built in Rust and uses LanceDB for storage.
How it works
Memory model: Vector store
AutoGineer overview, from the brain’s own files
Octobrain stores memories and knowledge in a vector database. It uses embedding models to convert text into vectors for semantic retrieval. When a user or agent interacts with it, the system performs searches across stored memories and indexed knowledge sources. It supports project scoping based on Git remotes and allows for the creation of relationships between memories. The MCP server implementation enables integration with tools like Claude Desktop, allowing agents to call functions to memorize, remember, or search through indexed knowledge.
| Folder | Role | Files |
|---|---|---|
| .github | agent-config | 2 |
| scripts | scripts | 2 |
| src | source-code | 47 |
| .cargo | folder | 1 |
| benches | folder | 18 |
| config-templates | folder | 1 |
The agent reads
- src/memory/store.rs evidence: AGENTS.md
- search_memories evidence: AGENTS.md
- list_tools evidence: AGENTS.md
The agent writes
- src/memory/formatting.rs evidence: AGENTS.md
- src/knowledge/store.rs evidence: AGENTS.md
- server.json evidence: AGENTS.md
- remember_multi evidence: AGENTS.md
- config-templates/default.toml evidence: AGENTS.md
- Cargo.toml evidence: AGENTS.md
Requirements
Apps: Docker
Runtimes: Rust
Databases: Qdrant
API keys (by name): GOOGLE_API_KEY, JINA_API_KEY, OPENAI_API_KEY, VOYAGE_API_KEY
Works with: Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Kiro, OpenCode, Amp, Cline, JetBrains Junie, Devin (ex-Windsurf)
Set it up
This brain runs code automatically: 1 script. Review Makefile before opening the folder in Claude Code. No step below turns a hook on for you.
Makefile:echo "$(YELLOW)Installing $(BINARY_NAME)...$(NC)"; cargo install --path .; echo "$(GREEN)$(BINARY_NAME) installed successfully$(NC)"
- Not scanned by AutoGineerThe author’s MCP configuration (README.md) also starts it in a way AutoGineer does not offer. Read that file: AutoGineer did not scan that path; what it runs is listed under “This brain runs”. https://github.com/Muvon/octobrain/blob/bfb15d6772028f00207b757e883e2d1ddd3fb562/README.md
- Not scanned by AutoGineerThe author’s README also describes installing it from a clone of its repository. Read its install section: AutoGineer did not scan that path. https://github.com/Muvon/octobrain/blob/bfb15d6772028f00207b757e883e2d1ddd3fb562/README.md#development-setup
- Not scanned by AutoGineerThe author’s README also describes installing it with Homebrew (the author’s own tap). Read its install section: AutoGineer did not scan that path. https://github.com/Muvon/octobrain/blob/bfb15d6772028f00207b757e883e2d1ddd3fb562/README.md#installation
- Not scanned by AutoGineerThe author’s README also describes installing it with cargo. Read its install section: AutoGineer did not scan that path. https://github.com/Muvon/octobrain/blob/bfb15d6772028f00207b757e883e2d1ddd3fb562/README.md#installation
- Not scanned by AutoGineerThe author’s README also describes installing it from a clone of its repository. Read its install section: AutoGineer did not scan that path. https://github.com/Muvon/octobrain/blob/bfb15d6772028f00207b757e883e2d1ddd3fb562/README.md#installation
- Not scanned by AutoGineerThe author’s README also describes installing it with cargo. Read its install section: AutoGineer did not scan that path. https://github.com/Muvon/octobrain/blob/bfb15d6772028f00207b757e883e2d1ddd3fb562/README.md#quick-start
Created by Muvon. Published in Muvon/octobrain. Licence: Apache License 2.0.
Usage
AutoGineer overview, from the brain’s own files
- Store project insights and decisions for future retrieval
- Search for relevant context across past conversations
- Index documentation and web content for agent access
- Connect related memories to form a knowledge graph
- Integrate with AI assistants via the MCP protocol
- “octobrain memory memorize --title "API Design" --content "Use REST for CRUD" --memory-type architecture”
- Stores a new memory entry regarding API design patterns in the persistent store.
- “octobrain memory remember "api design patterns"”
- Performs a semantic search and returns relevant memories matching the query.
- “octobrain knowledge index https://docs.rs/tokio/latest/tokio/”
- Indexes the content of the provided URL into the knowledge base for future retrieval.
Documentation by Muvon
Octobrain
Persistent memory for AI assistants — store insights, decisions, and knowledge that survives across conversations.
Image: Crates.io Image: License Image: Rust Image: CI Image: Coverage
MCP Registry: mcp-name: io.github.Muvon/octobrain
Table of Contents
Why Octobrain?
Quick Start
Installation
Usage
Features
Benchmarks
Configuration
Memory Types
MCP Integration
Storage Locations
Contributing
License
Octobrain gives your AI assistant a long-term memory. Store code insights, architecture decisions, bug fixes, and knowledge — then retrieve them with semantic search in future sessions. Works as a CLI tool or as an MCP server for integration with Claude Desktop and other AI tools.
Why Octobrain?
AI assistants start every conversation with zero context. You explain your project, your preferences, your decisions — every single time. Octobrain breaks that cycle:
Persistent memory — Insights survive across sessions, not just within them
Semantic search — Find memories by meaning, not exact keywords
Auto-linking — Related memories connect automatically (Zettelkasten-style)
Knowledge indexing — Ingest docs, articles, and files for retrieval
MCP integration — Works with Claude Desktop and other MCP-compatible tools
Quick Start
# Install from crates.io
cargo install octobrain
# Store your first memory
octobrain memory memorize --title "API Design Pattern" \
--content "Use REST for CRUD, GraphQL for complex queries" \
--memory-type architecture --tags "api,design"
# Search memories
octobrain memory remember "how should I design APIs"
# Start MCP server for Claude Desktop integration
octobrain mcpInstallation
From crates.io (Recommended)
cargo install octobrainFrom Source
# Clone and build
git clone https://github.com/muvon/octobrain.git
cd octobrain
cargo build --release
# Binary location
./target/release/octobrain --helpDocker
docker pull ghcr.io/muvon/octobrain:latestHomebrew (macOS/Linux)
brew install muvon/tap/octobrainFeature Flags
Octobrain supports multiple embedding providers:
| Flag | Description | API Key Required |
|---|---|---|
fastembed | Local embeddings via FastEmbed | No |
huggingface | Local embeddings via HuggingFace | No |
| (default) | Both fastembed + huggingface | No |
| (no features) | API-based: Voyage, OpenAI, Google, Jina | Yes |
# Build with local embeddings (default, no API keys needed)
cargo build --release
# Build with API-based embeddings only
cargo build --no-default-features --releaseFor API-based embeddings, set the appropriate environment variable:
VOYAGE_API_KEYfor Voyage AIOPENAI_API_KEYfor OpenAIGOOGLE_API_KEYfor GoogleJINA_API_KEYfor Jina
Usage
Memory Management
Store and retrieve insights, decisions, and context:
All memory subcommands accept global flags:
--scope <string>— Override project scope (default: auto-detected from Git remote)--role <string>— Filter by role (e.g. "developer", "reviewer")
# Store a memory
octobrain memory memorize --title "API Design" \
--content "Use REST for CRUD, GraphQL for complex queries" \
--memory-type architecture --tags "api,design"
# Search memories (semantic search)
octobrain memory remember "api design patterns"
# Multi-query search for broader coverage
octobrain memory remember "authentication" "security" "jwt"
# Get a memory by ID
octobrain memory get <id>
# Get recent memories
octobrain memory recent --limit 20
# Filter by type
octobrain memory by-type architecture --limit 10
# Filter by tags
octobrain memory by-tags "api,security"
# Find memories related to files
octobrain memory for-files "src/main.rs,src/lib.rs"
# Update a memory
octobrain memory update <id> --title "New Title" --add-tags "new-tag"
# Delete a memory
octobrain memory forget --memory-id <id>
# Get memories relevant to the current Git commit
octobrain memory current-commit
# Show memory statistics
octobrain memory stats
# Clean up old/low-importance memories
octobrain memory cleanup
# Compact tables and refresh indices (run when searches slow down)
octobrain memory maintenance
# ⚠️ Delete ALL memory data
octobrain memory clear-all --yesMemory Consolidation
Close a goal and fold all its contributing memories into a consolidated summary:
# Consolidate a goal (Achieves-link sources → Consolidated state, importance dampened)
octobrain memory consolidate <goal-id> --summary "Final summary"
# Sleep consolidation: auto-cluster recent similar memories
octobrain memory sleep-consolidate --threshold 0.85 --min-size 3Memory Relationships
Connect related memories for context-rich retrieval:
# Create a relationship between memories
octobrain memory relate <source-id> <target-id> \
--relationship-type "depends_on" \
--description "Source requires target to function"
# View relationships for a memory
octobrain memory relationships <memory-id>
# Find related memories through relationships
octobrain memory related <memory-id>
# Auto-link similar memories (Zettelkasten-style)
octobrain memory auto-link <memory-id>
# Explore memory graph
octobrain memory graph <memory-id> --depth 2Knowledge Base
Index and search web content, docs, and files:
# Index a URL
octobrain knowledge index https://docs.rs/tokio/latest/tokio/
# Index a local file (.txt, .md, .pdf, .docx, .html)
octobrain knowledge index ./docs/architecture.md
# Search knowledge base
octobrain knowledge search "how to handle async tasks"
# Search within a specific source (auto-indexes if outdated)
octobrain knowledge search "spawn blocking" --source https://docs.rs/tokio/
# Read full content of a URL or local file
octobrain knowledge read https://docs.rs/tokio/latest/tokio/
# Search indexed content by regex pattern
octobrain knowledge match "spawn_blocking|block_in_place"
# Store raw text content
octobrain knowledge store "meeting-notes" --content "Discussion points..."
# List indexed sources
octobrain knowledge list --limit 20
# Show statistics
octobrain knowledge stats
# Delete a source
octobrain knowledge delete https://example.com/docs
# Delete stored content by key
octobrain knowledge delete-stored "meeting-notes"Knowledge Boxes
Import and sync git-backed knowledge bundles scoped to your projects:
# Import a remote git repo as a knowledge box
octobrain box import https://github.com/org/docs-repo.git
# Import at global scope (visible in every project)
octobrain box import https://github.com/org/docs-repo.git --global
# Pull and re-index all subscribed boxes + local .box/ directories
# (the MCP server syncs each session's repos on first contact; agents run `knowledge` `sync` after editing .box/)
octobrain box sync
# List subscribed boxes
octobrain box list
# Remove a box
octobrain box remove github.com/org/docs-repoMCP Server
Run as an MCP server for integration with Claude Desktop and other AI tools:
# Start with stdio transport (for Claude Desktop)
octobrain mcp
# Start with HTTP transport (for web-based tools)
octobrain mcp --bind 0.0.0.0:12345Available MCP Tools:
| Tool | Description |
|---|---|
memorize | Store memories with metadata; optional related_to for inline relationships |
remember | Semantic search with filters; returns 1-hop graph neighbors |
forget | Delete memories (requires confirmation) |
knowledge | Unified tool: search, store, delete, read, match, sync via command field; sync re-indexes knowledge boxes after .box/ edits |
| See MCP Integration for Claude Desktop setup. |
Features
Semantic Search — Find memories by meaning using vector embeddings, not exact keyword matches
Hybrid Search — Combines BM25 full-text search with vector similarity for better results
Reranking Support — Pluggable cross-encoder reranking stage (provider-dependent)
Auto-Linking — Automatically connects semantically similar memories (Zettelkasten-style)
Temporal Decay — Ebbinghaus forgetting curve for importance management
Knowledge Indexing — Ingest URLs, PDFs, docs for retrieval
Project Scoping — Isolate memories per Git project or share across projects
Role Filtering — Tag memories by role (developer, reviewer, etc.)
Query Expansion (HyDE-lite) — Pseudo-relevance feedback for +10-30% recall on long-tail queries
MCP Protocol — Full MCP 2026-07-28 compliance for AI tool integration
Benchmarks
Retrieval quality of octobrain's knowledge system on standard BEIR datasets — nDCG@10, fully local, no LLM judge, using the harness's default embedder bge-small-en-v1.5 (384-dim, 33M params). Each corpus passage is indexed through octobrain's real retrieval path and scored against the official qrels (metrics reproduce pytrec_eval).
| Dataset | octobrain vector | octobrain hybrid | BM25¹ | bge-small-en-v1.5² |
|---|---|---|---|---|
| SciFact (5.2K docs, 300 q) | 0.722 | 0.742 | 0.665 | 0.713 |
| NFCorpus (3.6K docs, 323 q) | 0.341 | 0.363 | 0.325 | 0.343 |
vector = dense-only retrieval; reproduces the embedder's published BEIR numbers (validates the harness).
hybrid = BM25 + vector fused with Reciprocal Rank Fusion (k=60) — octobrain's default. Adds +2 nDCG@10 over the bare embedding and beats classic BM25 on both datasets.
¹ Canonical BM25 from the BEIR paper (Anserini/Lucene, k1=0.9 b=0.4). ² From the bge-small-en-v1.5 model card (MTEB).
Scope: this measures the ranking layer (embedding + BM25 fusion + reranking). BEIR passages are pre-chunked, so octobrain's chunking strategy is not exercised here.
⚠️ Reranker status: The cross-encoder reranker is currently a no-op with fastembed models (byte-identical results to hybrid-only). Rerank is excluded from the numbers above pending investigation. See
benches/README.mdfor details.
Reproduce (downloads the datasets, builds a release binary, runs fully offline):
cd benches && bash scripts/run_retrieval.shConfiguration
Configuration is stored in ~/.local/share/octobrain/config.toml. The template written on first run defines every option with sensible defaults, but loading is strict — a field you delete by hand causes startup to fail rather than falling back to a default.
Override the config location with OCTOBRAIN_CONFIG_PATH=/path/to/config.toml.
Key Settings
| Section | Option | Default | Description |
|---|---|---|---|
[embedding] | model | fastembed:Qdrant/all-MiniLM-L6-v2-onnx | Embedding model (provider:model format). Default is a local fastembed model — no API key, runs on CPU. |
[search] | similarity_threshold | 0.3 | Minimum relevance (0.0-1.0) |
[search.hybrid] | enabled | true | Enable BM25 + vector fusion |
[search.reranker] | enabled | true | Enable cross-encoder reranking |
[search.hyde] | enabled | true | Pseudo-relevance feedback query expansion |
[memory] | max_memories | 10000 | Maximum stored memories |
[memory] | auto_linking_enabled | true | Auto-connect similar memories |
[knowledge] | chunk_size | 1200 | Characters per chunk |
[embedding] | batch_size | 32 | Texts embedded per batch |
[embedding] | timeout_secs | 30 | Embedding call timeout (0 = no timeout) |
[search] | max_results | 50 | Hard ceiling on results from any search |
[search.reranker] | model | fastembed:jina-reranker-v2-base-multilingual | Cross-encoder model |
[search.reranker] | top_k_candidates | 50 | Candidates retrieved before reranking |
[search.hyde] | top_k | 3 | Neighbors averaged for the centroid |
[search.hyde] | alpha | 0.5 | Blend weight on the original query embedding |
[memory] | max_search_results | 50 | Default page size when no limit is given |
[memory] | sleep_consolidation_enabled | true | Lazy sleep consolidation on manager init |
[memory] | sleep_consolidation_interval_hours | 24 | Hours between sleep-consolidation passes |
[knowledge] | outdating_days | 15 | Days before indexed content is reindexed on search |
[knowledge] | max_results | 5 | Results returned from knowledge search |
Embedding Providers
[embedding]
# Local models (no API key, runs on CPU, model auto-downloaded on first use)
model = "fastembed:Qdrant/all-MiniLM-L6-v2-onnx" # Default: 384-dim quantized, ~125MB resident
model = "fastembed:nomic-ai/nomic-embed-text-v1.5" # 768-dim, 8192-ctx, ~550MB weights, highest quality
model = "fastembed:BAAI/bge-small-en-v1.5" # 384-dim, ~62 MTEB, fast + good quality
model = "fastembed:sentence-transformers/all-MiniLM-L6-v2-quantized" # Smallest (~22MB), fastest
model = "fastembed:BAAI/bge-base-en-v1.5" # Larger (~440MB), higher quality
model = "fastembed:intfloat/multilingual-e5-small" # Multilingual
# Cloud providers (require API keys, generally higher quality)
model = "voyage:voyage-3.5-lite" # VOYAGE_API_KEY
model = "openai:text-embedding-3-small" # OPENAI_API_KEY
model = "google:text-embedding-004" # GOOGLE_API_KEY
model = "jina:jina-embeddings-v3" # JINA_API_KEYFull Configuration
See config-templates/default.toml for all available options with documentation.
Memory Types
Organize memories by category for better filtering:
| Type | Use For |
|---|---|
code | Code patterns, solutions, implementations |
architecture | System design, decisions, patterns |
bug_fix | Bug fixes, troubleshooting, solutions |
feature | Feature specs, implementations |
documentation | Docs, explanations, knowledge |
user_preference | Settings, preferences, workflows |
decision | Project decisions, trade-offs |
learning | Tutorials, notes, education |
configuration | Setup, config, deployment |
testing | Test strategies, QA insights |
performance | Optimizations, benchmarks |
security | Vulnerabilities, fixes, considerations |
validation | Idea/product validation, hypothesis testing |
research | Technical/market research, analysis |
workflow | SOPs, playbooks, process descriptions |
requirement | Business requirements, specs, constraints |
design | UI/UX decisions, wireframes, system design |
integration | API integrations, third-party services |
communication | Stakeholder updates, team decisions |
process | Deployment procedures, runbooks, operations |
insight | General insights, tips |
goal | Task/intent anchors for consolidation workflow |
MCP Integration
Claude Desktop Setup
Add to your Claude Desktop config (~/Library/Application Support/Claude/claude_desktop_config.json on macOS):
{
"mcpServers": {
"octobrain": {
"command": "/path/to/octobrain",
"args": ["mcp"]
}
}
}Restart Claude Desktop. Octobrain tools will be available in your conversations.
HTTP Transport
For web-based integrations:
octobrain mcp --bind 0.0.0.0:12345The server exposes endpoints at /mcp for MCP protocol communication.
Storage Locations
Data is stored in platform-specific directories:
| Platform | Location |
|---|---|
| macOS | ~/.local/share/octobrain/ |
| Linux | ~/.local/share/octobrain/ or $XDG_DATA_HOME/octobrain/ |
| Windows | %APPDATA%\octobrain\ |
Project-specific memories are isolated by normalized Git remote URL (e.g., github.com/org/repo).
Contributing
Contributions are welcome! Please:
Fork the repository
Create a feature branch (
git checkout -b feature/amazing-feature)Run
cargo fmt --allto format codeRun
cargo clippyand fix all warningsRun
cargo test --no-default-featuresSubmit a pull request
Development Setup
# Clone and build
git clone https://github.com/muvon/octobrain.git
cd octobrain
cargo build --no-default-features
# Run tests
cargo test --no-default-features
# Run clippy
cargo clippy --no-default-featuresLicense
Apache-2.0 — see LICENSE for details.
Credits
Developed by Muvon Un Limited.
AGENTS.md
Octobrain — AGENTS.md
Standalone memory management system for AI context and conversation state: a CLI (octobrain) plus an MCP server, in Rust (MSRV 1.95, edition 2021). LanceDB vector storage, rmcp for MCP, octolib for embeddings/reranking. Apache-2.0, Muvon Un Limited.
Commands
Two build modes, both must stay green: fast loop --no-default-features (no heavy local models; what Makefile targets use) and full gate --all-features (what CI + pre-commit run; also compiles beir_bench; needs protoc on PATH).
Dev build:
cargo build --no-default-features· Release:cargo build --no-default-features --releaseCheck:
cargo check --no-default-features --all-targets· All feature combos:make check-featuresFormat (write):
cargo fmt --all· Format (verify):cargo fmt --all -- --check—make fmtis verify-onlyLint:
cargo clippy --no-default-features --all-targets -- -D warnings(CI/pre-commit variant uses--all-features)Tests light:
cargo test --no-default-features· CI parity:cargo test --all-features· One test:cargo test --no-default-features <test_name>Coverage:
cargo llvm-cov --summary-only --all-features --ignore-filename-regex '_tests\.rs$'Run CLI:
cargo run --no-default-features -- <subcommand>· MCP server:cargo run --no-default-features -- mcp(stdio) or-- mcp --bind=host:port(streamable HTTP)BEIR retrieval bench (local, free):
bash benches/scripts/run_retrieval.shorcargo run --release --features bench --bin beir_bench -- <dataset_dir> [label]Completions:
make install-completions/make test-completionsmake cireferences nonexistent targets (format-check,lint) — run the four commands above instead
Where to look
| Task | Start here |
|---|---|
| Memory CLI command | src/cli.rs (MemoryCommand) → src/commands.rs (execute_memory_command) |
| Knowledge / box CLI command | src/cli.rs (KnowledgeCommand, BoxCommand) → src/commands.rs |
| MCP tool | src/mcp/server.rs (#[tool] macro + Params struct) → src/mcp/memory.rs / src/mcp/knowledge.rs provider |
| Config option | src/config.rs struct + config-templates/default.toml — always both, same commit |
| Memory data model | src/memory/types.rs (incl. MemoryType, relationship enums) → src/memory/store.rs (schema, batch_to_memories) |
| Knowledge data model | src/knowledge/types.rs → src/knowledge/store.rs |
| Search internals | src/memory/store.rs: search_memories / hybrid_search / expand_query_embedding |
| Consolidation | src/memory/manager.rs: consolidate_goal, sleep_consolidate |
| Reranking | src/memory/reranker_integration.rs + RerankerConfig in src/config.rs |
| Cross-process embedding sharing | src/embedding.rs + src/embedding/shared.rs (election, loopback attach) |
| Knowledge boxes | src/knowledge/boxes.rs (registry/git/scope) → src/knowledge/manager.rs (import_box / sync_boxes) |
| Storage paths | src/storage.rs · LanceDB index tuning: src/vector_optimizer.rs |
| CLI output | src/memory/formatting.rs (memory), src/knowledge/formatting.rs (knowledge) |
| Benchmarks | benches/README.md — BEIR is local/metric-only; LongMemEval is Docker + .env + paid LLM calls |
| Recent changes | CHANGELOG.md |
Conventions
Every new
.rsfile starts with the full 13-line Apache-2.0 header, copyright 2026 (copy from any existing file).No
unwrap()/expect()outside*_tests.rs— use?. Only proven-invariant exceptions exist (insrc/embedding.rs,src/reranker.rs,src/storage.rs,src/mcp/server.rs,src/embedding/shared.rs,src/memory/store.rs,src/memory/formatting.rs,src/knowledge/store.rs); new code needs?or a documented invariant.Tests live in sibling
*_tests.rsfiles, not inline#[cfg(test)]modules.Config is strict:
Config::load()fails if any field is missing from the installed TOML. RustDefaultimpls are for construction only —config-templates/default.tomlis what ships. Shape changes need a step inplan()withversionbumped in the same commit.Commands and MCP handlers go through
MemoryManager/KnowledgeManager— never call the stores directly.MemorizeParamshas norelated_to; relationships come viacreate_relationship()or inline at the MCP layer.MCP tool pattern: typed Params struct (
JsonSchema + Serialize + Deserialize) →#[tool(...)]method onMcpServer→ resolve the calling session per request withensure_session_context()(octomind'sexperimental.session; scope =octolib::utils::path_to_scope(workdir)) →get_memory_provider()takes the scope fromSessionState::resolve_scope()(locked: the session's; unlocked session: its own when omitted, else one of the repos under its workdir or""; no session: the caller's) and overridesrolewhenrole_locked→execute_*()on the provider.list_toolsis per session (cacheScope: private) and names an unlocked session's scope options as thescopeenum. Update theget_info()instructions string when tool behavior changes.Tool JSON schemas are deliberately flattened (
$refinlined, null branches stripped) for backend compatibility — do not reintroduce$refor nullable types.Memory formatting entry points:
format_memories_for_cli()(search results) andformat_plain_memories_for_cli()(plain&[Memory]).format_memories()/format_search_results()do not exist.No blocking in async: no
std::thread::sleep, no sync I/O in async contexts.Minimal new deps — reuse
Cargo.tomlfirst. Its pins are load-bearing (time =0.3.47,alloc-stdlib =0.2.2,brotli-decompressor =5.0.1,[patch.crates-io]esaxx-rs git rev); a casualcargo updatebreaks the build (E0119 / E0277 / MSVC LNK2038).Release version lives in three places —
Cargo.toml,server.json,CHANGELOG.md— update them together (release.yml does not touchserver.json).
System behavior (semantics not to break)
Search pipeline (memory, in order): HyDE/PRF query expansion (
[search.hyde], Rocchio blend, no LLM) → hybrid vector+BM25 via RRF k=60 ([search.hybrid]) → post-fetch Rust filtering oftags/memory_types→ cross-encoder rerank ([search.reranker]) → access recording (count + decay boost).States:
Working→Consolidated(post goal-closure, importance ×0.2, kept for audit) →Archived(tombstone before hard delete). Source trust:user_confirmed1.0 ·imported0.9 ·agent_inferred0.85 ·auto_linked0.8. Decay: Ebbinghaus, half-life 90d, floor 0.05, access boost ×1.2.Goal consolidation: parent importance = max(sources) × 1.1 clamped to [0,1]. An MCP-layer
related_to: Closestriggers it automatically with the just-stored memory as parent — no manual call from the MCP path.Supersedesedges are honored (relevance ×0.1, soft — never deleted) but never auto-created.Background work on
MemoryManager::new()/ writes: stale-ref cleanup (marker-gated on Git HEAD, rename-aware), sleep consolidation (marker-gated,[memory] sleep_consolidation_*), maintenance every 250 writes or 24h (1h retry lease). Never force-run in production paths; useoctobrain memory maintenancefor a synchronous pass anddrain_pending_maintenance()in tests/shutdown.auto_link fires asynchronously on
memorize/update_memory;auto_link_memory()is refresh-only;consolidate_goaldrains pending links first.rememberaccepts 1 string or 2–5 terms (array);remember_multifuses per-query results with RRF k=60.Knowledge boxes ship sources only, never vectors; rows carry
box://<box_id>/<rel>URIs and are pruned when files leave the box. Project-local.box/dirs are discovered at sync, never registered; global boxes have empty scope.Chunking: parent sections (returned to user) split into child chunks (embedded);
chunk_size = 1200,chunk_overlap = 300.Storage: one shared LanceDB scoped by the
scopecolumn (normalized Git remote URL) — not per-project dirs.~/.local/share/octobrain/(XDG) /%APPDATA%\octobrain\; boxes under<storage>/boxes/, shared-embedding endpoints under<storage>/run/.
Done
cargo fmt --all -- --checkexits 0cargo clippy --all-targets --all-features -- -D warningsexits 0cargo test --all-featurespasses (CI matrix: ubuntu/windows/macos on Rust 1.98.0)make check-featurespasses when touching feature-gated codeNon-command criteria: new config fields shipped in
config-templates/default.toml; new files carry the license header; no newunwrap()/expect()outside tests
Gotchas
tagsandmemory_typesare stored as JSON strings in LanceDB — not SQL-filterable; filter post-fetch in Rust (matches_json_filters()), never inonly_if()clauses.MemoryStorebakesproject_keyandroleat construction — they are not query-time overrides.The
knowledgeMCP tool is one tool with acommanddiscriminator; the CLI has separate subcommands.Full-feature builds need
protoc. Linux test runs needORT_LIB_LOCATION(static ONNX Runtime); Windows needsRUSTFLAGS=-C target-feature=-crt-static. macOS works out of the box. See.github/workflows/ci.yml.Env
RUSTFLAGSreplaces.cargo/config.tomlentirely — re-apply target flags (musl+fp16/-lgcc) when setting it.MSRV is 1.95 (
rust-version); CI pins 1.98.0 — do not use newer APIs.Stale Makefile details:
make fmtverifies only,make ciis broken,make install-depshas atrustuptypo. Prefer raw cargo commands.LongMemEval benches require
benches/.env(LLM keys) and cost ~10M tokens per full run; smoke-test withmake smokeinbenches/.
Never
Add a config field without updating
config-templates/default.toml(andplan()when the shape changes)Use
unwrap()orexpect()in non-test codeCreate LanceDB indexes manually or hardcode partition counts —
VectorOptimizer/ensure_optimal_index()owns thisPush
tags/memory_typesfilters into LanceDB SQL predicatesCall
MemoryStore/KnowledgeStoredirectly from commands or MCP handlersAdd dependencies without reusing existing ones, or loosen the pinned versions in
Cargo.tomlShip a
.rsfile without the full Apache-2.0 headerForce-run sleep consolidation or maintenance in production paths
References
benches/README.md— read before touching benchmarks (BEIR vs LongMemEval, env knobs, cost estimates)README.md(§ Configuration, § MCP Integration) — user-facing docs to keep in sync when config or tools change.github/workflows/ci.yml— canonical test matrix and the ORT/protoc/RUSTFLAGS setup per platformconfig-templates/default.toml— annotated source of truth for every option
86 files · 79 not served here
- .cargo/config.toml (not served here)
- .editorconfig (not served here)
- .github/workflows/ci.yml (not served here)
- .github/workflows/release.yml (not served here)
- .gitignore (not served here)
- .pre-commit-config.yaml (not served here)
- AGENTS.md
- ATTRIBUTION.md
- AUTOGINEER-RUNS.md
- CHANGELOG.md
- Cargo.lock (not served here)
- Cargo.toml (not served here)
- Dockerfile (not served here)
- LICENSE
- Makefile (not served here)
- README.md
- benches/.env.example (not served here)
- benches/.gitignore (not served here)
- benches/Makefile (not served here)
- benches/README.md (not served here)
- benches/adapters/__init__.py (not served here)
- benches/adapters/llm_client.py (not served here)
- benches/adapters/longmemeval_run.py (not served here)
- benches/adapters/octobrain_client.py (not served here)
- benches/docker/Dockerfile (not served here)
- benches/docker/docker-compose.yml (not served here)
- benches/requirements.txt (not served here)
- benches/results/.gitkeep (not served here)
- benches/results/README.md (not served here)
- benches/scripts/entrypoint.sh (not served here)
- benches/scripts/fetch_longmemeval.sh (not served here)
- benches/scripts/run_longmemeval.sh (not served here)
- benches/scripts/run_retrieval.sh (not served here)
- benches/scripts/summarize_score.py (not served here)
- config-templates/default.toml (not served here)
- rustfmt.toml (not served here)
- scripts/install-completions.sh (not served here)
- scripts/test-completions.sh (not served here)
- server.json
- src/arrow_helpers.rs (not served here)
- src/bin/beir_bench.rs (not served here)
- src/cli.rs (not served here)
- src/commands.rs (not served here)
- src/config.rs (not served here)
- src/constants.rs (not served here)
- src/embedding.rs (not served here)
- src/embedding/shared.rs (not served here)
- src/embedding/shared_tests.rs (not served here)
- src/knowledge/boxes.rs (not served here)
- src/knowledge/chunker.rs (not served here)
- src/knowledge/content.rs (not served here)
- src/knowledge/formatting.rs (not served here)
- src/knowledge/manager.rs (not served here)
- src/knowledge/mod.rs (not served here)
- src/knowledge/store.rs (not served here)
- src/knowledge/types.rs (not served here)
- src/lib.rs (not served here)
- src/main.rs (not served here)
- src/mcp/knowledge.rs (not served here)
- src/mcp/logging.rs (not served here)
- src/mcp/memory.rs (not served here)
- src/mcp/memory_tests.rs (not served here)
- src/mcp/mod.rs (not served here)
- src/mcp/server.rs (not served here)
- src/mcp/server_tests.rs (not served here)
- src/mcp/types.rs (not served here)
- src/memory/auto_link_tests.rs (not served here)
- src/memory/decay_tests.rs (not served here)
- src/memory/formatting.rs (not served here)
- src/memory/fusion_tests.rs (not served here)
- src/memory/git_utils.rs (not served here)
- src/memory/goal_tests.rs (not served here)
- src/memory/hybrid_tests.rs (not served here)
- src/memory/hyde_tests.rs (not served here)
- src/memory/manager.rs (not served here)
- src/memory/manager_tests.rs (not served here)
- src/memory/mod.rs (not served here)
- src/memory/reranker_integration.rs (not served here)
- src/memory/role_tests.rs (not served here)
- src/memory/sleep_tests.rs (not served here)
- src/memory/store.rs (not served here)
- src/memory/types.rs (not served here)
- src/reranker.rs (not served here)
- src/sql.rs (not served here)
- src/storage.rs (not served here)
- src/vector_optimizer.rs (not served here)
Advantages
- Provides persistent memory that survives across different AI sessions evidence: README.md
- Supports hybrid search combining vector similarity and BM25 full-text search evidence: README.md
Limitations
- Strict configuration loading causes startup failure if any field is missing from the TOML file evidence: AGENTS.md
- The cross-encoder reranker is currently a no-op when using fastembed models evidence: README.md
Security
Risk level: Medium risk
This brain runs
Git hooks (5)
.pre-commit-config.yaml:pre-commit hooks from https://github.com/doublify/pre-commit-rust at v1.0 (contributor tooling: runs only after pre-commit install)· uses the network.pre-commit-config.yaml:cargo fmt.pre-commit-config.yaml:cargo clippy.pre-commit-config.yaml:cargo check.pre-commit-config.yaml:pre-commit hooks from https://github.com/pre-commit/pre-commit-hooks at v4.4.0 (contributor tooling: runs only after pre-commit install)· uses the network
Agent instructions that run or fetch something (13)
AGENTS.md:what Makefile targets use) and **full gate** `--all-features` (what CI + pre-commit run;AGENTS.md:Check: `cargo check --no-default-features --all-targets` · All feature combos: `make check-features`AGENTS.md:Format (write): `cargo fmt --all` · Format (verify): `cargo fmt --all -- --check` — `make fmt` is verify-onlyAGENTS.md:Run CLI: `cargo run --no-default-features -- <subcommand>` · MCP server: `cargo run --no-default-features -- mcp` (stdio) or `-- mcp --bind=host:port` (streamable HTTP)AGENTS.md:BEIR retrieval bench (local, free): `bash benches/scripts/run_retrieval.sh` or `cargo run --release --features bench --bin beir_bench -- <dataset_dir> [label]`AGENTS.md:Completions: `make install-completions` / `make test-completions`AGENTS.md:`make ci` references nonexistent targets (`format-check`, `lint`) — run the four commands above insteadAGENTS.md:boxes under `<storage>/boxes/`, shared-embedding endpoints under `<storage>/run/`.AGENTS.md:`make check-features` passes when touching feature-gated codeAGENTS.md:Stale Makefile details: `make fmt` verifies only, `make ci` is broken, `make install-deps` has a `trustup` typo.AGENTS.md:LongMemEval benches require `benches/.env` (LLM keys) and cost ~10M tokens per full run;AGENTS.md:smoke-test with `make smoke` in `benches/`.AGENTS.md:Force-run sleep consolidation or maintenance in production paths
Install scripts (1)
Makefile(make install):echo "$(YELLOW)Installing $(BINARY_NAME)...$(NC)"; cargo install --path .; echo "$(GREEN)$(BINARY_NAME) installed successfully$(NC)"
MCP servers (1)
README.md(octobrain):/path/to/octobrain mcp
- Medium risk: runs-git-hook-remote-exec (.pre-commit-config.yaml:4)
- Medium risk: runs-git-hook-remote-exec (.pre-commit-config.yaml:35)
Attribution and licence
- Created by
- Muvon
- Publisher
- Muvon (Official Muvon project)
- Source
- Muvon/octobrain · commit bfb15d6
- Licence
- Apache License 2.0 (files served here)
- ATTRIBUTION.md (written by AutoGineer)
- Synced
AutoGineer is not affiliated with or endorsed by Muvon.
Install from source
79 of its files are not served here, so there is no ZIP. Muvon/octobrain at bfb15d6