Building a Rebuildable Search Index
In this article
- Say which four fields every chunk record carries and why they are set when the document is parsed.
- Rebuild an index from a corpus manifest and use a checksum to show that a rerun changed nothing.
- Predict which chunks remain after a new document version and a source delete, and which of them each user can retrieve.
- Explain what LangChain's incremental and full cleanup modes delete, and when a deleted document survives.
Overview
An internal policy assistant answers one company's employees about its HR and travel policies, using 120 policy documents that each carry an access list of the groups allowed to read them. Nothing is indexed yet. Before any answer can be trusted, you need to answer one question: when the travel rules change or a page is deleted, can you prove what the search index holds? Here you give every chunk, each stored piece of a document, the fields that make it traceable, rebuild the index and get the same result twice, and update or delete a document without leftovers. Then you check which chunks an employee and a manager can retrieve, and read the same logic in LangChain's indexing API.
Sign in to keep reading
The rest of this article opens with an account. An account also keeps your progress and quiz results on every device, and lets you follow news for up to five topics.
Still to read in this article
- What a chunk carries
- A build you can run twice
- Updates and deletes leave nothing behind
- The access filter sits inside the query
- The same reconcile in LangChain
- Common mistakes
- In production
- Sources
- Check yourself, 13 questions