AI Assist
AI Assist is built into the Agent Builder editor. It understands the current state of your canvas and uses that context to produce relevant results — not generic templates.
Opening AI Assist
Click the sparkle (✦) icon in the right action bar of the editor. The AI Assist panel opens on the right side of the canvas. The icon is highlighted in blue when the panel is active.
Describe It by Voice
Click the microphone under the description box and say what you want. Your words are added to the box for you to check, then click Generate Workflow or Add nodes. When the description was spoken, AI Assist also tells you out loud what it built: how many steps, and the first few by name. More in Talk to Studio.
Two Modes
Generate
Start from a description. Get a complete, ready-to-run workflow.
Type a plain-English description of the workflow you want to build, then click Generate Workflow. The AI returns a full graph with nodes, edges, and configs. The generated workflow replaces the current canvas.
Example prompts:
- "Classify an incoming support ticket as billing, technical, or general, then route it to the right agent for each category"
- "Retrieve relevant documents from the knowledge base, summarize them with an agent, and output the summary"
- "Loop until the agent's output quality score exceeds 0.8, up to 5 retries"
Generate replaces the existing canvas. If your canvas already has nodes, you will see a confirmation dialog before the replacement happens.
A canvas history snapshot is automatically taken before the replacement — use Ctrl+Z (Undo) to revert to the previous canvas if the generated workflow isn't what you wanted. This undo snapshot is in the editor's in-memory history and is separate from the versioning system's persistent snapshots.
What happens after generation:
- The AI returns a graph (nodes + edges + configs).
- The server checks it with the same validator used at publish (expression errors, missing required fields such as a
classifynode's classes or afile_searchnode's knowledge base, node count limits), and the editor shows any warnings in the toast notification. The graph is still applied — warnings are informational, not blocking. - Nodes are automatically laid out on the canvas using BFS depth levels, starting from the
startnode — no manual positioning needed. - The graph is saved immediately as a draft.
- You can then edit any node's config to refine the result.
What the AI can build: every node type in the palette — agent, classify, if_else, while_loop, transform, set_state, guardrails, user_approval, file_search, mcp, for_each, merge, sub_workflow and note, plus start and end — with each node's config written under the keys the runtime reads (see Node Types). Routing nodes come with labelled branches: one edge per class for classify, true/false for if_else, and continue/done for while_loop.
A step that searches documents becomes a file_search node with no knowledge base selected. Pick one before you submit the workflow, since a search node without one can't be published. Likewise, fill in an mcp node's server URL and a sub_workflow node's target workflow.
Suggest
Already have a workflow? Get AI suggestions for what to add next.
Describe what you want to add or improve, and the AI returns additional nodes that fit the existing workflow. The suggested nodes are placed to the right of your current graph without overwriting anything.
Example prompts:
- "Add a guardrails check before the final agent"
- "Add a human approval step if the classification confidence is low"
- "Insert a transform node to strip HTML from the input before the agent processes it"
What happens after suggestion:
- The AI analyses the workflow as it is on your canvas, including edits you haven't saved yet, and your prompt.
- It returns a set of new nodes and edges. Edges may already connect a new node to an existing one.
- New nodes are appended to the right of the existing canvas (offset by the current max X coordinate + 100px). A suggested id that's already used on the canvas is renamed.
- Connect any remaining suggested nodes to your graph by drawing edges from the relevant connectors.
Switching Modes
Use the Generate / Suggest tabs at the top of the AI Assist panel to switch between modes. The text area and button update to match the selected mode.
Context Passed to the AI
| Mode | What the AI sees |
|---|---|
| Generate | Your text description + every node type with the config it needs |
| Suggest | Your text description + the current graph (all nodes, edges, and configs) + every node type with the config it needs |
This means Suggest mode is context-aware: it can reference and connect to specific nodes in your graph.
Two limits apply to the graph Suggest sends:
- MCP auth tokens are always replaced with
••••••••, so they never reach the model. - A graph whose JSON is longer than 12,000 characters is sent as a summary: every node's id, type, label and config keys, plus every edge. It's never cut off partway.
API Endpoints
AI Assist is powered by two backend endpoints:
POST /api/v1/agent-workflows/generate
Generate a complete workflow graph from a text description.
Request body:
{
"description": "Classify a ticket then route to the right agent",
"catalog_id": null,
"space_id": null
}catalog_id / space_id pick whose LLM credentials are used; leave them out to use the instance default. A blank description is refused with HTTP 422 before any model call.
Response (the result itself, or a job to poll with ?background=true — see Long generations and errors):
{
"graph": {
"nodes": [
{ "id": "start", "type": "start", "label": "Start", "config": {} },
{ "id": "classify_1", "type": "classify", "label": "Classify Ticket", "config": { "classes": ["billing", "technical", "general"] } },
{ "id": "agent_billing", "type": "agent", "label": "Billing Agent", "config": { "system_prompt": "You handle billing queries..." } },
{ "id": "end_1", "type": "end", "label": "End", "config": {} }
],
"edges": [
{ "id": "e1", "from": "start", "to": "classify_1", "source": "start", "target": "classify_1" },
{ "id": "e2", "from": "classify_1", "to": "agent_billing", "source": "classify_1", "target": "agent_billing", "condition": "billing", "label": "billing" }
]
},
"node_count": 4,
"edge_count": 2,
"generated_by": "hrida_agent_runtime",
"warnings": []
}Nodes and edges come back as lists, in the shape the canvas and runtime use:
- Every node has a
label, taken from the model'sname. - Every edge has
from/toalongsidesource/target. - A branch edge's
conditionis copied tolabel, which is what the runtime routes on. - Config keys the model sometimes writes in an older form are renamed to the ones the runtime reads.
condition_expressionbecomescondition,key/value_expressionbecomestate_key/state_value, andcategoriesbecomesclasses.
warnings lists the structural problems the publish validator would report (for example a missing end node, or a file_search node with no knowledge base). The editor applies auto-layout.
POST /api/v1/agent-workflows/{id}/suggest-nodes
Suggest nodes to add to an existing workflow.
Request body:
{
"description": "Add a guardrails check before the final agent",
"catalog_id": null,
"space_id": null,
"current_graph": { "nodes": [...], "edges": [...] }
}current_graph is optional: the editor sends the canvas as shown, unsaved edits included. Without it, the workflow's saved graph is used. Either way you need read access to the workflow.
Response: { "additions": { "nodes": [...], "edges": [...] }, "node_count", "edge_count", "generated_by" }, containing only the new nodes and edges, normalised the same way as /generate. The editor merges them into the existing canvas.
Long Generations and Errors
Generating a workflow can take a few minutes on a slow model, longer than some proxies keep one response open. Generation gives up after AI_ASSIST_TIMEOUT_SECONDS (default 300).
Background jobs (what the editor uses)
Add ?background=true to either endpoint. The request returns at once:
POST /api/v1/agent-workflows/generate?background=true
→ 202 { "job_id": "6f1c…", "status": "running" }Then poll the job, every few seconds, until it isn't running:
GET /api/v1/agent-workflows/assist-jobs/{job_id}
→ 200 { "job_id": "6f1c…", "status": "running" }
→ 200 { "job_id": "6f1c…", "status": "completed", "result": { "graph": …, "node_count": 4, … } }
→ 200 { "job_id": "6f1c…", "status": "failed", "detail": "AI Assist timed out after 300s — try a shorter description.", "status_code": 504 }resultis exactly what the endpoint would have returned.- Only the user who started a job can read it; anyone else, and an unknown or expired job, gets
404. Jobs are kept for 15 minutes (in Redis, so any replica can answer the poll). - If the server restarts while a job runs, the job ends
failedwithstatus_code503; start it again.
Without background
The request waits for the result. While the model works, the server sends a space character every AI_ASSIST_KEEPALIVE_SECONDS (default 15) ahead of the JSON body, so a proxy doesn't close the request as idle; leading whitespace is valid JSON. A proxy can still cut off a very long response (on hrida.ai, at about 135 seconds), so prefer background jobs.
Because the status is already 200 by the time the model finishes, a failure during generation comes back as a 200 whose body is an error object: { "detail": "…", "status_code": 504 }.
Errors
status_code (in a failed job, or in the body above) is the status the error would otherwise have had:
status_code | Cause |
|---|---|
502 | The LLM provider returned an error |
422 | The model's reply still wasn't valid JSON. Small slips (text around the JSON, trailing commas, // comments) are repaired, and an invalid reply is sent back to the model once with the parse error before this is reported |
503 | The work was interrupted (for example the server restarted) |
504 | Timed out after AI_ASSIST_TIMEOUT_SECONDS |
The editor shows detail as an error toast, and never an empty one: if a proxy returns its own error page instead of JSON, the toast says so. Checks that run before generation starts, such as authentication, a missing workflow (404) or no access to the catalog or space, return their real HTTP status in both modes.
Tips for Better Results
- Be specific about routing logic: "If confidence < 0.7, route to human review; otherwise proceed" produces better
if_elseconfig than "add branching". - Name your agents: "a billing specialist agent" rather than "an agent" results in a more useful node name and system prompt.
- Describe failure paths: Mention what should happen when something goes wrong. The AI will add appropriate guardrail or fallback nodes.
- Iterate with Suggest: Start with a simple Generate, then use Suggest to layer in complexity (error handling, loops, human steps) incrementally.