Building a Next-Generation AI-Powered Code Editor

cursor · Tech · 2023 · source Agentic: no · promotional bias: low · source-backed · extracted with prompt 0.5.4 (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: AI-native software development tools

Cursor wanted to build a code editor whose interface and model stack evolved with rapidly improving language models, rather than merely swapping stronger models into a static autocomplete experience.

Constraints:

Architecture

Cursor built an AI-powered IDE around a hybrid model strategy: frontier model APIs such as Sonnet and reasoning models handle high-level reasoning, while about 10 served custom models handle low-latency and proprietary-data-sensitive features such as Cursor Tab, next-edit prediction, autocomplete, and codebase embeddings. The product loop relies on owning the IDE interface, shipping useful experiments early, collecting real user edit data, and training models on what happens between commits.

Diagram confidence: reconstructed (reconstructed from prose).

flowchart LR
  cursor-ide[Cursor IDE] --> frontier-model-apis[Frontier model APIs]
  cursor-ide --> custom-model-serving[Custom model serving]
  custom-model-serving --> cursor-tab[Cursor Tab]
  custom-model-serving --> codebase-indexing[Codebase indexing]
  cursor-ide --> user-edit-data[User edit data]
  user-edit-data --> custom-model-serving
  cursor-ide --> experimentation-loop[Experimentation loop]
  experimentation-loop --> user-edit-data
  frontier-model-apis --> cursor-ide
  codebase-indexing --> cursor-ide
  cursor-tab --> cursor-ide
Drag to pan · scroll or use +/− to zoom · reconstructed from the source's described component topology

Components

Component Role Interacts with
Cursor IDE Owned editor interface where AI coding features, UX experiments, and codebase context live. Frontier model APIs, Custom model serving, Codebase indexing, User edit data, Experimentation loop
Frontier model APIs External high-capability models such as Sonnet, o-series models, and DeepSeek R1 for reasoning-heavy work. Cursor IDE, Custom model serving
Custom model serving Cursor-trained production models for low-latency and distribution-specific tasks. Cursor IDE, User edit data, Codebase indexing
Cursor Tab Next-edit prediction and autocomplete feature that evolved from Copilot++ after failed prompted-model attempts. Cursor IDE, Custom model serving
Codebase indexing Embedding-backed codebase understanding that lets users ask questions about an entire codebase. Cursor IDE, Custom model serving
User edit data Proprietary signal about edits between commits used to train next-edit models. Cursor IDE, Custom model serving, Experimentation loop
Experimentation loop Ship, observe, improve, or cut features based on usefulness to the team and user reaction. Cursor IDE, User edit data

Data flow

Developers work inside Cursor's IDE. The product captures codebase context, user edit behavior, and feature usage. Frontier models are called for reasoning-heavy tasks, while custom models trained on Cursor-specific data power next-edit/autocomplete and embedding-based codebase understanding. Product experiments are shipped once useful to the team, observed in real use, and either improved, cut, or folded into the core editor experience.

4 supporting quotes
“going back we use custom models for mainly low lat latency things. Um so areas where you need much lower latency um and lower costs than what the labs can provide. Areas where we have a lot of data that is maybe out of”transcript, stated
“looking to pre-train these models is you have all this data on GitHub but you don't have what happens between the commits. And that we found to be a really excellent source of data. Um and then things are not really that interested in improving like we can train much better embedding models uh”transcript, stated
“give or take. Yeah. And you know with these users we now had um some data and we could use this to train models to predict your next edit. Um, and that's like one example of we we tried there were two other attempts in the past where we tried to get this to work and it just completely failed. And”transcript, stated
“work? Yeah, we I think we've biased towards releasing as soon as something shows signs of usefulness to the team. Got it. Let's now um um go to the team building, right? So, when did you add your first non- co-founder for co-founders like the fifth team member or the first non-”transcript, implied

Why this architecture

Cursor chose a hybrid architecture because model choice depends on product constraints. API-based frontier models are the best tool for many reasoning tasks, but low-latency editor interactions and between-commit edit behavior benefit from custom models trained on Cursor's own usage data. Owning the IDE gave the team the UX surface needed to turn those model capabilities into product features.

4 supporting quotes
“we try to use the best tool for the job. And a lot of the time that's going to be just calling an API. But as you have a large as you build a large enough team, you build enough expertise, you have enough kind of data that you can use to improve these models. Um we've started”transcript, stated
“as you build a large enough team, you build enough expertise, you have enough kind of data that you can use to improve these models.”transcript, stated
“areas where you need much lower latency um and lower costs than what the labs can provide. Areas where we have a lot of data that is maybe out of distribution of like what these labs kind of get in pre-training and next edit prediction is a great example of that.”transcript, stated
“think we had this thesis um that you needed to own the interface, you need to own the ID and that gave us this edge compared to you know there are tens of other really really wellunded startups and like GitHub copilot that existed but focusing on the UX to start”transcript, stated

Models used: Claude Sonnet · o1 · o3 · DeepSeek R1 · custom Cursor models · custom embedding models

Scale

Alternatives considered (roads not taken)

Swap stronger models into a static Copilot-style autocomplete experience

Rejected because: Cursor believed better models required reimagining the software-building interface, not only improving ghost text.

“the only thing that had changed is they swapped out a new model that OpenAI gave them. it was the same exact thing otherwise”transcript, stated
“Um, and it just didn't seem like the future of coding was going to be better ghost text, better autocomplete. If language models were really going to get good enough that they were going to produce 90 95% of software, our thesis is that you had to reimagine the interface by which”transcript, stated

Spend heavily on GPUs before product-market fit

Rejected because: Cursor's strategy was pragmatic model choice, using APIs when appropriate and training custom models only where data and latency justified it.

“companies in maybe 2023 and 2024 raised a lot of money and spent it all in GPUs before product market fit. And I don't think that is the right move. Um I think we try to use the best tool for the job.”transcript, stated
“before product market fit. And I don't think that is the right move. Um I think we try to use the best tool for the job. And a lot of the time that's going to be just calling an API. But as you have a large as you build a large enough team, you build enough expertise, you have”transcript, stated

Use prompted models for Copilot++/next-edit prediction

Rejected because: Prompted attempts failed until Cursor had enough user data to train custom next-edit models.

“Copilot++ does your edits. Um, and we experimented with this like over the summer using prompted models completely failed. And the thing that made it work was around January of 2024, we now had enough users that we had some user data and we can How many users did you have”transcript, stated
“give or take. Yeah. And you know with these users we now had um some data and we could use this to train models to predict your next edit. Um, and that's like one example of we we tried there were two other attempts in the past where we tried to get this to work and it just completely failed. And”transcript, stated

Focus narrowly on tests or bug detection

Rejected because: During slow growth, the team considered narrowing scope but continued building the broader editor because they were users of the product and found core features that worked.

“maybe we should be focusing more narrowly on, you know, some particular use case like tests or bug detection, things like that.”transcript, stated
“Um, but the really magical thing about this product was that we were users of it. So, we could iterate incredibly quickly and we tried all these different things that summer and then we found this kind of core set of features that really really worked incredibly well.”transcript, stated

Patterns

model-routing (model-architecture)

Cursor routes work between frontier models for reasoning and custom models for low-latency or proprietary-data-sensitive editor features.

“on the frontier we mainly stick to I think sonnet is the main one”transcript, stated
“we use custom models for mainly low lat latency things.”transcript, stated

latency-optimization (serving)

Cursor trains custom models for editor features where low latency and lower costs matter more than maximum frontier-model capability.

“areas where you need much lower latency um and lower costs than what the labs can provide.”transcript, stated
“this is what we do for tab cursor tab like the kind of next edit prediction autocomplete.”transcript, stated

data-quality-loop (training-data)

Cursor uses real user edit behavior, especially what happens between commits, as a training signal unavailable in ordinary GitHub pretraining data.

“you have all this data on GitHub but you don't have what happens between the commits.”transcript, stated
“with these users we now had um some data and we could use this to train models to predict your next edit.”transcript, stated

rag-retrieval (codebase-context)

Cursor uses codebase indexing and custom embedding models so users can ask questions about a whole codebase and retrieve relevant code context.

“the other was codebase indexing where you can ask questions about your whole codebase.”transcript, stated
“we can train much better embedding models”transcript, stated

Tradeoffs

Use APIs and custom models pragmatically

Chose Frontier APIs for many tasks plus custom models where they had data and latency advantages over Owning all model infrastructure from the beginning.

Rationale: Cursor saw API calls as often the best tool, while custom models became worthwhile once the team had usage data and specialized latency needs.

“we try to use the best tool for the job. And a lot of the time that's going to be just calling an API.”transcript, stated
“we've started to find that uh building custom models um is more and more impactful.”transcript, stated

Own the editor interface

Chose A full IDE product over A narrower developer tool or model-only layer.

Rationale: Cursor believed owning the interface gave it an edge in translating model improvements into useful coding workflows.

“we thought you needed to own the ID and I think that's proven to be um I think it's proven to be the correct choice.”transcript, stated
“focusing on the UX to start out with gave us that edge I think.”transcript, stated

Train custom models on proprietary edit data

Chose Between-commit user edit data over Relying only on GitHub code snapshots from pretraining.

Rationale: The next-edit task depends on how programmers change code, not only final committed code states.

“you have all this data on GitHub but you don't have what happens between the commits.”transcript, stated
“that we found to be a really excellent source of data.”transcript, stated

Keep broad AI-editor ambition during slow growth

Chose Continue iterating on the general-purpose coding IDE over Narrowing to tests, bug detection, or another specialized use case.

Rationale: The team was its own user base and found core features that made the broader product take off.

“are we trying to build this general purpose thing for all engineers? Um, as this really small team, maybe we should be focusing more narrowly”transcript, stated
“we found this kind of core set of features that really really worked incredibly well.”transcript, stated

Gotchas (what bit them)

Better base models do not automatically produce a better programming interface.

Root cause: Copilot's product experience stayed largely the same even as underlying models improved.

Resolution: Cursor owned the IDE interface and experimented with new interaction models such as instructed edits and codebase indexing.

“The models themselves were starting to get better. If you kind of looked at the research, the product itself hasn't changed.”transcript, stated
“we had this thesis um that you needed to own the interface, you need to own the ID”transcript, stated

Prompt-only next-edit models failed before the team had enough user data.

Root cause: Next-edit prediction depends on behavior between commits, a distribution not captured by ordinary code pretraining data.

Resolution: After reaching enough usage, Cursor trained custom models on user edit data.

“using prompted models completely failed.”transcript, stated
“with these users we now had um some data and we could use this to train models to predict your next edit.”transcript, stated

Premature infrastructure spending can outpace product-market fit.

Root cause: AI startups were tempted to spend large funding rounds on GPUs before knowing what product worked.

Resolution: Cursor used APIs where they were the best tool and invested in custom models where specific latency, cost, or data advantages existed.

“raised a lot of money and spent it all in GPUs before product market fit.”transcript, stated
“we try to use the best tool for the job. And a lot of the time that's going to be just calling an API.”transcript, stated

Many plausible AI coding features do not work on the first several attempts.

Root cause: The product space required discovering UX/model combinations that were useful in practice.

Resolution: Cursor shipped useful half-finished experiments, watched reactions, cut most ideas, and kept improving the ones that worked.

3 supporting quotes
“there's like 10 failed experiments of what didn't work.”transcript, stated
“release these like halffinish things which a lot of our competi competitors kind of refuse to do.”transcript, stated
“you're okay to release a lot and then cut most and keep the ones that work?”transcript, stated

Evaluation

Cursor evaluated product and model decisions through rapid product experiments, internal dogfooding, user reaction after release, and production use of custom models for latency-sensitive features.

Metrics: daily active users · custom models served in production · feature usefulness to the team · growth after feature launches · latency and cost relative to lab-provided frontier models

3 supporting quotes
“the really magical thing about this product was that we were users of it. So, we could iterate incredibly quickly”transcript, stated
“once you release to the world, see how people react it, um, you can improve it a ton.”transcript, stated
“we've biased towards releasing as soon as something shows signs of usefulness to the team.”transcript, stated

Outcomes

The interview cites about 30,000 daily active users by January 2024, roughly 10 served custom models, and $100 million annualized revenue run rate.

3 supporting quotes
“after we integrated those two features and we launched them, um, growth kind of just took off.”transcript, stated
“technically it's like 50 but the ones that are actually served it's probably like 10 10 custom models”transcript, stated
“I think we're probably a bit more than 1% but definitely less than 10%. I'd say two or three.”transcript, stated