How farheenaiml/nurtureai works
NurtureAI is a maternity and health companion whose main workflow takes a user’s text or voice question through a web interface to an AI service, where a planner selects a specialist, guideline retrieval supplies context, and a critic reviews the draft before a response is returned. The application also includes pregnancy and postpartum tracking, nutrition, symptoms, and account features. README documentation describes capabilities beyond the sampled code; links for those are cited to the README rather than treated as source-inspected.
Main entry points: app.ai-assistant.tsx AI chat interface · main.py AI backend · app.index.tsx Maternity dashboard · aiServer.ts AI request service
Components 24
Web experience
- Maternity dashboard
src/routes/app.index.tsx - Care tracking pages
src/routes - Nutrition tracking
src/routes/app.nutrition.tsx - Pregnancy journey
src/routes/app.pregnancy.tsx - AI chat interface
src/routes/app.ai-assistant.tsx - Voice mode
src/components/ai/VoiceMode.tsx
Application services
- Account state
src/store/authStore.ts - Authentication service
src/backend/authServer.ts - PostgreSQL
- AI request service
src/backend/aiServer.ts - Fallback responses
src/backend/mockFallback.ts - Application data
src/services/mockData.ts
AI agent workflow
- AI backend
agents/main.py - Query planner
agents/planner_agent.py - Domain specialists
agents - Safety critic
agents/critic_agent.py
Guideline retrieval
- Context retriever
agents/rag/retriever.py - Query embeddings
agents/rag/embeddings.py - ChromaDB store
agents/rag/vector_store.py - Guideline ingestion
agents/rag/ingest.py
Voice processing
- Voice endpoints
agents/voice/routes.py - Speech recognition
agents/voice/speech_to_text.py - Speech synthesis
agents/voice/text_to_speech.py
Other components
- User
Connections 23
- User → Maternity dashboard: uses
- User → AI chat interface: asks questions
- Maternity dashboard → Care tracking pages: opens care tools
- AI chat interface → AI request service: sends prompt
src/routes/app.ai-assistant.tsx - AI chat interface → Voice mode: offers voice mode
src/routes/app.ai-assistant.tsx - AI chat interface → Application data: reads questions
src/routes/app.ai-assistant.tsx - Maternity dashboard → Application data: reads dashboard data
src/routes/app.index.tsx - Nutrition tracking → Application data: reads nutrition data
src/routes/app.nutrition.tsx - Pregnancy journey → Account state: reads profile
src/routes/app.pregnancy.tsx - Account state → Authentication service: calls account actions
src/store/authStore.ts - Authentication service → PostgreSQL: reads and writes
src/backend/authServer.ts - AI request service → AI backend: forwards AI requests
- AI request service → Fallback responses: uses fallback
src/backend/aiServer.ts - AI backend → Query planner: routes query
agents/main.py - AI backend → Domain specialists: dispatches query
agents/main.py - AI backend → Safety critic: reviews draft
agents/main.py - Domain specialists → Context retriever: retrieves context
agents/emergency_agent.py - Context retriever → Query embeddings: embeds query
agents/rag/retriever.py - Context retriever → ChromaDB store: queries collection
agents/rag/retriever.py - Guideline ingestion → ChromaDB store: stores guideline chunks
agents/rag/ingest.py - Voice mode → Voice endpoints: uses voice endpoints
- Voice endpoints → Speech recognition: transcribes audio
agents/voice/routes.py - Voice endpoints → Speech synthesis: generates speech
agents/voice/routes.py