Skip to content

feat(n8n): wire up PreRouter for complexity-based routing#172

Merged
saschabuehrle merged 1 commit intomainfrom
feat/n8n-prerouter-wiring
Mar 11, 2026
Merged

feat(n8n): wire up PreRouter for complexity-based routing#172
saschabuehrle merged 1 commit intomainfrom
feat/n8n-prerouter-wiring

Conversation

@saschabuehrle
Copy link
Copy Markdown
Collaborator

Summary

  • Replace manual hard/expert complexity check with PreRouter, providing configurable cascade complexities, domain-aware routing context, and structured RoutingDecision with strategy/reason/confidence
  • Falls back to manual ComplexityDetector logic when PreRouter is unavailable
  • Add router: 'pre-router' | 'complexity' metadata to direct_verifier response

Test plan

  • PreRouter routes trivial queries to CASCADE strategy
  • PreRouter routes expert queries to DIRECT_BEST strategy
  • Constructor initializes preRouter when useComplexityRouting is true
  • Complex query e2e test asserts metadata.router === 'pre-router'
  • All 65 tests pass (4 test files)
  • Build succeeds

Replace manual hard/expert complexity check with PreRouter, which provides
configurable cascade complexities, domain-aware routing context, statistics
tracking, and structured RoutingDecision with strategy/reason/confidence.
Falls back to manual ComplexityDetector logic when PreRouter is unavailable.
@saschabuehrle saschabuehrle merged commit c2f60a0 into main Mar 11, 2026
25 of 27 checks passed
@saschabuehrle saschabuehrle deleted the feat/n8n-prerouter-wiring branch March 11, 2026 18:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant