Short answer: treat every generated product answer as a claim that must carry a reproducible retrieval receipt, not as prose that merely happened to follow a vector search.
For fintech product content, I would ship the smallest useful version as three separate paths: an immutable content revision path, a bounded retrieval path, and an append-only evidence log. The answer shown to a customer should cite the exact content revisions returned by retrieval. The log should retain enough input and version data to explain that choice later, while excluding raw customer text when a stable digest and a redacted query will do. This costs more storage and engineering time than logging one relevance score. The trade is worth making when grounding and citation are release criteria rather than cosmetic UI.
Fast search isn't the hard part.
Receipts are evidence, not telemetry.
Build the receipt before tuning relevance
The data flow is plain: publish a versioned product-content record, split that revision into stable chunks, index those chunks, retrieve a bounded candidate set, and generate only from that set. Before returning the answer, write one receipt that connects the request to the index version, filter policy, retrieved chunk revisions, and citations actually rendered. The retrieval-augmented generation paper establishes the broad pattern of combining generation with retrieved non-parametric memory; the evidence receipt is the application control that makes a particular use of that pattern inspectable.
In a fintech catalog, a product page can contain eligibility rules, fee disclosures, geographic restrictions, and marketing copy. Those fields don't have equal authority. A high-scoring marketing chunk must not silently outrank a current disclosure for a question about fees. Keep authority and effective dates as explicit metadata, then apply deterministic policy filters before semantic ranking. The log needs both the eligible set boundary and the final result because a perfect ranking inside the wrong policy boundary is still a bad answer.
This is where a ship-first implementation often goes sideways: the team records the query, the top score, and the generated answer, then discovers during review that it cannot tell which content revision was eligible. A score such as 0.82 isn't evidence by itself. Without the index snapshot, policy version, chunk revision, and rank, it cannot distinguish stale content from a ranking change or a citation-rendering mistake.
Here is the failure mode I design against. A card issuer updates an annual-fee disclosure at 09:00, the content pipeline publishes revision r184, and an index rebuild starts. At 09:03, a customer asks whether a fee applies in Singapore. The semantic query finds both r184 and the still-addressable r183; a cache keyed only by product ID returns the older chunk, while the generator cites the product landing page instead of the disclosure. A conventional request log shows a 200 response and a healthy latency. A useful receipt shows the policy version, the index snapshot, both candidate revisions with rank, the one selected citation, and the answer digest. During review, that record makes the defect legible: eligibility was correct, cache invalidation was not, and citation mapping drifted. Without it, an engineer has to guess which of three moving parts changed, and the customer-facing answer cannot be defended even if the wording sounds plausible.
How should retrieval architecture preserve audit logs for product search?
Preserve decisions at their boundaries. The request boundary records a correlation ID, a privacy-safe query representation, locale, and product scope. The policy boundary records the versioned filters that determined eligibility. The retrieval boundary records the embedding and index identifiers plus ordered candidates. The generation boundary records cited chunk IDs and the final answer digest. One occurredAt timestamp is useful, but timestamps alone don't make the decision reproducible — mutable names such as current-index need immutable version values beside them.
The receipt should answer four questions without replaying production: What content was allowed? What content was found? What evidence did the answer use? Which configuration made those choices? If a field doesn't help answer one of those questions, don't collect it by reflex. Full prompts and raw queries are tempting because they're easy to dump, but they expand the sensitive-data footprint. For a customer query that may include an account detail, store a keyed digest for correlation, retain only the redacted text needed for review, and put access and retention policy around the receipt store.
| Boundary | Record | Why it matters |
|---|---|---|
| Request | locale, product scope, query digest | Replays the caller context without copying sensitive text |
| Policy | filter and authority version | Proves which revisions were eligible |
| Retrieval | index, embedding, ordered candidates | Explains ranking and stale-content exposure |
| Generation | cited IDs and answer digest | Connects customer claims to inspectable evidence |
I'm not sure one retention period fits every fintech product or jurisdiction; legal, security, and product owners have to resolve that policy. The architecture should therefore attach a retention class to each receipt rather than hard-code a universal number in the search service.
A runnable TypeScript evidence boundary
The following example keeps retrieval behind a generic interface. It does not prescribe a database or model, and it deliberately separates the answer's citations from every candidate returned by search. That distinction matters: retrieved evidence is what the generator could use; cited evidence is what the customer can inspect.
import { createHash, randomUUID } from "node:crypto"; type SearchRequest = { query: string; locale: string; productIds: string[]; }; type Candidate = { chunkId: string; contentRevision: string; score: number; sourceUrl: string; }; type RetrievalContext = { policyVersion: string; indexVersion: string; embeddingVersion: string; }; type EvidenceReceipt = { receiptId: string; occurredAt: string; queryDigest: string; locale: string; productIds: string[]; policyVersion: string; indexVersion: string; embeddingVersion: string; candidates: Array<Pick<Candidate, "chunkId" | "contentRevision" | "score">>; citedChunkIds: string[]; answerDigest: string; }; interface Retriever { search(request: SearchRequest, limit: number): Promise<Candidate[]>; } interface ReceiptStore { append(receipt: EvidenceReceipt): Promise<void>; } function digest(value: string): string { return createHash("sha256").update(value, "utf8").digest("hex"); } function selectCitations(candidates: Candidate[]): Candidate[] { // Production policy can be richer, but it must remain versioned and testable. return candidates.slice(0, 3); } export async function answerProductQuestion( request: SearchRequest, context: RetrievalContext, retriever: Retriever, receipts: ReceiptStore, ): Promise<{ answer: string; citations: string[]; receiptId: string }> { const candidates = await retriever.search(request, 8); const cited = selectCitations(candidates); const answer = cited.length === 0 ? "No supported answer was found in the eligible product content." : `Answer grounded in ${cited.length} eligible content revision(s).`; const receiptId = randomUUID(); await receipts.append({ receiptId, occurredAt: new Date().toISOString(), queryDigest: digest(request.query), locale: request.locale, productIds: [...request.productIds].sort(), policyVersion: context.policyVersion, indexVersion: context.indexVersion, embeddingVersion: context.embeddingVersion, candidates: candidates.map(({ chunkId, contentRevision, score }) => ({ chunkId, contentRevision, score, })), citedChunkIds: cited.map(({ chunkId }) => chunkId), answerDigest: digest(answer), }); return { answer, citations: cited.map(({ sourceUrl }) => sourceUrl), receiptId, }; } There are two deliberate limits here. First, the example returns a deterministic placeholder answer instead of pretending a generic snippet can implement a verified generator. Put your generator behind another interface, validate that its citation IDs belong to candidates, and reject unsupported IDs before rendering. Second, the receipt stores scores for diagnosis, not as proof of truth. Grounding is established by the content revision and policy chain; citation is established by the mapping from answer claims to those revisions.
Keep the write ordering explicit. If an answer cannot be returned unless its receipt is durable, append before responding as shown. If search availability takes priority, use a durable queue and accept that a small audit gap is part of the design. Don't describe an asynchronous queue as equivalent to a synchronous audit write; the failure semantics differ, and the right choice depends on the control the receipt is meant to satisfy.
Test claims, not just nearest neighbors
An offline relevance set is necessary, but it doesn't cover the failure that matters here. Build evaluation cases from product-content revisions and expected citations. Each case should include the query, eligible product scope, policy version, required evidence revision, and forbidden stale revisions. Then evaluate retrieval and citation separately: did the required revision enter the bounded candidate set, and did the rendered answer cite only eligible candidates?
Use adversarial cases drawn from the content model rather than invented prose. A current fee disclosure and an expired disclosure can share most of their wording. Two products can use the same benefit name in different regions. A short marketing summary can be semantically closer to a query than the controlling terms. These cases expose whether metadata filtering, authority ordering, and effective-date logic happen before generation. They also make regressions attributable: a missing candidate points toward ingestion, filtering, or ranking, while an uncited candidate points toward generation or citation mapping.
Exact thresholds are local. Your mileage may vary with catalog size, change frequency, and the consequence of a wrong answer. I would still make three release conditions non-negotiable: every citation resolves to the logged content revision, no forbidden revision reaches generation, and the receipt schema survives replay after an index rollout. Measure latency and storage alongside those checks because evidence logging isn't free, but don't trade away the chain you need to investigate a grounded-answer failure.
Operate the evidence chain as product data
Watch the joins. A dashboard full of average similarity scores won't reveal that citation URLs stopped resolving after a content migration. Operational checks should sample receipts and verify that each logged revision remains addressable, each cited ID belongs to the recorded candidate set, and each policy or index version maps to immutable deployment metadata. Track the no-supported-answer rate by locale and product scope; a sudden change can indicate an ingestion or filtering shift without requiring access to raw customer queries.
Deletion deserves equal attention. Content retention and receipt retention are related but different: deleting customer text should not leave it copied into prompts, logs, traces, and queue payloads, while deleting a public product revision too early can make an existing citation impossible to audit. Define the lifecycle at schema design time. An append-only receipt can still carry an expiry class and cryptographic digests instead of sensitive text.
The catch is that this architecture is not suitable for every search box. For low-risk site navigation, where results are links and no generated claim is presented as product guidance, versioned evidence receipts may add cost and operational burden without enough benefit. Stick with ordinary query analytics and access logs there. Use the stronger chain when the system synthesizes fintech product claims, citations are part of the customer experience, or reviewers must reconstruct why one revision was used.
Before release, walk one real content change from publication through chunking, indexing, retrieval, answer rendering, receipt lookup, and expiry. Confirm the old revision is excluded by policy, the new one is cited by immutable ID, and the displayed citation still resolves. Then repeat after changing the ranking configuration. That compact rehearsal catches more architectural gaps than another week spent nudging similarity weights, and it leaves a clear decision rule: ship only when an answer and its evidence can travel together.