freshcrate
Home > Databases > CortexaDB

CortexaDB

It is a simple, fast, and hard-durable embedded database designed specifically for AI agent memory. It provides a single-file-like experience (no server required) but with native support for vectors,

Description

It is a simple, fast, and hard-durable embedded database designed specifically for AI agent memory. It provides a single-file-like experience (no server required) but with native support for vectors, graphs, and temporal search.

README

CortexaDB Logo

CortexaDB

SQLite for AI Agents

License Status Version Downloads Documentation Stars📖 Read the full documentation

CortexaDB is a lightweight, high-performance embedded database built in Rust, specifically designed to serve as the long-term memory for AI agents. It provides a single-file, zero-dependency storage solution that combines the simplicity of SQLite with the semantic power of vector search, graph relationships, and temporal indexing.


The Problem: Why CortexaDB?

Current AI agent frameworks often struggle with "memory" once the context window fills up. Developers usually have to choose between complex, over-engineered vector databases (that require a running server) or simple JSON files (that are slow and lose searchability at scale).

CortexaDB exists to provide a middle ground: a hard-durable, embedded memory engine that runs inside your agent's process. It ensures your agent never forgets, starting instantly with zero overhead, and maintaining millisecond query latencies even as it learns thousands of new facts.


Quickstart

from cortexadb import CortexaDB
from cortexadb.providers.openai import OpenAIEmbedder

# 1. Open database with an embedder 
db = CortexaDB.open("agent.mem", embedder=OpenAIEmbedder())

# 2. Add facts 
mid1 = db.add("The user prefers dark mode.")
mid2 = db.add("User works at Stripe.")
db.connect(mid1, mid2, "relates_to")

# 3. Fluent Query Builder
hits = db.query("What are the user's preferences?") \
    .limit(5) \
    .use_graph() \
    .execute()

print(f"Top Hit: {hits[0].id}")

Installation

CortexaDB is available on PyPI for Python and can be added via Cargo for Rust.

Python

pip install cortexadb
pip install cortexadb[docs,pdf]  # Optional: For PDF/Docx support

Core Capabilities

  • 100x Faster Ingestion: New batch insertion system allows processing 5,000+ chunks/second.
  • Hybrid Retrieval: Search by semantic similarity (Vector), structural relationship (Graph), and time-based recency in a single query.
  • Ultra-Fast Indexing: Uses HNSW (USearch) for sub-millisecond approximate nearest neighbor search.
  • Fluent API: Chainable QueryBuilder for expressive searching and collection scoping.
  • Hard Durability: WAL-backed storage ensures zero data loss.
  • Privacy First: Completely local. Your agent's memory stays on your machine.

Technical Architecture & Benchmarks

Performance Benchmarks (v1.0.1)

Measured on an M-series Mac — 10,000 embeddings × 384 dimensions.

Operation Latency / Time
Bulk Ingestion (1,000 chunks) 0.12s
Single Memory Add 1ms
HNSW Search p50 1.03ms (debug) / ~0.3ms (release)
HNSW Recall 95%

Star History

Star History Chart

See the full benchmark docs for HNSW vs Exact comparison and how to reproduce.


License & Status

CortexaDB v1.0.1 is a stable release available under the MIT and Apache-2.0 licenses.
We welcome feedback and contributions!


CortexaDB — Because agents shouldn't have to choose between speed and a soul (memory).

Release History

VersionChangesUrgencyDate
v1.0.1**Full Changelog**: https://github.com/anaslimem/CortexaDB/compare/v1.0.0...v1.0.1High4/16/2026
v0.1.0-test4**Full Changelog**: https://github.com/anaslimem/CortexaDB/compare/v0.1.0-test3...v0.1.0-test4High4/16/2026
v0.1.0-test3**Full Changelog**: https://github.com/anaslimem/CortexaDB/compare/v1.0.0...v0.1.0-test3High4/16/2026
v1.0.0## What's Changed * Updated docs by @anaslimem in https://github.com/anaslimem/CortexaDB/pull/17 * Dev by @anaslimem in https://github.com/anaslimem/CortexaDB/pull/18 * docs: add documentation links and badge to README by @azizbecha in https://github.com/anaslimem/CortexaDB/pull/19 * Cleaning code by @anaslimem in https://github.com/anaslimem/CortexaDB/pull/20 * FIxed the python version error by @anaslimem in https://github.com/anaslimem/CortexaDB/pull/27 * Enhance error handling by @anaslimem iLow3/18/2026
v0.1.8## What's Changed * Modernize Python API and Implement High-Performance Batch Ingestion (v0.1.7) by @anaslimem in https://github.com/anaslimem/CortexaDB/pull/16 **Full Changelog**: https://github.com/anaslimem/CortexaDB/compare/v0.1.7...v0.1.8Low3/8/2026
v0.1.7## What's Changed * fix(core): sync missing vectors from state machine to HNSW on recovery by @anaslimem in https://github.com/anaslimem/CortexaDB/pull/11 * perf(core): replace Mutex with RwLock in HnswBackend for highly concurrent reads by @anaslimem in https://github.com/anaslimem/CortexaDB/pull/12 * perf(core): decouple slow disk fsync from global write lock for highly concurrent ingestion by @anaslimem in https://github.com/anaslimem/CortexaDB/pull/13 * feat: docs by @azizbecha in https://giLow3/6/2026
v0.1.6## What's Changed * Updated features by @anaslimem in https://github.com/anaslimem/CortexaDB/pull/7 * chore: fix strict clippy violations and apply rustfmt by @anaslimem in https://github.com/anaslimem/CortexaDB/pull/8 * fix: enforce namespace isolation during graph-expanded ask by @anaslimem in https://github.com/anaslimem/CortexaDB/pull/9 * Updated with the replay features and readme by @anaslimem in https://github.com/anaslimem/CortexaDB/pull/10 **Full Changelog**: https://github.com/anasliLow3/3/2026
v0.1.5## What's Changed * Add benchmark suite with HNSW performance testing by @anaslimem in https://github.com/anaslimem/CortexaDB/pull/6 **Full Changelog**: https://github.com/anaslimem/CortexaDB/compare/v0.1.4...v0.1.5Low3/1/2026
v0.1.4## What's Changed * feat: HNSW automatic persistence for fast restart (v0.1.3) by @anaslimem in https://github.com/anaslimem/CortexaDB/pull/3 * feat: L2/Euclidean distance metric support (v0.1.4) by @anaslimem in https://github.com/anaslimem/CortexaDB/pull/4 **Full Changelog**: https://github.com/anaslimem/CortexaDB/compare/v0.1.2...v0.1.4Low2/28/2026
v0.1.3**Full Changelog**: https://github.com/anaslimem/CortexaDB/compare/v0.1.2...v0.1.3Low2/27/2026
v0.1.2## What's Changed * Add HNSW indexing with USearch by @anaslimem in https://github.com/anaslimem/CortexaDB/pull/2 **Full Changelog**: https://github.com/anaslimem/CortexaDB/compare/v0.1.1...v0.1.2Low2/27/2026
v0.1.1## What's Changed * feat: add 5 chunking strategies in Rust core by @anaslimem in https://github.com/anaslimem/CortexaDB/pull/1 ## New Contributors * @anaslimem made their first contribution in https://github.com/anaslimem/CortexaDB/pull/1 **Full Changelog**: https://github.com/anaslimem/CortexaDB/compare/v0.1.0...v0.1.1Low2/25/2026
v0.1.0**Full Changelog**: https://github.com/anaslimem/CortexaDB/commits/v0.1.0Low2/25/2026

Dependencies & License Audit

Loading dependencies...

Similar Packages

contextdbEmbedded database for agentic memory — relational, graph, and vector under unified MVCC transactionsv0.3.4
AnyCam2Ros📷 Transform any camera into ROS2 image topics for seamless integration with robotic systems and effective VLA model deployment.master@2026-04-21
vektoriMemory that remembers the story not just the facts. Three layer sentence graph for AI agents -> Facts, Episodes, raw Sentences. One DB. Zero config.main@2026-04-19
coordinodeThe graph-native hybrid retrieval engine for AI and GraphRAG. Graph + Vector + Full-Text in a single transactional engine.v0.4.1
PageIndex📑 PageIndex: Document Index for Vectorless, Reasoning-based RAGmain@2026-04-10