Building Cursor Composer: A Fast, Intelligent Agent-Based Coding Model with Reinforcement Learning

cursor · Tech · 2025 · source Agentic: yes · promotional bias: med · source-backed · extracted with prompt 0.5.5 (schema v2)

Generated from extraction.json — do not edit by hand. Every claim cites verbatim source evidence; stated means the quote directly asserts the claim, implied means it supports it indirectly.

Problem

Domain: Agentic coding model training and deployment

Cursor wanted a coding agent model that felt fast enough for interactive editor use while retaining frontier-level coding intelligence on realistic software-engineering work. The challenge was to train a production-like agent, not just a text model: it had to call tools, edit files, search codebases, run terminals, operate in real environments, and improve through reinforcement learning without diverging from the production Cursor agent experience.

Constraints:

Architecture

Composer is an agent-based coding LLM trained with reinforcement learning against Cursor-like production environments. A user query goes to the Cursor backend; the Composer agent emits tool-call XML patterns and selects from roughly 10 tools such as read file, edit file, codebase search, lint collection, and terminal execution. Training treats user queries as rollout starts, runs many Cursor instances in parallel, scores outcomes, and updates a large mixture-of-experts model. The infrastructure is split into a PyTorch trainer, a Ray-based inference server that orchestrates rollouts and manages advantages, and an environment server that spins up microVMs where files can change, commands can run, and linters can execute. Cursor reuses its Cloud Agents production VM infrastructure for RL, uses custom MXFP8 kernels for low-precision MoE training, and trains Composer against the same semantic-search model and tool structure used in production.

Diagram confidence: reconstructed (reconstructed from prose).

flowchart LR
  user-query[User query] --> cursor-backend[Cursor backend]
  cursor-backend --> composer-agent[Composer agent]
  composer-agent --> tool-space[Tool space]
  composer-agent --> training-data-queries[Training data queries]
  tool-space --> read-file-tool[Read file tool]
  tool-space --> edit-file-tool[Edit file tool]
  tool-space --> codebase-search-tool[Codebase search tool]
  tool-space --> lint-collection-tool[Lint collection tool]
  tool-space --> terminal-command-tool[Terminal command tool]
  codebase-search-tool --> embedding-search-model[Embedding search model]
  training-data-queries --> inference-server[Inference server]
  inference-server --> environment-server[Environment server]
  inference-server --> ray-controller[Ray controller]
  inference-server --> trainer[Trainer]
  environment-server --> microvm-environments[MicroVM environments]
  environment-server --> cloud-agents-infrastructure[Cloud Agents infrastructure]
  cloud-agents-infrastructure --> production-agent-server[Production agent server]
  trainer --> mxfp8-kernels[MXFP8 kernels]
  trainer --> mixture-of-experts-model[Mixture-of-experts model]
  mixture-of-experts-model --> inference-server
  internal-benchmark[Internal benchmark] --> composer-agent
Drag to pan · scroll or use +/− to zoom · reconstructed from the source's described component topology

Components

Component Role Interacts with
User query Developer request that starts both the production agent flow and the RL rollout flow. Cursor backend
Cursor backend Production request entry point that sends user queries to Composer. Composer agent
Composer agent Agent-based coding LLM that chooses serial or parallel tool calls and produces edits. Tool space, Training data queries
Tool space Combinatorial action space of production Cursor tools available to the agent. Read file tool, Edit file tool, Codebase search tool, Lint collection tool, Terminal command tool
Read file tool Tool for inspecting source files, summarized in the frontend during rollouts. —
Edit file tool Tool for applying code changes shown live in the Cursor editor. —
Codebase search tool Semantic and repository search capability used to find files relevant to a query. Embedding search model
Lint collection tool Tool that collects lint feedback during agent edits. —
Terminal command tool Tool for running commands in the coding environment. —
Training data queries Queries used as RL starting points by pretending they are production user requests. Inference server
Inference server Ray-based rollout orchestrator that calls tools, manages advantages, and balances work. Environment server, Ray controller, Trainer
Ray controller Single controller interface used to load-balance rollouts across threads and processes. —
Environment server Service that runs stateful development environments for rollout tool execution. MicroVM environments, Cloud Agents infrastructure
MicroVM environments Stateful mini Cursor environments where files can be changed, terminal commands run, and linters executed. —
Cloud Agents infrastructure Production VM infrastructure reused for RL training so train-time agents match product behavior. Production agent server
Production agent server Shared server that is identical for customer cloud agents and RL training. —
Trainer PyTorch training service that updates the MoE model from rollout advantages. MXFP8 kernels, Mixture-of-experts model
MXFP8 kernels Custom low-precision kernels for faster, higher-quality MoE training and efficient sampling. —
Mixture-of-experts model Large coding model trained through RL and shipped back to inference for rollouts. Inference server
Embedding search model Cursor-trained semantic search model used to index files and let Composer query codebases naturally. —
Internal benchmark Cursor repository benchmark measuring large-codebase work and adherence to codebase standards. Composer agent

