Expose retrieval mode in query-based responses for easier debugging #14

Open
opened 2026-04-03 11:27:12 +00:00 by sam · 0 comments
Member

Summary

Expose whether a query-based tool used semantic/vector search or the Postgres full-text fallback path in its response payloads.

Why

llm/todo.md lists this as a useful follow-up for debugging search behavior after the semantic fallback work. Right now fallback appears to be implemented, but callers cannot easily tell which retrieval mode was used for a given response.

Affected tools

Consider this for the query-based tools that use shared retrieval logic:

  • search_thoughts
  • recall_context
  • get_project_context when query is provided
  • summarize_thoughts when query is provided
  • semantic neighbors in related_thoughts

Scope ideas

  • Add a small machine-readable field such as retrieval_mode: semantic|text
  • Preserve backward compatibility for existing clients
  • Keep the field consistent across all query-driven outputs
  • Update README and any relevant tests

Acceptance criteria

  • Query responses clearly indicate whether vector search or full-text fallback was used
  • The field is consistent across the supported tools
  • Documentation and tests cover the new output shape

Source

Nice follow-up from llm/todo.md: expose the retrieval mode in responses for easier debugging of semantic vs text fallback.

## Summary Expose whether a query-based tool used semantic/vector search or the Postgres full-text fallback path in its response payloads. ## Why `llm/todo.md` lists this as a useful follow-up for debugging search behavior after the semantic fallback work. Right now fallback appears to be implemented, but callers cannot easily tell which retrieval mode was used for a given response. ## Affected tools Consider this for the query-based tools that use shared retrieval logic: - `search_thoughts` - `recall_context` - `get_project_context` when `query` is provided - `summarize_thoughts` when `query` is provided - semantic neighbors in `related_thoughts` ## Scope ideas - Add a small machine-readable field such as `retrieval_mode: semantic|text` - Preserve backward compatibility for existing clients - Keep the field consistent across all query-driven outputs - Update README and any relevant tests ## Acceptance criteria - Query responses clearly indicate whether vector search or full-text fallback was used - The field is consistent across the supported tools - Documentation and tests cover the new output shape ## Source Nice follow-up from `llm/todo.md`: expose the retrieval mode in responses for easier debugging of semantic vs text fallback.
Sign in to join this conversation.