Smooth stones arranged in decreasing size on warm sand, representing recurring document retrieval
All posts

Reflex: retrieval built for recurring documents

Reflex combines semantic relevance, lexical evidence and account-scoped cache reuse for recurring-document retrieval.

Most retrieval systems treat every request as new work. A document that was searched a minute ago can be embedded, transferred and scored again as if the system had never seen it. For RAG applications built over policies, product catalogs, support libraries, source code or tenant knowledge bases, that is the wrong economic model: queries change constantly, but the evidence often does not.

Reflex is built around that asymmetry. It turns recurring document representations into a reusable asset, combines semantic similarity with deterministic lexical evidence and returns a calibrated order without adding a pairwise language-model pass to every query. The result is a retrieval layer whose latency and unit cost improve as the same evidence continues to serve new questions.

Retrieval should remember the documents, not just answer the query

Dense embeddings are effective because they place related ideas close together even when their wording differs. Production search, however, also depends on literal evidence: a product code, a statute, an acronym, a person's name, an exact phrase or two terms appearing close to each other.

Reflex brings those signals together in one path. It first establishes semantic relevance, then calibrates the surviving candidates with candidate-local lexical evidence. Its lexical stage combines BM25-like term strength, query coverage, compact co-occurrence and constrained fuzzy matching. Because the calibration is deterministic, it requires no additional model inference once the embeddings are available.

That distinction matters operationally. A dedicated cross-encoder evaluates query-document pairs jointly. Reflex reuses independent document representations and spends its online work on the changing query and a bounded candidate set. Repeated documents stop behaving like repeated model jobs.

One retrieval layer, two integration paths

Reflex supports two ways of fitting into an application:

  1. Ad hoc reranking. Send a query and an existing list of document strings. Reflex returns their original indices in calibrated order, so an application can add semantic and lexical reranking without operating a permanent collection.
  2. Indexed RAG. Embed documents during indexing, retain their vectors with the collection and encode only the query online. Reflex can then participate as the final ranking stage before context is assembled for the model.

Reflex preserves each candidate's original index and returns results in descending relevance order. Its score and ordering describe the candidates supplied to the request; as with any reranker, it cannot recover evidence that does not reach its input.

Ranking without a pairwise model pass

Reflex combines semantic relevance with bounded lexical evidence when it orders candidate documents. That makes it useful when literal terms need to refine otherwise close semantic matches, without turning every request into a query-document pairwise inference pass.

The result is a reranking step rather than first-stage retrieval. Applications should still tune candidate retrieval, chunking and query formulation when relevant documents are consistently absent.

Reuse changes the request path

Cache awareness is part of the Reflex retrieval architecture. Exact queries or document strings can reuse processing within an account, while changed text creates a new cache entry. The current request's usage object distinguishes processed and cached input so applications can inspect the effect on their own workload.

The useful recurring-corpus case is a new question over documents that have already been processed. Policies, manuals, catalogs and support content naturally create this traffic shape. Reflex can reuse the stable evidence while ranking it for the new query.

Price and capacity depend on the request

Reflex charges processed and cached input differently, and every request remains subject to the account's reranking and Reflex quotas. Evaluate its fit with representative candidate sets rather than assuming that a cache benefit will apply to one-off or rarely repeated inputs.

See the dedicated AIVAX pricing and plans and limits pages for current commercial terms and quotas.

The architecture changes more than one retrieval decision

Reflex is designed as an operating layer for retrieval, not as a single opaque score endpoint.

How the Reflex architecture behaves in production
Concern Reflex behavior
Recurring documents Exact content can reuse its existing embedding instead of paying the full document path again.
Literal evidence Codes, names, acronyms, exact terms and compact co-occurrence can refine close semantic candidates.
Online compute The application layer runs on CPU and adds no pairwise model inference after embeddings are available.
Integration The same retrieval primitives support direct reranking and indexed RAG.
Model choice The embedding boundary is replaceable; the lexical engine does not depend on one encoder's weights.
Result semantics The public relevance score remains cosine similarity while the response order carries the calibration.

Together, these choices make Reflex especially natural for tenant-scoped search, support collections, knowledge bases, policy libraries, application catalogs and any RAG system where a changing stream of questions repeatedly reaches a comparatively stable body of evidence.

What Reflex is - and what it is not

Reflex occupies a specific layer in the retrieval stack. Its boundaries are deliberate:

  • It is not an embedding model. It orchestrates a compatible encoder, so the representation layer can evolve independently from the lexical calibration logic.
  • It is not corpus-wide BM25. Its lexical statistics are computed inside the current semantic candidates, keeping the final stage bounded and focused.
  • It is not a pairwise cross-encoder. It reaches its operating point without jointly running a language model over every query-document pair.
  • It is not an exact-response cache. Reused document embeddings still pass through semantic selection and lexical calibration, so a new query receives a newly ranked result.
  • It is not a replacement for first-stage recall. No final reranker can promote evidence that never reaches its candidate pool.

Those constraints define where Reflex compounds. Entirely cold, one-off batches cannot use document reuse. Repeated-corpus retrieval can.

Use Reflex where the candidate set already lives

Reflex is a collection-less search and reranking option for applications that already own their candidate documents. It returns ranked text candidates rather than generating an answer, so the application can pass the selected evidence to a language model or AI Gateway.

For a managed and persistent knowledge base, use AIVAX Semantic Search instead. The Reflex documentation describes the current request contract, cache behavior and the boundary between these two paths.

A retrieval layer for recurring evidence

Reflex starts from a practical observation: in production RAG, documents often repeat more than questions. Its architecture combines semantic relevance with lexical evidence and can reuse processing for repeated content.

That combination makes it useful when a changing stream of questions repeatedly reaches a comparatively stable body of evidence.