> For the complete documentation index, see [llms.txt](https://ruilabs.gitbook.io/airgent/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ruilabs.gitbook.io/airgent/agent/build-an-agent.md).

# Build an agent

## **Step 1: Navigate to Editor Page**

1. Open the [Agent Builder](https://air.gent/build?tab=agents).

<figure><img src="/files/A37QQNHZIXRDGLixjN1K" alt=""><figcaption><p>Agent Builder Page</p></figcaption></figure>

2. Click the **New** button and select **New Agent**.
3. You will redirected to our **Editor** page.

***

## **Step 2: Understanding the Agent Editor Page**

The Agent Editor is your workspace for building and customizing agents.

<figure><img src="/files/QLOgNvg7VlOp6zBbARRS" alt=""><figcaption><p>Agent Editor Page</p></figcaption></figure>

This section explains the key sections of the editor interface to help you get started.

### **1. Node Library (Left Panel)**

This is where all the available nodes are organized.

* **What It Does**:
  * Provides a categorized list of nodes, including basic, community, and custom nodes.
  * Allows you to drag and drop nodes into your workspace to begin building your agent.
* **How to Use**:
  * Browse through the categories (e.g., Basic, Tools, Control).
  * Click or drag a node to add it to your workflow.

### **2. Toolbar (Top Section)**

The toolbar provides essential tools for managing your agent.

* **What It Includes**:
  * **Home**: Back to homepage.
  * **Name**: Click to edit your agent name.
  * **Save**: Save your current workflow progress.
  * **Arrange**: Rearrange your nodes
  * **Import/Export**: Import an existing agent or export your agent design.
  * **Delete**: Remove the current workflow if needed.

### **3. Command Bar (Bottom Center)**

The Command Bar allows you to control the editor using natural language commands.

* **What It Does**:
  * Enables you to add nodes, connect them, or make adjustments by typing commands.
  * A powerful way to interact with the editor hands-free.
* **Example Commands**:
  * *“Add a node for HTTP input.”*
  * *“Connect Node A to Node B.”*
* **How to Use**:
  * Type your command and press Enter.

### **4. Message Box (Bottom Right)**

This is where you can send messages to your agent.

* **What It Does**:
  * Test your agent by sending input messages.
  * Evaluate how your agent responds based on the workflow you’ve created.
* **How to Use**:
  * Type a message and press Enter to simulate user interaction with your agent.

***

## **Step 3. Creating Your First Basic Agent**

The agent is setup as below:

<figure><img src="/files/SlNm6ebPvs8VJSTsbAZt" alt=""><figcaption><p>Basic agent setup</p></figcaption></figure>

In this section, we’ll walk through building a simple agent by connecting an **Input Node** and an **Output Node**. This basic setup will help you understand how nodes interact with each other.

{% stepper %}
{% step %}

### **Name and Save the Agent**

1. From the **Toolbar,** put in your agent name.
2. Click **Save** button.
   {% endstep %}

{% step %}

### **Add Nodes from the Node Library**

1. Open the **Node Library** on the left-hand side of the editor.
2. Expand the **Flow** section.
3. Drag and drop the following nodes onto the workspace:
   * **Input Node**: Handles input messages sent to the agent.
   * **Output Node**: Outputs the response from the agent.
     {% endstep %}

{% step %}

### **Understanding Node Properties**

Each node has its own properties (or “ports”) that can be connected to other nodes:

* **Input Node**:
  * **Exec**: The execution flow that triggers the next node.
  * **Message**: The input message that will flow through your agent.
  * **Thread ID** and **User ID**: Metadata for advanced use cases (ignore these for now).
* **Output Node**:
  * **Exec**: Accepts the execution flow from the previous node.
  * **Message**: Outputs the message that was processed by the agent.
    {% endstep %}

{% step %}

### **Link the Nodes**

1. Hover over the **Exec** property of the **Input Node**.
2. Click and drag a connection to the **Exec** property of the **Output Node**. This establishes the execution flow between the nodes.
3. Repeat the process for the **Message** property, connecting the **Input Node** to the **Output Node**.

*At this stage, you can ignore the **Thread ID** and **User ID** properties.*
{% endstep %}

{% step %}

### **Test Your Basic Agent**

1. Save your workflow using the **Save** button in the toolbar.
2. Use the **Message Box** at the bottom-right of the editor to test your agent:
   * Type a message and hit Enter.
   * The message will flow from the **Input Node** to the **Output Node** and return the same message as output.
     {% endstep %}
     {% endstepper %}

***

## **What’s Next?**

Congratulations! You’ve just created your first basic agent. This setup demonstrates how nodes interact through execution flow and message passing.

In the next sections, we’ll explore adding more complex nodes, and creating advanced workflows to expand your agent's capabilities.


---

# 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://ruilabs.gitbook.io/airgent/agent/build-an-agent.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.
