Introducing the Agent SDK · Cursor

Software groups use brokers outlined as code to deal with recurring work throughout the event lifecycle. These brokers connect with the locations the place a staff works and act when related occasions happen, whether or not meaning reviewing a pull request, executing a compliance workflow, or investigating an incident.
The most helpful brokers are tailor-made to how a selected staff operates. Until now, constructing one has usually meant adopting a product designed round another person’s workflow or ranging from scratch.
Today, we’re releasing the Agent SDK, the framework we use to construct our personal managed brokers like Bugbot, Security Reviewer, and Rollouts. Agent SDK lets you outline brokers in code and handle them like every other software program mission. Start from a template or level your coding agent at our docs. When the agent is prepared, agent-sdk deploy it to Cursor roads with one command.
Build round your workflow
The Agent SDK helps you to shortly construct and deploy brokers that work the way in which your staff does. They reply to the occasions your staff already handles and comply with insurance policies your staff can examine and alter.
Code evaluate is one instance. Each staff has its personal requirements for what requires consideration and who ought to evaluate it. With the Agent SDK, you’ll be able to construct an agent that responds to drag request occasions from GitHub, GitLab, or Bitbucket. The agent can assess the chance of a change, route it to the precise staff, and approve modifications that meet your coverage.
As an instance, a staff inside Cursor had constructed a big, fast-growing information base of classes discovered and wished each pull request checked towards it. This approach, the staff’s previous choices would maintain even because the codebase modified. With the Agent SDK, they constructed kb-reviewer in a few day. It now runs on each PR of their most important codebase, flags modifications that contradict a recorded lesson, cites the be aware behind every discovering, and encourages engineers to reconcile the discrepancies it experiences.
For extra difficult work, brokers can hand a activity to a different specialised agent with its personal instruments and periods. They may divide a job amongst subagents working in parallel.
The Agent SDK additionally helps evals and occasion replay out of the field, permitting for fast improvement with assurances that important workflows execute the way in which you anticipate. The PGA Tour makes use of the Agent SDK to energy their software program improvement manufacturing unit. Evals hold them shifting shortly.
The Agent SDK has enabled PGA to construct each part of our software program manufacturing unit on Cursor’s roads. It supplies the flexibleness we have to construct brokers that drive our improvement course of. And built-in help for evals permits us to shortly iterate on new concepts and optimize current capabilities reliably.
Michael Gyarmathy
Principal Engineer, PGA America
Define all the pieces in code
An Agent SDK agent is organized like a small software program mission. The directions that information it sit alongside code for its instruments, connections to exterior companies, and the evals used to check it.
Each file represents one thing the agent is aware of or can do. Prompts are written in Markdown, whereas instruments are outlined as TypeScript features. Because all the pieces is code, modifications can undergo the identical model management and evaluate course of as the remainder of your software program.
Deploy brokers wherever you want them
When you are able to put an agent into use, you’ll be able to deploy it to Cursor by operating agent-sdk deploy from the mission listing. The command builds the agent, provides it a URL, and begins it on our roads. You can handle secrets and techniques and integrations from the dashboard, whereas persevering with to make use of the identical logs, evals, and playground obtainable domestically.
You may run the agent by yourself roads. Each agent runs as a single Node course of that may be packaged in a container.
Get began
Getting began with the Agent SDK appears very like beginning every other software program mission. Create a mission listing, then launch the native playground:
import { homedir } from "node:os";
import { be a part of } from "node:path";
import { outlineAgent } from "@cursor/agent-sdk";
export default outlineAgent({
identify: "Robo",
mannequin: {
id: "composer-2.5",
params: [
{ id: "effort", value: "high" },
{ id: "fast", value: "true" },
],
},
native: {
cwd: be a part of(homedir(), ".cache", "manufacturing unit", "robo"),
},
})
From there, you’ll be able to iterate domestically and run evals earlier than deploying with agent-sdk deploy.
The Agent SDK additionally ships with expertise that information coding brokers via the event course of. You can level an agent on the docs and have it assist construct the bot with you.
The Agent SDK is mostly obtainable in the present day. Read the docs and get began.
