Skip to main content

zizkadb-sdk

PyPI: zizkadb-sdk 0.5.0

Python SDK for ZizkaDB — Why did your agent do that? Call db.why(event_id) or zizkadb why <id> after logging with parent_id.

Setup (managed cloud)

  1. Sign up at db.zizka.ai
  2. Dashboard → Create agent (e.g. my-bot) — you get an API key for that agent
  3. Use the same agent name in every db.log() call
  4. Set ZIZKADB_API_KEY (or pass the key to the constructor)

Important: The agent in db.log(agent="...", ...) must match the agent you created in the dashboard. A mismatch returns 403 AgentScopeError.

Install

pip install zizkadb-sdk

Note: There is an unrelated package called agentdb on PyPI. Install zizkadb-sdk. Import: from zizkadb import ZizkaDB.

Scaffold a project

pip install zizkadb-sdk
zizkadb init my-agent --template basic
cd my-agent && cp .env.example .env   # paste your key into ZIZKADB_API_KEY
pip install -r requirements.txt
python agent.py

Templates: basic, openai, langchain, crewai, mcp-cursor.

Framework packages (optional)

Package Install Use case
zizkadb-langchain pip install zizkadb-langchain LangChain callbacks
zizkadb-crewai pip install zizkadb-crewai CrewAI crew logger
zizkadb-livekit pip install zizkadb-livekit LiveKit voice → Sessions + Events

See integrations/ and docs/integrations/livekit.md.

Quickstart

from zizkadb import ZizkaDB

# Key from Dashboard → Settings → API keys → create "my-bot" → copy key
db = ZizkaDB("zizkadb_live_xxxx")

async with db:
    result = await db.log(
        agent="my-bot",  # must match dashboard agent name
        event="tool_call",
        data={"tool": "search", "query": "billing"},
    )
    chain = await db.why(result.event_id)
    chain.print()

Multi-agent apps (ZizkaDB Cloud)

An API key works for one agent name. Running several agents — and agent-to-agent messaging between them — is a ZizkaDB Cloud feature; create each agent and its key in the dashboard.

Self-hosted ZizkaDB is single-agent: log everything under one agent name and use session_id to separate users or conversations. A second agent name is rejected with 409 agent_limit_reached.

More than logging

Method What it does
log(..., idempotency_key=, supersedes=, importance=) Safe retries; replace an outdated fact; weight it in memory
log_batch(events) Up to 500 events in one request
search(query, mode=) Keyword out of the box, hybrid with embeddings
context_for(agent, task) Relevant past as a prompt block (no OpenAI key needed)
verify_chain(agent, after_seq=, anchor=) Prove no event was edited, removed or reordered
iter_events(agent) Every event, cursor-paged
export_events(agent) / import_events(lines) Portable NDJSON copy and import

Needs a server from release 0.5.0. Full guide: CONNECT.md.

Errors

Exception Meaning
AuthError Invalid or revoked API key
AgentScopeError Key is for agent A but you logged to agent B
NotFoundError Event or agent not found

Environment variables

Variable Purpose
ZIZKADB_API_KEY Your cloud API key (preferred)
AGENTDB_API_KEY Legacy alias for ZIZKADB_API_KEY
ZIZKADB_AGENT Default agent name (used in templates/examples)
ZIZKADB_HOST Self-hosted API URL. Used when the client gets no host argument, so with an API key it sends requests here instead of ZizkaDB Cloud (legacy alias AGENTDB_HOST)
ZIZKADB_TELEMETRY Set false to opt out (anonymous ping on client construct)

Self-host dashboard

  1. bash scripts/setup-local.sh (API + dashboard on port 3001)
  2. Open http://localhost:3001/login → Open my dashboard →

Metadata

Release files for zizkadb-sdk 0.5.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for zizkadb-sdk 0.5.0
File Size Uploaded Provenance Actions
zizkadb_sdk-0.5.0.tar.gz 55.4 kB Without provenance Details for zizkadb_sdk-0.5.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for zizkadb-sdk 0.5.0
File Interpreter ABI Platform Actions
zizkadb_sdk-0.5.0-py3-none-any.whl Python 3 none any Details for zizkadb_sdk-0.5.0-py3-none-any.whl

Total release size: 106.4 kB

Release files / zizkadb_sdk-0.5.0.tar.gz

Download URL zizkadb_sdk-0.5.0.tar.gz
Size 55.4 kB
Tags Source
SHA-256 checksum
How to use checksums
55f1348c3092c1da76c289f9dcc5baae6fa519fe18c839f0f167bbfe14e11263
BLAKE2b-256 checksum
How to use checksums
dda8dc682c3210a428aa93d01fc677595b93b9dd836eb9962143576989d76511
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.9

Release files / zizkadb_sdk-0.5.0-py3-none-any.whl

Download URL zizkadb_sdk-0.5.0-py3-none-any.whl
Size 51.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
167541672a30c630d360b393c1107fb53cc87756721f42b7dd0ec607ca4272aa
BLAKE2b-256 checksum
How to use checksums
cad3eed59d5720f773a2b2f7f6dba1e4451a3e7c678f997b0d2ad3393087fdb6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.9

Security for zizkadb-sdk 0.5.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page