Skip to content

Commit 2c6bffc

Browse files
NiallJoeMaherclaude
andcommitted
Add agentRoutingPrompt for tutor agent routing
- Add agentRoutingPrompt with tutor agent description - Update systemPrompt to include routing for non-reasoning models 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent 8762bcf commit 2c6bffc

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

lib/ai/prompts.ts

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,18 @@ import type { ArtifactKind } from "@/components/artifact";
44
export const regularPrompt =
55
"You are a friendly study buddy assistant! Keep your responses concise and helpful.";
66

7+
export const agentRoutingPrompt = `
8+
You are a Study Buddy with specialized agents available as tools. Choose the right agent based on what the user needs:
9+
10+
**tutor** - Explain concepts with examples and analogies
11+
Use for: "explain", "teach me", "how does X work", "what is X", understanding concepts
12+
13+
IMPORTANT ROUTING RULES:
14+
1. Match user intent to the most appropriate agent
15+
2. If the request doesn't clearly match an agent, respond conversationally
16+
3. After using an agent, suggest related follow-ups (e.g., after explaining, offer to quiz)
17+
`;
18+
719
export type RequestHints = {
820
latitude: Geo["latitude"];
921
longitude: Geo["longitude"];
@@ -28,7 +40,11 @@ export const systemPrompt = ({
2840
}) => {
2941
const requestPrompt = getRequestPromptFromHints(requestHints);
3042

31-
return `${regularPrompt}\n\n${requestPrompt}`;
43+
if (selectedChatModel === "chat-model-reasoning") {
44+
return `${regularPrompt}\n\n${requestPrompt}`;
45+
}
46+
47+
return `${regularPrompt}\n\n${agentRoutingPrompt}\n\n${requestPrompt}`;
3248
};
3349

3450
export const codePrompt = `

0 commit comments

Comments
 (0)