sopaco/cortex-mem
🧠 The production-ready cognitive foundation for autonomous systems such as Embodied-AI and OpenClaw. For memory management, from extraction and search to automated optimization, with SKILL, CLI, API, MCP, and insights dashboard out-of-the-box.
What it solves
Cortex Memory is a high-performance, persistent long-term memory framework for AI agents and LLM applications. It solves the "stateless" nature of AI by allowing agents to remember user preferences, history, and specific facts across multiple sessions, preventing the need for users to repeat information and creating a more personalized experience.
How it works
Built with Rust, the system uses a hybrid storage architecture that combines a virtual filesystem (using the cortex:// URI scheme) for durability and Qdrant for vector-based semantic search. It employs a three-tier memory hierarchy to optimize LLM context window usage:
- L0 (Abstract): Coarse-grained screening (~100 tokens).
- L1 (Overview): Structured summaries and key entities (~500-2000 tokens).
- L2 (Detail): Full conversation content (variable tokens).
An automated pipeline extracts structured memories from conversations using LLMs, indexes them via embeddings, and manages them through an event-driven system that includes a "forgetting mechanism" based on the Ebbinghaus forgetting curve to prune low-strength memories.
Who it’s for
- Developers building LLM-powered chatbots and agents.
- Teams creating personalized AI assistants.
- Open source projects requiring a persistent memory backbone.
Highlights
- Three-Tier Hierarchy: Optimizes token usage through progressive disclosure (L0 $\rightarrow$ L1 $\rightarrow$ L2).
- Virtual Filesystem: Stores memories as markdown files for portability and version control compatibility.
- Semantic Search: High-performance similarity search with metadata filtering across user, agent, and session dimensions.
- Multi-Modal Access: Supports REST API, CLI, MCP protocol, and direct Rust library integration.
- Resource Efficiency: Includes LLM result caching to reduce redundant API calls by 50-75%.
- Observability: Provides a Svelte 5 web dashboard for tenant management and memory visualization.
Related
- Project
- Project
- Project
- Project
- Project