DataADK Packages

Two local packages

ai/packages/ holds two standalone, host-neutral packages that the main workspace consumes as editable pypi-dependencies:

Keeping them separate lets the same Agent System be built and tested outside the KAP host and synced into KavApps kavai_server unchanged.

kavai-agent-contract

The host-neutral Agent System contract (packages/kavai-agent-contract/src/kavai_agent_contract/):

  • system.py — the system interface an implementation must satisfy.
  • types.py — shared types, including RunContext (the caller-scoped capabilities the host injects per request).
  • testing/conformance.py — the conformance suite any implementation runs.

It depends only on pydantic. Verify with pixi run test-agent-contract.

kavai-dataadk

A standalone DataADK Agent System implementing the contract (packages/kavai-dataadk/src/kavai_dataadk/): system.py, agent.py, runner.py, factory.py, tool_adapter.py, adk_converters.py, config_loader.py, fallback_pipeline.py, gemini/supabase error classifiers, host_capabilities.py, and callbacks/ · models/ · tools/ · resources/. It depends on kavai-agent-contract, google-adk/genai, supabase, sqlglot, and postgrest. Verify with pixi run test-dataadk-package.

Boundary rules

The package must stay host-agnostic. tests/test_boundaries.py enforces:

  • No host kavai / FastAPI imports.
  • No .env reads or client initialization at import time.
  • No writes under the source tree.
  • Capabilities (config, auth, storage signing, Supabase clients) are injected via RunContext, never imported.

The KAVAI_DATAADK_IMPL selector

The selector lives on the KavApps kavai_server side (documented in packages/kavai-dataadk/README.md):

  • unset / legacy → the in-repo implementation (default and rollback path).
  • package → registers this package via the host’s package adapter, wiring the host seams (config, auth, JWT context, storage signing, Supabase clients) at startup.

KAP is the canonical source; the package trees are physically synced into kavion-v0/backend/packages/…. Inside KAP the selector is retired: dataadk always resolves to the package and argus always to the in-repo module (see Runtime & systems).