A knowledge graph pipeline for better LLM document search
Raw text is cleaned, parsed, and split into small overlapping chunks so nearby meaning is not lost. Named items such as people, companies, or products are extracted from each chunk, then linked when they appear together in the same chunk. Those links form a that stores both the relationships and the source chunks behind them.
The graph is divided into topic groups, and random chunks from each group are sent to an LLM to create a broad summary without over-focusing on the most connected nodes. The same document chunks are also placed in a and indexed with BM25. When a question arrives, the system searches by meaning, searches by matching words, extracts named items from the question, follows nearby links in the graph, and brings back the connected chunks.
The results from these paths are then combined and reranked. The aim is to reduce the problem where important information in the middle of long material is missed, especially for questions that need several reasoning steps.
Key points
- Text is split into overlapping chunks to keep local meaning intact.
- Named items are connected into a based on appearing together in chunks.
- Topic groups are summarized with an LLM using sampled chunks from each group.
- Queries use meaning search, BM25 word matching, and at the same time.
- Results from different retrieval paths are combined and reranked before use.