Skip to main content
Karta is the core class. It detects your harness, discovers agents and skills, holds session handles, and exposes send/stream in sync and async forms.

Construct

On construction, Karta auto-detects the harness, loads karta.jsonc if present, and discovers agents and skills from the harness.

Properties

agents
dict[str, Agent]
Discovered agents, keyed by name.
default_agent
Agent
The fallback agent used when none is specified.
skills
Mapping[str, Mapping]
Discovered skills and their metadata.
gateway
Gateway | None
The active gateway, if configured.
profile
HumanAgent
The current user profile (from karta.jsonc or the OS user).

Sending turns

All four take the same keyword arguments: metadata, agent, session_id, participant, thinking.
A Response carries text, the turn messages, the agent that handled the turn, and usage (input_tokens, output_tokens, total_tokens).

Opening a session

See the Session reference.

Hooks

Register handlers for lifecycle events: message.received, message.completed, agent.handoff, session.created.

Policies

See Hooks & policies for the full set.