A lightweight local vector-aware database for Python
Project description
menteedb
menteedb is a lightweight local Python library that combines table-like records with optional vector similarity search.
Features
- Define tables with a schema.
- Insert structured records.
- Enable vector search on one text field per table.
- Add fast text contains search per table.
- Query by field filters and/or semantic similarity.
- Persist data locally with append-only files for speed.
Quick Start
from menteedb import MenteeDB
db = MenteeDB(base_path="./data")
db.create_table(
table_name="notes",
fields={"title": "str", "body": "str", "tag": "str"},
vector_field="body",
)
db.insert("notes", {"title": "First", "body": "Vector databases are useful.", "tag": "ml"})
db.insert("notes", {"title": "Second", "body": "I enjoy local-first tools.", "tag": "dev"})
results = db.query("notes", vector_query="local vector tools", top_k=2)
for item in results:
print(item["score"], item["record"])
text_hits = db.query("notes", text_query="local", text_fields=["body"])
print(text_hits)
Query Modes
- Filter-only:
db.query("notes", conditions={"tag": "ml"})
- Text contains search:
db.query("notes", text_query="vector", text_fields=["title", "body"])
- Vector-only:
db.query("notes", vector_query="your text")
- Hybrid (filter + vector):
db.query("notes", conditions={"tag": "dev"}, vector_query="local tools")
Storage Layout
For base_path="./data" and table notes, menteedb stores:
./data/notes/schema.json./data/notes/records.jsonl./data/notes/vector_ids.jsonl./data/notes/vectors.f32
This is local file-based storage. It is not publicly exposed over the network, but anyone with local filesystem access to this folder can read it.
Privacy and Permissions
- By default,
MenteeDB(..., secure_permissions=True)applies best-effort private permissions (700for table folders,600for files). - On Windows, real privacy is controlled by NTFS ACLs; chmod behavior is limited.
Testing
Run locally:
pip install .[dev]
pytest -q
CI/CD to PyPI
Workflow file: .github/workflows/pypi-publish.yml
- Runs tests on pushes to
main, tags (v*), and releases. - Publishes to PyPI on tag push (
v*) or GitHub Release publish. - Uses trusted publishing via GitHub OIDC.
Notes
- This initial version supports one vector field per table.
- Default embeddings use a deterministic local hashing embedder with no external model download.
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 Distribution
Built Distribution
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 menteedb-0.1.0.tar.gz.
File metadata
- Download URL: menteedb-0.1.0.tar.gz
- Upload date:
- Size: 6.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
61cfd5633cb8822b43547656d37dc6f0971edd1490507a141d195f1a8881a8d9
|
|
| MD5 |
882e8ef332c8d7200d4be776bdac8c20
|
|
| BLAKE2b-256 |
0e21fa3a12f21821307041725eaf2ce38fec6bfcd7257bd570d882cf86d29462
|
Provenance
The following attestation bundles were made for menteedb-0.1.0.tar.gz:
Publisher:
pypi-publish.yml on SyabAhmad/menteedb
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
menteedb-0.1.0.tar.gz -
Subject digest:
61cfd5633cb8822b43547656d37dc6f0971edd1490507a141d195f1a8881a8d9 - Sigstore transparency entry: 1107788646
- Sigstore integration time:
-
Permalink:
SyabAhmad/menteedb@61c54cbaeb87fcdce62c18611bda5035ab09de3d -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/SyabAhmad
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-publish.yml@61c54cbaeb87fcdce62c18611bda5035ab09de3d -
Trigger Event:
push
-
Statement type:
File details
Details for the file menteedb-0.1.0-py3-none-any.whl.
File metadata
- Download URL: menteedb-0.1.0-py3-none-any.whl
- Upload date:
- Size: 6.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2c5ba5200d8ed9b999f3589a8ead0e76d59501075ddea60188462cbadc6597e8
|
|
| MD5 |
9b2bd20f1bb3452497514bdee25249f7
|
|
| BLAKE2b-256 |
ee43086e33e16b4f12710cbc627ede278a39883eb95c67520c30655df2b81ee8
|
Provenance
The following attestation bundles were made for menteedb-0.1.0-py3-none-any.whl:
Publisher:
pypi-publish.yml on SyabAhmad/menteedb
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
menteedb-0.1.0-py3-none-any.whl -
Subject digest:
2c5ba5200d8ed9b999f3589a8ead0e76d59501075ddea60188462cbadc6597e8 - Sigstore transparency entry: 1107788649
- Sigstore integration time:
-
Permalink:
SyabAhmad/menteedb@61c54cbaeb87fcdce62c18611bda5035ab09de3d -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/SyabAhmad
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-publish.yml@61c54cbaeb87fcdce62c18611bda5035ab09de3d -
Trigger Event:
push
-
Statement type: