refactor: remove inferred_categories from RecallState and update category merging logic

- Removed the inferred_categories field from RecallState to simplify state management.
- Updated the _merged_categories method to only merge caller-supplied categories, enhancing clarity in category handling.
This commit is contained in:
Joao Moura
2026-03-03 07:53:51 -08:00
parent 9d09a173e6
commit a3ea6d280a

View File

@@ -37,7 +37,6 @@ class RecallState(BaseModel):
query: str = ""
scope: str | None = None
categories: list[str] | None = None
inferred_categories: list[str] = Field(default_factory=list)
time_cutoff: datetime | None = None
source: str | None = None
include_private: bool = False
@@ -84,7 +83,7 @@ class RecallFlow(Flow[RecallState]):
def _merged_categories(self) -> list[str] | None:
"""Merge caller-supplied and LLM-inferred categories."""
merged = list(
set((self.state.categories or []) + self.state.inferred_categories)
set((self.state.categories or []))
)
return merged or None
@@ -212,10 +211,6 @@ class RecallFlow(Flow[RecallState]):
)
self.state.query_analysis = analysis
# Wire keywords -> category filter
if analysis.keywords:
self.state.inferred_categories = analysis.keywords
# Parse time_filter into a datetime cutoff
if analysis.time_filter:
try: