Repository navigation
Description
Bug Description
After upgrading a self-hosted Hindsight deployment to v0.7.0, a large Codex/Hermes full-session retain appears to have corrupted the active memory bank.
This has two observable problems:
- Oversized async retain split one logical document into many child retain operations with the same
document_id. Later child operations overwrote earlier document state / memory units, so only a late chunk-sized slice survived. - Recall quality degraded badly after the upgrade. Irrelevant results are returned with apparently high normalized scores. In trace, raw Cohere-compatible reranker scores were very low, but Hindsight normalized the best bad candidate to
1.0.
This caused real data loss in practice: I spent many hours processing a large memory corpus with local accelerator/GPU-backed embedding and reranking endpoints, and after the upgrade the accumulated useful memory was effectively lost/corrupted.
Steps to Reproduce
- Run Hindsight v0.7.0 self-hosted with async retain enabled.
- Configure Codex integration with
retainMode=full-sessionand a stable sessiondocument_id. - Submit a large single-document conversation through retain.
- In my case one parent operation had one item, about 2.39M tokens, split into 262 child sub-batches.
- Let the worker process/retry the child operations.
- Fetch the document by
document_idand compare storedoriginal_textwith the original submitted text. - Run recall with
trace=trueon unrelated or weakly related queries and inspectcross_encoder_score,cross_encoder_score_normalized, andcombined_score.
Expected Behavior
For retain:
- A single logical document with a stable
document_idshould remain one logical document. - Internal async splitting/chunking must not turn one document into many independent full-replace writes.
- Child/sub-batch completion order must not decide which slice survives.
- Fetching the document by
document_idshould return the full original document, not one child slice. - Previously extracted memory units for the same logical document should not be deleted by later child chunks.
For recall:
- Scores shown in trace/UI should not imply strong relevance when all raw reranker scores are extremely low.
- If Cohere-compatible reranker scores are already probabilities/relevance scores in
[0,1], Hindsight should preserve meaningful absolute signal or expose both raw and normalized scores clearly. - A best-of-bad candidate should not become
1.0in a way that looks like high confidence.
Actual Behavior
Observed on my deployment:
- Hindsight v0.7.0 split one oversized single-document retain into many child operations.
- All child operations used the same
document_id. - Later child operations overwrote earlier document state / memory units.
- The active document row became exactly equal to a late child payload, not the full original session.
Concrete evidence:
- Parent operation:
3a01b1de-3345-4529-af9d-2d20127a7a00 - Bank:
eleanor-system-project - Document ID:
019e27f1-495a-77b2-a1e6-7a5c73556da4 - Parent had
items_count=1 - Total tokens: about
2,389,777 - Child sub-batches:
262 - Completed children:
167 - Failed children:
95 - Later child completion overwrote earlier document contents / memory units.
A second confirmation run showed the same shape:
- Parent split into
34child sub-batches. 33completed,1failed.- All children used the same
document_id. - The final stored document was exactly equal to child fix: doc build and lint files #34:
doc_len=22878child_len=22878exact_match=true
Recall quality also degraded. Example query:
кто такой хозяин?
Returned irrelevant facts such as:
WhatsApp не имеет add_to_contacts...
VK не поддерживает поиск/добавление по телефону...
Trace showed the raw reranker scores were very low:
cross_encoder_score = 0.004253690596669912
cross_encoder_score = 0.001749964663758874
cross_encoder_score = 0.0016085038660094142
But Hindsight normalized them to:
cross_encoder_score_normalized = 1.0
cross_encoder_score_normalized = 0.5
cross_encoder_score_normalized = 0.0
So the top irrelevant result appeared as a high-scoring result, even though the raw reranker score was near zero.
This made the recall output look confident while returning garbage.
Version
Hindsight v0.7.0Self-hosted Docker image:
ghcr.io/vectorize-io/hindsight:latest
sha256:03cfd4d99ca4a067fbc250473b44611a1a69ea4f7457da9e2af700ff0b999825
This was extremely disappointing as an end user. Hindsight is positioned as persistent memory, so silent memory corruption is one of the worst possible failure modes. In my case this wasted many hours of local accelerator/GPU processing and left the active memory bank in a state where recall became unreliable. I would strongly recommend treating this as a data-loss regression and adding either a migration warning, a hard safety check for oversized single-document async retain, or a safe recovery tool for affected users.
Version
Hindsight v0.7.0
LLM Provider
None
Activity
nicoloboschi commentedon May 28, 2026
I agree this is a critical problem, especially the retain issue. we're fixing it and releasing 0.7.1. Thanks for the patience
The normalization in the recall is expected as our recall results are sorted without absolute scores.
nicoloboschi commentedon May 28, 2026
fixed in 0.7.1 - sorry about it and thanks for raising the issue