AI-powered web platform for people caring for an elderly or ill loved one.
The project combines:
- guided intake form,
- legal-information retrieval (RAG),
- AI-generated personalized recommendations,
- interactive map of nearby social services.
When caregiving starts suddenly, people usually do not know:
- what support they are entitled to,
- what practical steps to take first,
- which services are available nearby.
What Now helps users move from uncertainty to an actionable plan in a few minutes.
- User opens frontend and fills a 4-step caregiving questionnaire.
- Frontend sends form data to backend endpoint
POST /api/v1/answer. - Backend converts answers into a compact retrieval query.
- Backend performs semantic search over indexed legal chunks in PostgreSQL + pgvector.
- Backend asks AI model for a grounded response based on retrieved sources.
- Backend finds relevant social services (semantic + optional geo-radius filter).
- Frontend renders the response (Markdown) and service map (Leaflet).
- User can continue in chat (
POST /api/v1/chat/messageor WebSocket/api/v1/chat/ws).
- Multi-step form (
/pomoc) - Result view with AI response and map modal
- Dedicated map page (
/mapa) - Responsive UI for desktop and mobile
- Laws ingestion and chunk indexing (JSON/PDF)
- Semantic search over legal text
- First-answer generation from form data
- Chat endpoint (HTTP + WebSocket)
- Social-service filtering and semantic matching
- PostgreSQL 16
- pgvector extension for embedding similarity
- Alembic migrations
- Main entities: law chunks, social services, service locations, target groups
- Next.js 16.1.6
- React 19.2.3
- TypeScript 5
- Tailwind CSS 4
- @tailwindcss/typography
- Leaflet 1.9.4
- React Leaflet 5.0.0
- react-markdown + remark-gfm
- Lucide React
- ESLint 9
- Python 3.13+
- FastAPI (async API)
- Uvicorn
- SQLAlchemy 2 (async)
- asyncpg
- pgvector
- Alembic
- Pydantic + pydantic-settings
- httpx
- sentence-transformers
- pypdf
- Docker + Docker Compose
- uv (Python package/dependency manager)
- PostgreSQL image:
pgvector/pgvector:0.6.0-pg16
tasks/service (Celery, Playwright, RabbitMQ) prepared for async parsing workflows- Services are currently commented out in
docker-compose.ymland are not part of the default runtime _gemma4/scripts in backend are experimental CLI utilities
what-now/
├── docker-compose.yml
├── frontend/ # Next.js application
├── backend/ # FastAPI application
├── tasks/ # Optional task workers (currently not active in compose)
└── test_docker.sh # Convenience script for compose validation/start
Base prefix: /api/v1
GET /laws/health- laws slice health checkPOST /laws/- upload/index law documentsGET /laws/- semantic law searchPOST /answer- first personalized answer from intake formPOST /chat/message- one-shot chat responseWS /chat/ws- realtime chat channelGET /map/services- paginated map services with filtersGET /map/services/{source_service_id}- service detailPOST /map/services/search- semantic + geo service search
- Docker + Docker Compose
- API credentials and model configuration for backend AI endpoint
Create backend environment file:
cp backend/.env.example backend/.envIf .env.example is not present, create backend/.env manually and provide at least:
# API
API_HOST=0.0.0.0
API_PORT=8001
# Database
POSTGRES_USER=backend
POSTGRES_PASSWORD=secret
POSTGRES_HOST=backend-db
POSTGRES_PORT=5432
POSTGRES_DB=whatnow
# AI
AI_MODEL_NAME=your-model-name
AI_SERVER_URL=https://your-ai-endpoint
AI_REQUEST_TIMEOUT=60docker compose --env-file backend/.env up -d --build- Frontend:
http://localhost:3000 - Backend API docs:
http://localhost:8001/docs
docker compose --env-file backend/.env downcd backend
uv sync
source .venv/bin/activate
alembic upgrade head
python main.pycd frontend
npm install
npm run dev- Legal text is chunked and stored with embeddings.
- Query and chunk vectors are compared using cosine distance in pgvector.
- Social-service matching combines semantic similarity with optional location radius.
- If user location is missing, semantic matching still works without geo filtering.
- Primary product language is Czech.
- AI quality depends on configured external AI server/model.
- No active scheduler runtime flow is currently wired into backend runtime path.
- Frontend details:
frontend/README.md - Backend details:
backend/README.md
This project is licensed under the MIT License. See the LICENSE file for details.