The mind database for AI agents
Project description
MenteDB Python SDK
Python bindings for MenteDB, the mind database for AI agents. Built with PyO3 and maturin for native Rust performance from Python.
Installation
From source (development)
cd sdks/python
pip install maturin
maturin develop
From PyPI (once published)
pip install mentedb
Quick start
from mentedb import MenteDB, MemoryType, EdgeType
with MenteDB("./agent-memory") as db:
# Store a memory
mid = db.store(
"The deployment failed because the config was missing",
memory_type=MemoryType.EPISODIC,
tags=["deployment", "config"],
)
# Recall memories with MQL
result = db.recall("RECALL tag:deployment LIMIT 5")
print(result.text)
# Vector similarity search
hits = db.search(embedding=[0.1] * 384, k=5)
for hit in hits:
print(f"{hit.id}: {hit.score:.4f}")
# Relate memories
mid2 = db.store("Always validate config before deploy", memory_type=MemoryType.PROCEDURAL)
db.relate(mid, mid2, edge_type=EdgeType.CAUSED)
# Forget a memory
db.forget(mid)
Cognitive features
The SDK also exposes MenteDB cognitive subsystems for real time stream monitoring, conversation trajectory tracking, and pain signal management.
from mentedb._mentedb_python import CognitionStream, TrajectoryTracker, PainRegistry
# Stream monitoring
stream = CognitionStream(buffer_size=500)
stream.feed_token("The")
stream.feed_token(" sky")
alerts = stream.check_alerts([("some-uuid", "the sky is blue")])
# Trajectory tracking
tracker = TrajectoryTracker(max_turns=50)
tracker.record_turn("deployment", "investigating", ["which env?"])
context = tracker.get_resume_context()
# Pain registry
pain = PainRegistry(max_warnings=3)
pain.record_pain("some-uuid", 0.8, ["timeout", "deploy"], "deploy timed out")
warnings = pain.check_triggers(["deploy"])
API reference
MenteDB
| Method | Description |
|---|---|
store(content, memory_type, embedding, agent_id, tags) |
Store a memory, returns its UUID |
recall(query) |
Recall memories using MQL |
search(embedding, k) |
Vector similarity search |
relate(source, target, edge_type, weight) |
Add a relationship |
forget(memory_id) |
Remove a memory |
close() |
Flush and close the database |
Types
MemoryType: episodic, semantic, procedural, anti_pattern, reasoning, correction
EdgeType: caused, before, related, contradicts, supports, supersedes, derived, part_of
License
Apache 2.0. See the repository root LICENSE file for details.
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 mentedb-0.1.0-cp312-cp312-win_amd64.whl.
File metadata
- Download URL: mentedb-0.1.0-cp312-cp312-win_amd64.whl
- Upload date:
- Size: 1.7 MB
- Tags: CPython 3.12, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
693323ba8975a3ce95fe6bc87b344493843dcc6eacdc3cfeb48fb100cba004b4
|
|
| MD5 |
210a0f831f5a3183b971f45ca23f3010
|
|
| BLAKE2b-256 |
50a1dbb522757edcc473c1ca8310ad7fda083a502df25e53ec23427d3c4aa5ba
|
Provenance
The following attestation bundles were made for mentedb-0.1.0-cp312-cp312-win_amd64.whl:
Publisher:
release.yml on nambok/mentedb
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mentedb-0.1.0-cp312-cp312-win_amd64.whl -
Subject digest:
693323ba8975a3ce95fe6bc87b344493843dcc6eacdc3cfeb48fb100cba004b4 - Sigstore transparency entry: 1238536659
- Sigstore integration time:
-
Permalink:
nambok/mentedb@cbca111447cb027fdac24467b36ecb1fe2808e9b -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/nambok
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@cbca111447cb027fdac24467b36ecb1fe2808e9b -
Trigger Event:
push
-
Statement type:
File details
Details for the file mentedb-0.1.0-cp312-cp312-manylinux_2_38_x86_64.whl.
File metadata
- Download URL: mentedb-0.1.0-cp312-cp312-manylinux_2_38_x86_64.whl
- Upload date:
- Size: 4.4 MB
- Tags: CPython 3.12, manylinux: glibc 2.38+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3139e12454b2ae5c880b41a4e9e0e7a00c935e85142ab68e7569455696decfaf
|
|
| MD5 |
eb4a4f2cdf475be6d674613d7962697b
|
|
| BLAKE2b-256 |
945146200a9574e7455a9b0bef9bf561321a3ccc1095ff38699f9246a4f6e064
|
Provenance
The following attestation bundles were made for mentedb-0.1.0-cp312-cp312-manylinux_2_38_x86_64.whl:
Publisher:
release.yml on nambok/mentedb
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mentedb-0.1.0-cp312-cp312-manylinux_2_38_x86_64.whl -
Subject digest:
3139e12454b2ae5c880b41a4e9e0e7a00c935e85142ab68e7569455696decfaf - Sigstore transparency entry: 1238536654
- Sigstore integration time:
-
Permalink:
nambok/mentedb@cbca111447cb027fdac24467b36ecb1fe2808e9b -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/nambok
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@cbca111447cb027fdac24467b36ecb1fe2808e9b -
Trigger Event:
push
-
Statement type:
File details
Details for the file mentedb-0.1.0-cp312-cp312-macosx_11_0_arm64.whl.
File metadata
- Download URL: mentedb-0.1.0-cp312-cp312-macosx_11_0_arm64.whl
- Upload date:
- Size: 2.0 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 |
fd13bf58638ee0977aca0e8abab8837a20c047e46b84bfc1fed0efa61823ab46
|
|
| MD5 |
831cc92dc5115a36723217d7a7c4762a
|
|
| BLAKE2b-256 |
24a3748fde29133ef3b2fb123dda4dda16c882ea2fb841e0cdcbbfb9a8e1786a
|
Provenance
The following attestation bundles were made for mentedb-0.1.0-cp312-cp312-macosx_11_0_arm64.whl:
Publisher:
release.yml on nambok/mentedb
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mentedb-0.1.0-cp312-cp312-macosx_11_0_arm64.whl -
Subject digest:
fd13bf58638ee0977aca0e8abab8837a20c047e46b84bfc1fed0efa61823ab46 - Sigstore transparency entry: 1238536651
- Sigstore integration time:
-
Permalink:
nambok/mentedb@cbca111447cb027fdac24467b36ecb1fe2808e9b -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/nambok
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@cbca111447cb027fdac24467b36ecb1fe2808e9b -
Trigger Event:
push
-
Statement type: