Skip to main content
An llmAgent pairs a system prompt with a tool set. You define what the agent knows and what it can do — the LLM figures out how to do it.

Basic example

import { guildTools, llmAgent } from "@guildai/agents-sdk"
import { gitHubTools } from "@guildai-services/guildai~github"

const systemPrompt = `
You are a code review assistant.

When given a pull request, retrieve the latest changes
using the GitHub tools and provide helpful feedback.
`

export default llmAgent({
  description: "Reviews pull requests and provides feedback.",
  tools: { ...gitHubTools, ...guildTools },
  systemPrompt,
})

Input and output

Every llmAgent uses the same fixed schemas:
// Input: the initial prompt with task details
type Input = { type: "text"; text: string }

// Output: the agent's final response
type Output = { type: "text"; text: string }

Execution modes

llmAgent supports two modes:
mode
'one-shot' | 'multi-turn'
default:"'one-shot'"
  • "one-shot" — The agent processes the input, returns a single response, then terminates.
  • "multi-turn" — The agent continues interacting with the user until it calls the __submit__ tool to signal task completion.
export default llmAgent({
  description: "An agent that can have back-and-forth conversations.",
  tools: {},
  systemPrompt:
    "Help users interactively. Continue asking questions until you have all the information you need.",
  mode: "multi-turn",
})

Tool recommendations

  • userInterfaceTools is included automatically — no need to add it.
  • Include guildTools if the agent uses tools that require authorization (e.g., GitHub access), so it can request credentials when needed.

Selecting specific tools

Use pick to include only the tools you need. See Selecting specific tools in the Tool sets reference.

Next steps

  • Coded agents — Build deterministic TypeScript agents.
  • Task object — Access platform services from inside an agent.
  • Tool sets — See all available tool sets.