An empathetic, trauma-informed chatbot that helps people experiencing homelessness find services in NYC.
NO HALLUCINATION: LLM handles conversation ONLY. All service data comes from database queries.
StreetLives/
├── backend/ # Python FastAPI backend
├── frontend/ # React frontend (to be implemented)
├── services/ # Microservices (future)
├── infra/ # Infrastructure & deployment
└── docs/ # Documentation
- Trauma-informed dialog: Warm, patient, crisis-aware conversation
- Dynamic taxonomy: Service categories loaded from database (39 types)
- Eligibility-driven questions: Asks only what's needed based on service rules
- Progressive disclosure: One question at a time
- Session management: Tracks conversation state
- Privacy by design: Optional sensitive questions, consent required
# Start conversation
POST /api/chat/start
→ Returns: session_id + greeting
# Send message
POST /api/chat/message
{
"session_id": "uuid",
"message": "I need food"
}
→ Returns: empathetic response + extracted data + progress
# Check session status
GET /api/chat/session/{session_id}# Install Python dependencies
cd backend
pip install -r requirements.txt
# Set environment variables
cp ../.env.example ../.env
# Edit .env with database credentials
# Run backend
cd backend/api
python main.py
# API docs available at: http://localhost:8000/docsRequired in .env:
# Database
DB_HOST=your-db-host
DB_PORT=5432
DB_NAME=streetlives
DB_USER=your-user
DB_PASSWORD=your-password
# OpenAI
OPENAI_API_KEY=sk-...
OPENAI_MODEL=gpt-4o-mini
cd frontend
npm install
npm startFrontend will connect to backend API at http://localhost:8000
Production PostgreSQL database with:
- 2,414 locations across NYC
- 3,506 services from various providers
- 39 taxonomy categories (Food, Shelter, Clothing, etc.)
- 3,646 eligibility rules (determines what questions to ask)
See backend/DATABASE_SCHEMA_FINDINGS.md for details.
See CLAUDE.md for complete development log and progress tracking.
# Test database connection
cd backend/tests
python test_db_connection.py
# Explore database schema
cd backend/scripts
python explore_schema.py
# Run FastAPI server
cd backend/api
python main.pyVisit http://localhost:8000/docs for interactive API documentation.
- NO Hallucination: LLM NEVER generates service data
- Data-Driven: Questions based on database eligibility rules
- Trauma-Informed: Empathetic, patient, crisis-aware
- Privacy First: Consent required, optional sensitive questions
- Progressive Disclosure: One question at a time
- Template Queries: Pre-defined, parameterized, auditable
✅ Completed:
- Database schema exploration
- Pydantic models aligned with DB
- Dynamic taxonomy loader
- Conversational intake flow logic
- Empathetic dialog service (OpenAI)
- Session management
- FastAPI chat endpoints
⏳ In Progress:
- Query execution engine
- Service card formatter
- Frontend implementation
Copyright © 2025 StreetLives
For questions about this codebase, see CLAUDE.md for development log.