Skip to content

feat: upgrade memory_search to use FactStore ticker lookup before text search #159

@luceinaltis

Description

@luceinaltis

Context

pipeline.memory_search() currently passes the raw user query directly to BM25/vector search. It has no awareness of Intent.tickers or the FactStore. This means "how's my AAPL thesis going?" relies on keyword overlap with past Markdown summaries instead of a direct SELECT * FROM theses WHERE ticker='AAPL'.

Goal

Make memory_search a two-stage retrieval: structured FactStore lookup first, free-text search as fallback.

Scope

  • Modify pipeline.memory_search() to accept fact_store parameter
  • When fact_store is available and the query contains ticker references, run get_open_theses(tickers) + get_findings(ticker) first
  • If structured results are sufficient, return them directly
  • Otherwise fall back to existing MemorySearcher.search(query) path
  • Thread fact_store through dispatcher → pipeline call chain
  • Update tests

Impact

This closes the last gap where cross-session memory depends on analyst LLM judgment. Ticker-based queries get deterministic recall.

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