Skip to lesson
Exit
How Coding Agents Work (and Their Limits)1 / 2

2 min lesson

Index, then retrieve

Take "Index, then retrieve" step by step, then finish with the result that proves it worked.

Step 1 of 2

Index, then retrievehow the slice gets chosen

Cursor builds an index of your codebase so it can find relevant code fast, then retrieves a curated slice into the context at request time. Two distinct stages and conflating them is a common teaching mistake.

FROM REPO TO ANSWER

Interactive diagram. Step through it with the Next and Previous controls below, or Tab to a region to read its detail.

diagram: flow

Indexing is ahead-of-time; retrieval is per request. Only the assembled slice reaches the model - everything else is invisible.