Skip to main content
Now you put the analytic model from part 1 and the knowledge base from part 3 to work. You build an agent that answers business questions, then give it a weekly automation that posts a report to a Slack channel.

Before you start

  • You completed 3. Build a knowledge base.
  • To post to Slack, the agent needs Slack tools: a Slack MCP server credential in the vault the agent uses. With workspace defaults, that is the Default vault. See Vault and Tools to add it.

1. Create the agent

  1. Click Agents on the left navigation rail, then Create New.
  2. Enter an Agent name and a Description.
  3. Leave the Runtime fields — Vault, Tool bundle, Default model and Sandbox environment — at their defaults.
  4. Click Create & open builder.
The Agent Builder opens in three columns: Chats, Config and Versions on the left, the builder chat in the middle, and Sandbox files on the right.

2. Connect the model and the knowledge base

Open the Config tab on the left.
1

Connect the knowledge base

Under Knowledge bases, open Pick a context…, select the knowledge base from part 3, and click +. The agent can now read it, mounted read-only in its sandbox.
2

Connect the analytic model

Under Analytic models, open Pick models…, select the model from part 1, and click Connect model. Only published, materialized models can be connected.
3

Save

Click Save config. Connections apply from the agent’s next turn.
An attached knowledge base is read-only by default. To let the agent write back into it — its memory of what it learned — open the knowledge base’s Agents tab and set Access to Read & write or Read & write (ask first). See Use a knowledge base and Memory.

3. Write the agent’s instructions

In the builder chat, describe what the agent does. The builder writes the agent’s instructions and files in the sandbox; you can see them in Sandbox files.
Example prompt

4. Test it

Click Test run in the header. The Test run tab runs the unpublished draft, so you can check answers before anyone else sees the agent. Try questions that need both the model and the knowledge base:
Example questions
Refine the instructions in the builder chat until the answers are right. Click New run to test again.

5. Publish

Click Publish in the header. In Publish this agent, add Release notes (optional) and click Publish. Publishing saves a version and deploys the agent: the agent is enabled and appears in Chat. To ask it questions any time, click Chat on the navigation rail, choose the agent with Select an agent, and type your question.

6. Schedule the weekly report

1

Open Automations

Open the agent’s detail page — click Agent at the top left of the builder — and go to the Automations tab. Click New Automation.
2

Describe the job

Enter a Name, for example Weekly report. In What should it do?, describe the report and where to post it:
What should it do?
3

Add a weekly trigger

Under Triggers, click Add trigger and choose Scheduled. Set Frequency to Every week, pick the Day of week and Time, and set Time zone to your team’s time zone.
4

Save

Click Create.
5

Try it now

Click Run now on the automation’s row instead of waiting for the schedule. Check the Slack channel for the report.
The automation posts to Slack through the Slack tools in the agent’s vault, because the prompt asks for it. To chat with the agent inside Slack instead — mention it and get an answer in the thread — give it its own Slack bot on the Channels tab. See Channels.

What you built

  • A published agent that answers questions from the analytic model and the knowledge base.
  • A weekly automation that writes a report and posts it to Slack.
Learn more in Build agents, Triggers, Channels and Versions and logs.

Previous: Build a knowledge base

Turn the documents into a versioned knowledge base.

Next: Ship an app

Build a marimo dashboard and share it with your team.