The in-app AI
Code: convex/ai.ts. Key: the space's own Claude key from its vault ("Connect your AI" in HQ, or the Connections page). The platform's own key is optional and off for now: when it's set, spaces without a key use it under the platform's limits (docs/build/AI-LIMITS.md); when it isn't, they see "Connect your AI".
How it works #
- The person sends a message (
ai.send), which schedulesai.respond. respondsends Claude the block list, the rules and the current blueprint, plus the last 20 messages.- Claude calls
propose_change({ summary, ops }). The server applies the ops to a copy and runscheckBlueprint. Errors go back to Claude to fix (up to 6 rounds). - A valid proposal is stored as pending. The person approves it in the chat or in HQ.
Limits #
- The AI never writes the blueprint directly; only
blueprint.approvedoes, after a person taps it. - It can't remove the HQ page.
- Mini-app HTML runs sandboxed (WebView on phones, iframe on web) with a strict content policy (no network).
Next tools #
read_blueprintfor big workspaces (send only the part it needs)- Capability tools: list connected MCP servers and keys by name, call them on the server
save_template: turn a page or the whole blueprint into a reusable template