Skip to content

feat: extract and persist Findings from ToolResults (FactStore Phase 2) #157

@luceinaltis

Description

@luceinaltis

Context

PR #156 introduced FactStore with TradeThesis persistence (Phase 1). The findings table schema is defined but not yet populated. Key analytical insights from ToolResult data are currently lost when the session ends.

Goal

Extract discrete Finding records from successful ToolResult objects during each query and persist them to fact_store.findings. This enables ticker-based recall of past insights (e.g. "what did we learn about AAPL's earnings last time?") without relying on free-text search.

Scope

  • Implement FactStore.save_finding() and FactStore.get_findings(entity, limit) CRUD methods
  • Create the findings DuckDB table (schema already sketched in Phase 1 plan)
  • Extract findings from ToolResult.data in ConversationEngine._persist_facts() — focus on trade_thesis, news, and fundamentals tool results
  • Add unit tests to tests/memory/test_fact_store.py

Non-goals

  • LLM-based finding extraction (keep it zero-LLM-cost for now — parse structured ToolResult.data directly)
  • UserPreference extraction (separate Phase 3 issue)

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