Developer guide
These pages explain how Kontext is put together and how to work in this repository. They assume a checkout.
Getting started
Section titled “Getting started”- Contributing guide — prerequisites, local setup, common commands, and the pull request process.
- Agent guide — the canonical architecture and conventions reference.
Architecture
Section titled “Architecture”- Architecture overview — The system map: layers, processes, data flow, and technology choices.
AI architecture
Section titled “AI architecture”- AI architecture — Agents, teams, tools, and the SQL validation path behind Kontext’s AI features.
- Agent harness abstraction — How the agent framework stays a swappable adapter behind neutral contracts.
- Model provider configuration — Provider inputs, catalog defaults, and the harness-neutral model object.
- Tool result schemas — The shared transport schema for tool results across TypeScript and Python.
Notebook
Section titled “Notebook”- Notebook system — The block document model, package layout, and host integration contract.
Concepts
Section titled “Concepts”- Security and trust model — Launch tokens, Host/Origin guards, JWTs, confinement, and residual risk.
- Authorization and permissions — Claims, project roles, feature gates, and the permission map.
Repository workflows
Section titled “Repository workflows”- Environment reference — Runtime environment variables, ownership, and security-sensitive settings.
- Generated code — The committed API types and Python models, and how to regenerate them.
- OpenAPI workflow — Refreshing and validating the tracked API specifications.
- Python package boundaries — The Python package responsibility matrix and dependency rules.
- Releasing — The app, wheel, TypeScript package, and docs publishing paths.
- Local operations — Running the local stack, recovering launch tokens, and diagnosing common failures.
- Desktop builds — Bundling CPython and the local runtime into the macOS app, and publishing DMGs.