Summary
The Advisor persists a per-session interaction summary to the learner's Person record, but two gaps make that capture unreliable and non-durable.
Persistence path today: POST /logout → save_interaction_summary task → MCP lif_mutation → GraphQL updatePerson → Query Planner /update → LIF Cache /update → MongoDB LIF.person, appended under the person's interactions array. The saved object is a rollup (summary, sentiment, severity, followupRequired, interactionStart/End, channel=AI_AGENT, interactionType=ADVISING) — not the turn-by-turn transcript (that lives only in-memory: conversation_states + LangGraph InMemorySaver).
Gap 1 — capture is best-effort, tied to explicit logout
bases/lif/advisor_restapi/core.py:286-307 only summarizes when the user hits /logout and there's a live in-memory agent (if state and state.get("lif_ai_agent")). So no summary is saved when:
- the user just closes the tab / navigates away,
- the access token expires without an explicit logout,
- the session was restored after an advisor-api restart (no in-memory agent), or
- the advisor-api process restarts/redeploys mid-session (single worker, in-memory state — the whole conversation is lost before it can be summarized).
There is no turn-level or periodic persistence — it's all-or-nothing at logout.
Gap 2 — cache-only durability (no source of truth)
The interaction is written only to the LIF Cache (components/lif/query_planner_service/core.py:178-193 — "Execute a LIF update on the LIF Cache"; query_cache_service/core.py:34-35, Mongo LIF.person). Unlike other LIF fragments, which the orchestrator can re-pull from upstream source systems, advisor interactions have no upstream source — nothing writes them back. Their longevity is therefore bounded by the cached Person document's lifetime; if that record is evicted or rebuilt, the interactions are gone with no way to recover them.
Impact
Advisor interaction history (and the sentiment/severity/follow-up signals derived from it) is lossy and non-durable — fine for a demo, but not a dependable record of advising interactions.
Possible directions (not prescriptive)
- Capture incrementally / on a heartbeat rather than only at logout (survives tab-close, token expiry, and restarts).
- Give advisor interactions a real system of record (a durable store or a designated source) rather than writing learner-data mutations into the cache — ties into ADR-0002/ADR-0003 (cache vs. source, mutation write-back semantics).
- At minimum, document the current behavior as demo-tier best-effort so it isn't mistaken for a reliable audit trail.
Found while answering an architecture question about advisor chat-session storage.
Summary
The Advisor persists a per-session interaction summary to the learner's Person record, but two gaps make that capture unreliable and non-durable.
Persistence path today:
POST /logout→save_interaction_summarytask → MCPlif_mutation→ GraphQLupdatePerson→ Query Planner/update→ LIF Cache/update→ MongoDBLIF.person, appended under the person'sinteractionsarray. The saved object is a rollup (summary,sentiment,severity,followupRequired,interactionStart/End,channel=AI_AGENT,interactionType=ADVISING) — not the turn-by-turn transcript (that lives only in-memory:conversation_states+ LangGraphInMemorySaver).Gap 1 — capture is best-effort, tied to explicit logout
bases/lif/advisor_restapi/core.py:286-307only summarizes when the user hits/logoutand there's a live in-memory agent (if state and state.get("lif_ai_agent")). So no summary is saved when:There is no turn-level or periodic persistence — it's all-or-nothing at logout.
Gap 2 — cache-only durability (no source of truth)
The interaction is written only to the LIF Cache (
components/lif/query_planner_service/core.py:178-193— "Execute a LIF update on the LIF Cache";query_cache_service/core.py:34-35, MongoLIF.person). Unlike other LIF fragments, which the orchestrator can re-pull from upstream source systems, advisor interactions have no upstream source — nothing writes them back. Their longevity is therefore bounded by the cached Person document's lifetime; if that record is evicted or rebuilt, the interactions are gone with no way to recover them.Impact
Advisor interaction history (and the sentiment/severity/follow-up signals derived from it) is lossy and non-durable — fine for a demo, but not a dependable record of advising interactions.
Possible directions (not prescriptive)
Found while answering an architecture question about advisor chat-session storage.