Skip to content

feat: SessionDigest — structured replacement for Tier 2 free-text summaries #158

@luceinaltis

Description

@luceinaltis

Context

The current Tier 2 compaction writes a free-text Markdown summary via SessionCompactor. This loses structured information (tickers discussed, intent types, thesis IDs, confidence). PR #156 defined a SessionDigest dataclass but didn't implement persistence.

Goal

Write a SessionDigest record to the fact store alongside the existing Markdown summary on each compaction, preserving structured metadata that the free-text summary discards.

Scope

  • Implement FactStore.save_digest() and FactStore.get_sessions_for_ticker(ticker) CRUD methods
  • Create the session_digests DuckDB table (uses VARCHAR[] arrays for tickers/intents)
  • In ConversationEngine._maybe_compact(), accumulate tickers_discussed and intent_types_used across queries, then write digest on compaction
  • Add get_sessions_for_ticker() to enable "which sessions discussed AAPL?" lookups
  • Unit tests

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions