Skip to main content

Zeno memory protocols, context-bound handles, and SQLite defaults.

Project description

zeno-memory

Memory protocols, per-turn view handles, and SQLite-backed defaults for the Zeno framework.

Install

uv add 'zeno-framework[memory]'

What's in here

  • Protocols: SessionStore, UserMemoryStore, KnowledgeStore, ConversationStore, VectorStore.
  • Per-turn handles: MemoryView, UserMemoryView, KnowledgeView, ConversationHandle, SessionHandle.
  • SQLite defaults: SqliteSessionStore, SqliteUserMemoryStore, SqliteConversationStore.
  • Composer: ThreeLayer (session + user memory + knowledge + conversation).
  • Adapter: VectorBackedUserMemoryStore — wraps any KnowledgeStore to make user memory semantically searchable.

Wiring

from pathlib import Path

from zeno.app import ZenoApp
from zeno.memory import ThreeLayer
from zeno.memory.sqlite.conversation_store import SqliteConversationStore
from zeno.memory.sqlite.session_store import SqliteSessionStore
from zeno.memory.sqlite.user_memory_store import SqliteUserMemoryStore

data = Path.home() / ".zeno"
data.mkdir(parents=True, exist_ok=True)

# `knowledge=` is a `KnowledgeStore` from a vector backend — see
# `zeno-chroma` or `zeno-qdrant` for concrete adapters. The example below
# uses `SqliteUserMemoryStore` for user memory; swap in
# `VectorBackedUserMemoryStore(knowledge_store=...)` to make user memory
# semantically searchable.
memory = ThreeLayer(
    session=SqliteSessionStore(data / "sessions.db"),
    user_memory=SqliteUserMemoryStore(data / "user_memory.db"),
    knowledge=...,  # ChromaKnowledgeStore | QdrantKnowledgeStore | …
    conversation=SqliteConversationStore(data / "conversations.db"),
)

app = ZenoApp(agent=..., memory=memory, channels=..., provider=...)

ZenoApp calls memory.view_for(user_id=, channel=, thread_key=) once per turn and binds the resulting MemoryView into Ctx. Tools use ctx.memory.user, ctx.memory.knowledge, ctx.memory.session, and ctx.memory.conversation without ever seeing the underlying store.

Choosing a UserMemoryStore

Store Use when
SqliteUserMemoryStore You want exact-match recall on stored facts. Cheap, no embedding model required.
VectorBackedUserMemoryStore(knowledge_store=…) You want semantic recall (e.g. "what did the user say about their job?"). Reuses the same vector backend you wired for knowledge.

Both implement the same UserMemoryStore protocol — swap freely without changing tool code.

ConversationStore (provider portability)

Non-Claude providers (e.g. OpenAIProvider) write each turn's assistant, tool, and user messages through ConversationStore so the next turn has prior context. ClaudeSDKProvider does not use it — the SDK owns its own session history.

Vector backends

Concrete KnowledgeStore adapters live in sibling packages:

See also: zeno-core for Ctx, @tool, and the MemoryBinderProtocol.

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_memory-1.0.2.tar.gz (21.6 kB view details)

Uploaded Source

Built Distribution

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

zeno_memory-1.0.2-py3-none-any.whl (20.8 kB view details)

Uploaded Python 3

File details

Details for the file zeno_memory-1.0.2.tar.gz.

File metadata

  • Download URL: zeno_memory-1.0.2.tar.gz
  • Upload date:
  • Size: 21.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for zeno_memory-1.0.2.tar.gz
Algorithm Hash digest
SHA256 7c649e38499913faa01fffef901652a0320a6b9894d68cb104e96c8252d32638
MD5 752850920bbd1bc18aeefc4b53cbf0b4
BLAKE2b-256 c950829a411e8da700f81806a6278f08434d67ed28266baa4a43b569fd5a326f

See more details on using hashes here.

Provenance

The following attestation bundles were made for zeno_memory-1.0.2.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_memory-1.0.2-py3-none-any.whl.

File metadata

  • Download URL: zeno_memory-1.0.2-py3-none-any.whl
  • Upload date:
  • Size: 20.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_memory-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 19dd4e96a5a6f35a615ab0fed57152fcee9af521119cde0e960858697cfef6da
MD5 3ed7cc69ef1683c88ce278ea347a91ff
BLAKE2b-256 307e1637bf0cea7a85e9875117d2783a8de01c57cbfdec47906eaba38f9222fb

See more details on using hashes here.

Provenance

The following attestation bundles were made for zeno_memory-1.0.2-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