First Run
Sign up, send your first message, and see your first asset saved.
Create Your First Account
Visit http://localhost:3000 and sign up with email and password. An OTP verification email will be sent via Resend.
After email verification, the databaseHooks.user.create.after hook in lib/auth.ts automatically:
- Creates a
teamsrow with a slug derived from your name - Creates a
teamMembersrow linking you asowner
You're now fully set up — no manual team creation needed.
Send Your First Message
The main chat endpoint is POST /api/assistant/router. The request shape is:
{
messages: UIMessage[] // Vercel AI SDK UIMessage format
conversationId?: string // omit to create a new conversation
agentId?: string // optional: bypass routing and force a specific agent
modelId?: string // optional: override the agent's default model
}When conversationId is omitted, a new conversation is created and its ID is returned in the x-conversation-id response header.
The response is a Server-Sent Events stream in Vercel AI SDK format — use useChat from @ai-sdk/react on the frontend.
How Routing Works
Every message passes through the Orchestrator first. It makes one fast gpt-4o-mini call to decide which agent handles the request. You can skip this entirely by passing agentId in the request body:
// This routes directly to the receipt-scanner agent, no LLM routing call
{
messages: [...],
agentId: "receipt-scanner"
}This is useful for dedicated agent pages where the intent is always the same.
Your First Asset
Assets are outputs automatically saved from tool calls — images, posts, scripts, receipts, and more.
To create one, try uploading a receipt image to the chat with the receipt scanner:
- Send a message to
POST /api/assistant/routerwithagentId: "receipt-scanner"and attach an image URL in the message - The
receipt-scanneragent calls theextract_receipt_datatool saveAgentResponse()inlib/ai/utils.tsintercepts the tool result and inserts a row into theassetstable- Fetch your assets at
GET /api/assets
You never write asset-saving code. The Asset Interceptor handles all persistence automatically based on which tool was called.