> For the complete documentation index, see [llms.txt](https://karini-ai.gitbook.io/karini-ai-documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://karini-ai.gitbook.io/karini-ai-documentation/kai-natural-language-agent-builder.md).

# Kai - Natural Language Agent Builder

### Overview

The Kai Agent Builder is an AI-powered assistant integrated directly into the recipe interface. It enables users to design, configure, and publish workflows through natural language interaction, eliminating the need for manual node placement or drag-and-drop configuration.

Users interact with the agent through a dedicated chat panel rendered adjacent to the canvas. As instructions are provided, the agent translates them into workflow modifications applied to the canvas in real time.

Agent Builder provides a comprehensive set of workflow design capabilities, allowing you to build, modify, and configure workflows entirely through natural language without interacting directly with the canvas.&#x20;

From constructing complex pipelines from scratch to making targeted changes to existing workflows, Agent Builder handles the full lifecycle of workflow design.

* **Design workflows from scratch** : Agent Builder lets you describe your intended workflow in natural language and automatically generates a fully structured canvas layout, complete with node placement, edge connections, and prompt configuration. Complex pipelines such as RAG, data classification, or content generation can be built entirely through conversation, with no manual canvas assembly required.
* **Modify existing workflows** : Agent Builder supports targeted modifications to any deployed workflow, allowing you to refactor, simplify, optimize, or extend existing structures without rebuilding from scratch. Changes are applied only to the specified components, leaving all unaffected nodes, edges, and configurations intact.
* **Node management** : Agent Builder provides full control over the node composition of any workflow, allowing you to add or remove any supported node type including Chat Node, Webhook node, Sink node, Processing node, Router, Agent, Guardrail and Knowledge base nodes. New nodes are automatically positioned and connected within the existing graph, preserving structural integrity and correct data flow.

### Prerequisites

Before using **Kai** **Agent Builder**, ensure that the required models are configured in your **organization settings**.

**1. Natural Language Assistant (NLA) Model**

The **NLA Assistant Model** is the primary LLM endpoint that powers all NLA operations. This model is required for NLA features to function.

**2. NLA Advisor Model**

The **NLA Advisor Model** is optional and is used to assist with various natural language processing tasks within advisor workflows.

To configure these, navigate to [**Organization Settings** ](/karini-ai-documentation/organization.md#natural-language-assistant)**→ Global Default Model Endpoints**.

<figure><img src="/files/rsF2YeDkBnSw7HI5wYhO" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
If the **NLA Advisor Model** is not configured on the organization settings page, the **NLA Assistant Model** is used as the fallback model.
{% endhint %}

After the required model settings are configured, an **Admin** must create the **NLA from Template** on the **Organization** page to enable the **Natural Language Assistant (NLA)** workflow.

<figure><img src="/files/xqwWVYmLtQF6BJeEjIvf" alt=""><figcaption></figcaption></figure>

Once created, the **NLA Builder recipe** becomes available with the configured tools. This recipe is already **published** and **deployed**, allowing users to start the flow directly.

<figure><img src="/files/vQtjVRW8dqiQlymZeFYd" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
&#x20;Click **Create New Version** to create a new version of the current NLA recipe. This enables controlled updates to the recipe while retaining the existing version for traceability, comparison, and rollback if required.
{% endhint %}

#### Steps to Start the NLA Recipe Workflow

1. Navigate to the **Recipes** page.
2. Click **Add New**.
3. Select the **Natural Language Recipe Builder** icon.
4. The **NLA chat widget** opens.
5. Enter your requirement in natural language to start building the recipe workflow.

<figure><img src="/files/YACZK173qRggOZ7EoWVB" alt=""><figcaption></figcaption></figure>

### Workflow creation follows a structured, multi-phase dialogue:

#### **1. Describe your idea**

It is entry point of the workflow creation process. The user provides a high-level natural language description of what the workflow should accomplish. The agent parses this input to extract key signals: the workflow's purpose, expected inputs/outputs, and implied logic branches.

The agent does not require structured input or domain-specific syntax, it resolves ambiguity in subsequent phases. The quality and specificity of the initial description directly influences how many clarifying questions are generated in the next phase.

e.g., *"Create a customer support pipeline that routes incoming queries to specialized handlers based on category."*

After entering a **natural language query**, the **NLA chat widget** displays the response.

<figure><img src="/files/699TW2dwI3Yn7cuMIQkX" alt=""><figcaption></figcaption></figure>

#### **2. Provide Required inputs**

After parsing the intent, the agent identifies gaps in the specification, missing parameters, undefined conditions, or branching logic that cannot be inferred. It surfaces these as 1–4 targeted questions, prioritized by impact on workflow structure.

This phase is bounded intentionally: the agent avoids exhaustive questioning and makes reasonable assumptions where possible, flagging those assumptions explicitly. The goal is to reach a buildable specification with minimal back-and-forth.

The user needs to provide all required workflow details and clarify any missing or ambiguous information so the assistant can generate the workflow configuration accurately.

<figure><img src="/files/bFgUpLgDdtwNOGy6xX9K" alt=""><figcaption></figcaption></figure>

#### **3. Review Recipe Layout**

Once sufficient information is collected, the agent constructs a structural skeleton of the workflow on the canvas. This includes all nodes (e.g., AI nodes, conditional routers, input/output handlers) and their directed edges representing data flow.

The agent simultaneously presents a plain-language summary of this structure for the user to review  listing each node, its role, and how it connects to adjacent nodes. The user can request modifications before any prompts or models are configured. This acts as a checkpoint to catch structural errors early.

<figure><img src="/files/FGVaDKgiCWOZGNcoW8Rw" alt=""><figcaption></figcaption></figure>

After the user provides all required workflow details through the **NLA chat widget**, the platform generates the corresponding **recipe workflow**. The generated workflow is displayed in the **Recipe Builder canvas**, where users can review the workflow structure, validate the configured nodes, and make any required changes before saving or publishing the recipe.

<figure><img src="/files/jl53DSlZ7QyzNa0jKe3K" alt=""><figcaption></figcaption></figure>

#### **4. Prompt and Model Configuration**

With the structure approved, the agent moves to configuration. For each AI node, it selects a default LLM based on the node's function and the declared intent.

It then generates or assigns prompts for each node. Before creating new prompts, the agent queries the existing prompt library for semantic matches, if compatible prompts are found, it proposes reuse rather than duplication. The user can accept, override, or request edits to any prompt at this stage.

<figure><img src="/files/5VlkYWM7HWfoxZO7lPGu" alt=""><figcaption></figcaption></figure>

#### **5. Validation**

In this phase agent runs automated tests against each AI node using representative input samples. It evaluates outputs against expected behavior defined either by the user or inferred from the workflow intent.

If a node's output falls outside acceptable bounds, the agent enters a revision loop: it adjusts the prompt, re-runs the test, and presents the result. This continues until the node passes or the user manually overrides. The revision loop is bounded to prevent infinite cycling.

After the workflow is **published**, the recipe is updated with the generated **recipe name** and **recipe version**. Users can review these details in the **Recipe Builder** to confirm that the workflow has been successfully saved and versioned.

<figure><img src="/files/GRGRXKQvUozwrsSvnkL4" alt=""><figcaption></figcaption></figure>

#### **6. Deployment**

The is final phase. Once the user confirms the workflow is correct, they issue a publish instruction via the chat panel. The agent performs a pre-deployment validation pass, checking for disconnected nodes, missing configurations, or unresolved prompt slots then packages and deploys the workflow to the target environment.

After deployment, the agent confirms the **active deployment status** and provides the published workflow **endpoint** or **identifier**, based on the platform configuration.

Users can then create a **Copilot** and test the deployed workflow to verify that it functions as expected.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://karini-ai.gitbook.io/karini-ai-documentation/kai-natural-language-agent-builder.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
