CARM'INK Journal / Engineeringen

Why Deterministic Search Still Matters in the Age of Generative AI

Generative AI can explain and synthesize, but precision-critical workflows still need search with explicit criteria, stable results, provenance and reproducibility.

EngineeringCARM'INK Lab
A declared search query produces a replayable result set before a generative stage explains the selected evidence and preserves its boundary.
Search establishes what was found; generation makes the selected evidence understandable.

Generative AI can explain and synthesize. Search has a different job: identify which evidence matched a declared condition, in a defined collection, under an inspectable set of rules.

A generated answer can be fluent and useful while leaving a basic question unanswered: which records did the system actually find?

That question matters when a task depends on an exact identifier, a bounded date range, a controlled status or a complete set of records matching stated conditions. In those cases, search is part of the system’s control surface. Its results should be traceable and repeatable under defined conditions.

Search and generation belong in the same architecture. They should not be treated as the same operation.

A small test bench

Imagine a repository of controlled records. One task is to find the record whose identifier is exactly R-2048. A second task is to retrieve every record with a specified status during a defined period. A third is to explain how a set of records relates to a policy.

Each task has a different contract:

Task Search contract Generation’s role
Find R-2048 Apply the declared matching and normalization rules; return that record or no match. Explain the record’s metadata if requested.
Retrieve records by status and date Apply explicit filters and return a stable, ordered result set. Summarize the results without exceeding the selected set.
Explain relationships across records Retrieve relevant evidence and preserve its sources. Compare, interpret and explain the evidence, with uncertainty made visible.

The table is not a ranking of technologies. It separates responsibilities. Search establishes which evidence is in scope. Generation works with that evidence to produce an explanation.

What “deterministic” promises

Deterministic search does not mean that the same list must remain unchanged forever. The underlying collection can change. A new record can match. A corrected value can remove a match. A revised index or ranking configuration can change the order.

The useful promise is narrower: given the same data snapshot, query semantics, permissions, filters, ranking configuration and ordering rules, the system can reproduce the same result set.

That promise needs an explicit ordering rule. The W3C SPARQL specification makes this visible: ORDER BY establishes the order of a solution sequence, and using LIMIT or OFFSET to select a predictable subset depends on making that order predictable. If multiple results tie on all the sort criteria, a stable tie-breaker may still be needed. [1]

Ranked text search also has configuration and collection state. Apache Lucene’s BM25 implementation exposes parameters such as k1 and b, and its scoring uses collection and term statistics. [2] A reproducible search therefore records more than a query string: it preserves the index state and the scoring behavior that produced the ranking.

This is an engineering contract, not nostalgia for older tools.

Repeatable does not mean correct

A deterministic result can still be wrong.

The source data may be incomplete. A field may have been normalized incorrectly. The access filter may exclude a relevant record. The query may encode the wrong interpretation of a term. A ranking function may consistently place a useful result below a less useful one.

Repeatability makes these issues easier to investigate; it does not solve them. Search quality still needs evaluation against the task. For exact lookup, test whether exact identifiers return correctly and near matches do not silently substitute. For discovery, assess relevance, coverage and the consequences of missed results.

A system should also say what kind of search it performed. Exact matching, structured filters, lexical ranking and approximate semantic retrieval make different promises. A nearest-neighbor search may be useful for finding related material, but it should not be presented as proof that an exact item exists or does not exist.

The handoff to generation

Retrieval-augmented generation combines retrieval with a generative model. In the original RAG formulation, a pre-trained sequence-to-sequence model is paired with a dense vector index and a neural retriever. [3] That architecture is powerful because the model can use external material while producing an answer. The design still depends on selecting the right material.

The handoff should preserve the boundary between the two stages:

  1. Interpret the request into explicit constraints where possible.
  2. Search the authorized collection and preserve the resulting record identifiers and source locations.
  3. Give the selected evidence to the model for explanation or synthesis.
  4. Link important claims back to the retrieved evidence.
  5. When the search returns no usable evidence, report that limitation rather than filling the gap with a plausible completion.

A model can help translate natural language into a search plan, expand terminology or explain why records appear relevant. The system should retain the original request and make material query transformations inspectable. If the model broadens an exact identifier lookup into a similarity search, that change should be visible.

The boundary also matters when retrieval produces conflicting evidence. Generation can describe the conflict. It should not erase it by presenting one source as definitive unless the system has an explicit rule for resolving that conflict.

Design for replay

When a result may need to be audited, challenged or reproduced, preserve the information that shaped it:

  • the original query and interpreted constraints;
  • the collection or index version;
  • the caller’s permissions and applicable filters;
  • the matching, normalization and ranking configuration;
  • the final ordering, including tie-breaking;
  • the identifiers and versions of the records returned;
  • the model and evidence context used to generate the explanation.

That record lets an engineer distinguish a retrieval change from a generation change. It can show that a result moved because the corpus changed, because a filter changed, or because the model described the same evidence differently.

Not every search needs this level of recording. The necessary depth depends on the consequences of a missed or misordered result. The architecture should make that decision deliberately.

Precision and interpretation can coexist

Deterministic search does not have to exclude semantic discovery. A system may use flexible retrieval to find possible matches, then apply explicit constraints to confirm identifiers, dates, states or relationships. It may also use search to assemble evidence and generation to explain it.

The important point is to label each step according to the promise it can keep:

  • exact lookup returns exact matches under declared normalization rules;
  • structured search returns records satisfying stated constraints;
  • ranked search presents candidates according to a configured ranking method;
  • semantic retrieval identifies likely related material;
  • generation produces an interpretation of the evidence it receives.

A single interface can combine these operations. A single opaque model response should not conceal which one produced the answer.

As generative systems become better at writing, the need to know what they found becomes more important. Search gives an AI system an evidence boundary. Generation helps make that evidence understandable.

The strongest systems give each operation a clear contract—and preserve the handoff between them.

References

  1. W3C, SPARQL 1.1 Query Language, sections on ORDER BY, LIMIT and OFFSET.
  2. Apache Lucene, BM25Similarity, Lucene 10.5.2 API documentation.
  3. Patrick Lewis et al., Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks, NeurIPS 2020.

Continue the thread

A system worth understanding

Take the question into context.

Journal thinking connects back to the systems, architectures and Forward Deployed AI work that give the lab's research an operating environment.

Start a conversation