Build an agent
Create a personal assistant agent in the kagent UI, then make its behavior reusable with a shared template.
About this tutorial
Build your first agent in the kagent UI: a personal assistant that you create from one form. Then turn its behavior into a shared template that other agents can reuse.
An agent has two halves. A template describes what the agent does: its model, its system prompt, and its tools. A harness describes where and how the agent runs. kagent install creates a kagent-default harness for you, so the first agent needs only the template half.
For how templates, harnesses, and agents fit together, see About agents. To build the same kind of agent from YAML and the CLI instead, see Your first agent.
Time: about 10 minutes.
Before you begin
Build the agent
Follow the steps in the kagent UI, or apply the same resources as YAML from the command line.
Open the kagent UI
kagent dashboardThe command forwards the UI to http://localhost:8082 and opens it in your browser. Leave it running while you work.
Create a personal assistant

In the sidebar, click Agents, and then click New Agent.
In the Name field, enter
personal-assistant. Leave the Namespace askagent.In the Harness section, leave Shared harness set to
kagent-default.In the Template section, select Inline. An inline template belongs to this agent only, which is the shortest path to a working agent.
Fill in the template.
Field Value Model configuration kagent/default-model-config, the model that the installation set up from your API key.Description My personal assistantSystem prompt You are my personal assistant. Be friendly and concise. Help me plan my day, draft messages, and answer questions.Leave the other fields as they are. You add tools in Add an MCP server.
Click Create agent. The UI returns to the Agents list, where the agent shows the Preparing status while kagent builds a snapshot of its runtime.
Click Refresh until the status changes to Ready. This step usually takes less than a minute.
Click the agent name,
personal-assistant, to open its chat page. Enter a message, such asWhat can you help me with?, and click Send. Each chat that you start is a Session with the agent.
Make the behavior reusable
The personal assistant keeps its behavior inline, so no other agent can use it. A shared template holds the same settings as an object of its own. Every agent that references the template gets its model, prompt, and tools, and a change to the template reaches all of them.

On the Agents page, click New Template.
Fill in the template, and then click Create template.
Field Value Name assistant-templateModel configuration kagent/default-model-configDescription A friendly, concise assistantSystem prompt You are a personal assistant. Be friendly and concise. Help plan the day, draft messages, and answer questions.The template is listed on the Templates tab of the Agents page.
Click New Agent, and enter
team-assistantin the Name field.In the Template section, leave Reference selected, and choose
assistant-templatefrom the Shared template list.Click Create agent, and then click Refresh until the agent is Ready.
The Agents list now shows both agents. The Template column reads Inline for personal-assistant and assistant-template for team-assistant.
Harnesses
Both agents run on the kagent-default harness. A harness sets the runtime that compiles and runs a template, the image, and the worker pool that the agent’s sessions are scheduled on. kagent install also creates the codex-default and claude-default harnesses, which run a template on those runtimes.
To create a harness of your own, click New Harness on the Agents page. For the options, see Agent harness.
Verify the agents
Check that both agents are ready.
kubectl get agent personal-assistant team-assistant -n kagentExample output:
NAME READY AGE personal-assistant True 2m team-assistant True 2mCheck that the shared template exists.
kubectl get agenttemplate assistant-template -n kagentIn the kagent UI, click the name of each agent, and send it a message. Both answer in the same friendly, concise style.
What you built
Two agents: one that keeps its behavior inline, and one that takes it from a shared template. Along the way, you used these features:
| Feature | What you did | Read more |
|---|---|---|
| Agents and inline templates | Created an agent whose model and prompt live in the Agent itself | About agents |
| Shared AgentTemplates | Moved the behavior into a template that several agents reference | Core concepts |
| Harnesses | Ran both agents on the kagent-default harness | Agent harness |
Clean up
The next tutorials, such as Add an MCP server and Schedule an agent, reuse the personal-assistant agent. Keep it if you go on to them.
Delete the agent that references the template, and then the template.
kubectl delete agent team-assistant -n kagent kubectl delete agenttemplate assistant-template -n kagentOptional: Delete the personal assistant.
kubectl delete agent personal-assistant -n kagent