Fast, embedded vector + graph memory for AI agents
Project description
CortexaDB
SQLite for AI Agents
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4ac05a78b602055b443fe557861bd358c30fc82c85f209c989fc90322416e26f
|
|
| MD5 |
42f7ff996c6652f67a75b207daed6955
|
|
| BLAKE2b-256 |
d188aa9554830ea43408a3b06559c97e48db3f109fd66a26be370925d29d531d
|
Provenance
The following attestation bundles were made for cortexadb-1.0.0-cp314-cp314-win_amd64.whl:
Publisher:
release.yml on anaslimem/CortexaDB
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cortexadb-1.0.0-cp314-cp314-win_amd64.whl -
Subject digest:
4ac05a78b602055b443fe557861bd358c30fc82c85f209c989fc90322416e26f - Sigstore transparency entry: 1321959708
- Sigstore integration time:
-
Permalink:
anaslimem/CortexaDB@a012b9f8ba348b52215a6738980604e58ea924b7 -
Branch / Tag:
refs/tags/v0.1.0-test4 - Owner: https://github.com/anaslimem
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@a012b9f8ba348b52215a6738980604e58ea924b7 -
Trigger Event:
push
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9d5424071c4c7a02f5095930b669cc9ece080694ea7fa9341e54dd2d80557581
|
|
| MD5 |
ecffbcf302ae33e6ce3c918859485277
|
|
| BLAKE2b-256 |
734060e33d7c821d1f6e31ef3499951be5f1b9c3780f93c94f6f910e607d275f
|
Provenance
The following attestation bundles were made for cortexadb-1.0.0-cp313-cp313-win_amd64.whl:
Publisher:
release.yml on anaslimem/CortexaDB
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cortexadb-1.0.0-cp313-cp313-win_amd64.whl -
Subject digest:
9d5424071c4c7a02f5095930b669cc9ece080694ea7fa9341e54dd2d80557581 - Sigstore transparency entry: 1321959799
- Sigstore integration time:
-
Permalink:
anaslimem/CortexaDB@a012b9f8ba348b52215a6738980604e58ea924b7 -
Branch / Tag:
refs/tags/v0.1.0-test4 - Owner: https://github.com/anaslimem
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@a012b9f8ba348b52215a6738980604e58ea924b7 -
Trigger Event:
push
-
Statement type:
File details
Details for the file cortexadb-1.0.0-cp313-cp313-macosx_11_0_arm64.whl.
File metadata
- Download URL: cortexadb-1.0.0-cp313-cp313-macosx_11_0_arm64.whl
- Upload date:
- Size: 1.3 MB
- Tags: CPython 3.13, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3acfabe8913e2a94d843778fb9c118f054f4b7253c93051eabf9347c81b70834
|
|
| MD5 |
212e6093deb7044bd895b82d7d840af6
|
|
| BLAKE2b-256 |
f54b3fdcfe0346b6b0e0d71f13a4dcc3ad99955bac19551a3464d82e69eb658f
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cortexadb-1.0.0-cp313-cp313-macosx_11_0_arm64.whl -
Subject digest:
3acfabe8913e2a94d843778fb9c118f054f4b7253c93051eabf9347c81b70834 - Sigstore transparency entry: 1126099411
- Sigstore integration time:
-
Permalink:
anaslimem/CortexaDB@080c9dbadeb58678f63dad419c0d95a1dfe16e32 -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/anaslimem
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@080c9dbadeb58678f63dad419c0d95a1dfe16e32 -
Trigger Event:
push
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
694dde96f69b6a4cc8234e289e565047ab425378b53fa79bfdc2d2e0332a2d95
|
|
| MD5 |
154405756f94bf4893626c009898394c
|
|
| BLAKE2b-256 |
00b3f063bb4f505a9765764bb910d5c0da923e44261780ccd977d0fdd479f1cd
|
Provenance
The following attestation bundles were made for cortexadb-1.0.0-cp312-cp312-win_amd64.whl:
Publisher:
release.yml on anaslimem/CortexaDB
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cortexadb-1.0.0-cp312-cp312-win_amd64.whl -
Subject digest:
694dde96f69b6a4cc8234e289e565047ab425378b53fa79bfdc2d2e0332a2d95 - Sigstore transparency entry: 1321959918
- Sigstore integration time:
-
Permalink:
anaslimem/CortexaDB@a012b9f8ba348b52215a6738980604e58ea924b7 -
Branch / Tag:
refs/tags/v0.1.0-test4 - Owner: https://github.com/anaslimem
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@a012b9f8ba348b52215a6738980604e58ea924b7 -
Trigger Event:
push
-
Statement type:
File details
Details for the file cortexadb-1.0.0-cp312-cp312-manylinux_2_34_x86_64.whl.
File metadata
- Download URL: cortexadb-1.0.0-cp312-cp312-manylinux_2_34_x86_64.whl
- Upload date:
- Size: 1.5 MB
- Tags: CPython 3.12, manylinux: glibc 2.34+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ee86fce0cc9b8cb3dc903e04080aa482633c44942508e1dec2743f4db73e8c8a
|
|
| MD5 |
97df971242eb02debd08e241d9255360
|
|
| BLAKE2b-256 |
46278fd0fa62e70b710fe025832cc20833225e11ee8a82a7026b0ac198e060b7
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cortexadb-1.0.0-cp312-cp312-manylinux_2_34_x86_64.whl -
Subject digest:
ee86fce0cc9b8cb3dc903e04080aa482633c44942508e1dec2743f4db73e8c8a - Sigstore transparency entry: 1126099334
- Sigstore integration time:
-
Permalink:
anaslimem/CortexaDB@080c9dbadeb58678f63dad419c0d95a1dfe16e32 -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/anaslimem
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@080c9dbadeb58678f63dad419c0d95a1dfe16e32 -
Trigger Event:
push
-
Statement type:
File details
Details for the file cortexadb-1.0.0-cp312-cp312-macosx_11_0_arm64.whl.
File metadata
- Download URL: cortexadb-1.0.0-cp312-cp312-macosx_11_0_arm64.whl
- Upload date:
- Size: 1.3 MB
- Tags: CPython 3.12, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
03c0268e78c93c03152b0c205fa2df4ad5bb31d0445605d4923d2f724ae23e7b
|
|
| MD5 |
7e2b6f72d4c20deaa5d6648b9786ca4b
|
|
| BLAKE2b-256 |
7a8f65587483a46eeefcd4a86bf66fb002b9286316659b333c8632dcfd3c898a
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cortexadb-1.0.0-cp312-cp312-macosx_11_0_arm64.whl -
Subject digest:
03c0268e78c93c03152b0c205fa2df4ad5bb31d0445605d4923d2f724ae23e7b - Sigstore transparency entry: 1126099544
- Sigstore integration time:
-
Permalink:
anaslimem/CortexaDB@080c9dbadeb58678f63dad419c0d95a1dfe16e32 -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/anaslimem
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@080c9dbadeb58678f63dad419c0d95a1dfe16e32 -
Trigger Event:
push
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
05eacfe578f8f350a3e980c1b02a31271ea8e3c2af5d9ec4846896d9ce65967d
|
|
| MD5 |
49c610501e255670ae068d7675de2b1e
|
|
| BLAKE2b-256 |
e863c0a0c2f02d95e439ad75a23f94a53541cc5de70d10fdbdfb4470ee8e94a7
|
Provenance
The following attestation bundles were made for cortexadb-1.0.0-cp311-cp311-win_amd64.whl:
Publisher:
release.yml on anaslimem/CortexaDB
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cortexadb-1.0.0-cp311-cp311-win_amd64.whl -
Subject digest:
05eacfe578f8f350a3e980c1b02a31271ea8e3c2af5d9ec4846896d9ce65967d - Sigstore transparency entry: 1321960060
- Sigstore integration time:
-
Permalink:
anaslimem/CortexaDB@a012b9f8ba348b52215a6738980604e58ea924b7 -
Branch / Tag:
refs/tags/v0.1.0-test4 - Owner: https://github.com/anaslimem
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@a012b9f8ba348b52215a6738980604e58ea924b7 -
Trigger Event:
push
-
Statement type:
File details
Details for the file cortexadb-1.0.0-cp311-cp311-manylinux_2_34_x86_64.whl.
File metadata
- Download URL: cortexadb-1.0.0-cp311-cp311-manylinux_2_34_x86_64.whl
- Upload date:
- Size: 1.5 MB
- Tags: CPython 3.11, manylinux: glibc 2.34+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bcff39450fbaf36dbed84d58d46e8ec8a0f5b6f3d61146830bcb0fa129c57f4b
|
|
| MD5 |
730285ea6e1de8a8d3c7050660bba622
|
|
| BLAKE2b-256 |
fb96fc9e5aee73f0ac280f8c2fff205b790c848642d97613d693837dd6ca3843
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cortexadb-1.0.0-cp311-cp311-manylinux_2_34_x86_64.whl -
Subject digest:
bcff39450fbaf36dbed84d58d46e8ec8a0f5b6f3d61146830bcb0fa129c57f4b - Sigstore transparency entry: 1126099253
- Sigstore integration time:
-
Permalink:
anaslimem/CortexaDB@080c9dbadeb58678f63dad419c0d95a1dfe16e32 -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/anaslimem
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@080c9dbadeb58678f63dad419c0d95a1dfe16e32 -
Trigger Event:
push
-
Statement type:
File details
Details for the file cortexadb-1.0.0-cp311-cp311-macosx_11_0_arm64.whl.
File metadata
- Download URL: cortexadb-1.0.0-cp311-cp311-macosx_11_0_arm64.whl
- Upload date:
- Size: 1.3 MB
- Tags: CPython 3.11, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d685a93af6f9ae364e61e1fe702b6fc681e053c8aaf3d59044bdcdc07497ba6a
|
|
| MD5 |
7226e7ad876b503a30c717a20f277f94
|
|
| BLAKE2b-256 |
e342001a4200c8e66545e576bc2a224640308793e76b55b2825c4c20c37f5ce5
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cortexadb-1.0.0-cp311-cp311-macosx_11_0_arm64.whl -
Subject digest:
d685a93af6f9ae364e61e1fe702b6fc681e053c8aaf3d59044bdcdc07497ba6a - Sigstore transparency entry: 1126099458
- Sigstore integration time:
-
Permalink:
anaslimem/CortexaDB@080c9dbadeb58678f63dad419c0d95a1dfe16e32 -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/anaslimem
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@080c9dbadeb58678f63dad419c0d95a1dfe16e32 -
Trigger Event:
push
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fa474332a5bcc97b3efe75d95fdd54f5ffcb9ea1a9276364bf15c3bd91a0986e
|
|
| MD5 |
a4bda73a8c54f74aff25bfe2fd93bca7
|
|
| BLAKE2b-256 |
81e43ebb14d86804852e5158bebab51e2e738ade2f1da7c118e630022c57ed12
|
Provenance
The following attestation bundles were made for cortexadb-1.0.0-cp310-cp310-win_amd64.whl:
Publisher:
release.yml on anaslimem/CortexaDB
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cortexadb-1.0.0-cp310-cp310-win_amd64.whl -
Subject digest:
fa474332a5bcc97b3efe75d95fdd54f5ffcb9ea1a9276364bf15c3bd91a0986e - Sigstore transparency entry: 1321877461
- Sigstore integration time:
-
Permalink:
anaslimem/CortexaDB@0eb519bd44aee910e8dccbfcb54a5caf870b6316 -
Branch / Tag:
refs/tags/v0.1.0-test3 - Owner: https://github.com/anaslimem
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@0eb519bd44aee910e8dccbfcb54a5caf870b6316 -
Trigger Event:
push
-
Statement type: