Skip to main content

Fast, embedded vector + graph memory for AI agents

Project description

CortexaDB Logo

CortexaDB

SQLite for AI Agents

License Status Version Downloads Documentation

📖 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.0)

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%

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


License & Status

CortexaDB v1.0.0 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).

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

cortexadb-1.0.0-cp314-cp314-win_amd64.whl (2.1 MB view details)

Uploaded CPython 3.14Windows x86-64

cortexadb-1.0.0-cp313-cp313-win_amd64.whl (2.1 MB view details)

Uploaded CPython 3.13Windows x86-64

cortexadb-1.0.0-cp313-cp313-macosx_11_0_arm64.whl (1.3 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

cortexadb-1.0.0-cp312-cp312-win_amd64.whl (2.1 MB view details)

Uploaded CPython 3.12Windows x86-64

cortexadb-1.0.0-cp312-cp312-manylinux_2_34_x86_64.whl (1.5 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.34+ x86-64

cortexadb-1.0.0-cp312-cp312-macosx_11_0_arm64.whl (1.3 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

cortexadb-1.0.0-cp311-cp311-win_amd64.whl (2.1 MB view details)

Uploaded CPython 3.11Windows x86-64

cortexadb-1.0.0-cp311-cp311-manylinux_2_34_x86_64.whl (1.5 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.34+ x86-64

cortexadb-1.0.0-cp311-cp311-macosx_11_0_arm64.whl (1.3 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

cortexadb-1.0.0-cp310-cp310-win_amd64.whl (2.1 MB view details)

Uploaded CPython 3.10Windows x86-64

File details

Details for the file cortexadb-1.0.0-cp314-cp314-win_amd64.whl.

File metadata

  • Download URL: cortexadb-1.0.0-cp314-cp314-win_amd64.whl
  • Upload date:
  • Size: 2.1 MB
  • Tags: CPython 3.14, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for cortexadb-1.0.0-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 4ac05a78b602055b443fe557861bd358c30fc82c85f209c989fc90322416e26f
MD5 42f7ff996c6652f67a75b207daed6955
BLAKE2b-256 d188aa9554830ea43408a3b06559c97e48db3f109fd66a26be370925d29d531d

See more details on using hashes here.

Provenance

The following attestation bundles were made for cortexadb-1.0.0-cp314-cp314-win_amd64.whl:

Publisher: release.yml on anaslimem/CortexaDB

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file cortexadb-1.0.0-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: cortexadb-1.0.0-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 2.1 MB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for cortexadb-1.0.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 9d5424071c4c7a02f5095930b669cc9ece080694ea7fa9341e54dd2d80557581
MD5 ecffbcf302ae33e6ce3c918859485277
BLAKE2b-256 734060e33d7c821d1f6e31ef3499951be5f1b9c3780f93c94f6f910e607d275f

See more details on using hashes here.

Provenance

The following attestation bundles were made for cortexadb-1.0.0-cp313-cp313-win_amd64.whl:

Publisher: release.yml on anaslimem/CortexaDB

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file cortexadb-1.0.0-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for cortexadb-1.0.0-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 3acfabe8913e2a94d843778fb9c118f054f4b7253c93051eabf9347c81b70834
MD5 212e6093deb7044bd895b82d7d840af6
BLAKE2b-256 f54b3fdcfe0346b6b0e0d71f13a4dcc3ad99955bac19551a3464d82e69eb658f

See more details on using hashes here.

Provenance

The following attestation bundles were made for cortexadb-1.0.0-cp313-cp313-macosx_11_0_arm64.whl:

Publisher: release.yml on anaslimem/CortexaDB

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file cortexadb-1.0.0-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: cortexadb-1.0.0-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 2.1 MB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for cortexadb-1.0.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 694dde96f69b6a4cc8234e289e565047ab425378b53fa79bfdc2d2e0332a2d95
MD5 154405756f94bf4893626c009898394c
BLAKE2b-256 00b3f063bb4f505a9765764bb910d5c0da923e44261780ccd977d0fdd479f1cd

See more details on using hashes here.

Provenance

The following attestation bundles were made for cortexadb-1.0.0-cp312-cp312-win_amd64.whl:

Publisher: release.yml on anaslimem/CortexaDB

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file cortexadb-1.0.0-cp312-cp312-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for cortexadb-1.0.0-cp312-cp312-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 ee86fce0cc9b8cb3dc903e04080aa482633c44942508e1dec2743f4db73e8c8a
MD5 97df971242eb02debd08e241d9255360
BLAKE2b-256 46278fd0fa62e70b710fe025832cc20833225e11ee8a82a7026b0ac198e060b7

See more details on using hashes here.

Provenance

The following attestation bundles were made for cortexadb-1.0.0-cp312-cp312-manylinux_2_34_x86_64.whl:

Publisher: release.yml on anaslimem/CortexaDB

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file cortexadb-1.0.0-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for cortexadb-1.0.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 03c0268e78c93c03152b0c205fa2df4ad5bb31d0445605d4923d2f724ae23e7b
MD5 7e2b6f72d4c20deaa5d6648b9786ca4b
BLAKE2b-256 7a8f65587483a46eeefcd4a86bf66fb002b9286316659b333c8632dcfd3c898a

See more details on using hashes here.

Provenance

The following attestation bundles were made for cortexadb-1.0.0-cp312-cp312-macosx_11_0_arm64.whl:

Publisher: release.yml on anaslimem/CortexaDB

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file cortexadb-1.0.0-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: cortexadb-1.0.0-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 2.1 MB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for cortexadb-1.0.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 05eacfe578f8f350a3e980c1b02a31271ea8e3c2af5d9ec4846896d9ce65967d
MD5 49c610501e255670ae068d7675de2b1e
BLAKE2b-256 e863c0a0c2f02d95e439ad75a23f94a53541cc5de70d10fdbdfb4470ee8e94a7

See more details on using hashes here.

Provenance

The following attestation bundles were made for cortexadb-1.0.0-cp311-cp311-win_amd64.whl:

Publisher: release.yml on anaslimem/CortexaDB

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file cortexadb-1.0.0-cp311-cp311-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for cortexadb-1.0.0-cp311-cp311-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 bcff39450fbaf36dbed84d58d46e8ec8a0f5b6f3d61146830bcb0fa129c57f4b
MD5 730285ea6e1de8a8d3c7050660bba622
BLAKE2b-256 fb96fc9e5aee73f0ac280f8c2fff205b790c848642d97613d693837dd6ca3843

See more details on using hashes here.

Provenance

The following attestation bundles were made for cortexadb-1.0.0-cp311-cp311-manylinux_2_34_x86_64.whl:

Publisher: release.yml on anaslimem/CortexaDB

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file cortexadb-1.0.0-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for cortexadb-1.0.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 d685a93af6f9ae364e61e1fe702b6fc681e053c8aaf3d59044bdcdc07497ba6a
MD5 7226e7ad876b503a30c717a20f277f94
BLAKE2b-256 e342001a4200c8e66545e576bc2a224640308793e76b55b2825c4c20c37f5ce5

See more details on using hashes here.

Provenance

The following attestation bundles were made for cortexadb-1.0.0-cp311-cp311-macosx_11_0_arm64.whl:

Publisher: release.yml on anaslimem/CortexaDB

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file cortexadb-1.0.0-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: cortexadb-1.0.0-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 2.1 MB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for cortexadb-1.0.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 fa474332a5bcc97b3efe75d95fdd54f5ffcb9ea1a9276364bf15c3bd91a0986e
MD5 a4bda73a8c54f74aff25bfe2fd93bca7
BLAKE2b-256 81e43ebb14d86804852e5158bebab51e2e738ade2f1da7c118e630022c57ed12

See more details on using hashes here.

Provenance

The following attestation bundles were made for cortexadb-1.0.0-cp310-cp310-win_amd64.whl:

Publisher: release.yml on anaslimem/CortexaDB

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page