This project implements a next-generation memory architecture for OpenClaw agents. It merges the efficiency of Data Warehouse techniques (Micro-partitions, Zone Maps) with the semantic understanding of Vector Search and the relational power of Knowledge Graphs.
- Hybrid Recall: Combines exact keyword matching (BM25/TF-IDF) with dense vector semantic search.
- Micro-Partitioning: Data is stored in immutable, compressed blocks with metadata pruning (Zone Maps) for ultra-fast filtering.
- Local-First: Designed to run efficiently without heavy external databases (no Postgres/Pinecone required).
- Agent-Specific Profiles:
- Trader: Optimized for time-series and sentiment correlation.
- Coder: Built for AST/Graph traversal and code relationships.
- Orchestrator: Focuses on hierarchical summarization and high-level intent.
The system is modularized as follows:
core: The foundational storage engine (Partitions, Indices, Memory Objects).vectors: Integration with local embedding models (e.g.,all-MiniLM-L6-v2) and similarity search.graph: Lightweight graph structures for managing relationships between memories.personas: specialized configurations and mixins for different agent types.
from openclaw_memory.core import MemorySystem
from openclaw_memory.personas import CoderMemory
# Initialize a standard system
mem = MemorySystem(base_path="./data")
# Add a memory
mem.add("Executed trade: BUY BTC at 45000", tags=["finance", "crypto"])
# Search (Hybrid)
results = mem.search("bitcoin purchase", limit=5)