cortex-mem  by sopaco

AI-native memory framework for autonomous systems

Created 4 months ago
254 stars

Top 99.1% on SourcePulse

GitHubView on GitHub
Project Summary

Cortex Memory is a production-ready, AI-native memory framework built in Rust, designed to provide intelligent, context-aware long-term memory for autonomous systems and AI agents. It addresses the limitations of stateless AI by enabling applications to remember user details, personalize interactions, and maintain context across sessions, transforming them into more capable and human-like partners. The framework targets developers building LLM-powered applications, AI assistants, and open-source projects requiring a robust memory backbone.

How It Works

Cortex Memory employs a hybrid storage architecture combining virtual-filesystem durability with vector-based semantic search. It utilizes a three-tier memory hierarchy (L0 Abstract, L1 Overview, L2 Detail) to progressively disclose information, optimizing LLM context window usage. Data is organized using a cortex:// URI scheme, enabling file-system-like management. Memory extraction is LLM-powered, and retrieval leverages Qdrant for high-performance vector similarity search with metadata filtering and weighted scoring across the memory layers.

Quick Start & Requirements

  • Primary install/run command: Installation is primarily via cargo (e.g., cargo install --path cortex-mem-cli, cargo install --path cortex-mem-service).
  • Non-default prerequisites: Rust toolchain (version 1.86+), Qdrant vector database (version 1.7+), an OpenAI-compatible LLM API endpoint, and an OpenAI-compatible Embedding API endpoint are required. Configuration is managed via a config.toml file.
  • Links:
    • CLI/Service/MCP installation: cargo install --path <path>
    • Configuration example: config.toml
    • Web Dashboard (cortex-mem-insights): http://localhost:5173 (after running backend service)
    • MemClaw: openclaw plugins install @memclaw/memclaw
    • Cortex TARS: cd examples/cortex-mem-tars && cargo build --release && cargo run --release

Highlighted Details

  • File-System Based Storage: Memory content stored as markdown files using the cortex:// virtual URI scheme.
  • Intelligent Memory Extraction: LLM-powered analysis with confidence scoring extracts structured memories.
  • Vector-Based Semantic Search: High-performance similarity search via Qdrant with metadata filtering and weighted scoring.
  • Multi-Modal Access: Interact via REST API, CLI, MCP protocol, or direct Rust library.
  • Three-Tier Memory Hierarchy: L0 (Abstract), L1 (Overview), L2 (Detail) optimize LLM context window usage.
  • LLM Result Caching: Reduces redundant LLM API calls by 50-75%.
  • Memory Forgetting Mechanism: Archives or deletes low-strength memories based on the Ebbinghaus forgetting curve.
  • Benchmark Performance: Achieved 68.42% on the LoCoMo10 dataset using LLM-as-a-Judge, outperforming other systems.
  • Token Efficiency: Demonstrates significantly fewer tokens per question compared to other evaluated systems.
  • Web Dashboard: Svelte 5 SPA (cortex-mem-insights) for monitoring, management, and visualization.

Maintenance & Community

The project welcomes contributions via GitHub Issues and standard pull request workflows. Notable community showcases include MemClaw, an OpenClaw memory enhancement plugin, and Cortex TARS, a TUI application demonstrating multi-agent management and real-time audio-to-memory capabilities.

Licensing & Compatibility

This project is licensed under the MIT License, which is permissive for commercial use and integration into closed-source applications.

Limitations & Caveats

The framework relies on external LLM and embedding services, requiring API keys and network access. Setup involves configuring Rust, Qdrant, and external API endpoints, which may present a moderate barrier to entry. While benchmarks indicate strong performance, real-world effectiveness depends on the quality of the configured LLM/embedding models and the specific application context.

Health Check
Last Commit

6 days ago

Responsiveness

Inactive

Pull Requests (30d)
17
Issues (30d)
2
Star History
58 stars in the last 30 days

Explore Similar Projects

Starred by Chip Huyen Chip Huyen(Author of "AI Engineering", "Designing Machine Learning Systems"), Travis Fischer Travis Fischer(Founder of Agentic), and
2 more.

Memori by MemoriLabs

1.9%
13k
LLM memory engine for context-aware AI
Created 8 months ago
Updated 2 days ago
Feedback? Help us improve.