> For the complete documentation index, see [llms.txt](https://docs.stackai.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.stackai.com/guides-and-quickstarts/agent-builder-and-skills/build-your-first-ai-agent.md).

# Build your first AI agent

Build an AI agent to answer requests using your instructions, knowledge sources, and tools. Agent Builder brings these settings together so you can configure the agent without arranging workflow nodes.

{% embed url="<https://files.gitbook.com/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSQ1Sgy933krTyK0S4JpP%2Fuploads%2FnWOHqvGeEyVOFxjZpDFk%2FG011.mp4?alt=media&token=97c8a8ab-b5a9-4cca-a7df-5c5a8024f484>" %}

## Before you start

You need access to the correct organization and permission to create a project. For the first request, use text you can paste into the conversation; you do not need to connect an external app or upload documents yet. If you cannot create a project or select a model, ask your organization administrator to check your access.

## Create the agent

In Projects, select **New Project**. Under **Quick Start**, select **Create New Agent**. Enter a project name.

![New agent creation controls](https://content.gitbook.com/content/SQ1Sgy933krTyK0S4JpP/blobs/cyq54j2Xo4gAC9gf92QY/assets/g011-g011-01-create-agent.png)

## Describe its purpose

Set the agent’s **Name** and **Description**. These help users understand what it can do.

![Agent Name and Description](https://content.gitbook.com/content/SQ1Sgy933krTyK0S4JpP/blobs/7eQEMWj3vJvhOgAlchX0/assets/g011-g011-02-identity.png)

## Choose a model and write instructions

Select an **AI Provider** and **AI Model** available to your organization. For a first text-only task, choose a model your organization has approved for the information you will submit. The available choices depend on your workspace; if you are unsure which account or model to use, ask your administrator.

In **Instructions**, describe the task, the information the agent should use, and the response you need. You can start with this reusable instruction template:

```
Summarize the text the user provides in three short bullet points.
Use only facts in that text. Preserve names, dates, amounts, and qualifications.
If the request needs information that is missing, say what is missing.
Do not invent facts or claim to have searched a source that is not connected.
```

Replace the summary task and format when you adapt the agent to your work. Knowledge sources supply organizational documents; tools perform operations such as searching another application. Instructions alone do not connect either one.

![AI model selection and agent instructions](https://content.gitbook.com/content/SQ1Sgy933krTyK0S4JpP/blobs/VaRv5LCAUjMSVtTvoIe9/assets/g011-g011-03-instructions.png)

## Help users start a conversation

Add **Conversation starters** for common requests. Set **Input Placeholder** to guide users who write their own request.

![Conversation starters and Input Placeholder](https://content.gitbook.com/content/SQ1Sgy933krTyK0S4JpP/blobs/Uw8boq8w7z7o2XdfFd7T/assets/g011-g011-04-starter.png)

## Review the responses

Open **Draft Preview** and paste a short paragraph that contains at least three facts you can check. Ask the agent to summarize it. With the instruction template above, a successful response has three short bullet points, retains the important facts, and introduces no unsupported detail.

Change one fact in the paragraph and submit it again. The new response should reflect the changed input. If it does not, check your instructions and the request you actually sent.

![Agent response in Draft Preview](https://content.gitbook.com/content/SQ1Sgy933krTyK0S4JpP/blobs/Nh2t5cFEpSGBmq4j1h71/assets/g011-g011-05-preview-result.png)

Also ask a question the agent cannot answer from its available information. If it invents details, revise the instructions to explain how it should handle missing information.

![Response to a question outside the available information](https://content.gitbook.com/content/SQ1Sgy933krTyK0S4JpP/blobs/ay1djEjpfj4NELschfzW/assets/g011-g011-06-unknown-fact.png)

## Important behavior

Add knowledge sources for organizational information and tools for operations in other systems.

Agent Builder saves draft edits automatically. Check its save status before leaving; if it reports unsaved changes, keep the page open and resolve the save issue. A saved draft is not a published agent. Configure access and use **Publish Agent** when it is ready for users.

## Continue building

* For answers based on your documents, [add a knowledge base](/guides-and-quickstarts/agent-builder-and-skills/ground-an-agent-using-a-knowledge-base.md).
* To find information or change records in another application, [give the agent tools](/guides-and-quickstarts/agent-builder-and-skills/give-an-agent-tools.md).
* Before users can access it, [configure appearance and security](/guides-and-quickstarts/agent-builder-and-skills/agent-appearance-and-security.md) and follow that guide’s **Publish and share the agent** steps. Check the published interface as an intended user, not only in Draft Preview.


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.stackai.com/guides-and-quickstarts/agent-builder-and-skills/build-your-first-ai-agent.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
