Real-memory hybrid recall validation v0.1

August 15, 2026 ยท View on GitHub

Scope and privacy boundary

On 2026-08-15, the opt-in hybrid recall path was tested against the local development database rather than a synthetic fixture. The corpus contained 16 recall-eligible evidence records in one exact user/agent/workspace scope. The test output contained only identifiers, scores, counts, hashes, ranks, and audit metadata. It did not print the API credential, source text, rendered recall text, or vectors.

The operator explicitly approved sending these 16 records to the configured Google Gemini embedding endpoint. Before migration, the schema-v3 database was copied to runtime/backups/dev-memory.pre-v4.20260815.db. Its SHA-256 was:

DE6494DC985D805578448E86D4259E8598A9864D4D1151C1FFF7A836CD52237D

Both database paths are ignored by Git.

Migration and cache result

The working database migrated to schema v4 and retained all 16 evidence records. Its embedding cache contains 16 vectors under the identity google-gemini / gemini-embedding-2 / 3072. The preserved backup remains schema v3 and has no embedding-cache table.

An idempotency rerun started with 16 cached vectors and ended with 16. Backfill reported zero candidates, zero inserts, and zero batches. Consequently, the rerun sent only the test query for embedding and did not resend source records.

Retrieval result

The fixed Chinese test query asked whether an autonomous silicon subject must necessarily become hostile to the humans who nurtured it. Lexical search found one candidate. Semantic search found eight candidates above the provisional 0.62 threshold, with cosine scores from 0.626252 to 0.774047.

The lexical first-ranked record was semantic rank two. Reciprocal-rank fusion therefore promoted that cross-leg match to fused rank one; semantic ranks one and three followed it. This demonstrates useful lexical/semantic complementarity on this corpus, without establishing general retrieval quality.

Model-visible runtime and audit result

The same query was executed through PassiveMemoryRuntime.prepareAndAuditHybridRecall(), not only through the lower-level search functions. The outcome was injected, retrieval version was hybrid-recall-v1, and three evidence records produced an 829-character model-visible recall block.

The audit's rendered SHA-256 matched the actual recall block. The serialized audit did not contain the raw query. Its semantic-maintenance fields recorded zero backfill candidates, inserts, and batches, matching the cache inspection.

Reproduction

The validation command requires Node.js 22 or newer because the project uses node:sqlite:

npm run validate:real-memory -- --database runtime/dev-memory.db --query '<query>'
npm run inspect:database -- runtime/dev-memory.db runtime/backups/dev-memory.pre-v4.20260815.db

validate:real-memory intentionally prints retrieval metadata. Run it only in an environment where hashed evidence identifiers and scores are acceptable.

Interpretation limits

This was one small, thematically related, operator-owned corpus with one inspection query. It verifies migration safety, cache reuse, exact runtime integration, fusion behavior, and privacy-oriented audit shape. It does not calibrate the 0.62 threshold for broader personal histories, establish recall or precision metrics, or replace independently labelled evaluation.

Subsequent runtime revision

After this validation, hybrid recall v2 moved document backfill out of agent/pre-step into resumable background maintenance. Recall audit v3 now records whether the semantic leg was used or made a sanitized lexical fallback. The v1/v2 identifiers and zero-backfill audit facts above remain the historical result of the frozen validation run rather than a description of the newer request path.

The revised runtime was then checked in --runtime-only mode against the same database and query. The cache remained 16 before and after, the maintenance probe found zero candidates, and the request sent only one query embedding. hybrid-recall-v2 selected the same three evidence ids and rendered 829 characters; its hash matched, the audit contained no raw query, and audit v3 recorded semantic outcome used.