ChromaDB-backed KnowledgeStore adapter for Zeno.
Project description
zeno-chroma
ChromaDB-backed KnowledgeStore
adapter for Zeno.
Persists facts and documents in a local Chroma collection with each
row stamped by user_id so multi-tenant isolation is enforced at
query time via Chroma's where filter rather than post-fetch
filtering. Plugs into the ThreeLayer memory binder as the
knowledge and (optionally) the user_memory backing.
Install
uv add 'zeno-framework[chroma]'
# or, without the AI package:
uv add zeno-chroma
Features
- Persistent local store via
chromadb.PersistentClient— no server to run, just a directory user_id-scoped search using Chroma'swherefilter (S7 isolation is structural, not advisory)- Cosine similarity, distance → similarity score conversion
(
1.0 - distance, clamped to[0, 1]) - Synchronous Chroma client wrapped in
asyncio.to_threadso embeddings and queries don't block the event loop - Default Chroma embedding function; pass
embedding_function=to override - Pairs with
VectorBackedUserMemoryStoreto also serve user-memory reads/writes from the same collection
Minimal usage
import asyncio
from pathlib import Path
from zeno.agent import Agent
from zeno.app import ZenoApp
from zeno.builtin_tools import recall, remember
from zeno.channels.cli import CliChannel
from zeno.chroma import ChromaKnowledgeStore
from zeno.memory.sqlite.conversation_store import SqliteConversationStore
from zeno.memory.sqlite.session_store import SqliteSessionStore
from zeno.memory.three_layer import ThreeLayer
from zeno.memory.vector_backed.user_memory_store import VectorBackedUserMemoryStore
from zeno.testing import FakeProvider
async def main() -> None:
data_dir = Path("./.zeno")
data_dir.mkdir(exist_ok=True)
knowledge = ChromaKnowledgeStore(persist_dir=data_dir / "chroma")
memory = ThreeLayer(
session=SqliteSessionStore(data_dir / "sessions.db"),
user_memory=VectorBackedUserMemoryStore(knowledge_store=knowledge),
knowledge=knowledge,
conversation=SqliteConversationStore(data_dir / "conversations.db"),
)
app = ZenoApp(
agent=Agent(
name="root",
instructions="Use `recall` to look things up and `remember` to store facts.",
tools=[recall, remember],
),
channels=[CliChannel()],
provider=FakeProvider(),
memory=memory,
)
await app.run()
asyncio.run(main())
The first call to remember writes a row tagged with the active
user_id. Subsequent recall calls only see rows that user inserted —
cross-user isolation is enforced by the where={"user_id": ...}
filter on every query.
Testing
uv run pytest packages/zeno-chroma
Tests run against a temporary Chroma directory so no global state
leaks between cases. The contract suite shared with zeno-qdrant
guarantees both adapters honour the same KnowledgeStore semantics.
Part of the Zeno framework.
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 zeno_chroma-1.0.1.tar.gz.
File metadata
- Download URL: zeno_chroma-1.0.1.tar.gz
- Upload date:
- Size: 5.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cd5f490e512054a7347c95edbd7d8cb3e909fdc7130644387fb0809eb7ee9eb3
|
|
| MD5 |
7c9b320c54f7ccf904ebcdfc14b3c484
|
|
| BLAKE2b-256 |
15793048fb8dcebd68c26a176a162a16ff6053c9efc3e3be163d5448f28ce9e0
|
Provenance
The following attestation bundles were made for zeno_chroma-1.0.1.tar.gz:
Publisher:
publish.yml on nkootstra/zeno
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
zeno_chroma-1.0.1.tar.gz -
Subject digest:
cd5f490e512054a7347c95edbd7d8cb3e909fdc7130644387fb0809eb7ee9eb3 - Sigstore transparency entry: 1390034982
- Sigstore integration time:
-
Permalink:
nkootstra/zeno@d2cdcd756fc7ca022ec23fe9ef35d76e7683ac9c -
Branch / Tag:
refs/tags/v1.0.1 - Owner: https://github.com/nkootstra
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@d2cdcd756fc7ca022ec23fe9ef35d76e7683ac9c -
Trigger Event:
push
-
Statement type:
File details
Details for the file zeno_chroma-1.0.1-py3-none-any.whl.
File metadata
- Download URL: zeno_chroma-1.0.1-py3-none-any.whl
- Upload date:
- Size: 5.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8e6d086f6fc6fcbd51ce3934254c5372fd4b67ee64d961829f6e77cc41b05431
|
|
| MD5 |
68c9f3a416944c432c218ef60e49b82e
|
|
| BLAKE2b-256 |
8bf9d708bbc1e67d3f272656127e57f87b52672b6be64d8f7774ecab0402a39d
|
Provenance
The following attestation bundles were made for zeno_chroma-1.0.1-py3-none-any.whl:
Publisher:
publish.yml on nkootstra/zeno
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
zeno_chroma-1.0.1-py3-none-any.whl -
Subject digest:
8e6d086f6fc6fcbd51ce3934254c5372fd4b67ee64d961829f6e77cc41b05431 - Sigstore transparency entry: 1390035080
- Sigstore integration time:
-
Permalink:
nkootstra/zeno@d2cdcd756fc7ca022ec23fe9ef35d76e7683ac9c -
Branch / Tag:
refs/tags/v1.0.1 - Owner: https://github.com/nkootstra
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@d2cdcd756fc7ca022ec23fe9ef35d76e7683ac9c -
Trigger Event:
push
-
Statement type: