Skip to main content
This is the local Karta-session loop on one machine: an operator runs Karta, an agent builder brings a support bot project, and an end user chats with it through a browser widget - replies streaming token by token. No cloud account. It mirrors the runnable support-bot.

The cast

Operator

Hosts the platform - locally, karta dev plays this part.

Agent builder

Brings the support bot project and exercises it.

End user

Opens a chat widget in the browser and talks to the bot.

1. The agent

Our bot is Beans, the support agent for a fictional roaster. The whole agent is three files.
app/CLAUDE.md
app/app.py
app/karta.toml
That’s a complete, deployable agent. CLAUDE.md is the instructions; karta.toml gives it a name, opts it into deploys, and tells Karta how to load it. (karta setup writes this file for you.)

2. Run it: one command plays the operator

karta dev serves the folder behind the HTTP session API - the uniform surface every Karta agent speaks - and prints its local URL (Local agent API: http://127.0.0.1:<port>/v1). It also drops you into a chat REPL; for this tutorial the widget is the client, so keep karta dev running and note the URL.

3. End user: a streaming chat widget

A tiny web server hosts the widget and proxies to Karta, so the browser only ever talks to your origin. The two calls it makes:
1

Open a session

2

Send & stream replies

The widget reads the SSE stream and grows the reply bubble token by token - exactly what the Messages endpoint emits with stream: true.

4. Try it

Open the widget in a browser. Beans greets you, and a conversation flows:
Multi-turn context holds because each message reuses the same session_id - and the history lives in the harness, not the widget.

What this exercised

  • An agent (CLAUDE.md + karta.toml) with zero Karta-specific agent code.
  • The operator to developer to end user persona split, locally.
  • The uniform session API and SSE streaming that a real frontend builds against.

Where to take it next

Add a sub-agent

Hand billing questions to a dedicated harness role.

Add a skill

Give Beans real order-lookup capability.

Deploy it for real

Publish a release behind an agent URL.

Front it with the OpenAI SDK

Point an existing client at your agent.