Data flow

A user query enters the Cursor backend and is passed to Composer. Composer generates tokens, including XML-pattern tool calls, then selects serial or parallel tool actions across file reading, editing, codebase search, lint collection, and terminal execution. In production, those tool calls update the editor and show summarized reads, live edits, and terminal output. In RL training, the same query becomes a training-data prompt; the inference server runs many rollouts from that starting point, calls production-like tools against microVM-backed environments, collects tool results, scores rollout outputs, computes advantages, and returns them to the trainer. The PyTorch trainer updates the mixture-of-experts model, ships new weights back to inference, and repeats the rollout-check-update loop while internal benchmarks and user feedback measure whether the model is both intelligent and fast.

4 supporting quotes
“the user first submits a query to the cursor backend. The agent then reads that query and then it makes a series of tool calls.”transcript, stated
“The agent can call these tools in serial or in parallel if it thinks that we'll uh return good results. Now at a low level, this agent is still just a large language model. So all it's doing is generating tokens. You can think about some of these tokens as”transcript, stated
“we're going to take our training data and pretend it was just a user query that got sent to the model. that user query will be sent to the agent and the agent will call a series of tools to try to accomplish the goal. So here in rollout one, we say read a”transcript, stated
“The inference server is in charge of running the rollouts, calling the tools, and managing the advantages. The main challenge here is one I alluded to earlier. If you're naive about this process and just let the agent do its own thing, you get a issue with”transcript, stated

Why this architecture

Cursor optimized for the product experience of fast, intelligent agentic coding rather than isolated benchmark wins. That pushed the architecture toward production-like RL: the same tool formats, semantic-search model, and cloud-agent environment infrastructure used by real users also appear in training. The three-server split separates concerns: PyTorch training updates the MoE model, Ray inference handles rollout orchestration and straggler mitigation, and microVM environments provide stateful tool execution. Custom MXFP8 kernels reduce the cost of training and sampling enough to keep the rollout loop practical, while parallel tool calling targets end-to-end latency rather than token speed alone.

4 supporting quotes
“maintain the same efficiency. Our goal was twofold. We wanted to build a model that was both intelligent and also felt very fast. For intelligence, we weren't kind of targeting arbitrary benchmarks. We wanted to build a model that felt good to use for realistic coding work. We built an internal”transcript, stated
“we weren't kind of targeting arbitrary benchmarks. We wanted to build a model that felt good to use for realistic coding work.”transcript, stated
“tool calls to the environments and getting back the tool results. As I mentioned earlier, our goal was to train through the production cursor product. One thing that's really interesting about Cursor is that we're able to co-design both the product itself as well as our”transcript, stated
“these problems reflect challenges in scaling the machine learning part of the system. But the actual solutions to these challenges are all infrastructure um choices. And so I think for this audience I want to talk a bit about some of the infrastructure decisions we made that were uh the”transcript, stated

Models used: Composer · Cursor Tab · Cheetah prototype · Mixture-of-experts language model · Embedding search model

Scale

Alternatives considered (roads not taken)

Optimize for arbitrary public benchmarks.

Rejected because: Cursor chose an internal benchmark over its own repositories because day-to-day coding quality depends on large-codebase work and codebase-standard adherence.

“wanted to build a model that was both intelligent and also felt very fast. For intelligence, we weren't kind of targeting arbitrary benchmarks. We wanted to build a model that felt good to use for realistic coding work. We built an internal benchmark from our own”transcript, stated
“We built an internal benchmark from our own repositories that measured the model's ability to work with large code bases”transcript, stated

