Creating your first agent
In this guide, you'll learn how to create your first AI agent using the kagent dashboard.
Prerequisites
Before you being make sure you have a Kubernetes cluster with kagent installed. If you haven't done this yet, check out the installation guide or the quickstart guide.
We'll be working in the kagent dashboard, so use the kagent CLI to open the dashboard:
$ kagentkagent >> dashboard

Creating the agent
To start, click the "New Agent" button in the top right corner of the dashboard. The create agent form will appear.
We'll creating an agent that can use Kubernetes tools to interact with the cluster. Let's name it k8sagent. The agent description field is not used as part of the agent's functionality, but it's a good idea to add a description to help you remember what the agent does.
Set the following description:
This agent can interact with the Kubernetes API to get information about the cluster.
Together with tools, agent instructions are what agent uses to interact with the user. They play an important role in instructing and guiding the agent on how and when to use tools, how to interact with the user, and what to do in certain scenarios. Think of these instructions as if you'd be giving them to a colleague who's new to the job.
Let's set the following instructions for the agent:
You're a friendly and helpful agent that uses Kubernetes tools to answer users questions about the cluster.# Instructions- If user question is unclear, ask for clarification before running any tools- Always be helpful and friendly- If you don't know how to answer the question DO NOT make things uprespond with "Sorry, I don't know how to answer that" and ask the user to further clarify the question# Response format- ALWAYS format your response as Markdown- Your response will include a summary of actions you took and an explanation of the result
Note that the way you structure your instructions is up to you. You can add more details, or simplify them as needed. It's important to make sure the instructions are clear and easy to follow.
We'll leave the default model (GPT-4o) selected and move to the next step.
Adding tools
Tools are the other building block of the agent. They are the commands that the agent can run to interact with the environment. As LLMs don't have the ability to run commands, tools are the way to bridge the gap between the agent and the environment. Kagent provides a set of built-in tools that you can use to interact with Kubernetes, Istio, Prometheus and projects. You can also build your own tools!
For this agent, we'll add the following tools two tools - GetResources and GetAvailableAPIResources. The first tool will enable the agent to run kubectl get command and retrieve resources running in the cluster. The second tool will enable the agent to get a list of available API resources in the cluster.
Click the Add Tools button and search for GetResources and GetAvailableAPIResources - click on them to select them and then click the Save Selection to add them to the agent.

Last thing to do is to click the Create Agent button to create the agent.
Configuring tools
Certain tools will require additional configuration before they can be used by agents. To configure the individual tools, click the settings icon in the list of tools to open the configuration dialog.

Testing the agent
Once the agent is created, you'll be automatically redirected to the chat interface. You can ask the agent questions like "What pods are running in the cluster?" or "What are the available API resources?" and the agent will respond with the information.
Let's try asking the agent for the available API resources "Which API resources are available in my cluster?"
The agent will call the GetAvailableAPIResources
tool and then synthesize a response based on the result of that tool call.

Next Steps
- Learn more about Core Concepts
- Join our Community