Skip to main content
karta-runtime is the Python SDK. It embeds an agent in your own Python process or serves it over HTTP. It is also the engine behind the karta CLI’s karta dev, which bootstraps it for you.

Install

You also need a supported harness installed for the agent project you want to run.

The two entry points

Karta

The orchestrator. Detects your harness, discovers agents, and sends/streams turns.

Session

A multi-turn handle with participants and agent handoff.

Three lines to a response

Karta detects the harness from the current directory: .claude/ or CLAUDE.md means Claude Code, .opencode/ means OpenCode, .deepagents/ means DeepAgents, .goose/ means Goose, and .codex/config.toml means Codex CLI.

Sync and async, send and stream

Every send has four shapes - sync/async x accumulated/streamed:
See Streaming events for the event model.

Serve over HTTP

Run your agent behind the HTTP API locally with the CLI - the same session API production serves:
To run it in production, deploy it.

Where to go

Karta reference

Constructor, properties, and every method.

Hooks & policies

React to lifecycle events; gate messages with policies.