CortexaDB LogoCortexaDB

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

Guides

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_entries or max_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.

On this page