fleet-memory/hindsight-api-slim/hindsight_api/engine/search
Nicolò Boschi 9cfdd464a9
fix(retain): preserve normalized experience fact types (#848)
* fix(retain): preserve normalized experience fact types and remove deprecated opinion type

The ExtractedFactType conversion was re-checking for raw "assistant" fact_type
after the parsing layer had already normalized it to "experience". Since
fact_from_llm.fact_type was always "experience" (never "assistant"), the ternary
always fell through to "world", silently losing experience classification.

Also removes the deprecated "opinion" fact type from internal extraction models,
database constraints/indexes (via migration), and dead code paths. The public API
surface (descriptions, response models, backwards-compat filter) is unchanged.

* refactor(retain): drop unused confidence_score column

The confidence_score column was only ever non-null for opinion facts
(which are now removed). It was always written as NULL and never read
back from the database. Remove it from:
- DB model and migration (DROP COLUMN)
- INSERT queries in fact_storage.py
- retain_async/retain_batch_async parameters
- RetainContext/RetainResult extension models
- RetainBatch dataclass
2026-04-02 12:20:37 +02:00
..
__init__.py breaking: remove BFS and MPFP graph retrieval strategies (#767) 2026-04-01 12:44:40 +02:00
fusion.py feat: introduce hindsight-api-slim and hindsight-all-slim packages (#560) 2026-03-13 13:50:03 +01:00
graph_retrieval.py fix(retain): preserve normalized experience fact types (#848) 2026-04-02 12:20:37 +02:00
link_expansion_retrieval.py perf: 3-phase retain pipeline — fix deadlocks, cap temporal links, query-time entity expansion (#722) 2026-04-01 12:52:49 +02:00
reranking.py fix: control plane UI fixes for recall and data view (#693) 2026-03-25 18:42:57 +01:00
retrieval.py breaking: remove BFS and MPFP graph retrieval strategies (#767) 2026-04-01 12:44:40 +02:00
tags.py feat: compound tag filtering via tag_groups (#562) 2026-03-13 14:30:11 +01:00
temporal_extraction.py feat: introduce hindsight-api-slim and hindsight-all-slim packages (#560) 2026-03-13 13:50:03 +01:00
think_utils.py fix(retain): preserve normalized experience fact types (#848) 2026-04-02 12:20:37 +02:00
trace.py fix(retain): preserve normalized experience fact types (#848) 2026-04-02 12:20:37 +02:00
tracer.py fix(retain): preserve normalized experience fact types (#848) 2026-04-02 12:20:37 +02:00
types.py breaking: remove BFS and MPFP graph retrieval strategies (#767) 2026-04-01 12:44:40 +02:00