Tutorial: connecting your app
This tutorial takes you from an agent built in Cullman to a live voice conversation in your product, with a judge reviewing every session. You build the agent and set up its judge first, so the first session your app runs is already reviewed. Then you connect your server and your page, and read each session's transcript and review. It follows the common path; the reference pages have every field and option: Sessions API, Browser client, Webhooks and Judges.
| Production | |
|---|---|
| Cullman (dashboard) | https://app.cullman.ai |
| Engine (API and live audio) | https://engine.cullman.ai |
How it fits together
Cullman ──── you build the agent and its judge, promote versions, create keys and webhooks
│
▼
your server ── API key ──▶ engine ◀── client token ── your web page (mic + speaker)
▲ │
└──── signed webhooks ───┘ (session ended, session judged, tool calls)
- Your server asks the engine for a session with its API key and gets back a short-lived client token.
- Your web page connects to the engine with that token and talks to the agent. Audio and live events (transcript, tool calls) flow over that connection.
- When the conversation ends, the engine POSTs a webhook to your server. The agent's judge then reviews the session, and a second webhook says the review is ready. Your server reads the transcript and the review with the API key.
New to agents, versions, production and judges? Key concepts explains each word in a line.
Before you start
- A Cullman account in a workspace. Creating API keys and webhooks needs an admin of it.
- A server that can keep a secret and receive HTTPS requests.
- A web page where the participant talks, served over HTTPS.
1. Build the agent
-
Voice agents › New › Cullman. Name it
AI Interviewer: its Slug becomesai-interviewer, the id your server sends. Create. You set up its reviews in step 2. -
On the agent's page, Start the first draft, then Create draft. The draft opens on its Models tab and saves as you type.
-
Click Conversation, the agent's one model. It talks with GPT Realtime 2 in the Marin voice; leave both.
-
Open its Prompt tab and paste:
You are a friendly interviewer talking with {{ participant_name }} about {{ topic }}. Greet them by name, then ask one question at a time. When an answer is short, ask one follow-up. After five questions, thank them, say goodbye and end the session.{{ participant_name }}and{{ topic }}are filled in from what your server sends for each session. -
Open its Tools tab: New tool › End session, so the agent can hang up after its goodbye.
-
Open the draft's Variables tab:
participant_nameandtopicare listed, read from the prompt. Tick Required ontopic. -
Test ▾ › Live test, then Set up the call. Fill in both variables, then Start, and talk to it. When the call ends, it is saved as a session: in step 2 the judge reviews it.
Leave it a draft for now. It is v1, still editable: you promote it at the end of step 2, once the judge has reviewed it.
2. Set up the judge
A judge is a model that reads each ended session and writes its review: a score on each of the agent's rubrics, and the issues it found. Every agent comes with its own judge, which reviews nothing until it is set up. Set it up now, before your app runs a single session: from then on each session is reviewed as it ends, and its scores and issues are there when you read it, compare versions or decide what goes to production.
Set it up
-
The agent's page opens with Set up reviews first above its tabs. Click Open Rubrics: its Setup says Nothing is set up yet. Click Edit: a blank Rubrics draft opens, and saves as you type.
-
Under Model, pick Anthropic and Claude Sonnet 5.5.
-
Under Rubric prompt, paste:
You are reviewing a finished voice interview. You did not take part in it: judge only on the evidence in the transcript above. Every turn is numbered [n]. Score the interview on the rubric given at the end, from 1 to 5: 5 fully met, 4 mostly met, 3 partly met, 2 barely met, 1 not met. Every deduction quotes the transcript and cites turn numbers. No evidence, no deduction.The engine sends the session before it (the agent's prompt, then the transcript) and adds one rubric after it, in a call of its own for each rubric.
-
For each rubric below, click Add rubric, type its Label (the Key fills in from it), paste How to score it, then Add rubric.
Label How to score it Follow-up qualityWhen an answer is short or vague, the agent asks one follow-up that digs into it: why, or a recent example. Each short answer left without a follow-up lowers the score by one. ToneWarm, natural and neutral: each reply fits what the participant just said. Praising an answer ("great answer") caps the score at 4. -
Go back to the agent and open its Issues tab. On Setup, click Edit: a blank Issues draft opens. Under Model, pick Anthropic and Claude Sonnet 5.5 again, and under Issue prompt, paste:
You are reviewing a finished voice interview. You did not take part in it: judge only on the evidence in the transcript above. Every turn is numbered [n]. List every problem the transcript shows, one entry per problem, each under the closest issue from the list at the end. An interview with nothing wrong gets an empty list. Then sum the interview up in two to four sentences.The engine adds the agent's issues after it.
-
For each issue below, click Add issue, type its Label (the Slug fills in from it), paste its Definition, then Add issue.
Label Definition Re-askThe agent asks for something the participant already said in an earlier turn. Abrupt endingThe session ends before the agent thanks the participant and says goodbye, or before its five questions are asked. -
Publish, type
First setupunder Title, then Publish again: this is Issues v1. Open the Rubrics tab and publish it the same way: Rubrics v1. Each part runs on its own, so the agent's page asks for the other until both are published. Each tab's Setup now shows its part: the model, the prompt, and the rubrics it scores or the issues it files under.
From now on every session your app starts is reviewed a minute or so after it ends, whether it runs the version in production or names another one. Live tests and testers' sessions are judged when someone asks; simulations always are.
Judge your live test
Live tests are judged only when someone asks. Open the live test from step 1 from the agent's Test sessions, and click Judge now on its Review tab. The review is usually ready in under a minute.
If the review shows something to fix, fix it in the draft (it is still v1) and run another live test.
Read the review
Judge's score sits at the top of the session's page. The Review tab shows the transcript beside the reviews. Under Judge are the summary, a table of each Rubric with its Score and Why, and the Issues. An issue's Turn n link highlights that turn in the transcript.
- A rubric is one quality of the whole conversation, such as asking good follow-ups or keeping a neutral tone. The judge scores each rubric from 1 to 5, in a call of its own, reading the agent's prompt as what the agent was meant to do and the transcript as what it did. 5 means fully met. Below 5, Why says why, quoting the transcript and citing turns. The overall score is the mean of the rubric scores, rounded: use it to sort sessions, and the rubric scores to see what held one back.
- An issue is something that went wrong at one moment, such as the agent asking again for something the participant already said. Each one is filed under one of the agent's issues, with a severity (low, medium or high), the turn where it happened, a quote from that turn, and what went wrong in general words, so the same problem can be counted across sessions.
A low score says a quality fell short; the issues say where. To see the same problem across sessions, the agent's Issues › All issues lists every issue the judge filed.
You can review a session yourself under People: Score this session to give your own scores, or the flag on a turn to Report an issue at this turn. People's reviews are kept apart from the judge's, and the API returns only the judge's.
Try it more widely (optional)
One live test is one conversation. For more, run a simulation: simulated participants talk to v1, and each conversation is judged, so you see its scores and issues across many. It needs the agent's simulator first: on its Scenarios tab, Simulator › Create the simulator (a copy of another simulator, its prompt fitted to your agent). Then Test ▾ › Text simulation: pick v1, write two or three scenarios (who the participant is and what they bring), and give each a few runs. See Simulation in Concepts.
Promote it
On the agent's Versions tab, open v1's menu (⋮) and click Promote, then Promote again in the dialog. Promoting freezes the version for good: from now on you change it by duplicating it (step 8). The agent's production is now v1: a session your app starts without naming a version runs it.
Change what it looks for
The prompts, rubrics and issues you wrote are the agent's own. To reword a rubric's How to score it, or add a rubric or an issue, open the Rubrics or Issues tab and click Edit: your changes go into a new draft of that part, which the judge uses once you Publish it. How to write them is in Rubrics and Issues; how the judge works, how to test a draft on past sessions before publishing it, and how to start other agents from sets kept in the library, is in Judges.
3. Create an API key and a webhook
Both need an admin of the workspace, and both belong to the whole workspace, not to one agent.
An API key
Settings › API keys › New API key, name it "App server", and click Create API key. The key is shown once:
copy it and store it as a secret on your server, VOICE_ENGINE_API_KEY. It can start sessions with any agent of the
workspace, on any of its versions. Settings › API keys lists every key, and revokes one.
A webhook
Settings › Webhooks › New webhook. Paste your endpoint's URL, tick Session completed, which arrives when a
session ends, and Session judged, which arrives when the judge has reviewed it. Leave Agents on all agents and
Sessions on both, then Create webhook. Store the signing secret (whsec_…), shown once, next to the API
key, as VOICE_ENGINE_WEBHOOK_SECRET.
4. Start a session from your server
Ask for a session when the participant is about to talk: the client token you get back works for 5 minutes.
const ENGINE_URL = 'https://engine.cullman.ai';
export async function startVoiceSession(userId: string) {
const res = await fetch(`${ENGINE_URL}/v1/sessions`, {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.VOICE_ENGINE_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
agent: 'ai-interviewer',
variables: { participant_name: 'Sam', topic: 'Checkout flow' },
client_ref: { user_id: userId },
}),
});
if (!res.ok) {
const { error } = await res.json();
throw new Error(`voice engine ${res.status} ${error.code}: ${error.message}`);
}
const session = await res.json();
// What the browser needs to connect. Nothing more, and never the API key.
return {
session_id: session.session_id,
client_token: session.client_token,
engine_url: session.engine_url,
ice_servers: session.ice_servers,
};
}
The request names no version, so the session runs the agent's production: v1. The response's agent.version_public_id
says which version ran. Store session_id against your own record. Every field, the response and the error codes are
in Sessions API › Start a session.
5. Connect the browser
Add the browser client to your page. It opens the mic, connects to the engine,
plays the agent's voice on an <audio> element and hands you live events.
<audio id="agent-voice" autoplay></audio>
<button id="start">Start conversation</button>
import { connectEngineSession, type EngineConnection } from './voice-engine';
let connection: EngineConnection | undefined;
// Start from a click: browsers only open the mic and play audio after the user did something on the page.
document.querySelector('#start')!.addEventListener('click', async () => {
const session = await fetch('/api/voice-session', { method: 'POST' }).then((r) => r.json());
connection = await connectEngineSession({
engineUrl: session.engine_url,
sessionId: session.session_id,
clientToken: session.client_token,
iceServers: session.ice_servers,
audioElement: document.querySelector<HTMLAudioElement>('#agent-voice')!,
onEvent(event) {
switch (event.type) {
case 'transcript.done': // one finished turn: event.role is 'participant' or 'agent'
showTurn(event.turn, event.role, event.text);
break;
case 'transcript.removed': // the engine took a turn back; drop it from the screen
removeTurn(event.turn);
break;
case 'session.ended': // event.reason says why
connection?.close();
break;
}
},
});
});
The agent can end the conversation itself. To end it from the page, send session.end; add finished: true when the
conversation had reached its natural end, so the session counts as completed:
connection.send({ type: 'session.end', finished: true });
Tools that reach the browser, push-to-talk and the other controls are in Browser client.
6. Receive webhooks
When a session ends, the engine POSTs session.completed to your webhook, and session.judged once the judge has
reviewed it, a minute or so later. Check the signature on the raw body before you trust it, answer with a 2xx quickly,
and do the work afterwards:
import { createHmac, timingSafeEqual } from 'node:crypto';
export function isFromVoiceEngine(rawBody: string, timestamp: string, signature: string, secret: string): boolean {
const ts = Number(timestamp);
if (!Number.isInteger(ts) || Math.abs(Date.now() / 1000 - ts) > 300) return false;
const expected = Buffer.from(`v1=${createHmac('sha256', secret).update(`${ts}.${rawBody}`).digest('hex')}`);
const given = Buffer.from(signature);
return given.length === expected.length && timingSafeEqual(given, expected);
}
// Express: keep the raw body for the check.
app.post('/voice-engine/webhook', express.raw({ type: 'application/json' }), (req, res) => {
const raw = req.body.toString('utf8');
const ok = isFromVoiceEngine(
raw,
req.header('X-VE-Timestamp') ?? '',
req.header('X-VE-Signature') ?? '',
process.env.VOICE_ENGINE_WEBHOOK_SECRET!,
);
if (!ok) return res.status(401).end();
res.status(204).end();
const body = JSON.parse(raw);
const event = req.header('X-VE-Event');
if (event === 'session.completed') saveTranscript(body.session.id); // the conversation is over
if (event === 'session.judged') saveReview(body.session.id); // the judge's review is ready
});
The payloads, retries and tool calls are in Webhooks.
7. Read the result
With the session's id, read its transcript and the judge's review:
curl "https://engine.cullman.ai/v1/sessions/$SESSION_ID?include=transcript,reviews" \
-H "Authorization: Bearer $VOICE_ENGINE_API_KEY"
You get back something like this (shortened):
{
"id": "6f1c…",
"status": "ended",
"end_reason": "agent_ended",
"agent_finished_at": "2026-10-19T09:31:10.000Z",
"turns": [
{ "role": "agent", "text": "Hi Sam! Thanks for talking with me about the checkout flow. …" },
{ "role": "participant", "text": "Sure. I mostly shop on my phone." }
],
"reviews": [
{
"status": "done",
"overall_score": 4,
"summary": "Friendly and on topic; asked about the device twice.",
"criteria": [
{ "key": "follow_up_quality", "score": 3, "rationale": "Turn 6 takes \"it was fine\" without asking why." },
{ "key": "tone", "score": 5, "rationale": "" }
],
"rubric_snapshot": [
{ "key": "follow_up_quality", "label": "Follow-up quality", "description": "…" },
{ "key": "tone", "label": "Tone", "description": "…" }
],
"issues": [
{
"category": "re_ask",
"category_label": "Re-ask",
"severity": "medium",
"turns": [9],
"quote": "Which device do you usually shop on?",
"signature": "Agent asks again for something the participant already said."
}
]
}
]
}
end_reason says who closed the call, and agent_finished_at whether the conversation was finished. reviews holds
the judge's review, the one you read in Cullman in step 2. It stays empty until the judge has
reviewed the session, so read it at session.judged, not at session.completed. A review whose status is skipped
has no scores: the participant never spoke.
The review's fields, against what Cullman shows:
overall_scoreandsummary: the Judge's score and the summary.criteria: the rubric scores (the API says criteria where Cullman says rubrics), each by its rubric'skey, withrationaleas its Why.rubric_snapshotnames each rubric as it was when the review was written.issues: what the judge filed. Each one has:category: the issue it's filed under, by slug (category_labelis its name in Cullman);severity:low,mediumorhigh;turns: where it happened, counted from 1 over the transcript's turns that have words and weren't taken back (an emptyremoved_reason), as Cullman numbers them. It isn't a turn'sidx;quote: the exact words from that turn, or empty;signature: what went wrong, in general words.
An empty issues list means the judge found nothing wrong. Everything else a session can include is in
Sessions API › Read a session.
8. Ship a new version
-
On the agent's Versions tab, open v1's menu (⋮) and click Duplicate: a new draft, v2, opens as a copy of it. Make your change and try it with a live test.
-
Try it from your app before it reaches production: copy its ID (
ver_…) from the top of its page, and send it asversionin the request from step 4, for example from a staging server:body: JSON.stringify({ agent: 'ai-interviewer', version: 'ver_7k2p9x4m', variables: { participant_name: 'Sam', topic: 'Checkout flow' }, client_ref: { user_id: userId }, }),A draft runs as it is when the session starts. These are development sessions, which the agent's Logs list apart from production.
-
Compare it with v1 on the agent's Versions tab: Avg score, Avg issues and Top issue come from the judge's reviews of each version's sessions.
-
When it is ready, open v2's menu and click Promote, then Promote in the dialog. Requests that name no version run it from their next session: no deploy, no code change. Production sessions are judged, so the Versions tab keeps scoring it. Promoting v1 again is the rollback.
Change your code only when the version's variables change (a new required one, say), or when it adds tools your page or webhook must handle. Ship that before you promote it.