Skip to main content

ZizkaDB + LiveKit Agents

PyPI: zizkadb-livekit 0.2.1 · depends on zizkadb-sdk>=0.3.0 + 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.1"

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.1

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

Built distribution (wheel)

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

Total release size: 37.7 kB

Release files / zizkadb_livekit-0.2.1.tar.gz

Download URL zizkadb_livekit-0.2.1.tar.gz
Size 19.2 kB
Tags Source
SHA-256 checksum
How to use checksums
6121d18a88e2e7395afccbd43b0398f2b74e89c302ac3f05f21c0ed069c5c044
BLAKE2b-256 checksum
How to use checksums
226aa0e37c935042889ae712f3653837e8cbb3200e588445f54c16962f67d5c7
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.1-py3-none-any.whl

Download URL zizkadb_livekit-0.2.1-py3-none-any.whl
Size 18.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6f68d546a9b535385ebae30d3602743daea4c2fc92fa6145ecf2369638818ea9
BLAKE2b-256 checksum
How to use checksums
363a1d823c1ade0990f91a3bebc3bb0ac789d756a0083017ce14312357a0fbf4
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.1

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.

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