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.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%

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

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.1-cp314-cp314-win_amd64.whl (2.1 MB view details)

Uploaded CPython 3.14Windows x86-64

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

Uploaded CPython 3.13Windows x86-64

cortexadb-1.0.1-cp313-cp313-macosx_11_0_arm64.whl (2.1 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

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

Uploaded CPython 3.12Windows x86-64

cortexadb-1.0.1-cp312-cp312-manylinux_2_34_x86_64.whl (3.4 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.34+ x86-64

cortexadb-1.0.1-cp312-cp312-macosx_11_0_arm64.whl (2.1 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

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

Uploaded CPython 3.11Windows x86-64

cortexadb-1.0.1-cp311-cp311-manylinux_2_34_x86_64.whl (3.4 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.34+ x86-64

cortexadb-1.0.1-cp311-cp311-macosx_11_0_arm64.whl (2.1 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

cortexadb-1.0.1-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.1-cp314-cp314-win_amd64.whl.

File metadata

  • Download URL: cortexadb-1.0.1-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.1-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 cdac284ed42a82576462893ad659ee0e9df0c7cfd20df605aace9dbab00fddfe
MD5 db54b525745540b5ff4d3b0b6494ce60
BLAKE2b-256 05cf6d679d915a494371b6ec0cea78e8f03fec333f80bb41fb1be2bbaef4d49a

See more details on using hashes here.

Provenance

The following attestation bundles were made for cortexadb-1.0.1-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.1-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: cortexadb-1.0.1-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.1-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 6df0c41adfa8b983e711c53345a92b3037cf7157a50533e0dea6a11eef7559a3
MD5 02e807c2436ae427bd094f052925b526
BLAKE2b-256 e304f02e2029dc2f1f8f28d8a70e927385dca1218334c026c715c841356d6bf6

See more details on using hashes here.

Provenance

The following attestation bundles were made for cortexadb-1.0.1-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.1-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for cortexadb-1.0.1-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 9606a0faafbebcfd853889eec5ae7e708976ac8fd860c48fb529852d9b806abc
MD5 e7d81be17de782b61c81407530cb6af4
BLAKE2b-256 48c6b8668ea5aebd8af808f6eb647ec4e7503e843e63ac96a725e0ac875dd34d

See more details on using hashes here.

Provenance

The following attestation bundles were made for cortexadb-1.0.1-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.1-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: cortexadb-1.0.1-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.1-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 c4f1f6e4ba0c0743124ebe357286ed43375ecbf56bebd0ee180af55e05374982
MD5 ca7734601a07d5a31b44c9ef40b8b2c3
BLAKE2b-256 d3938d3dcbc3f641bfaf408f6ac8697706e4a64b7955fcf529d2e4e8e13912d1

See more details on using hashes here.

Provenance

The following attestation bundles were made for cortexadb-1.0.1-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.1-cp312-cp312-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for cortexadb-1.0.1-cp312-cp312-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 a09c03aec6867891778936d3a1feabd5ce34f724dd7ee8287e37733c8eba0db4
MD5 92cb2cca5dcaa67e52fd44cd194ae67a
BLAKE2b-256 a915efc8a67b1c1f01c1836062efb3dd1761f700e2ca848bbdf49b9227bd1996

See more details on using hashes here.

Provenance

The following attestation bundles were made for cortexadb-1.0.1-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.1-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for cortexadb-1.0.1-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 0f8b34337305868ea111a6e8560a79df86245c98c1cd1f8572337e4ae1a21f8f
MD5 a3aa2fb9ce1f7e390c73e326bcfc3be4
BLAKE2b-256 34c8f945cc80db9d0d044eb3bbae61373bb7954fefcf678d841f68f89ef39e41

See more details on using hashes here.

Provenance

The following attestation bundles were made for cortexadb-1.0.1-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.1-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: cortexadb-1.0.1-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.1-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 2cefe945118eaffbb39673503a1e6a1d3ddb441422f8b4e588e20908e3b39809
MD5 58facc07f11c6ebb3ba4f07e45bacc5a
BLAKE2b-256 0044a7bf262895495f8747d1942ffa30c4b42eed1752e95e7ba8214dd8d38928

See more details on using hashes here.

Provenance

The following attestation bundles were made for cortexadb-1.0.1-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.1-cp311-cp311-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for cortexadb-1.0.1-cp311-cp311-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 bf11a1b352d0c178eb6c20ae271ad097d7ab31ac5753201c5be4a47894d6115b
MD5 ed4503dbcee6760bcbad35b8822e3e85
BLAKE2b-256 56b250dde068b074134b5423187230c42e74e4cc2b7c23a8b0b334d93ce81033

See more details on using hashes here.

Provenance

The following attestation bundles were made for cortexadb-1.0.1-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.1-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for cortexadb-1.0.1-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 10a57c54c5ef56c8dd6b4c8199e2b830b9df4b1c7264fb2ca2c99caf7801511e
MD5 c958b59128f9785958fa6c5970d32f77
BLAKE2b-256 9812bdea9da91d74a20dde168bab5c7a9218c8cc24fe8a55fe40c08685d67b45

See more details on using hashes here.

Provenance

The following attestation bundles were made for cortexadb-1.0.1-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.1-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: cortexadb-1.0.1-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.1-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 7d3b9400480bb1eb81e1d02a27697d5b141ef9044d18f989ae1852ee50bc4144
MD5 954b1d29ff5ac760294b0835e03ce310
BLAKE2b-256 c52b2c76423e93319013ad9a0de1ef820ad06d09fffd7bbd24cbc38ee2f6f6f3

See more details on using hashes here.

Provenance

The following attestation bundles were made for cortexadb-1.0.1-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