Skip to main content
An agent is an LLM-powered worker that can reason about a request, choose tools, use memory, read files, and keep going until it has an answer or has completed the task. Use an agent when the path must vary at runtime: answering a support question, researching an issue, drafting a reply, or deciding which tool to call next. If the work follows a known sequence, prefer a workflow; it can still use an agent or promptLlm() for the steps that need judgment.

Example requests

Ask your coding agent to build an agent, the tools it should use, and where people should interact with it.
“Build a support agent that answers product questions from our docs, checks customer details, and drafts replies in our support tone.”
“Create an agent that watches for tagged Slack messages, investigates the topic, and replies with a sourced summary.”
“Build a data agent that can query our warehouse and answer questions from a #data Slack channel.”

How agents are defined

In Keystroke, agents live in your project code under src/agents/. Each file default-exports a defineAgent() definition, and the runtime discovers it when you run or deploy the project.

What agents can use

Agents are useful when a task needs judgment, language understanding, tool use, or multi-turn context. Agents are one of the main primitives in a project, alongside workflows, actions, and triggers. Actions are the usual way to give an agent reliable capabilities. Workflows are the usual way to orchestrate several deterministic steps around one or more agent calls.

How to run agents

You can use an agent from the CLI, API, a workflow, another agent, or an external gateway like Slack. You can also run an agent automatically by attaching a trigger (a schedule, webhook, or poll), and agents can even schedule their own runs with ephemeral triggers.
Open Agents in the web app to see the agents available in your active project. Open History and filter to Agent when you want to inspect sessions after they run.

Running deployed agents

Deploy your project, then prompt the agent against the deployed project:

Next steps

Build agents

Define agents with tools, models, skills, files, and runtime options.

Run agents

Prompt agents from the CLI and inspect sessions.

Triggers

Run agents on a schedule, webhook, or poll.

Agent runs

Review conversation history, tool calls, traces, and errors.