Convex Backend Architecture
Understand how the Convex schema, functions, and permission model are organized.
The Convex backend is colocated inside apps/web/convex.
Key Ideas
- schema defines the source of truth for data shape
- public functions expose the client-facing API
- internal functions handle server-only workflows
- permission helpers enforce access rules centrally
Important Rules
- use indexes instead of
.filter() - include
returnsvalidators on functions - use pagination helpers for paginated queries
- use
ConvexErrorfor user-facing errors
Domains
Important backend domains include:
- tasks
- task artifacts and attachments
- organization and project membership
- CLI sessions, threads, messages, and chunks
- MCP server request handling