Definition

Indexing prepares data structures that a retriever searches for candidate items. A term index records which passages contain a word. A vector index organizes embeddings for similarity search. Some systems also index metadata fields used in filters.

The indexed item might be a whole document, a passage, or a record. Indexing is often part of a larger ingestion process, but the term refers to making those items searchable, not to fetching or cleaning source files. At query time, the retriever uses the available indexes to select candidates.

Simple example

An assistant searches deployment guides split into passages. The search system records which passages contain “rollback” and builds a vector index over their embeddings. Each indexed passage keeps its own ID and a source document ID. A question like “How do I undo a failed deployment?” may find the rollback procedure through vector similarity even though the wording differs.

Why it matters

Without a suitable index, a search may have to inspect every item. That can be fine for a small corpus, but query cost grows with the amount of content. Index choice also shapes which candidates retrieval can find and how quickly it can apply filters. A fast query is little help if the needed passage was never indexed.

One important nuance

An index can lag behind its source. If a rollback procedure changes while its old passage and embedding remain searchable, the assistant may retrieve obsolete instructions. To avoid serving stale results, update affected indexes or exclude obsolete entries before using them. Source IDs and versions help you check whether a result still matches the current document.