Stale vector reused after model change
Detect: Cache returns a vector with incompatible representation metadata.
Recover: Include model and preprocessing identity in every cache key.
Compute reusable document vectors ahead of requests using content identity, version lineage, and an explicit freshness strategy.
Pre-computing embeddings moves document encoding out of the interactive retrieval path. Stable source chunks are embedded during ingestion or a scheduled backfill, then stored for repeated search. Query embeddings are usually still computed per request, though exact reusable queries may have their own cache. The approach improves latency only if precomputed vectors remain compatible and current.
A content-addressed design can avoid re-embedding unchanged chunks, but the cache key must include the embedding model, tokenizer or preprocessing contract, and relevant normalization settings. Identical text in two tenants may share computation only under an approved policy; their access metadata and retrieval identities still remain separate.
A prototype compares request-time document encoding with an offline index build and records the resulting freshness delay.
Production hashes source chunks, versions embedding configurations, and retries failed records without restarting the whole corpus.
Enterprise scale separates bulk backfills from incremental updates, estimates migration cost, and tracks source coverage and visibility before switching indexes.
Lists document revisions and the chunks expected in an embedding build.
Reuses compatible vectors for unchanged approved content.
Encode bounded batches with validated dimensions and normalization.
Persists vectors and lineage before or alongside index publication.
Verifies that the expected source set is represented and current.
flowchart LR
S["Source revision manifest"] --> C["Versioned chunking"]
C --> H["Content and model hash lookup"]
H --> R["Reuse compatible vector"]
H --> E["Encode missing chunk"]
R --> V["Versioned vector artifacts"]
E --> V
V --> I["Search index publication"]
I --> Q["Coverage and freshness checks"]Record the exact documents and revisions included in the build.
Apply a versioned preprocessing policy with stable source offsets.
Look up content hashes under the complete embedding configuration identity.
Batch only required work and retain per-record failure status.
Write vectors with source and permission metadata, then verify search visibility.
Process changed or deleted chunks and rebuild in parallel when the embedding space changes.
Public administration · Illustrative enterprise scenario, not a reported customer outcome.
A records service exposes decades of approved policy documents through an internal assistant.
Encoding documents during queries makes response time unpredictable and repeats expensive work.
Prepare searchable vectors offline while keeping new policy revisions current.
A snapshot manifest drives a backfill, and content hashes reuse unchanged paragraphs across approved revisions.
If an embedding model changes, a new index is built separately rather than mixing new vectors with the old space.
Measure build coverage, update lag, avoided encoding work, and query latency; precomputation transfers cost in time rather than eliminating it.
| Decision | Benefit | Cost |
|---|---|---|
| Offline computation | Reduces interactive retrieval latency. | Introduces freshness and build-management responsibilities. |
| Content-based reuse | Avoids encoding unchanged text. | Requires precise configuration keys and access-aware identity. |
| Parallel migration indexes | Permit safe embedding upgrades. | Temporarily increase storage and compute cost. |
Detect: Cache returns a vector with incompatible representation metadata.
Recover: Include model and preprocessing identity in every cache key.
Detect: Published index coverage is below the source manifest.
Recover: Track per-record status and block incomplete publication where required.
Include model, preprocessing, and normalization settings.
Keep tenant and source permissions separate.
Use stable chunk hashes and incremental manifests.