Commit graph

16 commits

Author SHA1 Message Date
c2cabc01d3 feat(g1-g4): design system, memories pipeline, medical tracking, AI brain
G1 — Design System: 14 UI primitives (Button, Card, Modal, Sheet, Input,
Textarea, Select, EmptyState, LoadingShimmer, ConfirmDialog, WashiTape,
Badge, Avatar, Tabs), PageTransition with Framer Motion, sun/moon CSS vars,
Caveat font, /dev/components visual showcase.

G2 — Memories Pipeline: R2 presigned uploads, Sharp thumbnail generation,
LiteLLM vision captions + pgvector embeddings, CSS masonry gallery with
infinite scroll, private toggle, semantic search fallback to ILIKE.

G3 — Medical: dose log + correction audit trail, IAP vaccine bulk import,
emergency escalation page, pediatrician phone in settings.

G4 — AI Brain: keyword guardrail → LLM classifier → structured DB tool-use
(7 tools) → memory search → general parenting handler; ai_usage table;
22-case medical bypass safety test suite.

DB migrations: 0011_memories, 0012_medical_doses, 0013_ai_usage.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-17 17:48:34 +05:30
c459b4411a fix: secure /api/ai endpoint and remove debug routes
- Add auth to /api/ai via requireFamily middleware
- Remove /api/ai and /api/auth/debug from public routes
- Delete debug/test routes that expose internal state

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-17 16:41:47 +05:30
1628588d5a fix(ai): correct env var names and fresh session per home modal open
AI route was reading LITELLM_URL/LITELLM_KEY but env vars are named
LITELLM_BASE_URL/LITELLM_API_KEY — causing 503 on every request.

Home page chat now creates a fresh session each time the modal opens
and resets homeSessionId on close, so conversations don't pile into
the same old session.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-17 13:31:30 +05:30
b3e8b0a75f Fix TypeScript error in AI route 2026-05-16 23:13:24 +05:30
2196c3d07d Security hardening: auth, bcrypt, rate-limiting, RLS, audit 2026-05-16 23:11:01 +05:30
5f341d694a Fix model to minimax-2.7 2026-05-10 12:10:07 +05:30
50a5f2a972 Fix LiteLLM URL to llm.manohargupta.com 2026-05-10 12:09:21 +05:30
d318fed3ca Debug AI response 2026-05-10 12:09:12 +05:30
c466c8bad5 Use LiteLLM gateway URL 2026-05-10 12:08:48 +05:30
c6ae0593f6 Add Ollama fallback + better error handling 2026-05-10 12:06:47 +05:30
d070dd8d21 Fix MiniMax API with correct model name 2026-05-10 12:06:00 +05:30
bbb3953147 Use MiniMax API directly 2026-05-10 12:04:39 +05:30
89ca48b420 Try multiple model names for AI API 2026-05-10 12:01:11 +05:30
4e9935cb74 Fix AI model to minimax/Abab7.5-chat 2026-05-10 11:49:08 +05:30
1615847d5b Fix AI model to minimax-m2.7 2026-05-10 11:47:08 +05:30
e3ce3241d0 Add LiteLLM AI API and chat UI 2026-05-10 11:38:31 +05:30