Agents and the builder
Every tab of the agent builder, the live preview, publishing to an environment, rollback, duplicate and archive.
Agents lists each agent with its model, the version active in the selected environment, status and last update. + New agent asks only for a name; everything else is edited in the builder. The row menu offers Open builder, Duplicate (creates “Name (copy)” as a draft) and Archive (hides the agent and stops new conversations; versions and existing conversations are kept).
The builder
Two columns: the tabbed editor and the Preview. Every field autosaves; “Saved” flashes after each change. The header shows the active version badge, a draft has changes chip when the draft differs from what is live, Versions, and Publish to Development / Production.
How it works
The first tab, and the one an agent opens on, is a read-only canvas of one turn, drawn from the draft you are editing (the row menu’s How it works entry opens it directly). Boxes connected left to right show what the runtime does with a message, in the order it happens:
- User sends a message over the
kletso.v1socket, with the public context keys; triggers attached to this agent and the voice session sit beside it as other ways into the conversation. - Jev reads the turn: picked options become values, hand-off requests and prompt injection are flagged, and with routing on the turn is rated by difficulty.
- The prompt inputs: system prompt and tone, the history window (or the last few messages verbatim plus the rolling summary), user memory, recall of earlier conversations and every attached knowledge base with its top-k and minimum score, all feeding Build the request.
- Routing and the models: the default model and, with routing on, the fast, medium and intelligent tiers, each box naming the provider, the model and the project secret it runs on. A model without a usable key is marked needs attention.
- Tool rounds: the loop limit, then one box per attached tool (method, host, auth, confirm-first, act-as-user, side effect) and the built-in tools
render_ui(allowed components and link hosts),handoff(target and reasons),notify_app/app_command,set_moodwhen the agent may pick moods, and the workflow when the agent is workflow-backed. Orange two-way arrows are the call-and-result round trips. - Reply streams to the app, Your app renders it (with the avatar’s mood rules), and the after-reply work: memory upkeep (summary fold, fact extraction, recall indexing) and conversation tags.
Switched-off capabilities are drawn as dimmed dashed boxes so you can see what the agent could do; untick Show switched-off steps to hide them. The expand icon at the right of the toolbar opens the canvas full screen (Esc leaves); the workflow builder has the same button. Click any box for a plain-words explanation of that step with its current values, an Edit in … button that jumps to the tab where it is configured, and a link to the page it lives on (Tools, Knowledge, Triggers, Users, Conversations). The right panel lists the steps that need attention (missing keys, empty prompt, no allowed components, knowledge base without ready sources) until you select a box.
Persona
Name, internal description, system prompt, tone chips (Friendly, Professional, Concise, Playful, Empathetic, Formal), greeting (first message of every conversation), fallback (used when the model cannot answer). The prompt is a template; chips insert {{ context.plan }}, {{ context.currency }}, {{ context.locale }}, {{ context.screen }} and {{ context.userId }}. Only context.* variables are filled, and only for keys listed as public in Behaviour.
Write the prompt as instructions about which tool to call for which intent and what to render. Example that works well with current models:
Call the matching tool right away with sensible defaults instead of asking clarifying questions: products → search_products (query = the user’s words, maxPrice when they give a budget); order status → track_shipment. Never invent prices: quote tool results only. After a tool returns items, render them with render_ui (products as acme.productCard, one per item inside a column) and keep the text short.
Model
The Select model list has four rows: Default (recommended), Fast, Medium and Intelligent. Each row shows the model that answers that tier, a one-line description and the provider and key it runs on. Click a row (or move with ↑/↓) to open its editor: provider (Anthropic, OpenAI, Google, Groq), model, and your API key, a project Secret chosen by name. Every row has its own provider and key, so the fast tier can run on Groq with one secret while the intelligent tier runs on Anthropic with another. Once a key is chosen, the model dropdown asks the provider which models that key can actually run and lists those instead of the defaults; a saved model the key cannot see stays selectable but is flagged. Below the list: temperature (0–1) and max output tokens. Without a secret the agent runs the deterministic mock provider, which is useful for demos but never calls a real model. Default model ids: OpenAI gpt-6-sol, gpt-6-mini, gpt-5.4; Anthropic claude-fable-5-1, claude-opus-5-5, claude-sonnet-5, claude-haiku-4-5; Google gemini-3.5-pro, gemini-3.5-flash; Groq llama-4-maverick, qwen-4-72b.
Routing
A Route each turn by difficulty (Jev) toggle turns on model routing: before each model call, Jev classifies the user’s turn and the runtime calls a cheaper or stronger model depending on how hard the turn looks, instead of always using the Default row. While routing is off the three tier rows are dimmed. A tier’s model dropdown starts with Use fallback, which leaves the tier empty:
- Fast — greetings, yes/no, follow-ups answerable from the chat, option picks.
- Medium — one lookup or tool call and a short answer.
- Intelligent — several tools, comparisons, corrections, complaints.
The model above always stays the fallback: when routing is off, when Jev is unavailable, when the turn is a resumed confirmation, or when the chosen tier has no model set (fast falls back to medium, then to the model above; medium and intelligent fall back to the model above directly). A tier set without a key is flagged in red and answers not_configured in production, exactly like a main model without a key.
Prompt caching is per model, so alternating tiers between turns means each tier re-reads the cached prompt prefix the first time it’s used in a conversation rather than reusing another tier’s cache; this is usually still cheaper than always running the intelligent tier.
The Conversations Turns table shows a small tier chip next to the model that actually answered each turn, and the Model input panel’s header names the model used and the routing reason.
Max output tokens is a ceiling, not a target: the model stops when it is done, so a high value costs nothing unless used, while a low one cuts cards and answers off. New agents start at 4,096. Models that reason before they answer spend output tokens on that reasoning, so the runtime raises the ceiling to at least 4,096 for them whatever the field says, and the Model tab warns when the value is lower than that for a reasoning model, or under 2,048 for an agent that renders UI. If a budget still runs out before the cards are written, the runtime stops after two failed attempts and tells the user instead of looping.
Tools
Attach project tools with a switch. Per attachment: confirm first (the user approves each call in the chat) and act as user (forward the signed-in user’s token). Defaults come from the tool’s own settings.
Knowledge
Attach knowledge bases with top-k and minimum score. Indexing and retrieval are planned; the tab is functional but retrieval returns placeholder results today.
Workflow
Optionally attach a workflow. Stored on the agent; dispatch from live turns is planned.
UI
The allowed components checklist over every type in the project (built-ins and custom, the latter marked from code or custom), and the URL allowlist (hosts that url actions and links may open, comma separated). The model can only emit types ticked here.
Behaviour
Max tool rounds (default 6), history window in messages (default 20), hand off to (Kletso inbox, Slack channel, Never), hand off when (request, frustration, payment_issue, legal, low_confidence), public context keys (sent to the model and tools), sensitive context keys (tools only), and Jev turn judgments (beta, on by default): before each model call, Jev reads the user’s message against the UI last shown and attaches the picked option, flags a request for a human and marks suspicious input. Switch it off for agents that should see raw text only. Fast path (beta, off by default) goes one step further and acts on Jev’s tool pick: the judged tool runs before the first model round with the user’s words as its query, other tools are refused in that turn, chit-chat turns carry no tool definitions, and a cards-only reply uses the surface’s fallback text instead of another model round; see Jev judgments. Memory (beta, see Memory): conversation summary with the number of messages kept verbatim (default 6), user memory (durable facts the user states, remembered across conversations and editable on the Users page) keep sensitive facts (off by default), and recall earlier conversations (snippets of the user’s past chats retrieved when Jev judges the message needs them).
Versions
Every publish is an immutable row: number, note, date, who, and chips for the environments where it is active. Use in Development / Production re-publishes that version there (rollback or roll-forward). Nothing is ever deleted.
Publish
The modal summarises what changed against the active version, the attached tools, the model (with a warning if no key is set), what it replaces, and takes an optional release note. Publishing snapshots the draft as the next version and makes it active in the selected environment. Sessions pick it up on their next bootstrap.
Preview
The right column is a real conversation with the draft on the selected environment (or the in-browser runtime in demo mode). You see bubbles, tool-call chips, a schematic rendering of every surface, and an event inspector with timing, tokens, latency and finish reason. Restart with the circular arrow. Preview conversations appear in Conversations as preview:<your email>.