Skip to content

feat: Add per-request use_agentic toggle and slim retrieval response - #57

Merged
EricNGOntos merged 1 commit into
stagingfrom
feat/wuchengke/retrieval-api-cleanup
May 13, 2026
Merged

EricNGOntos merged 1 commit into
stagingfrom
feat/wuchengke/retrieval-api-cleanup

Conversation

@EricNGOntos

Copy link
Copy Markdown
Contributor

What

New request parameter: use_agentic

Adds a per-request boolean toggle to POST /v1/retrieval/query:

Value Behavior
true Force agentic retrieval (LLM-driven navigation + answer synthesis)
false Force legacy retrieval (3-channel RRF only)
null / omitted Use server default (RETRIEVAL_AGENTIC_ENABLED env var, currently true)

This allows SDK users to explicitly control retrieval mode per request without requiring server reconfiguration.

Removed deprecated parameter

  • enable_decomposition — was accepted but silently ignored since the workflow planner migration. Removed from both the request schema and internal function signature.

Slimmed response schema

Removed debug/internal fields from RetrievalQueryResponse that are not useful to SDK consumers:

Removed Field Reason
plan Internal query decomposition plan
steps (+ WorkflowStepResponse class) Per-step execution details
final_strategy_used Internal routing label
wallet_snapshot Token budget diagnostics
planner_snapshot Planner state diagnostics
evidence_text Raw hierarchical context fed to LLM

Retained core response fields: namespace, query, router_used, answer_text, referenced_chunks, results

Internal pipeline impact

None. All changes are at the API boundary layer only:

  • workflow/orchestrator.py — untouched
  • agentic/orchestrator.py — untouched
  • workflow/types.py — untouched (to_api_response() still generates full dict internally)
  • Pydantic response_model simply filters out extra fields during serialization

Verification

  • make lint — ✅ passed
  • make typecheck — ✅ 0 errors

- Add use_agentic (bool|null) request parameter: true=force agentic,
  false=force legacy, null=server default (RETRIEVAL_AGENTIC_ENABLED).
- Remove deprecated enable_decomposition parameter (was ignored).
- Strip debug-only response fields (plan, steps, wallet_snapshot,
  planner_snapshot, final_strategy_used, evidence_text).
- Keep core response: namespace, query, router_used, answer_text,
  referenced_chunks, results.
@EricNGOntos EricNGOntos self-assigned this May 13, 2026
@EricNGOntos
EricNGOntos merged commit 8e84cd6 into staging May 13, 2026
6 of 7 checks passed
@EricNGOntos
EricNGOntos deleted the feat/wuchengke/retrieval-api-cleanup branch May 13, 2026 14:42
EricNGOntos added a commit that referenced this pull request May 13, 2026
* feat: implement decomposed retrieval workflow system with query planning, synthesis, and execution budget management.

* fix(agentic): resolve asset reconciliation and navigation orchestrator bugs

* test: update retrieval contract test to assert new agentic response fields

* feat: enable agentic retrieval by default and sync env configs (#54)

* chore: remove stale SDK scaffolds from monorepo (#56)

The real SDKs live in standalone repos:
- Python: Ontos-AI/knowhere-python-sdk
- Node: Ontos-AI/knowhere-node-sdk

Deleted:
- packages/sdk-python/ (only contained build artifacts)
- packages/sdk-typescript/ (only contained dist/node_modules)
- packages/openapi-specs/ (empty, only node_modules)

Updated AGENTS.md project structure accordingly.

* feat: add per-request use_agentic toggle and slim retrieval API contract (#57)

- Add use_agentic (bool|null) request parameter: true=force agentic,
  false=force legacy, null=server default (RETRIEVAL_AGENTIC_ENABLED).
- Remove deprecated enable_decomposition parameter (was ignored).
- Strip debug-only response fields (plan, steps, wallet_snapshot,
  planner_snapshot, final_strategy_used, evidence_text).
- Keep core response: namespace, query, router_used, answer_text,
  referenced_chunks, results.

* docs: concisely update AGENTS.md for WorkflowOrchestrator and use_agentic (#58)

* fix: remove agentic internal fields from empty query contract test (#59)
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