Docs
First Run

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:

  1. Creates a teams row with a slug derived from your name
  2. Creates a teamMembers row linking you as owner

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:

  1. Send a message to POST /api/assistant/router with agentId: "receipt-scanner" and attach an image URL in the message
  2. The receipt-scanner agent calls the extract_receipt_data tool
  3. saveAgentResponse() in lib/ai/utils.ts intercepts the tool result and inserts a row into the assets table
  4. 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.