Skip to main content

ZizkaDB + LiveKit Agents

PyPI: zizkadb-livekit 0.2.2 · depends on zizkadb-sdk>=0.4.1 + livekit-agents>=1.3.0

Log voice calls to ZizkaDB with the same Activity → Sessions / Events model as text agents.

  • One session_id per call (use the LiveKit room name or job id)
  • Transcript only — text copied from LiveKit's chat history and make_session_report() (no audio in ZizkaDB)
  • Pipeline events — tool calls, handoffs, state changes, interruptions, token usage
  • Causal lineage — a single-stranded parent_id chain for Why? in the dashboard
  • Never on the audio path — writes are queued and drained in the background; a ZizkaDB outage degrades observability, never the call

Install

pip install "zizkadb-livekit>=0.2.2"

Start ZizkaDB (Docker quickstart):

curl -fsSL https://raw.githubusercontent.com/Zizka-ai/ZizkaDB/main/scripts/quickstart-remote.sh | bash

Usage

import os
from livekit.agents import AgentServer, JobContext, AgentSession, Agent
from zizkadb import ZizkaDB
from zizkadb_livekit import ZizkaDBLiveKitObserver, pop_observer, register_observer

server = AgentServer()


async def on_session_end(ctx: JobContext) -> None:
    # on_session_end receives the same JobContext as the entrypoint, so the
    # observer is looked up per call. One worker serves many calls concurrently;
    # a module-level observer would let them overwrite each other's transcripts.
    observer = pop_observer(ctx)
    if observer is None:
        return
    try:
        await observer.ingest_session_report(ctx)
    finally:
        await observer.aclose()


@server.rtc_session(agent_name="support-voice", on_session_end=on_session_end)
async def entrypoint(ctx: JobContext):
    db = ZizkaDB(host=os.getenv("ZIZKADB_HOST", "http://localhost:8000"))
    observer = ZizkaDBLiveKitObserver(
        db,
        agent=os.getenv("ZIZKADB_AGENT", "support-voice"),
        session_id=ctx.room.name,
    )
    register_observer(ctx, observer)

    session = AgentSession(...)  # your STT / LLM / TTS
    # Attach before session.start() so no turn is missed.
    observer.attach(session, job_ctx=ctx)
    observer.queue_session_started(room=ctx.room.name, job_id=ctx.job.id)

    await session.start(agent=Agent(instructions="..."), room=ctx.room)
    await ctx.connect()

Open http://localhost:3001 → Activity → your agent → Sessions.

Verbosity

Voice pipelines emit many more events than text agents, so events are tiered. Each level logs its own tier and everything quieter; errors and session boundaries are always logged.

Level Adds
transcript Turns, tool calls/results, handoffs, errors, session boundaries
standard (default) State changes, interruptions, timeouts, token usage
verbose Partial transcripts, turn-detector predictions, bounded raw payloads
observer = ZizkaDBLiveKitObserver(db, agent="...", session_id="...", level="verbose")

or set ZIZKADB_EVENT_LEVEL globally.

Event types

Event Source
session_started / session_ended Call boundaries
user_message / assistant_response LiveKit chat history
user_transcript Final STT result
tool_call / tool_result Tool items + function_tools_executed
agent_handoff Multi-agent workflow handoff
user_state_changed / agent_state_changed Pipeline state
usage_updated Token usage
error Failures

Manual helpers: log_tool_call, log_tool_result, log_error.

Lifecycle

  • attach(session, job_ctx=ctx) — subscribe to the live event stream, before session.start(). Never raises.
  • queue_session_started(...) — non-blocking; use await log_session_started(...) if you need the event id.
  • ingest_session_report(ctx) — back-fill the full transcript at call end.
  • flush(timeout=None) — wait for queued writes (default flush_timeout, 10s).
  • aclose() — flush, stop the writer, release the pooled connection. Idempotent; also usable as async with.

Environment

export ZIZKADB_HOST=http://localhost:8000   # self-host
export ZIZKADB_AGENT=support-voice
export ZIZKADB_EVENT_LEVEL=standard         # transcript | standard | verbose
# Cloud: export ZIZKADB_API_KEY=zizkadb_live_...

See examples/livekit-agent for a full sample.

Metadata

Release files for zizkadb-livekit 0.2.2

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-livekit 0.2.2
File Size Uploaded Provenance
zizkadb_livekit-0.2.2.tar.gz 19.2 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for zizkadb-livekit 0.2.2
File Interpreter ABI Platform
zizkadb_livekit-0.2.2-py3-none-any.whl Python 3 none any Details

Total release size: 37.7 kB

Release files / zizkadb_livekit-0.2.2.tar.gz

Download URL zizkadb_livekit-0.2.2.tar.gz
Size 19.2 kB
Tags Source
SHA-256 checksum
How to use checksums
bf5afbee65a5cae7ea7b7e52c1dd124a2b5d801c2be15535a9b948435017856c
BLAKE2b-256 checksum
How to use checksums
29a41d3cfbedca9199aaa0f5cd7e3997b1073045ea9e97a56118e146de62717e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.9

Release files / zizkadb_livekit-0.2.2-py3-none-any.whl

Download URL zizkadb_livekit-0.2.2-py3-none-any.whl
Size 18.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c94dae05517a678c96dde6aa412204df082f6a4f84d07d7524008dc82e763275
BLAKE2b-256 checksum
How to use checksums
64cbb9c7926c5bd401d1d6a2455a23ff77c42877f36c21ffdadd8266ae68fdbe
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.9

Security for zizkadb-livekit 0.2.2

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