Build your agent
Patterns
Workflow shapes that work well in production, with the JSON for each.
Fast, natural chat
Listen → AI reply → back to Listen. The AI speaks as it writes, so the caller hears the first words soonest. The AI can still end the call by returning hangup.
"ask_for_input": { "type": "input", "parameters": { "input_variables": { "user_input": "str" } }, "next": "chat" },"chat": { "type": "llm-streaming", "parameters": { "system_prompt": "…", "service": "groq", "model": "openai/gpt-oss-120b", "history_key": "conversation_history" }, "next": "ask_for_input"}Instant acknowledgement
Run a tiny model and the main model side by side. The tiny one says “Sure, one moment” almost at once; the main answer follows. Give each its own history_key so they don't mix memories, and a stream_timeout on the main one so a very late answer is dropped. The Quick ack + main LLM template builds this.
"ask_for_input": { "type": "input", "parameters": { "input_variables": { "user_input": "str" } }, "next": ["ack", "main"] },"ack": { "type": "llm-streaming", "parameters": { "model": "openai/gpt-oss-20b", "history_key": "conversation_history_ack", "system_prompt": "Reply with a two to four word acknowledgement only." } },"main": { "type": "llm-streaming", "parameters": { "model": "openai/gpt-oss-120b", "history_key": "conversation_history", "stream_timeout": 8, "system_prompt": "…" }, "next": "ask_for_input" }Decide, then branch
An AI decision fills in fields; a Say speaks the reply; a Branch picks the path from a field.
"decide": { "type": "llm", "parameters": { "system_prompt": "Work out what the caller wants.", "llm_return_type": { "speak": { "type": "str", "description": "What to say." }, "intent": { "type": "str", "description": "book, cancel or other" } } }, "next": "say_it"},"say_it": { "type": "out", "parameters": { "variables": ["speak"] }, "next": "route" },"route": { "type": "conditional", "parameters": { "input_variables": { "intent": "str" }, "mappings": { "book": "booking", "cancel": "cancelling", "default": "ask_for_input" } }}End the call
Send hangup: true with the last line. The line is spoken first, then the call ends:
"goodbye": { "type": "out", "parameters": { "out_dict": { "speak": "Thanks for calling. Goodbye!", "hangup": true } } }To let the AI decide, include hangup in its decided fields and pass it on with "variables": ["speak", "hangup"].
Show what the caller said
A Say step with only "variables": ["user_input"], run beside the AI step, puts the caller's words in the transcript without speaking them back. The templates call it transcription.
Next steps
- Import, export and code: reuse a workflow elsewhere.
- Steps: every setting of every step.