Local Knowledge Base Retrieval Acceleration: A Multi-Hop Approach Without Vectorization

    This article explains why local knowledge bases often become slow and hard to maintain, and how a structured, non-vector retrieval approach can address those issues. It covers the limitations of similarity-based RAG, the shift toward explicit indexes over text chunks, entities, and relations, and a step-by-step implementation path from document parsing to multi-hop query expansion and generation. It also outlines evaluation metrics, practical boundaries, and engineering recommendations for teams looking for a lighter, more controllable retrieval pipeline.

    1. The Problem: Why Local Knowledge Bases Are Slow and Hard to Maintain

    In enterprise knowledge management, building a knowledge base usually involves document parsing, chunking, embedding, writing to a vector index, recall and ranking, and prompt assembly. The pipeline looks mature on paper, but in real deployments teams often run into three recurring problems.

    The first is high indexing cost. As the number of documents grows, calling a large model chunk by chunk to extract entities and items, followed by embedding computation, consumes significant time and compute. In local environments without GPU resources, indexing can degrade from minutes to hours.

    The second is that chunking breaks semantics. Suppose a policy document states that “Zhang San is responsible for Project A, with a budget of 5 million.” If the chunk boundary is placed poorly, the sentence is split into two chunks, and retrieval may hit only one of them, breaking the multi-hop reasoning chain. Chunk size, overlap windows, and separator strategies all require repeated tuning.

    The third is a long maintenance chain. A single revision to a source file means re-uploading, re-chunking, and re-embedding. Lowering the similarity threshold introduces noise; raising it may miss critical fragments. Teams often find themselves in a “push down one, pop up the other” loop.

    As a result, the industry keeps looking for a lighter, cheaper, and more accurate retrieval approach. One direction discussed frequently in recent years is to bypass vector similarity and organize text with explicit structural relationships, making retrieval closer to a database query than to fuzzy matching.

    2. From Similarity Recall to Structured Retrieval

    The core assumption of traditional retrieval-augmented generation is that semantic similarity equals relevance. Text is mapped into high-dimensional vectors, and approximate nearest neighbor search is used to find candidate chunks. This works well for conversational questions, but it has two inherent weaknesses: similarity does not equal an answer, and cross-chunk associations are hard to cover in a single recall pass.

    Structured retrieval takes the opposite approach: build explicit indexes over text chunks, entities, and relations first, then expand step by step along those relations at query time. It behaves more like executing a multi-hop query over a local knowledge base than scoring similarity once. The direct benefits are threefold.

    1. Lighter preprocessing. No embedding model and no vector database are required; the index can be built once the raw text is parsed.
    2. More controllable results. The recall path is explainable, which makes it easier to investigate why a specific chunk was hit.
    3. More stable multi-hop behavior. Clues across chunks and documents can be connected along relations, reducing the breaks caused by chunking.

    This does not mean similarity retrieval has no value. For vague, conversational questions without clear entities, vector recall still has advantages. The more reasonable engineering judgment is to let the two methods play to their strengths rather than replace each other.

    3. Implementing Non-Vector Retrieval

    To try this approach in a local environment, follow the order below to avoid rebuilding the existing pipeline all at once.

    Step 1: Unify document parsing. Convert common formats into plain text or a lightweight structure, preserving heading hierarchy, page numbers, and paragraph numbers. Parsing quality determines index quality, so do not rush this step.

    Step 2: Build a chunk-level index. Assign a stable identifier to each text chunk and record its position in the source document. A schematic structure looks like this:

    1. doc_id -> document identifier
    2. chunk_id -> chunk identifier
    3. parent_id -> parent section
    4. entities -> entities appearing in the chunk
    5. relations -> relations between entities

    Step 3: Extract lightweight relations. There is no need to call a large model for every chunk. Low-cost methods such as rules, dictionaries, and named entity recognition can build a usable relation skeleton first, which can be enriched later.

    Step 4: Perform multi-hop expansion at query time. The user question is first parsed into entities and constraints, then candidate chunks are expanded layer by layer along relations, followed by deduplication and ranking. Pseudocode:

    1. def search(query, max_hop=2):
    2. seeds = extract_entities(query)
    3. frontier = seeds
    4. visited = set()
    5. for _ in range(max_hop):
    6. next_frontier = []
    7. for node in frontier:
    8. for nb in neighbors(node):
    9. if nb not in visited:
    10. visited.add(nb)
    11. next_frontier.append(nb)
    12. frontier = next_frontier
    13. return rank(visited, query)

    Step 5: Connect to the generation stage. Assemble the recalled chunks into the prompt in structured order, clearly labeling the source chunk IDs so the answer can include traceable citations.

    4. Evaluation: Do Not Rely on “It Feels More Accurate”

    When evaluating this kind of approach, cover at least four metrics: recall rate, answer accuracy, time to first token, and indexing time. Multi-hop scenarios should have a dedicated test set, for example questions that require crossing two sections, questions that require a numeric comparison, and questions that require connecting a timeline.

    Keep three principles during evaluation. First, fix the test set so that tuning does not change the questions each time. Second, record errors from the retrieval stage and the generation stage separately to determine whether the problem lies in retrieval or expression. Third, record resource consumption as well, including memory usage and indexing time, to avoid improving accuracy at the cost of higher cost.

    An executable evaluation table structure is as follows:

    Case Type Sample Count Recall Rate Accuracy Average Latency
    Single-hop fact 50 TBD TBD TBD
    Two-hop relation 50 TBD TBD TBD
    Numeric comparison 30 TBD TBD TBD

    5. Applicability and Engineering Recommendations

    Structured retrieval is not a universal solution. It fits content with clear entities and explicit relations, such as policy documents, technical manuals, product specification sheets, and ticket records. For corpora with heavy conversational language and obvious semantic drift, keep similarity recall as a complement.

    Three engineering recommendations apply. First, run a small-scale validation with a few hundred text chunks to prove the pipeline before deciding whether to expand. Second, decouple index construction from the query service so they can scale and be monitored independently. Third, use general cloud capabilities for non-core parts, for example object storage for raw documents, a message queue to smooth out indexing spikes, a container platform to deploy the query service, and logging plus monitoring and alerting to track latency and error rates.

    6. Conclusion

    The difficulty of a local knowledge base has never been whether a piece of text can be retrieved, but whether the right few chunks can be retrieved stably, at low cost, and in a maintainable way. When indexing no longer depends on expensive preprocessing, and when the retrieval path can be explained and debugged, teams can put their optimization focus back on data quality and business understanding. For developers, rather than chasing a specific tool, it is more durable to first understand where structured retrieval and similarity retrieval each apply, and then make trade-offs based on the shape of their own data.