Skip to content

feat: add retrieval query mode router (agent vs classic) - #469

Merged
EricNGOntos merged 1 commit into
mainfrom
feat/wuchengke/query-mode-router
Oct 24, 2026
Merged

EricNGOntos merged 1 commit into
mainfrom
feat/wuchengke/query-mode-router

Conversation

@EricNGOntos

Copy link
Copy Markdown
Contributor

Summary

  • When use_agentic is unset (None), run an LLM query router that chooses agent_explore vs classic map-unit BM25.
  • Explicit True/False still force the mode; small-corpus short-circuit stays first; failures/disabled fall back to agent.
  • Surface router_decision on the public retrieval response; document env knobs RETRIEVAL_QUERY_ROUTER_ENABLED / RETRIEVAL_QUERY_ROUTER_MODEL.

Test plan

  • make check
  • packages/shared-python/shared/tests/test_query_router_classifier.py
  • apps/api/tests/contract/test_retrieval_query_router_contract.py
  • Live LLM smoke: fact lookup → classic, compare/why → agent

Made with Cursor

- Updated the `use_agentic` parameter behavior to allow for a query router to choose between classic and agent retrieval modes.
- Modified documentation and environment examples to reflect the new routing logic.
- Introduced a router decision structure to capture the mode chosen by the query router.
- Adjusted retrieval execution logic to incorporate the new routing mechanism, ensuring seamless integration of agentic and classic retrieval methods.
@EricNGOntos
EricNGOntos merged commit 6bc056a into main Oct 24, 2026
6 checks passed
@EricNGOntos
EricNGOntos deleted the feat/wuchengke/query-mode-router branch October 24, 2026 05:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant