Octobrain - Standalone Memory Management System
Standalone memory management system for AI context and conversation state.
Features
- Semantic Search: Find memories using natural language queries
- Vector Storage: LanceDB for efficient vector similarity search
- Git Integration: Automatic context tracking with Git commits
- Memory Commands: Complete memory lifecycle management under
memorysubcommand - Knowledge Base: Web content indexing and semantic search for persistent knowledge
- MCP Server: Model Context Protocol server exposing memory and knowledge tools
- Platform-Specific Storage: Uses standard XDG data directories per OS
Installation
From Source
# Build with default features (fastembed + huggingface)
# Or build without default features (API-based embeddings only)
# Or build with specific features
# Run the binary
Features
Octobrain supports multiple embedding providers through feature flags:
- fastembed: Local embedding models via FastEmbed (no API key required)
- huggingface: Local embedding models via HuggingFace (no API key required)
- default: Both fastembed and huggingface features enabled
When building without default features (--no-default-features), you can use API-based embedding providers:
- Voyage AI (requires
VOYAGE_API_KEY) - OpenAI (requires
OPENAI_API_KEY) - Google (requires
GOOGLE_API_KEY) - Jina (requires
JINA_API_KEY)
Configure your embedding provider in ~/.local/share/octobrain/config.toml:
[]
= "voyage:voyage-3.5-lite" # or "openai:text-embedding-3-small", etc.
Usage
CLI Structure
Octobrain has three top-level commands:
memory- Memory management for storing and retrieving informationknowledge- Knowledge base management for web content indexing and searchmcp- Start MCP server (Model Context Protocol) exposing memory and knowledge toolshelp- Print this message or help of the given subcommand(s)
Memory Commands
All memory-related commands are grouped under the memory subcommand:
# Store a memory
# Search memories
# Multiple query search
# Delete a memory
# Update a memory
# Get memory by ID
# List recent memories
# Filter by type
# Search by tags
# Find memories for files
# Show statistics
# Clean up old memories
# Create relationships
# View relationships
# Find related memories
# Manually trigger auto-linking for a memory
# Get memory graph with linked context
Knowledge Commands
Knowledge base commands for web content indexing and semantic search:
# Index a URL into knowledge base (fetches and chunks content)
# Search knowledge base
# Search within a specific URL (auto-indexes if needed)
# Delete a URL and all its chunks from knowledge base
# Show knowledge base statistics
# List indexed sources
MCP Server
Start the MCP server to expose memory and knowledge tools via Model Context Protocol:
The server exposes seven tools:
Memory Tools:
memorize: Store memories with metadata (title, content, type, tags, importance)remember: Semantic search with multi-query support and filtersforget: Delete memories by ID or query (requires confirmation)relate: Create a relationship between two memoriesauto_link: Find and connect related memories based on semantic similaritymemory_graph: Explore memory relationships with multi-hop graph traversal
Knowledge Tools:
knowledge_search: Search indexed web knowledge with optional auto-indexing. Provide a URL to search within that source (auto-indexes if outdated), or omit URL to search across all indexed knowledge.
Configuration
Configuration is stored in ~/.local/share/octobrain/config.toml on Unix-like systems.
Default Configuration
[]
# Embedding model for memory operations
# Format: provider:model (e.g., voyage:voyage-3.5-lite, openai:text-embedding-3-small)
# Default: voyage:voyage-3.5-lite
= "voyage:voyage-3.5-lite"
# Batch size for embedding generation (number of texts to process at once)
# Default: 32
= 32
# Maximum tokens per batch request
# Default: 100000
= 100000
[]
# Similarity threshold for memory search (0.0 to 1.0)
# Lower values = more results, higher values = fewer but more relevant
# Default: 0.3
= 0.3
# Maximum number of results to return from search
# Default: 50
= 50
[]
# Enable hybrid search (native BM25 + vector RRF fusion via LanceDB)
# Default: true
= true
# Weight applied to the RRF-fused score (vector + BM25 combined) (0.0-1.0)
# Default: 0.8
= 0.8
# Default weight for recency signal (0.0-1.0)
# Default: 0.1
= 0.1
# Default weight for importance signal (0.0-1.0)
# Default: 0.1
= 0.1
# Recency decay period in days
# Default: 30
= 30
[]
# Enable reranking for improved search accuracy
# Default: false
= false
# Reranker model (fully qualified, e.g., voyage:rerank-2.5)
# Default: voyage:rerank-2.5
= "voyage:rerank-2.5"
# Number of candidates to retrieve before reranking
# Default: 50
= 50
# Number of results to return after reranking
# Default: 10
= 10
[]
# Maximum number of memories to keep in storage
# Default: 10000
= 10000
# Automatic cleanup threshold in days
# Default: 365 (1 year)
= 365
# Minimum importance for automatic cleanup
# Default: 0.1
= 0.1
# Maximum memories returned in search
# Default: 50
= 50
# Default importance for memories (0.0-1.0)
# Default: 0.5
= 0.5
# Enable temporal decay system (Ebbinghaus forgetting curve)
# Default: true
= true
# Half-life for importance decay in days (time for importance to halve)
# Default: 90 (3 months)
= 90
# Boost factor for access reinforcement (multiplier per access)
# Default: 1.2
= 1.2
# Minimum importance threshold (floor value after decay)
# Default: 0.05 (5%)
= 0.05
# Enable automatic linking between semantically similar memories
# Default: true
= true
# Similarity threshold for auto-linking (0.0-1.0)
# Default: 0.78
= 0.78
# Maximum number of auto-links per memory
# Default: 5
= 5
# Create bidirectional links (A->B and B->A)
# Default: true
= true
[]
# Size of each child chunk in characters
# Default: 1200
= 1200
# Overlap between child chunks in characters (~25% of chunk_size)
# Default: 300
= 300
# Days after which indexed content is considered outdated
# Default: 15
= 15
# Maximum number of results to return from knowledge search
# Default: 5
= 5
Storage Locations
Memories are stored in platform-specific directories following XDG Base Directory specification:
- macOS:
~/.local/share/octobrain/ - Linux:
~/.local/share/octobrain/(or$XDG_DATA_HOME/octobrain/) - Windows:
%APPDATA%\octobrain\
Project-specific data is stored in subdirectories identified by Git remote URL hash.
Memory Types
code: Code insights and patternsarchitecture: System design decisionsbug_fix: Bug fixes and solutionsfeature: Feature implementationsdocumentation: Documentation and knowledgeuser_preference: User settings and preferencesdecision: Project decisionslearning: Learning notes and tutorialsconfiguration: Configuration and setuptesting: Testing strategiesperformance: Performance optimizationssecurity: Security considerationsinsight: General insights
License
Apache-2.0
Credits
Developed by Muvon Un Limited.