Skip to content
This documentation covers kagent while it is in development and can describe unreleased features. For the current release, see the latest docs.

Build a personal AI assistant

Page as Markdown

Build an assistant that knows how you like to work, can check the weather, and sends you a plan for the day every morning.

Build a personal AI assistant

Build an assistant that knows how you like to work, can check the weather, and sends you a plan for the day every morning.

About this tutorial

Build an assistant of your own from start to finish in the kagent UI. You give it a personality, a weather tool so that it can do more than talk, and a morning routine that runs without you asking.

By the end, you have one agent, personal-assistant, that answers in your style, looks up the weather, and leaves a plan for your day in a conversation every morning. Under the hood, that agent is an inline AgentTemplate (its model, prompt, and tools) paired with the kagent-default Harness (where it runs). For how these pieces fit, see About agents and Core concepts.

Time: about 15 minutes.

Before you begin

If kagent already runs in your cluster, skip these steps.

  1. Install kubectl, helm 3, and kind v0.32.0 or later.

  2. Create a local kind cluster. To use a Kubernetes cluster that you already run, at version 1.37 or later, skip this step.

    kind create cluster --name kagent --image kindest/node:v1.37.0
  3. Set the API key of your model provider, then install the kagent CLI and run it. kagent install sets up the CRDs, Agent Substrate, a development PostgreSQL database, and kagent, and takes a few minutes.

    export OPENAI_API_KEY="your-api-key-here"
    curl -sL https://kagent.dev/install | bash && kagent install
  4. Check that the kagent pods run. Every pod reports Running.

    kubectl get pods -n kagent

The weather tool is a public server, so your cluster must be able to reach the internet.

Build the assistant

Build the agent step by step in the kagent UI, or apply the same resources as YAML and talk to the agent with the kagent CLI.

Open the kagent UI

kagent dashboard

The command forwards the UI to http://localhost:8082 and opens it in your browser. Leave it running while you work.

Create the assistant

Start with who the assistant is. Its system prompt is where you describe how it should behave.

The kagent UI creating an agent named personal-assistant with an inline template, then opening its chat page
Figure: Creating the personal assistant, sped up
  1. In the sidebar, click Agents, and then click New Agent.

  2. In the Name field, enter personal-assistant. Leave the Namespace as kagent, and leave Shared harness set to kagent-default.

  3. In the Template section, select Inline, and fill in the template.

    FieldValue
    Model configurationkagent/default-model-config
    DescriptionMy personal assistant
    System promptYou are my personal assistant. Be friendly and concise. Help me plan my day, draft messages, and answer questions.

    Make the prompt your own. Tell the assistant what you do, how long its answers should be, and anything that it should always or never do.

  4. Click Create agent, and then click Refresh until the status changes from Preparing to Ready.

  5. Click the agent name to open its chat page, and say hello. Ask it to draft a message or to plan a task.

Give it the weather

An assistant that can only talk cannot tell you whether to take an umbrella. Tools come from Model Context Protocol (MCP) servers, so register a weather server, and then hand its tool to the assistant.

Note

The weather server is a public demonstration server that the kagent project does not run. It can change or go away. When it has been idle, its first answer can take close to a minute, so these steps give it a 60-second connection timeout.

The kagent UI registering an MCP server named weather, expanding it to show the get_weather tool, then adding the server to the personal-assistant agent
Figure: Registering the weather server and adding it to the assistant, sped up
  1. In the sidebar, click MCP Servers, and then click New Server.

  2. Fill in the form, and then click Create server.

    FieldValue
    Nameweather
    Server URLmcp-weather-1cyg.onrender.com/mcp
    TLSHTTPS
    Connection timeout60s
  3. Click Refresh until the weather server shows 1 in the Tools column. Expand the row to see the tool, get_weather.

  4. In the sidebar, click Agents. In the row of the personal-assistant agent, click the edit icon.

  5. Under Tools from MCP servers, click Add an MCP server, and choose kagent/weather.

  6. Click Save agent, and wait until the agent returns to Ready.

  7. Open a New chat with the assistant, and ask What is the weather in Toronto right now?

Give it a morning routine

The assistant now answers when you ask. A schedule makes it start the conversation: every morning, it writes a plan for your day.

The kagent UI creating a daily schedule named morning-brief for the personal-assistant agent
Figure: Creating the morning schedule, sped up
  1. In the sidebar, click Schedules, and then click New Schedule.

  2. From the Agent list, choose kagent/personal-assistant, and enter morning-brief in the Name field.

  3. Set Time zone to your own, leave Repeat set to Daily, and set At time to when you start your day.

  4. In the Prompt field, enter what you want every morning, such as the following.

    Give me a short plan for today: three priorities and one reminder to take a break. Include the weather in Toronto.
  5. Leave Enable Schedule on, and click Create schedule.

  6. To see a brief now, click Run on the page of the schedule. Each run appears in the Execution history table, with a link to its conversation.

Verify the assistant

  1. Check that the agent is ready.

    kubectl get agent personal-assistant -n kagent

    Example output:

    NAME                 READY   AGE
    personal-assistant   True    5m
    
  2. Check that kagent accepted the weather server.

    kubectl get remotemcpserver weather -n kagent

    The ACCEPTED column shows True.

  3. In the kagent UI, click Schedules, open morning-brief, and check that the Execution history lists the run that you started, with a link to its conversation.

What you built

One agent with a prompt, a tool, and a schedule. Along the way, you used these features:

FeatureWhat you didRead more
Agents and inline templatesGave the agent its model and personality in one formAbout agents, System prompts
MCP toolsRegistered a remote MCP server and handed its tool to the agentAbout tools
Scheduled runsHad the agent start a conversation every morningScheduled runs

To take the assistant further:

IdeaHow
Give it more toolsRegister another MCP server, as in Add an MCP server, and add it to the assistant.
Make it ask before it actsTurn on approval for a tool, as in Human in the loop.
Share its voice with other agentsKeep its tone and rules in a prompt library.
Run it on another modelAdd a model, and choose it in the assistant’s edit form.

Clean up

Delete what this tutorial created.

  1. In the kagent UI, click Schedules, and delete morning-brief. If you created it with grpcurl, see Scheduled runs for the DeleteScheduledRun call.

  2. Delete the agent and the weather server.

    kubectl delete agent personal-assistant -n kagent
    kubectl delete remotemcpserver weather -n kagent

Next steps