Skip to content

smriti ask: RAG over full work history #61

Description

@ashu17706

What

A question-answering command over the entire work history. Unlike smriti recall (keyword/semantic search returning snippets), smriti ask takes a natural language question and synthesizes a grounded answer from past sessions.

smriti ask "why do we use post-filtering for vector search?"
smriti ask "how do we handle rate limiting in our APIs?"
smriti ask "what's the best approach for smriti's team sharing?"
smriti ask "when did we last work on the ingest pipeline?"

Pipeline

question
  → expandQuery()               # generate retrieval queries
  → multi-angle recall          # FTS + vec per sub-query
  → rerank(question, results)   # score relevance to question
  → top-5 sessions              # with citations
  → Ollama synthesis            # grounded answer with session references

Output:

We use post-filtering for vector search because sqlite-vec's virtual
tables hang when combined with JOIN queries (discovered March 14, smriti
session abc123). The fix: run vectors_vec unfiltered (3x overfetch),
then filter results in a separate batch lookup.

Sources:
  [1] abc123 — Vector search with filters: post-filter approach (Mar 14)
  [2] def456 — Two-step vector query pattern (Feb 27)

Difference from smriti recall --synthesize

recall --synthesize ask
Input Keyword/topic Natural language question
Retrieval Single search Multi-angle via expandQuery
Ranking RRF only RRF + rerank
Output Summary of what was found Answer to question + citations

Why

recall is a lookup tool. ask is a reasoning tool. It closes the gap between "I know roughly what I'm looking for" and "I have a question and need an answer."

Prerequisite: #58 (Phase 3), #59 preferred (Phase 4 for best quality)

Acceptance Criteria

  • smriti ask "question" command works end-to-end
  • Answer includes session citations with IDs and dates
  • --json flag returns structured output (answer + sources array)
  • --no-synthesize returns ranked sources only (no Ollama call)
  • Graceful fallback when Ollama unavailable (returns sources only)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions