Skip to main content

Python SDK for Z3rno — AI agent memory database.

Project description

z3rno (Python SDK)

License: Apache 2.0 CI PyPI

Python SDK for Z3rno -- thin HTTP client for the Z3rno memory API.

Installation

pip install z3rno

Quickstart

from z3rno import Z3rnoClient

client = Z3rnoClient(base_url="https://api.z3rno.dev", api_key="z3rno_sk_...")
memory = client.store(agent_id="agent-1", content="User prefers dark mode", memory_type="semantic")
results = client.recall(agent_id="agent-1", query="What does the user prefer?", top_k=5)
client.forget(memory_id=memory.id)

Async Usage

from z3rno import AsyncZ3rnoClient

async def main():
    async with AsyncZ3rnoClient(base_url="https://api.z3rno.dev", api_key="z3rno_sk_...") as client:
        memory = await client.store(agent_id="agent-1", content="User prefers dark mode")
        results = await client.recall(agent_id="agent-1", query="preferences")
        await client.forget(memory_id=memory.id)

Methods

Method Description
store(...) Store a new memory with optional type, metadata, relationships, TTL, and importance
recall(...) Recall memories by semantic similarity query
forget(...) Soft-delete a memory by ID
audit(...) Query the audit trail with optional filters and pagination

All methods are available on both Z3rnoClient (sync) and AsyncZ3rnoClient (async).

Features

  • Thin HTTP client -- only httpx, pydantic, and tenacity at runtime. No database drivers.
  • Typed errors -- Z3rnoRateLimitError, Z3rnoAuthenticationError, Z3rnoValidationError, each mapping to a specific HTTP status.
  • Automatic retries -- exponential backoff on connection errors and 5xx responses. Retry-After honored on 429.
  • Context manager support -- use with / async with for automatic cleanup.

Framework Integrations

Each is a separate package that depends on z3rno:

  • z3rno-langchain -- LangChain BaseMemory + BaseRetriever adapter
  • z3rno-crewai -- CrewAI memory provider
  • z3rno-openai -- OpenAI Agents SDK function tools

For Anthropic Claude, see the z3rno-mcp Model Context Protocol server.

API Documentation

Full API reference: docs.z3rno.dev/sdk/python

Development

uv sync --dev
uv run ruff check .
uv run mypy .
uv run pytest

See CONTRIBUTING.md for the full workflow.

License

Apache 2.0 -- see LICENSE.

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

z3rno-0.1.0.tar.gz (107.3 kB view details)

Uploaded Source

Built Distribution

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

z3rno-0.1.0-py3-none-any.whl (17.2 kB view details)

Uploaded Python 3

File details

Details for the file z3rno-0.1.0.tar.gz.

File metadata

  • Download URL: z3rno-0.1.0.tar.gz
  • Upload date:
  • Size: 107.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for z3rno-0.1.0.tar.gz
Algorithm Hash digest
SHA256 37e9818214f40d1c59bce380e4b6513b0aae55c555fd590378083c6ccd68d905
MD5 743b590292beeb42940c03a901f28871
BLAKE2b-256 f979a255145f50ec1ca9f1102dfd72fe17926c44f3b0f9906a726509d78f527c

See more details on using hashes here.

File details

Details for the file z3rno-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: z3rno-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 17.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for z3rno-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8ca3ac0ab67ad46ac5090f6260bf48c437eb5bd57cc2adc841730ac9458ab53e
MD5 987642ba333c873ed134cb68416f5fe8
BLAKE2b-256 f59eef81561d00ed16d9e4c4d13c8fd5338d2979db3a8dca8d7d5a24df19b57d

See more details on using hashes here.

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