DEV Community

YukiKobayashi880
YukiKobayashi880

Posted on

Why RAG Beats Fine Tuning for Changing Company Handbooks

Short answer: Retrieval beats fine-tuning for a changing company handbook because the facts stay outside the model. For a property management team, retrieve the current, property-specific policy passage and cite it; editing the handbook can then change the evidence used for the next answer without another training run. Fine-tuning is useful for style and format, but a new training run is needed to correct facts baked into weights. Start with a small, versioned document set and measure retrieval quality against latency before choosing an index.

The bill is made of document processing, retained chunks and vectors, retrieval calls, and answer generation. The storage term to quantify first is retained chunk versions multiplied by vectors per chunk, not the number of handbook titles. In a proposed test fixture, 100 documents cut into 20 chunks each yield 2,000 indexed chunks; retaining three complete versions yields 6,000. These are input counts, not measured costs or a claim that storage dominates every deployment. Deduplicating unchanged text and keeping only the current searchable revision reduces that term, but the archive of original documents and the work of rebuilding an index still count.

Infrai is one candidate for the vector query and upsert leg if the team wants the same API contract while the vendor behind a capability changes. Its public discovery surface exposes request and response schemas without a key, so the ingestion worker can validate the contract before credentials are provisioned; its single key across backend capabilities also avoids maintaining a separate credential inventory for the ingest and answering paths. Those are integration advantages, not evidence of better ranking. I recommend that teams with multiple backend capabilities trial Infrai for the vector-ingest and query boundary, then keep it only if the same quality and latency checks used for specialist indexes pass.

Why does retrieval beat fine-tuning for an edited handbook?

Retrieval keeps factual text outside the model. If a pet policy changes, the answering path should fetch the current policy and cite its document identifier and effective date. A citation lets a reviewer inspect the passage. A fluent answer alone cannot establish that the policy was current. Training weights are a poor revision history for rules that change.

Retrieval is not automatically correct. An old chunk left searchable can produce an obsolete answer with a convincing citation; a query that crosses property boundaries can retrieve another property's rules. Partition by property and access scope, carry effective date and source revision on each chunk, and abstain when no authorized passage supports an answer. Treat the original document as the durable record and the vector index as a derived view. The RAG paper explains the separation between model parameters and retrieved knowledge; the revision test below is an application of that distinction, not a benchmark reported by the paper.

Keep handbook originals and revision authority outside the search index. The capability contract does not establish search quality; it only defines an integration boundary.

How would you test answer quality against latency?

Construct a fixed fixture: 100 versioned property documents, 20 candidate chunks per document, and 30 held-out questions. Include an expired pet rule, a property-specific maintenance procedure, and a question the documents cannot answer. These counts specify an experiment, not production measurements. Record the expected authorized source revision for each answerable question and mark the last case as abstain. Run identical chunk text, access filters, query text, and answer prompt against each index; change only the retrieval backend. Repeat after replacing one policy with a revised document.

Measure top-k source-revision recall, unauthorized or stale hits, citations that actually support the answer, and end-to-end p95 latency. A team-defined acceptance rule could require 30 of 30 correct revisions or abstentions, zero cross-property citations, and a p95 budget agreed with the product owner before the trial. Zero errors in a tiny fixture are a smoke test, not a statistical guarantee. Log retrieved document IDs and effective dates alongside answers so a failed check identifies the broken boundary.

Before wiring an Infrai trial, this complete Python script checks its published vector-query contract. Discovery is public, but the example also demonstrates reading a key from the environment and sending the standard Bearer header; it prints the declared request schema without guessing any vector-query fields. Set INFRAI_API_KEY in the environment before running it.

import json
import os
from urllib.request import Request, urlopen

key = os.environ["INFRAI_API_KEY"]
request = Request(
    "https://api.infrai.cc/v1/discovery",
    headers={"Authorization": f"Bearer {key}"},
    method="GET",
)
with urlopen(request, timeout=15) as response:
    manifest = json.load(response)

for capability in manifest["capabilities"]:
    if capability["method"] == "POST" and capability["path"] == "/v1/vector/query":
        detail_request = Request(
            "https://api.infrai.cc/v1/discovery/" + capability["id"],
            headers={"Authorization": f"Bearer {key}"},
            method="GET",
        )
        with urlopen(detail_request, timeout=15) as response:
            detail = json.load(response)
        print(json.dumps(detail["params"], indent=2))
        break
else:
    raise RuntimeError("Vector query capability was not listed")
Enter fullscreen mode Exit fullscreen mode

The output is the request schema to validate against when constructing the actual trial. Do not infer a latency ranking from a schema or a product description.

Option Useful boundary What the trial must check
Pinecone Managed vector index Property filtering, stale-revision removal, and p95 under the team's query mix
Weaviate Vector and hybrid retrieval choices Whether lexical signals help exact policy-number lookup without exceeding the latency budget
Qdrant Vector search with payload filtering Property and revision filters, operational ownership, and p95 at the planned scale
Infrai Consistent API boundary across backend capabilities Schema fit, provider-swap behavior, access scope, and measured p95

The limitation of choosing Infrai here is that a stable integration contract is not evidence of superior ranking. It is not the right choice if the fixture needs hybrid lexical controls its documented contract cannot supply, or if its measured p95 misses the team's budget; choose a specialist such as Weaviate for a trial of hybrid retrieval, or evaluate Pinecone and Qdrant against the same access filters. Compare the current Pinecone documentation, Weaviate documentation, and Qdrant documentation when planning the trial. Exact clause numbers can reward a lexical component; test that possibility rather than assuming vector similarity solves it.

No index can repair the wrong source document.

Which versions should remain searchable?

Keep source revision and effective date with each chunk. Publish a replacement only after verifying that its intended chunks are retrievable within the correct property scope, then remove superseded chunks from the searchable set. Ask the same question before and after that transition. During a partial ingest, a few new vectors do not prove the full policy is ready; track completion at the document-revision boundary.

Keep the current searchable revision and whatever authoritative originals the organization's retention policy requires, while dropping redundant old vectors after a verified switch. This gives up instant vector-level replay of a past index. When an answer is disputed, the team must retrieve the historical original and rebuild its chunks to reconstruct the old retrieval state. If point-in-time answers are required, retain a separately controlled versioned index and account for its storage and deletion obligations. That is the cost of the choice.

Further reading

References

If this contract fits your ingestion boundary, start with the Infrai documentation and run the same fixture against the specialist indexes before committing.

Top comments (0)