Skip to main content

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's where filter (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_thread so embeddings and queries don't block the event loop
  • Default Chroma embedding function; pass embedding_function= to override
  • Pairs with VectorBackedUserMemoryStore to 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

zeno_chroma-1.0.0rc2.tar.gz (5.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

zeno_chroma-1.0.0rc2-py3-none-any.whl (5.8 kB view details)

Uploaded Python 3

File details

Details for the file zeno_chroma-1.0.0rc2.tar.gz.

File metadata

  • Download URL: zeno_chroma-1.0.0rc2.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

Hashes for zeno_chroma-1.0.0rc2.tar.gz
Algorithm Hash digest
SHA256 691c4231b69ced9cdc4a75d5f99a8b7e7c52259041a1270526a302ab57743e4e
MD5 3c321061626ffbc06e12627ab91203a6
BLAKE2b-256 e24ed6c9df90e86ddb225e148340859f0bc1c58e98a85114317ce683abea4578

See more details on using hashes here.

Provenance

The following attestation bundles were made for zeno_chroma-1.0.0rc2.tar.gz:

Publisher: publish.yml on nkootstra/zeno

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file zeno_chroma-1.0.0rc2-py3-none-any.whl.

File metadata

  • Download URL: zeno_chroma-1.0.0rc2-py3-none-any.whl
  • Upload date:
  • Size: 5.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for zeno_chroma-1.0.0rc2-py3-none-any.whl
Algorithm Hash digest
SHA256 3ca646f06fbc39e61b9b7f286f4d701518cdf33cbfe80c938ef378eec03ff7f5
MD5 6c3671e352c1f21c58cf6fed694fd51f
BLAKE2b-256 cfccb830e341110b36960d3d369bafa7f46d9b9489f5f7de97bf12a2148df8c0

See more details on using hashes here.

Provenance

The following attestation bundles were made for zeno_chroma-1.0.0rc2-py3-none-any.whl:

Publisher: publish.yml on nkootstra/zeno

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