# Agent SDK documentation

> Build and serve bots and agents from versioned Markdown and TypeScript.

## Overview

- [Agent SDK](/docs/index.md): Build, test, and deploy bots and agents as code with the Agent SDK.

## Getting started

- [Build with a coding agent](/docs/building-with-agents.md): Delegate Agent SDK creation, capability work, verification, and measured improvement to a coding agent.
- [Changelog](/docs/changelog.md): Changelog for @grok/agent-sdk releases.
- [Deployment](/docs/deployment.md): Deploy an Agent SDK project from Git with Cursor-managed hosting, or run one secure process on your own infrastructure.
- [Evals](/docs/evals.md): Measure and Improve agent behavior with Evals
- [Hillclimbing](/docs/hillclimbing.md): Iteratively improve agent behavior with evals
- [Build a PR reviewer](/docs/quickstart.md): Create an Agent SDK bot or agent that reviews pull requests by complexity, approves safe changes, and handles GitHub webhook events.
- [Fix common agent problems](/docs/troubleshooting.md): Match the symptom to one corrective action, then inspect the session trace when the first fix is not enough.

## Templates

- [Review pull requests with owners policies](/docs/templates/agentic-owners.md): Scaffold the agent, commit .agentic-owners policies, and let it risk-tier PRs, request the owners, and approve what the policy allows.
- [Review and triage templates](/docs/templates/reviews.md): Scaffold a pull request reviewer or an issue triager, try it locally, and deploy it.

## Guides

- [Peer agents](/docs/guides/agent-to-agent.md): Let one Agent SDK agent consult an independent specialist, continue its session, or call its deterministic tools.
- [Bitbucket](/docs/guides/bitbucket.md): Review pull requests, answer comments, and triage pushes on Bitbucket Cloud or Data Center.
- [Cursor cloud agents](/docs/guides/cloud-agents.md): Let an Agent SDK agent hand coding work to Cursor cloud agents and steer them: mount the extension and pick the repositories it may touch.
- [Convert a Cursor Automation](/docs/guides/convert-automation.md): Turn a dashboard Automation into an Agent SDK project, then reconnect its actions and triggers.
- [GitHub](/docs/guides/github.md): Let your agent read pull requests and CI, then write back reviews, comments, and checks.
- [GitLab](/docs/guides/gitlab.md): Review merge requests, answer notes, and triage failed pipelines on GitLab.com or self-managed GitLab.
- [Self-improvement](/docs/guides/improve.md): Let an agent propose a change to its own source through a branch and pull request, with review and deployment kept separate.
- [Jev](/docs/guides/jev.md): Use typed Jev decisions to filter findings, route pull requests, and gate review actions.
- [Host MCP OAuth](/docs/guides/mcp-oauth.md): Authorize a private MCP server locally, constrain its tools, and choose where its credentials live.
- [Migrate an early-alpha project](/docs/guides/migrate.md): Move a hosted Agent SDK architecture v1 project to v2 through a reviewed pull request.
- [OpenTelemetry](/docs/guides/opentelemetry.md): Export traces, metrics, and logs to an OTLP collector and tag them per turn.
- [PagerDuty](/docs/guides/pagerduty.md): Respond to PagerDuty incidents by investigating a page, following it through acknowledgement and resolution, and ignoring your own actions.
- [Slack](/docs/guides/slack.md): Wake your agent from mentions, DMs, and watched posts, then reply in the thread.
- [Webhooks & custom channels](/docs/guides/webhooks.md): Receive provider events, keep one conversation per domain object, and deliver agent replies back out.

## Reference

- [Access](/docs/reference/access.md): Who can view, deploy, and manage a deployed bot.
- [Agent config](/docs/reference/agent-config.md): defineAgent at bot/agent.ts: the model, local workspace, and programmatic serving.
- [Artifacts](/docs/reference/artifacts.md): Declare, tag, list, stream, and download durable agent outputs.
- [Channels](/docs/reference/channels.md): Define custom channel routes, schemas, state, events, and authentication.
- [CLI](/docs/reference/cli.md): Look up Agent SDK commands, targets, flags, outputs, and exit status.
- [MCP connections](/docs/reference/connections.md): Pull in tools from MCP servers: remote, stdio, the signed-in Cursor account's connectors, and peer agents.
- [Evals](/docs/reference/evals.md): Define eval cases, drive turns, assert trajectories, and interpret results.
- [Extensions](/docs/reference/extensions.md): Mount a namespaced package of tools, skills, connections, and other agent capabilities, then inspect or override what it adds.
- [Hooks](/docs/reference/hooks.md): Run code after session events for audit logs, metrics, and transcript mirrors.
- [HTTP API](/docs/reference/http-api.md): Public session, discovery, and channel routes callers use.
- [Instructions](/docs/reference/instructions.md): The always-on system prompt: authoring forms, how a local turn and a turn in the cloud receive it, and what makes instructions hold up.
- [Limits](/docs/reference/limits.md): How many deployments and deploys a team can have on Cursor-managed hosting, and the error a deploy returns at the cap.
- [Memory](/docs/reference/memory.md): Journal every turn so later sessions can read what earlier ones did.
- [Playground](/docs/reference/playground.md): The built-in web UI: chat with streaming, Try buttons and slash commands, session replay, and dev-mode dispatch.
- [Project layout](/docs/reference/project-layout.md): The canonical bot/ folder layout and its path-derived naming rules.
- [Schedules & reminders](/docs/reference/schedules.md): Cron-driven runs defined at deploy time, and per-session durable wakes created at runtime.
- [Sessions, events, and streaming](/docs/reference/sessions.md): Understand how conversations continue, how events stream, and where session data lives.
- [Skills](/docs/reference/skills.md): On-demand procedures the model loads only when relevant, in three authoring forms.
- [Subagents](/docs/reference/subagents.md): Specialist child agents the model delegates to mid-turn, each its own directory under bot/subagents/.
- [Tools](/docs/reference/tools.md): Define typed actions the model can call, control their dry-run effects, and call any server tool without a model turn.
