# Building a AI agent

AI agents are all the rage these days, thanks to ChatGPT.&#x20;

ChatGPT has opened a new way of asking questions and getting answers – that are accurate, brief, and quick.

{% embed url="<https://youtu.be/GMSSzHn9wlU?si=XOAXusDfF9tf9Yba>" %}

Here are the steps to build your own AI agents:

## Step 1: Creating a bot

Next, we need to build a bot that will speak with the visitor and use this knowledge base to fetch the answers to questions asked.

Go to Bot Builder > Build a bot > Inbound > Web

<figure><img src="https://360969599-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsrMxU8nO3RjusUiYuXBB%2Fuploads%2F5pzfvf7IEY2NKf56ETuz%2FCleanShot%202025-07-26%20at%2011.42.57.png?alt=media&#x26;token=73f548d8-071b-40db-be9b-6d86c351abda" alt=""><figcaption></figcaption></figure>

## Step 2: Creating a AI agent block

Choose the "AI agent" block from the list and create a new AI agent from the right panel.

<figure><img src="https://360969599-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsrMxU8nO3RjusUiYuXBB%2Fuploads%2F7M4kXR3psfA5MwCNkTkz%2FCleanShot%202025-07-26%20at%2011.44.39.png?alt=media&#x26;token=a98e37a8-4d2a-48af-8e9b-cfedc9f577f7" alt=""><figcaption></figcaption></figure>

## Step 3: Setting up the AI agent

The fundamentals of an AI agents are — Prompt, Functions, Paths, LLM settings.

<figure><img src="https://360969599-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsrMxU8nO3RjusUiYuXBB%2Fuploads%2FU9UlUIRDBxNu3b1rgjJ0%2FCleanShot%202025-07-26%20at%2011.46.04.png?alt=media&#x26;token=cbff49e7-1ff4-4aa7-bb50-7b9fa9cae050" alt=""><figcaption></figcaption></figure>

### Prompt

A prompt guides the AI on how you want the answer to be generated. Write a clear and concise instruction. Or you can use the "Generate prompt" button to get it auto-generated for you.

[Learn more](https://help.wotnot.io/build/prompts)

### Functions

Function allow the AI agent to dynamically execute a function to provide contexual responses. For example, you can create function to "fetch order status", "cancel a order" etc which allow the conversation to feel more natural and powerful.

[Learn more](https://help.wotnot.io/build/functions)

### Paths

By default, the AI agent will run on a loop, answering any question it is asked. But if you want the AI agent to come outside of the execution loop, you can define paths.&#x20;

Each path consists of a name, and a description that lets the AI know when should it take this path.

Every path you create displays a path on the canvas.

### LLM settings

Depending on the scope of your project, you can choose the LLM model you prefer to use along with the max tokens used to provide a response and the temperature for the creativity in responses.

For each response the AI agent generates, a AI credit is consumed. Some models consume more credits while some less.

[Learn more about AI credits](https://help.wotnot.io/build/ai-credits)

## Step 4: Creating a knowledge base

Let's build a knowledge base, so the AI agent always refers to it when trying to generate an answer to a question.

* Enable the "Use data from knowledge base" on the right panel
* Create a Knowledge base&#x20;
* Start adding data sources

[Learn more about knowledge base](https://help.wotnot.io/build/knowledge-base)

<figure><img src="https://360969599-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsrMxU8nO3RjusUiYuXBB%2Fuploads%2FHWf7lbdeqHDMtafjmLNy%2FCleanShot%202025-07-26%20at%2011.54.08.png?alt=media&#x26;token=6b9777a7-84e7-497f-8144-62672d188591" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
**NOTE:**&#x20;

* More data sources, enable more accurate responses.
* Train your website for more context about your business.
* [Setup refresh frequency](https://help.wotnot.io/build/knowledge-base/refresh-frequency) for your website data sources, so that it is always up-to-date.
  {% endhint %}

## Step 5: Add your flow

Feel free to add more blocks if you have chosen to add paths in your AI agent.&#x20;
