Indexing organizes document content so searches can find matching documents without reading them one by one. It also supports grounding LLM prompts in human-authored information retrieved from trusted sources. section 10.3.1
An inverted index is built in two steps:
- Create a forward index by listing the words in each document. section 10.3.1
- Invert that structure into a list of words, each linked to the documents where it appears. section 10.3.1
Finding “cat”
Like checking a textbook index for page numbers, a search can use the inverted index to jump to documents containing “cat,” rather than scan every document. Exact-word indexes can miss “cats”; modern full-text engines use character-based trigram indexes to help find both forms. section 10.3.1














