Skip to content
The AI Database
Screenshot of Cortex Memory

Cortex Memory

sopaco.github.io

A Rust framework that gives AI agents long-term memory with layered, searchable context.

Visit website (opens in a new tab)

At a glance

Good for
Builders
Ease
For developers
Lets you
  • Give AI agents memory that persists across sessions
  • Search agent memories through a REST API, MCP or CLI
  • Organise context in a file-system-style hierarchy
Pricing
Free
Works on
API, Command line, Self-hosted
Category
AI Agents

Cortex Memory - AI-native Memory Framework Built with Rust

Overview

Cortex Memory is an advanced AI-native memory framework designed for the creation of intelligent, context-aware agents. Built using the Rust programming language, Cortex Memory is engineered to provide high performance, ease of integration, and production-readiness, making it an exceptional solution for developers and businesses seeking to build scalable AI applications.

Key Features

Built with Rust

Cortex Memory takes full advantage of Rust’s capabilities, including:

  • Zero-Cost Abstractions: Ensures efficient performance without overhead.
  • Fearless Concurrency: Manages multiple tasks simultaneously without data races.
  • Guaranteed Memory Safety: Reduces bugs and enhances reliability, crucial for production environments.

It claims to be 3x faster in indexing than its main competitor, LangMem, and emphasizes a memory-safe design that supports a single binary deployment.

Production Ready

This framework targets enterprise applications with features that support:

  • Multi-Tenancy: Enables the isolation of data for different users or clients, allowing a single deployment to service thousands of users effectively.
  • Built-in Security: Ensures that sensitive information is handled appropriately.
  • Per-Tenant Analytics: Provides insights and metrics tailored to individual clients.

The capacity for streamlined deployment makes Cortex Memory an excellent choice for Software as a Service (SaaS) applications.

Easy Integration

Cortex Memory supports various integration methods that cater to a wide range of applications, including:

  • REST API: Facilitates easy communication with external systems.
  • MCP Protocol: Provides a protocol for model context management.
  • Native Rust Library: Allows seamless incorporation into Rust-based projects.

This flexibility makes it adaptable for various environments, from chatbots to complex enterprise systems.

Design Philosophy

Cortex Memory operates on principles that ensure scalability and efficiency in memory management:

Context Organization: Hierarchical File System

The framework uses a file system-inspired structure to manage resources, users, sessions, and memories. This organization simplifies access to context and makes it easily portable and versionable, utilizing the cortex:// URI schema.

The hierarchical structure is visually represented as:

cortex:// File System
│
├─ 📁 resources/
├─ 📁 user/
│  └─ 📁 user_001/
├─ 📁 agent/
├─ 📁 session/
└─ 📁 memories/

Layered Context Loading

Cortex Memory employs a three-tier hierarchy to manage context:

  • L0 Abstract: Offers succinct summaries of intent, using fewer than 100 tokens.
  • L1 Overview: Provides structured markdown summaries with a focus on relevant details (up to 2,000 tokens).
  • L2 Detail: Contains comprehensive transcripts with variable token lengths for in-depth sessions.

This tiered approach minimizes resource consumption while ensuring that essential context is accessible.

Recursive Context Retrieval

The system intelligently retrieves context using a hierarchical approach that involves:

  1. Starting from a directory level for positioning.
  2. Performing localized searches.
  3. Reranking results based on relevance.

This method ensures that pertinent memories are highlighted within extensive knowledge bases.

Observable and Self-Evolving Context

Cortex Memory evolves its understanding and memory through continuous interactions with contexts during sessions. Each commitment to a session triggers automatic updates and memory management, which builds a dynamic knowledge base that grows smarter over time without requiring manual adjustments.

Performance Metrics

Cortex Memory emphasizes performance in relation to production workloads with a benchmark comparison against LangMem:

  • Indexing Speed: Cortex Memory achieves 15,000 messages/sec, whereas LangMem reaches only 5,000 messages/sec.
  • Memory Usage: Cortex Memory has a significantly lower footprint of 120 MB for 10,000 sessions compared to LangMem’s 380 MB.

Architecture Overview

The architecture of Cortex Memory consists of three primary layers:

  1. Access Layer: Interfaces for interaction (CLI, REST API, MCP Protocol, etc.).
  2. Core Business Layer: Handles session management, layered memory operations, search and extraction capabilities, and automation.
  3. Infrastructure Layer: Integrates tools like Qdrant Vector DB and ensures multi-tenant isolation and hybrid storage solutions.

This modular architecture allows for scalability, adaptability, and robustness essential for enterprise environments.

Getting Started

Getting started with Cortex Memory is straightforward:

  1. Installation: A simple command setup makes it accessible.
  2. Using the API: The framework offers a minimal API for operations like semantic search, memory reading, and context management.

The ecosystem comprises several specialized components to support different functionalities:

  • cortex-mem-core: Core memory operations library.
  • cortex-mem-service: REST API server.
  • cortex-mem-cli: Command-line interface tool.
  • cortex-mem-insights: A web dashboard for insights.

Conclusion

Cortex Memory stands out as a powerful solution for developers and businesses that require an efficient, scalable, and intelligent memory framework. Its robust design, driven by Rust's performance capabilities, positions it as an ideal choice for creating modern AI agents that demand high performance and intelligent context management. It caters to diverse needs, making it a valuable asset in various AI-driven applications, including chatbots, enterprise systems, and SaaS products.

Ready to try it? Visit sopaco.github.io (opens in a new tab)

  • Screenshot of Kimi K2

    Kimi K2

    moonshotai.github.io
    Category
    AI Agents
    What it does
    Kimi K2 is an open-weight Mixture-of-Experts language model with 1 trillion total parameters and 32 billion activated, optimized for agentic tasks such as tool use, coding and mathematics. It is offered in Base and Instruct versions with an OpenAI and Anthropic compatible API.
  • Screenshot of Swarms

    Swarms

    swarms.ai
    Category
    AI Agents
    What it does
    Swarms is an open framework for building, deploying and scaling multi-agent AI systems, with orchestration patterns such as sequential workflows, parallel mixture of agents and hierarchical swarms. It is installed as a Python package and includes companion libraries for tools, models and memory.
  • Screenshot of Supermachine

    Supermachine

    supermachine.ai
    Category
    Development Tools
    What it does
    Supermachine is a platform offering one-click, remotely hosted Model Context Protocol (MCP) servers that connect AI agents to services such as Gmail, GitHub and PostgreSQL. It provides access to a public library of over 5,380 MCP servers and supports clients including Cursor, Zed and Claude Desktop.
  • Screenshot of AG-UI

    AG-UI

    docs.ag-ui.com
    Category
    Development Tools
    What it does
    AG-UI is an open, event-driven protocol that standardizes how front-end applications communicate with AI agents. It supports real-time streaming of state updates, human-in-the-loop interaction and transports such as SSE, webhooks and WebSockets.