A memory is saved successfully. Its detail page shows the new text. A keyword query finds it. A semantic query does not. Those observations can all be true at the same time.
In the accepted METABOLIQ Brain foundation, the memory record and its embedding have different lifecycles. The source row commits before background model execution completes. That keeps model execution outside the save path, but introduces a period when semantic retrieval may not reflect the saved version.
For Article 008, we tested that boundary with fictional data, injected failures and controlled thread interleavings against an isolated copy of the merged implementation. The scope remains one owner on a trusted local machine. Active ingestion development is outside this article.
Saved and indexed are separate states
The database stores an embedding row for a particular memory and model, along with the memory version, status and retry metadata. With an active index configuration, an insertion or version-changing update queues a pending embedding in the same database transaction as the source change.
The model runs afterward. A successful save therefore does not promise that a current embedding already exists. In our focused test, saving still succeeded while the embedding provider was configured to fail. The source record remained readable, keyword search found it, and the embedding row moved from pending to failed when indexing was attempted.
Keeping model execution outside the save path is not a guarantee that every save succeeds under any infrastructure failure. The database and queueing trigger still participate in the transaction. Raw changes that do not advance the memory version are also outside the normal versioned-write contract.
An old job must not overwrite a newer version
An indexing job reads the source version, computes its vector outside the database transaction and publishes only where the queued embedding version still matches the version it read. At semantic candidate selection, the query requires a ready embedding for the active model whose version matches the memory row.
We paused a version-one indexing job during model execution, edited the memory to version two and then released the older job. Its successful computation was reported as superseded. The newer row remained pending with no vector until it was indexed.
We repeated the interleaving with a delayed model failure. The old job reported failure, but did not mark the newer pending version as failed or increment its retry count. A subsequent job indexed the current version.
Those checks establish behavior for the tested publication and failure races. They do not establish correctness under every possible concurrent operation.
Candidate freshness is not a snapshot of the whole search
There is a separate boundary after candidate selection. Search first chooses candidate identifiers and ranking information, then reselects source records under the caller's access scope before constructing the response.
We paused a semantic request after its candidates had been selected but before that final record read. While it waited, we changed the selected memory's title and content. The response then contained version two and its new title, together with semantic ranking information computed before the edit.
The following semantic request omitted that memory while its new embedding remained pending. The observed in-flight response was not a single point-in-time snapshot of content and ranking.
This distinction prevents an overly broad claim that “a stale vector can never affect a response.” The candidate query rejects an already-stale vector at that stage, but a later edit can leave the selected score associated with newer returned content. The final access check and ranking freshness are different concerns.
Multiple workers can repeat computation
The index worker can run in more than one API process. Its due-work query does not reserve a job exclusively for one worker before model execution.
In a controlled two-worker test, both jobs reached the embedding provider for the same memory version. Both reported an indexed outcome, while the database retained one ready row for that memory and model.
That is useful protection against duplicate rows, not exactly-once computation. Overlapping workers may spend compute on the same version. We used a deterministic fake provider for these concurrency tests; they do not benchmark model throughput or all multi-process schedules.
Failure needs a visible route back to ready
Failed embedding rows carry attempt counts and an error field. Automatic retry eligibility uses a bounded backoff and attempt limit. The owner can explicitly requeue failed work after addressing its cause.
We exhausted the configured attempt limit and made the failure old enough that backoff alone would no longer block it. The row was still absent from due work. An owner retry reset its attempts, queued it again and allowed indexing to succeed.
We also injected a database error during vector publication. The source remained at its saved version and the embedding remained pending; a later indexing attempt completed. That check covers the injected publication failure, not every crash or uncertain-commit scenario.
A separate worker test forced the first configuration synchronization to raise an exception. The worker survived, retried synchronization and indexed the fictional memory. The implementation also periodically reconciles missing or older-version rows. In our explicit reconciliation test, removing a derived embedding and synchronizing configuration recreated pending work without editing the source memory.
Provider failure does not have one universal search outcome
Keyword retrieval does not need a query embedding. When a semantic request needs a new query vector and the provider is unavailable, the tested path returns an unavailable error. A hybrid request in that condition can return keyword results with a degraded notice.
There is a qualification: query embeddings are cached. We warmed a semantic query, failed the provider and repeated that query. It still returned the indexed memory. A different, uncached query returned an error, while a hybrid query fell back to keyword retrieval.
An outage therefore does not imply that every semantic request fails immediately. Cache state, existing ready vectors and the requested mode affect the observed behavior. A keyword fallback is also not a promise of the same ranking or recall as functioning hybrid retrieval.
Freshness metadata must respect access boundaries
Semantic and hybrid responses report whether the authorized scope has current embeddings and how many records in that scope lack them. The field named pending_in_scope is broader than a count of database rows whose literal status is pending: missing, failed or otherwise non-current embeddings can also contribute.
The owner-facing index status distinguishes ready, pending, failed, missing and other-model records. Its provider health check and worker-running indicator answer different questions. A successful health probe does not prove the backlog is drained or that every memory is ready.
In another paused-indexing test, the owner raised a memory's sensitivity while its older embedding was being computed. The old result was superseded. After the current version was indexed, the restricted agent still could not retrieve the record, and its pending count did not reveal that hidden record.
A model-switch test paused an old-model job while a differently named model with different dimensions became active in a separate application instance. The older job could finish its own row, but the new instance did not use that old-model vector. It returned the memory only after indexing it for the new model. The test did not establish arbitrary mixed-configuration deployment safety.
What the checks establish
All 12 focused failure and concurrency cases passed. They used a real PostgreSQL database with pgvector, deterministic fake embedding providers, explicit synchronization points and fictional owners and memories. The controlled interleavings are reproducible examples rather than an exhaustive concurrency proof.
The source was exported from the merged accepted foundation. Remote freshness could not be independently confirmed because the configured Git credential helper was unavailable. Active MB-003 changes, existing memory databases and real credentials were excluded from the verification.
These checks do not measure semantic relevance, real-model inference speed, indexing latency guarantees, large-corpus performance or production availability. They also do not audit every diagnostic or external log. The evidence package records the regression suites and website checks separately.
A save acknowledgement means the source transaction completed. It does not mean every retrieval path already sees the same version. Making that distinction visible—along with retry behavior, cache effects and the remaining read race—gives users a more accurate account of the system they are operating.
← All engineering articles