SuperAPI AI Directory

cortex-mem

Cortex Memory is an AI-native long-term memory framework built on Rust, providing a production-grade cognitive foundation for AI agents, embodied intelligence, and autonomous systems such as OpenClaw. It adopts a three-layer memory architecture of L0 summary → L1 overview → L2 details, combined with a virtual file system (cortex:// URI) and Qdrant vector semantic search, and can automatically extract, organize, and optimize memories from conversations. The framework provides multiple access methods such as SKILL, CLI, REST API, MCP protocol, and an insights dashboard, and supports multi-tenant isolation, session management, event-driven automation, incremental updates, and a memory cleanup mechanism based on the forgetting curve. Officially, it achieved a total score of 68.42% in the LoCoMo10 dataset evaluation and claims to save 11 times the tokens compared with OpenClaw+LanceDB.

Open website

About this tool

Cortex Memory is a production-grade cognitive memory framework for AI agents and autonomous systems, built with Rust, designed to provide high-performance, persistent, and intelligent long-term memory capabilities for AI applications, enabling them to remember, learn, and personalize interactions across sessions.

Purpose

Cortex Memory is used to provide long-term memory for LLM-driven chatbots and agents, solving the problems of stateless AI forgetting user details after each session, lacking personalization, repeatedly asking questions, and being limited to short-term conversation history. It is suitable for developers building LLM chatbots and agents, teams creating personalized AI assistants, open-source projects that need a memory backbone, and developers who want to build truly intelligent AI applications.

Main Capabilities

  • File system-based storage: Memory content is stored as markdown files, using the cortex:// virtual URI scheme, compatible with version control and easy to port.
  • Intelligent memory extraction: Automatically extracts structured memories (facts, decisions, entities) from conversations through LLM analysis, with confidence scoring.
  • Vector semantic search: High-performance similarity search implemented through Qdrant, supporting metadata filtering by dimension (user/agent/session) and using weighted scoring.
  • Multimodal access: Can be interacted with through REST API, CLI, MCP protocol, or direct integration with the Rust library.
  • Three-layer memory hierarchy: A progressive disclosure system (L0 summary → L1 overview → L2 details) that optimizes LLM context window usage through lazy generation.
  • Session management: Tracks conversation timelines, participants, and message history, supporting automatic indexing and event-driven processing.
  • Multi-tenant support: Through tenant-aware collection naming, provides isolated memory spaces for different users and agents in a single deployment.
  • Event-driven automation: File watchers and automatic indexers for background processing, synchronization, and profile enrichment.
  • LLM result caching: Intelligent caching with LRU eviction and TTL expiration, which can reduce redundant LLM API calls by 50-75%, and cascading layer debouncing can reduce layer updates by 70-90%.
  • Incremental memory updates: An event-driven incremental update system (MemoryEventCoordinator, CascadeLayerUpdater) automatically keeps L0/L1 layers synchronized when memories change.
  • Memory forgetting mechanism: MemoryCleanupSer based on the Ebbinghaus forgetting curvevice, automatically archives or deletes low-intensity memories to control storage growth for long-running agents.
  • Agent framework integration: built-in support for the Rig framework and Model Context Protocol (MCP).
  • Web dashboard: Svelte 5 SPA (Insights) for monitoring, tenant management, and semantic search visualization.

Memory architecture

Memories are organized by dimension (user, agent, session, or resources), scope (tenant or identifier), category (memories, profiles, entities, sessions, etc.), and ID (unique memory identifier). The three-tier memory hierarchy uses progressive disclosure, and the search engine uses weighted scoring combining the L0/L1/L2 three tiers.

Ecosystem modules

  • cortex-mem-core: the system core, including filesystem abstraction (cortex:// URI), LLM client wrapper, embedding generation, Qdrant integration, session management, layer generation (L0/L1/L2), extraction engine, search engine, automation orchestrator, incremental update system, and forgetting mechanism.
  • cortex-mem-service: a high-performance REST API server based on Axum that exposes all memory operations through /api/v2/* endpoints and runs on port 8085 by default.
  • cortex-mem-cli: command-line tool (cortex-mem binary) for developers and administrators to interact directly with memory storage.
  • cortex-mem-insights: a pure frontend Svelte 5 SPA for monitoring, analysis, and memory management through a Web interface.
  • cortex-mem-mcp: Model Context Protocol server for integration with AI assistants (Claude Desktop, Cursor, etc.).
  • cortex-mem-rig: an integration layer with the rig-core agent framework for tool registration.
  • cortex-mem-tools: MCP tool schemas and operation wrappers for agent integration.
  • cortex-mem-config: configuration management module that handles TOML loading, environment variable parsing, and tenant-specific overrides.

Usage

Getting started requires Rust 1.86 or later, Qdrant vector database (1.7+), an OpenAI-compatible LLM API endpoint (for memory extraction and analysis), and an OpenAI-compatible Embedding API endpoint (for vector search). The simplest way is to install the CLI and service binaries via cargo. Applications are configured through a config.toml file; the CLI looks for this file in the current directory by default, and the path can also be specified with the -c or --config flag. The CLI provides a direct interaction interface; all commands require config.toml, and the --tenant flag supports multi-tenant isolation; for example, you can add a new message to a session thread (--thread specifies the thread ID, --role specifies the role, default user), or perform semantic vector search with L0/L1/L2 weighted scoring (query is a natural language query, --thread filters threads, --limit/-n limits the number of results). After the dashboard is running, you can http://localhost:5173 access, and proxies API requests to backend services.

Applicable Scenarios and Community Cases

  • MemClaw: A deeply customized memory enhancement plugin for the OpenClaw ecosystem, powered by the locally running Cortex Memory engine, claiming to save over 80% of tokens compared to OpenClaw's built-in memory system while maintaining memory accuracy, security, and performance; it supports one-click migration from OpenClaw native memory, stores all memories locally, and has zero cloud dependency.
  • TweetClaw X/Twitter Signals: Cortex Memory can save reviewed public X/Twitter research from TweetClaw as persistent source memory, without storing credentials, raw exports, or private account data, making it suitable for OpenClaw agents that collect market, support, competitor, or community signals.
  • Cortex TARS: A production-grade AI-native TUI application that serves as a "second brain" companion, showcasing Cortex Memory's capabilities, including multi-agent management, persistent persona memory, memory isolation, and real-time audio-to-memory (capable of capturing conversations, meetings, or lectures and automatically converting them into structured, searchable memories).

Evaluation Performance

Cortex Memory was evaluated on the LoCoMo10 dataset (conv-26, 152 questions, 19 conversation sessions, spanning May to October 2023) using the LLM-as-a-Judge method. The results show that Cortex Memory v5 achieved an overall score of 68.42%, outperforming all OpenViking and OpenClaw configurations; in terms of token efficiency, it claims to use 11 times fewer tokens than OpenClaw+LanceDB and has an 18 times better score-per-token ratio. Key technical advantages include intent-driven retrieval (routing multi-hop queries to entity and relationship memory scopes, improving Cat 4 accuracy by 18.75 percentage points), a hierarchical L0/L1/L2 architecture (starting precise retrieval from summaries of about 100 tokens), and a Rust-based implementation (high performance, memory safety, backed by the Qdrant vector database). The evaluation script is located at examples/locomo-evaluation and implements a two-stage pipeline: Ingest (ingesting sessions into Cortex M by sample tenantemory), QA (generating answers to 152 questions via semantic retrieval + LLM), Judge (LLM-as-a-Judge scoring each answer as CORRECT/WRONG).

Limitations

The official materials do not provide clear statements regarding charging, pricing, platform support scope, specific performance limits, or known limitations; this information is not currently available.