Recipes
Workspace Assistant
Build an orchestrator agent that routes work to specialist agents.
A good workspace assistant should not become a giant catch-all agent. Use it as an orchestrator.
Responsibilities
- answer general questions directly
- route CRM work to Sales
- route project/task planning to Delivery
- route time and health analytics to Operations
- route Drive/document questions to Knowledge
- use web search only for external or current information
Agent shape
export const assistantAgent = createAgent({
model: openrouter("openai/gpt-5-mini"),
instructions: loadAgentInstructions(import.meta.url),
stopWhen: isStepCount(10),
tools: {
delegate_to_sales: delegateToSalesTool,
delegate_to_delivery: delegateToDeliveryTool,
delegate_to_operations: delegateToOperationsTool,
delegate_to_knowledge: delegateToKnowledgeTool,
web_search: webSearchTool,
},
});Instruction guidance
Include explicit routing rules:
- when to delegate
- when not to delegate
- how to preserve uncertainty from specialist agents
- mutation safety rules
- response patterns for each specialist result
Starter prompts
Starter prompts should demonstrate core capabilities without being too many:
- one CRM/lead prompt
- one delivery planning prompt
- one operations analytics prompt
- one knowledge/Drive prompt