Train against mocked or simulated tool environments.

Rejected because: The team preferred the real production environment so Composer could learn exact tool formats, responses, and semantic-search behavior used by customers.

“We could kind of mock out uh all of these different structures or try to simulate how it would work. Um, but one really nice benefit is that we're able to introduce specific tools that we think will be very valuable to the agent. One of these is that we have”transcript, stated
“composer with exactly the same model and structure that we're actually going to use in production. And so we're able to train the model to be a power user of this tool. So finally, let me talk a little bit about what we've seen so far in the first week of”transcript, stated

Treat actions only as next-token generation.

Rejected because: For RL, Cursor modeled the action space as combinatorial tool calls, which better matches agent behavior and tool strategy.

“at a low level, this agent is still just a large language model. So all it's doing is generating tokens. You can think about some of these tokens as forming XML patterns which allow it to call tools as well as the arguments for these tools themselves. But”transcript, stated
“from an RL perspective, we can mostly think about acting in the combinatorial space of tool calls. When you look at the front end of cursor, what you're seeing in these rollouts is all of the different tool calls that go into making a change. For things like”transcript, stated

Run naive rollout orchestration without load balancing.

Rejected because: Agent rollouts can install libraries, execute unpredictable commands, and finish at different times, so Cursor used Ray and a single controller interface to manage stragglers.

“If you're naive about this process and just let the agent do its own thing, you get a issue with stragglers. This is because the rollouts may call terminal commands. They may install entire libraries. They can kind of do whatever they want. And so what”transcript, stated
“using Ray and using a single controller interface. This allows us to do load balancing across many different threads and processes”transcript, stated

Rely on post-training quantization for rollout sampling.

Rejected because: Low-precision MXFP8 training let the team train faster and sample efficiently without a separate post-training quantization step.

“it also allows us to run sampling efficiently without having to do any sort of post-training quantization. We do this by using a microscaling format known as MXFP8. The idea here is that we can work with FP8 precision but utilize an extra scaling factor that”transcript, stated
“us to run sampling efficiently without having to do any sort of post-training quantization. We do this by using a microscaling format known as MXFP8. The idea here is that we can work with FP8 precision but utilize an extra scaling factor that allows us to get better precision”transcript, stated

Patterns

tool-use-orchestration (architecture)

Composer treats coding as an agent tool-use problem, choosing among read, edit, search, lint, and terminal tools in serial or parallel rather than only generating code tokens.

“It gets to pick from a series of tools that get to change the user's code.”transcript, stated
“The agent can call these tools in serial or in parallel if it thinks that we'll uh return good results.”transcript, stated

eval-driven-development (evaluation)

Cursor built an internal benchmark from its own repositories to measure realistic coding ability, codebase-scale work, and adherence to repository standards.

“We built an internal benchmark from our own repositories that measured the model's ability to work with large code bases”transcript, stated
“These factors of intelligence are the things that really matter when you're doing day-to-day software engineering.”transcript, stated

latency-optimization (operations)

Cursor optimized both token generation and end-to-end editor latency through efficient model serving and parallel tool calls so developers could stay in flow.

“having the model be quick enough for interactive use makes it easier for developers to keep a chain of thought and remain in their flow.”transcript, stated
“take advantage of things like parallel tool calling in order to produce fast results.”transcript, stated

rag-retrieval (architecture)

Composer uses Cursor's semantic codebase search tool, backed by a custom embedding model and the same indexed-file structure users see in production.

“we have trained our own embedding model to do powerful semantic search.”transcript, stated
“we index all of your files and it allows the agent to make natural language queries to find files it might want to edit.”transcript, stated

observability-tracing (operations)

The team monitored RL infrastructure utilization and rollout behavior with dashboards, including dashboards built with Composer itself.

“this is a kind of dashboard that we uh kind of coded up with composer that uh tells us how uh uh kind of the the utilization of this backend looks.”transcript, stated
“different rollouts will produce different numbers of tool calls and they might take very different amounts of time.”transcript, stated

cost-aware-routing (operations)

Cursor reduced training and sampling cost through low-precision MXFP8 kernels and by avoiding post-training quantization before rollout inference.

