fleet-memory/hindsight-docs/docs/developer/api
Nicolò Boschi e2baca8bfe
feat: mental model history tracking and UI diff view (#516)
* feat: mental model refresh history tracking and UI diff view

- DB migration: add history JSONB column to mental_models table
- Track previous content on each refresh in update_mental_model
- Add get_mental_model_history() engine method
- New GET /mental-models/{id}/history endpoint
- Control plane proxy route and getMentalModelHistory() in api.ts
- MentalModelDetailModal: add History tab with lazy loading, carousel
  navigation (left=older, right=newer), word-level content diff view

* fix: resolve alembic migration head conflict for mental model history

* feat: mental model history tracking, side-by-side diff UI, and config flag

- Track content changes on every mental model update/refresh (persisted in JSONB history column)
- New GET /mental-models/{id}/history endpoint returning changes most-recent-first
- Side-by-side diff view in History tab (Before/After columns, line-level highlights)
- Actions dropdown in detail panel (Edit, Refresh, View History, Delete)
- HINDSIGHT_API_ENABLE_MENTAL_MODEL_HISTORY config flag (default: true)
- Also adds missing HINDSIGHT_API_ENABLE_OBSERVATION_HISTORY to configuration docs
- Python client wrapper method get_mental_model_history()
- Tests for history persistence (recorded, ordered, name-only skipped, missing returns None)
- Fix NameError: timezone not imported in update_mental_model

* fix: call get_mental_model_history before delete in doc example
2026-03-06 17:50:48 +01:00
..
documents.mdx feat: add tags filtering and q description fix for list documents API (#468) 2026-03-02 17:03:16 +01:00
main-methods.mdx chore: internal renames (#204) 2026-01-27 09:53:28 +01:00
memory-banks.mdx feat: add source facts token limits to consolidation and recall (#509) 2026-03-06 13:01:33 +01:00
mental-models.mdx feat: mental model history tracking and UI diff view (#516) 2026-03-06 17:50:48 +01:00
operations.md chore: internal renames (#204) 2026-01-27 09:53:28 +01:00
quickstart.mdx doc: mental models (#199) 2026-01-26 14:27:08 +01:00
recall.mdx feat: filter graph memories with tags (#431) 2026-02-25 10:31:40 +01:00
reflect.mdx doc: improve api explanation (#415) 2026-02-20 17:02:01 +01:00
retain.mdx feat: support timestamp="unset" to retain content without a date (#465) 2026-03-02 12:03:23 +01:00
webhooks.mdx feat: webhook system with retain.completed event, UI, and docs (#487) 2026-03-04 14:17:01 +01:00