Data Agent SMS Runtime (Convex code)¶
GiveCare reference note for the current V2 runtime across ../gc-sms/convex/,
../gc-sms/src/, ../gc-sms/CLAUDE.md, and
../gc-sms/ARCHITECTURE.md. Current-tense runtime claims should use those V2
files only.
Key information used in wiki¶
- The current backend is a compact SMS-first Convex service.
- The live schema is grouped around identity/signup, messaging/outreach, memory/graph recall, assessments/score snapshots, caregiver loops, opportunity candidates, grounded resources, safety/review, observability, public web metrics, and email/subscriber records.
- The inbound path is
convex/http.ts->convex/agent.ingestInbound->convex/scheduler.enqueueJob->convex/scheduler.processDueJobs->convex/agent.runTurn. - The turn path is harness-owned: regulatory, consent, and crisis policy gates run before model execution; classifier labels, the chief-of-staff brief, the active domain navigation frame, graph-ranked memory, and caregiver-load context shape Pi/Gemini execution; pre-commit evaluation and atomic commit happen after the draft reply.
- The current commit boundary is
convex/agentDb.ts:commitTurn, which inserts the pending outbound message, applies approved memory writes, patches profile fields, completes assessments, records a trace, opens a safety event when needed, and marks the job done. Follow-up requests are enqueued separately throughconvex/scheduler.ts. - Outbound delivery uses the outbox pattern:
commitTurnwrites a pending outboundmessagesrow,convex/outbound.tssends pending rows through Twilio, andconvex/outboundDb.tsrecords delivery callbacks.