AI Architecture Handbook
The KAP AI backend as a Python package.
Introduction
The KAP AI backend lives in ai/ as a single pixi-managed Python package. The distribution is kavion-ai-server; the importable package is kavai (source under ai/src/kavai/). It exposes its capabilities to the web application over a thin HTTP/SSE Gateway speaking the AG-UI contract — the web-side wiring and the wire contract are in the Web Handbook (Web/AI Interface and the AG-UI contract).
All active engines are Google ADK / agent-runtime based: dataadk (the packaged reference), argus (the in-repo DataADK track, default), orion (next-gen ADK 2.x), and kawa (a tool-using AG-UI agent that runs in its own isolated environment). The delivery reference for the AI Assistant requirements is kavai_server in the KavApps submodule; KAP’s ai/ is the platform’s prototyping ground and the canonical source for the shared DataADK packages.
In this handbook
| Page | What it covers |
|---|---|
| Package layout | The kavai source tree, subpackages, the CLI entry point, and packaged data. |
| Runtime & systems | The Gateway / ADK Runtime / Kawa adapter processes and ports, request routing, and the four systems. |
| Environments & operations | The pixi features and environments, the serve-*/test-* tasks, and how to run it locally. |
| DataADK packages | The kavai-agent-contract and kavai-dataadk packages, the contract, and their boundary rules. |
| Integrity pipeline | The API 571/584 integrity stages, schemas, reference data, and contract endpoints. |