Feature Request: More Flexible Router Block (Multi-Route Selection & Custom System Prompt)
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 30/100
- Issue type
- Feature
- Clarity
- Needs clarification
- Activity status
- Quiet
- Tech stack
- typescript
- Domain
- ai
Research direction
No files, tests, or code entry points are named. Start by locating the Router block implementation and its existing single-route behavior, then determine how the requested routing modes, custom prompt, no-match handling, and confidence outputs fit together. Done would require an agreed, backward-compatible scope for these changes.
Written by the indexing model from the issue text.
Description
Problem
The current Router block is useful for AI-powered routing, but it appears to be limited to selecting a single route and relies on a hidden internal system prompt. This makes the block less flexible for advanced workflows and prevents users from adapting the routing behavior to different use cases.
In many real-world scenarios, a single input may legitimately belong to multiple categories. For example:
- A support ticket may involve both Billing and Technical issues.
- User feedback may contain both a Bug Report and Product Feedback.
- A lead may qualify for multiple downstream workflows.
Currently, the Router seems designed around single-route classification, which limits these use cases.
Proposed Improvements
1. Route Selection Mode
Add a configurable routing mode with options such as:
Single Route (Current Behavior)
- Select exactly one best-matching route.
- Backward compatible with existing workflows.
Multiple Routes
- Allow the model to select multiple matching routes.
- Output an array of selected routes instead of a single value.
- Trigger multiple output ports simultaneously.
Example:
Input:
"Billing charges are incorrect and the API is returning errors."
Selected Routes:
- Billing
- Technical
2. Custom System Prompt
Expose the Router's system prompt as an optional advanced setting.
Example use cases:
- Adjust routing strictness.
- Allow multi-label classification.
- Prioritize specific business rules.
- Customize fallback behavior.
- Define confidence thresholds.
- Improve domain-specific routing.
Example:
"You may select multiple routes if the input clearly belongs to more than one category."
or
"Prefer the most specific route instead of the most general route."
This would significantly increase flexibility without affecting users who prefer the default behavior.
3. Configurable No-Match Behavior
Allow users to choose between:
- Route to Error Path
- Force Best Match
- Return Multiple Candidates
- Use Custom Fallback Route
4. Confidence Score Output
Provide an optional confidence score for each routing decision.
Example outputs:
- selectedRoute
- selectedRoutes
- confidence
- reasoning
This would help with debugging and workflow monitoring.
Benefits
- Supports both single-label and multi-label classification.
- Works better for complex enterprise workflows.
- Gives users more control over routing behavior.
- Reduces the need for custom LLM blocks before the Router.
- Makes the Router adaptable to a wider range of use cases.
Summary
The Router block would become significantly more powerful by supporting:
- Single-route and multi-route modes.
- User-configurable system prompts.
- Configurable no-match behavior.
- Confidence score outputs.
These changes would preserve backward compatibility while providing much greater flexibility for advanced workflow design.
- Dominant language
- TypeScript
- Stars
- 29.8k
- Forks
- 3.9k
- Avg merge
- 1h 43m
- Merged PRs (30d)
- 937
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from simstudioai/sim
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
simstudioai/sim#10710 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
simstudioai/sim#10708 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
simstudioai/sim#10706 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
simstudioai/sim#10704 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
simstudioai/sim#10702 ·
Maintainers usually reply within 1 day
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
melgarafael/DeskcommCRM#5614 · 1 comment ·
Maintainers usually reply within 1 day
-
documentation
Difficulty 1/5 Under an hour Newbie friendliness 76/100
slackapi/slack-health-score#253 ·
Maintainers usually reply within 1 day
-
feature needs triage site
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
owid/owid-grapher#8019 ·
Maintainers usually reply within 1 day
-
via-triage
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
bug:new
Difficulty 2/5 1-3 hours Newbie friendliness 73/100
callstackincubator/simlock#2088 ·
Maintainers usually reply within 1 day