Skip to content

Commit c844944

Browse files
committed
Balance routing prompt — prefer precision over recall
The old prompt told the LLM to over-include ("when in doubt, include it"). This led to aggressive suggestions where tangentially related docs and skills were injected constantly. New rules: match against read_when hints, prefer fewer high-relevance items, leave it out when in doubt. Empty results are explicitly noted as valid and common.
1 parent a490d11 commit c844944

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

internal/prompt.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,17 @@ func Build(messages []Message, registry Registry) string {
2929
Based on the conversation above, decide what the agent needs before responding.
3030
3131
Rules:
32-
- Include any item that could plausibly be useful for what the user is asking
33-
- When in doubt, include it — it's better to over-suggest than to miss something relevant
34-
- Only exclude items that are clearly unrelated to the conversation
32+
- Only include items that are directly relevant to the user's current message
33+
- Match against the read_when hints — if the user's request doesn't match, don't include it
34+
- When in doubt, leave it out — unnecessary context wastes the agent's attention
35+
- For skills, only suggest when the task clearly fits the skill's purpose
36+
- Prefer suggesting fewer, higher-relevance items over many tangentially related ones
3537
- Return ONLY valid JSON, no explanation, no markdown fences
3638
3739
Return exactly:
3840
{"reasoning": "one sentence explaining your decision", "docs": ["path/to/doc.md"], "skills": ["skill-name"]}
3941
40-
If nothing is needed:
42+
If nothing is needed (this is a valid and common outcome):
4143
{"reasoning": "one sentence explaining why nothing is needed", "docs": [], "skills": []}
4244
`)
4345

0 commit comments

Comments
 (0)