“Low precision training speeds up our training process and it also allows us to run sampling efficiently without having to do any sort of post-training quantization.”transcript, stated
“FP8 precision but utilize an extra scaling factor that allows us to get better precision and higher quality training.”transcript, stated

Tradeoffs

Train through the production Cursor environment.

Chose Production-equivalent tool formats, responses, semantic search, and Cloud Agents VM infrastructure over Mocked or simulated training environments.

Rationale: The production environment made training harder and burstier, but it let Composer learn to be a power user of the exact tools it would use after release.

3 supporting quotes
“As I mentioned earlier, our goal was to train through the production cursor product. One thing that's really interesting about Cursor is that we're able to co-design both the product itself as well as our ML training.”transcript, stated
“We could kind of mock out uh all of these different structures or try to simulate how it would work.”transcript, stated
“And so we're able to train the model to be a power user of this tool. So finally, let me talk a little bit about what we've seen so far in the first week of Composer's release.”transcript, stated

Optimize for both intelligence and speed.

Chose A model that scored near frontier models while generating tokens four times more efficiently over Maximizing coding quality without preserving interactive latency.

Rationale: Cursor believed the product experience changed when users could receive edits in seconds and stay in flow instead of waiting on a slow agent.

3 supporting quotes
“Our goal was twofold. We wanted to build a model that was both intelligent and also felt very fast.”transcript, stated
“generates tokens efficiently, but also that it runs very quickly in your editor.”transcript, stated
“the kind of paro combination of speed and intelligence unlocks a different sort of coding.”transcript, stated

Model RL actions as tool-call strategies.

Chose A combinatorial tool-call action view over Only reasoning about next-token generation.

Rationale: Composer still generates tokens, but the useful behavior being trained is which tools to call, in what order, and whether to parallelize them.

3 supporting quotes
“So all it's doing is generating tokens. You can think about some of these tokens as forming XML patterns which allow it to call tools as well as the arguments for these tools themselves.”transcript, stated
“we can mostly think about acting in the combinatorial space of tool calls.”transcript, stated
“the model was able to call many more parallel tools and respond quicker to the user queries.”transcript, stated

Use custom low-precision kernels.

Chose MXFP8 custom kernels for MoE training and sampling efficiency over Standard higher-precision training plus post-training quantization.

Rationale: The custom kernels improved training speed and made it easier to ship updated weights to the inference server for rollouts.

3 supporting quotes
“developing a library of custom kernels that allow for low precision training.”transcript, stated
“allows us to run sampling efficiently without having to do any sort of post-training quantization.”transcript, stated
“So we found that for a mixture of experts layers, this gives us a 3.5 times speed up when using Blackwell chips. And uh we wrote a blog post that goes through all the fun details of making this work in practice.”transcript, stated

Use Ray controller-based rollout orchestration.

Chose Load-balanced rollout orchestration across many threads and processes over Letting each rollout run independently with no straggler control.

Rationale: Real agent rollouts perform unpredictable environment actions, so controlling stragglers was necessary to keep RL efficient.

3 supporting quotes
“And so what happens is if you run 10 rollouts, they might come back at varying different times. We were able to solve this issue by using Ray and using a single controller interface.”transcript, stated
“We were able to solve this issue by using Ray and using a single controller interface. This allows us to do load balancing across many different threads and processes and make this part of the process efficient.”transcript, stated
“This allows us to do load balancing across many different threads and processes and make this part of the process efficient. The inference server is going to spend a lot of time making these tool calls to the environments and getting back the tool results.”transcript, stated

Gotchas (what bit them)

Training and inference versions of the model must stay synchronized during RL.

Root cause: RL requires both a training version and a sampling version of a large distributed MoE model, doubling the coordination burden compared with pretraining or SFT.

Resolution: Cursor split responsibilities across trainer and inference server infrastructure and designed low-precision training so updated weights could be shipped efficiently for rollouts.

“it's doubly hard when you're doing RL because you have to have both a training version and a sampling version and they have to work in sync with each other.”transcript, stated
“Once we update the weights, we need to send them to the inference server.”transcript, stated

Realistic coding rollouts create severe straggler problems.

Root cause: Agents can install libraries, run arbitrary terminal commands, and take different numbers of tool calls, so parallel rollouts finish at very different times.

Resolution: Cursor used Ray with a single controller interface to load-balance work across threads and processes.

3 supporting quotes
“The main challenge here is one I alluded to earlier. If you're naive about this process and just let the agent do its own thing, you get a issue with stragglers.”transcript, stated
“This is because the rollouts may call terminal commands. They may install entire libraries. They can kind of do whatever they want.”transcript, stated
“This allows us to do load balancing across many different threads and processes and make this part of the process efficient.”transcript, stated

Production-like RL training creates bursty infrastructure load.

Root cause: Peak RL training spins up many more environments than normal product usage, creating burstiness in the same backend used by Cloud Agents.

Resolution: The team monitored backend utilization and adapted the production agent infrastructure to handle spiky training workloads.

3 supporting quotes
“the workload at our peak RL training is going to be much spikier than when running uh our our standard product.”transcript, stated
“you spin up tons of environments for training, you have this kind of burstiness that you have to make uh the product work well for.”transcript, stated
“Um and this is a kind of dashboard that we uh kind of coded up with composer that uh tells us how uh uh kind of the the utilization of this backend looks. Now, you might say, why is it worth spending all this time to actually use the real production environment?”transcript, stated

Early agent behavior made edits without enough evidence.

Root cause: Initial RL behavior optimized coding actions before the model learned to gather enough file and search context.

Resolution: As training progressed, the model learned to read more files and search more before editing.

“At the beginning, it was making ma many too many edits and making the edits without too much evidence.”transcript, stated
“As we train, the model read more files and did more search in order to find the right thing to edit and make the correct change.”transcript, stated

Mocked environments can train agents to use the wrong tool behavior.

Root cause: If RL training does not match production tool formats, responses, and semantic search behavior, the trained agent may not transfer cleanly to the product.

Resolution: Cursor reused the production Cloud Agents infrastructure and semantic-search model so the training environment matched production.

3 supporting quotes
“we want to use exactly the same tool format and tool responses as in the production product”transcript, stated
“We were able to use this same infrastructure in order to do our reinforcement learning training.”transcript, stated
“train composer with exactly the same model and structure that we're actually going to use in production.”transcript, stated

Evaluation

Cursor evaluated Composer with an internal benchmark drawn from its own repositories, rollout-performance curves over log-scale RL compute, direct product release feedback, and observed agent behavior such as whether training increased parallel tool calls and evidence-gathering before edits. The talk emphasizes product fit and realistic coding performance more than external benchmark maximization.

Metrics: Internal repository benchmark score · Comparison with frontier models · Comparison with prior-summer models · Comparison with open-source models and fast-branded coding models · Token generation efficiency · End-to-end editor response speed · Parallel tool-call frequency · Benchmark performance versus log-scale RL compute · User feedback after release · Agent behavior: files read and searches before edits

4 supporting quotes
“The composer model on our internal benchmark scores nearly as well as the best Frontier models”transcript, stated
“The x-axis of this graph is log scale amount of compute. So we're putting in a lot of compute into the RL process itself.”transcript, stated
“as we train performance on this benchmark increases at a regular rate.”transcript, stated
“Probably most importantly though is that users seem to like it. We released it a week ago and I think the kind of main uh feedback that we heard is that the kind of paro combination of speed and intelligence unlocks a different sort of coding.”transcript, stated

Outcomes

The talk reports about 10 production Cursor tools, 100,000 to 1 million tokens per modern rollout, hundreds of tool calls per rollout, training distributed across thousands of GPUs, a 3.5x MoE-layer speedup with MXFP8 on Blackwell chips, 10-rollout straggler examples, edits visible a second or two after the query in the demo, and first-week release feedback.

6 supporting quotes
“The composer model on our internal benchmark scores nearly as well as the best Frontier models and better than models released last summer.”transcript, stated
“At the same time, the model is four times more efficient at token generation than models of comparable intelligence.”transcript, stated
“The model starts around the same performance as the best open- source models in this area.”transcript, stated
“the model was able to call many more parallel tools and respond quicker to the user queries.”transcript, stated
“As we train, the model read more files and did more search in order to find the right thing to edit and make the correct change.”transcript, stated
“Much of my day-to-day work and many of the people on the team is now facilitated by the use of the same agents we're building.”transcript, stated