Structure-Aware Retrieval: A Vector-Free Approach to Local Knowledge Bases
This article explains structure-aware retrieval, a method for local knowledge bases that skips vector embeddings. It keeps entities, events, relationships, and source positions in the text, then locates answers with deterministic lookup rules. The article covers how the approach works, where it helps and where it falls short, and how to test it on your own data.
Structure-Aware Retrieval: A Vector-Free Approach to Local Knowledge Bases
Many teams building local knowledge bases follow the same path: parse documents, split text into chunks, generate embeddings, store them in a vector database, and repeatedly tune similarity thresholds. This path has a mature ecosystem, but each step has a cost. Structure-aware retrieval offers a different approach. Instead of compressing text into vectors, it keeps the entities, events, relationships, and original text positions, then uses deterministic lookup rules to find answers. This article explains the principles, strengths, and limitations of this approach, and describes how to test it in your own context.
1. Why RAG Became the Standard for Knowledge Bases
Retrieval-augmented generation (RAG) works in a straightforward way. Large language models have limited parametric knowledge, and they can hallucinate. The system first retrieves relevant passages from an external knowledge base, then places them in the prompt so the model answers from that material. This improves both the accuracy and the traceability of answers.
A typical engineering pipeline has five steps: document parsing, text chunking, embedding, indexing in a database, and retrieval followed by generation with the retrieved context. Most knowledge base products build on this pipeline.
2. Three Practical Problems with Vector Retrieval
1. Chunking Breaks Information
Suppose the source text says: “The project lead is Zhang San, and the project budget is 5 million yuan.” If a chunk boundary splits this sentence, a query such as “the budget of the project Zhang San leads” may retrieve only “project lead: Zhang San” or only “budget: 5 million yuan.” The model cannot get both facts at once. Sliding windows, parent-child chunking, and semantic chunking all reduce this problem, but chunk boundaries always exist.
2. Similarity Thresholds Are Hard to Standardize
A lower threshold adds noisy passages, and the model may be distracted by irrelevant content. A higher threshold may filter out relevant passages. The best threshold changes with the corpus and the query distribution. When the documents change, the existing parameters often stop working. Teams usually need repeated sampling and evaluation to find an acceptable configuration.
3. Updates and Rebuilds Are Expensive
When a source file changes, parsing, chunking, and embedding must run again. When the embedding model changes, the whole vector store generally must be recalculated. Teams with frequently updated documents spend much of their time maintaining indexes.
3. The Basic Method of Structure-Aware Retrieval
The core of structure-aware retrieval is preserving the text structure and replacing similarity calculation with explainable lookup. The method usually includes four stages.
1. Read Original Files Directly
This approach does not require splitting files into fixed-length chunks first. It builds indexes from natural structures such as paragraphs, headings, and lists. It also records where each clue appears in the original text, such as the file name, section, and paragraph number.
2. Extract Entities, Events, and Relationships
The system extracts three types of clues from text. Entities are objects such as people, project names, and organizations. Events are actions or attributes such as “responsible for,” “budget,” or “approval.” Relationships are the links between entities and events. Extraction can use rules, dictionaries, or small models, and it does not necessarily require a large language model. The extraction method directly affects indexing cost and recall quality, so it needs careful review when you choose a design.
3. Multi-Hop Lookup
Multi-hop lookup follows the clues step by step. Take the query “the budget of the project Zhang San is responsible for.” The system first locates the entity “Zhang San,” then finds the project linked to that person. It follows the project to the event “budget,” and finally returns to the original paragraph to extract the complete sentence as evidence. Each step can output the matched nodes and their text positions, so results can be traced and audited.
4. Deterministic Results
Vector retrieval returns results ranked by similarity, so someone must decide where to cut off the list. Deterministic lookup either matches or does not match, and its results do not depend on a threshold. The trade-off is that questions phrased very differently from the source text may not be found. Other methods are needed to fill that gap.
4. Comparison of the Two Approaches
| Dimension | Vector Retrieval | Structure-Aware Retrieval |
|---|---|---|
| Index dependencies | Embedding model, vector database | Text parsing, extraction rules, or small models |
| Hardware requirements | Often requires GPUs or large memory | Usually runs on CPUs |
| Update cost | Vectors must be recalculated after file changes | Usually rebuilds only the indexes related to changed files, depending on implementation |
| Query method | Similarity ranking with thresholds | Entity and relationship lookup, hop by hop |
| Semantic generalization | Stronger | Weaker, depends on extraction coverage |
| Result explanation | Depends on similarity scores | Can output the matched path and text position |
| Main risks | Broken chunks, threshold drift | Missed extractions, rule maintenance |
This table shows design-level differences. Actual performance depends on the implementation and the corpus, so you need to measure it with your own data.
5. Suitable and Unsuitable Scenarios
Structure-aware retrieval suits these corpora and needs:
- Policy documents, technical documentation, business ledgers, and contract clauses, where entities and events are explicit and the structure is clear;
- Precise queries, such as “Who is the approver of a given project?”;
- Scenarios that require source citations;
- Scenarios where files change often and knowledge must sync quickly.
Its benefits decline in these cases:
- Prose and chat logs, where entities are sparse;
- Vague queries where the meaning is similar but the wording is completely different;
- Corpora where the same entity has many abbreviations and aliases, and no alias table is maintained.
Most teams end up with a hybrid architecture. The table below shows one common division of labor.
| Query Type | Recommended Handling |
|---|---|
| Precise queries with clear entities | Structure-aware retrieval |
| Multi-hop relationships across paragraphs or documents | Structure-aware retrieval |
| Vague queries with varied wording | Vector retrieval as a fallback |
| Structured query misses | Fall back to vector retrieval or full-text search |
6. Testing at Small Scale
During a pilot, select a subset of the corpus that represents the full collection, covering the main document types and update frequencies. Then write a set of test questions for this subset. Cover three types: precise queries, multi-hop queries, and vague queries. Each question needs manually annotated reference evidence passages and reference answers. The old and new approaches must use the same question set, the same hardware, and recorded versions.
Record the following metrics.
| Metric | Meaning | How to Measure |
|---|---|---|
| Index build time | Time from raw files to a usable index | Record the full process on the same hardware |
| Incremental update time | Time for the index to become usable again after one file changes | Randomly modify sample files and time the process |
| Recall@K | Share of cases where the reference evidence appears in the top K results | Calculate against manual annotations |
| Answer accuracy | Share of model answers that match the reference answers | Dual manual review, with disagreements recorded |
| Resource usage | Peak memory, disk, and CPU or GPU usage | Record peaks with monitoring tools |
| Operating cost | Monthly staff hours needed to maintain indexes and rules | Track within the team |
7. Common Troubleshooting
- Empty retrieval results: Check whether entity names are written the same way as in the question, and add an alias table.
- Correct answer with wrong evidence: Check whether the position anchors point to the correct paragraph.
- Multi-hop paths are too long or responses are slow: Limit the number of hops and prune the paths.
- Confusion between entities with the same name: Add fields such as file source, department, or ID to disambiguate.
- Old content still returned after an update: Confirm that the incremental update was triggered, and check whether the file content hash has changed.
- Answers to frequent questions cannot be retrieved: Spot-check the extraction results for the answer paragraphs, and add rules or dictionary entries.
8. Implementation Recommendations
- Review your corpus types and query distribution first, and decide whether the benefits of structure-aware retrieval justify the investment.
- Run a small pilot on one business subset, and compare the old and new approaches using the metrics above.
- Assess production readiness, including standard interfaces, incremental updates, access control, and audit logs.
- If your team lacks operations capacity, consider a managed service, or a combination of object storage, container services, and log monitoring from a major cloud platform. Choose based on your budget and compliance requirements.
Conclusion
Two approaches to knowledge base technology are developing in parallel. Vector retrieval still has an advantage in semantic generalization. Structure-aware retrieval has advantages in precise queries, explainable results, and low-cost updates. The two are not mutually exclusive, and many teams combine them. Rather than following trends, first define your own corpus and questions. Then validate both approaches on the same data, and decide where to invest.
