convex-subconscious
Installation
SKILL.md
Convex + Subconscious: Full-Stack Real-Time AI Apps
Build production apps where AI agents modify data in real-time and every connected client sees changes instantly — no polling, no manual WebSocket management, no cache invalidation.
Mental Model
Subconscious runs AI agents. Give it instructions + tools, it reasons, calls your tools, returns results. The "function tool" pattern hooks your Convex HTTP endpoints into the agent — Subconscious POSTs to your endpoint, which writes to Convex DB, which instantly pushes updates to all clients via WebSocket.
Convex is a reactive database + serverless backend. Queries are read-only and reactive (auto-push via WebSocket). Mutations are transactional writes. HTTP actions expose public endpoints at https://<deployment>.convex.site. Actions call external APIs.
The Reactive Loop (Core Pattern)
1. React calls useAction(api.agent.triggerAgent) → starts Subconscious run
2. Subconscious agent reasons, calls POST /tools/create-item
3. Convex HTTP action calls ctx.runMutation(internal.items.create, ...)
4. Convex DB writes → invalidates all subscriptions to items.list
5. All clients subscribed via useQuery(api.items.list) re-render instantly
Related skills