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

Closed
opened 2026-04-03 11:27:12 +00:00 by sam · 3 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.
Member

Implementation on branch issue-14-expose-retrieval-mode, commit cfc78e0493. All five query-driven tools now return retrieval_mode (semantic or text) in their response payloads. Fields use omitempty for backwards compatibility. Tests added in retrieval_test.go. README updated. Verified: go build ./internal/tools/... clean, go test ./internal/tools/... all pass. No blockers.

Implementation on branch issue-14-expose-retrieval-mode, commit cfc78e049312adaf18d94b2056c94e65864b56ee. All five query-driven tools now return retrieval_mode (semantic or text) in their response payloads. Fields use omitempty for backwards compatibility. Tests added in retrieval_test.go. README updated. Verified: go build ./internal/tools/... clean, go test ./internal/tools/... all pass. No blockers.
Member

Dispatcher follow-up: PR created for the pushed implementation.

PR: #37 (#37)
Branch: issue-14-expose-retrieval-mode
Commit: cfc78e0493

Verification reported by worker:

  • go build ./internal/tools/... ./internal/store/... ./internal/mcpserver/... — pass
  • go test ./internal/tools/... -count=1 — pass

Caveat: go build ./... was not used as final verification because internal/app embeds ui/dist when UI assets are absent in the worker environment.

Issue left open for review/merge workflow.

Dispatcher follow-up: PR created for the pushed implementation. PR: https://git.warky.dev/wdevs/amcs/pulls/37 (#37) Branch: issue-14-expose-retrieval-mode Commit: cfc78e049312adaf18d94b2056c94e65864b56ee Verification reported by worker: - go build ./internal/tools/... ./internal/store/... ./internal/mcpserver/... — pass - go test ./internal/tools/... -count=1 — pass Caveat: go build ./... was not used as final verification because internal/app embeds ui/dist when UI assets are absent in the worker environment. Issue left open for review/merge workflow.
Member

Closing after verification: PR #37 (#37) was merged on 2026-07-14T14:44:14Z and implements retrieval_mode exposure for query responses. Verification recorded: go build ./internal/tools/... ./internal/store/... ./internal/mcpserver/...; go test ./internal/tools/... -count=1.

Closing after verification: PR #37 (https://git.warky.dev/wdevs/amcs/pulls/37) was merged on 2026-07-14T14:44:14Z and implements retrieval_mode exposure for query responses. Verification recorded: go build ./internal/tools/... ./internal/store/... ./internal/mcpserver/...; go test ./internal/tools/... -count=1.
Sign in to join this conversation.