CortexaDB Documentation
Simple, fast, and hard-durable embedded database for AI agent memory
CortexaDB is a simple, fast, and hard-durable embedded database designed specifically for AI agent memory. It provides a single-file experience (no server required) with native support for vectors, graphs, and temporal search.
Think of it as SQLite, but with semantic and relational intelligence for your agents.
Documentation Overview
Getting Started
- Installation - Install CortexaDB via pip or Cargo
- Quickstart - Your first database in 5 minutes
Guides
- Core Concepts - Architecture and how CortexaDB works
- Storage Engine - WAL, segments, checkpoints, and compaction
- Query Engine - Hybrid search with vector, graph, and temporal scoring
- Indexing - Exact search vs HNSW approximate nearest neighbor
- Chunking - Document ingestion and chunking strategies
- Namespaces - Multi-agent memory isolation
- Embedders - Embedding providers (OpenAI, Gemini, Ollama, Hash)
- Replay & Recording - Deterministic session recording and replay
- Configuration - All configuration options explained
API Reference
- Python API - Complete Python API reference
- Rust API - Rust crate API reference
Resources
- Benchmarks - Performance benchmarks and methodology
- Examples - Code examples for common use cases
Key Features
- Hybrid Retrieval - Combine vector similarity, graph relations, and recency in a single query
- Smart Chunking - 5 strategies for document ingestion (fixed, recursive, semantic, markdown, json)
- File Support - Load TXT, MD, JSON, DOCX, and PDF documents directly
- HNSW Indexing - Ultra-fast approximate nearest neighbor search via USearch
- Hard Durability - Write-Ahead Log and segmented storage ensure crash safety
- Multi-Agent Namespaces - Isolate memories between agents within a single database file
- Deterministic Replay - Record and replay operations for debugging or migration
- Automatic Capacity Management - LRU/importance-based eviction with
max_entriesormax_bytes
Quick Example
from cortexadb import CortexaDB
from cortexadb.providers.openai import OpenAIEmbedder
db = CortexaDB.open("agent.mem", embedder=OpenAIEmbedder())
db.remember("The user prefers dark mode.")
db.remember("User works at Stripe.")
hits = db.ask("What does the user like?")
for hit in hits:
print(f"ID: {hit.id}, Score: {hit.score}")License
CortexaDB is released under the MIT and Apache-2.0 licenses.
