Skip to content

Add passive hydration keyword boost from FTS5 #70

Description

@durch

Goal

Enhance passive hydration to include keyword-matched tool results alongside semantic results. Catches exact matches that vector search misses.

Depends on: #69 (FTS5 keyword search)

Design: .oh/designs/fts5-tool-result-search.md (Phase 2)

Context

Passive hydration currently uses LanceDB vector search only. After #69 lands, we have an FTS5 store of all tool results. This issue adds a keyword boost step to passive hydration:

  1. Extract distinctive terms from the hot window (file paths, error codes, identifiers)
  2. Query FTS5 with those terms
  3. If any keyword results aren't already in the semantic results, append them (up to 2-3 extra entries within hydration budget)

Additive only -- doesn't replace semantic search, just catches the "exact error code" case.

Acceptance Criteria

  • Passive hydration queries FTS5 after semantic search
  • Keyword results that duplicate semantic results are filtered out
  • Up to 2-3 keyword-only results appended within hydration budget
  • Term extraction from hot window is lightweight (paths + identifiers, not full text embedding)
  • Keyword boost is skippable if FTS5 store unavailable
  • No measurable latency increase on the hot path (keyword query is fast)

Technical Notes

Files to modify

  • packages/coding-agent/src/context/recall/passive-hydration.ts

Approach

  • After searchRecall() returns semantic results, extract key terms from hot window
  • Run FTS5 query via ToolResultStore.search()
  • Dedup against semantic results (match by content hash or turn number)
  • Append novel keyword results up to budget

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestoh-plannedCreated via oh-plan skill

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions