Production FastAPI/Lambda backend and React frontend for alcohol risk estimation, chemical exploration, grounded scientific retrieval, and conservative safety guidance.
- Estimates only.
- Not medical advice.
- Not legal or driving advice.
- Never use this system to decide whether it is safe to drive.
- Frontend: AWS Amplify, React, TypeScript, Vite.
- Backend: FastAPI in an AWS Lambda container image.
- Artifact storage: MongoDB Atlas GridFS.
- Vector retrieval: Pinecone.
- Graph database: Neo4j Aura.
- Generation: verified remote Ollama model when enabled; deterministic grounded synthesis when Ollama is disabled or unavailable.
- PBPK simulator:
backend/simulation/pbpk/pbpk_master_simulator.py - Semantic retrieval: Pinecone index
healthlens-knowledge, namespaceproduction, dimension768. - Neo4j causal graph integration.
- Grounding and safety guard before user display.
- User risk advisor for plain-language conservative guidance.
- Chemical Explorer API for compound search, detail, and conformer retrieval.
Copy .env.example to a local ignored env file and fill secrets outside Git.
Current runtime selectors:
ARTIFACT_STORE_BACKEND=mongodb
VECTOR_BACKEND=pineconeUnsupported selector values fail at startup/configuration with a clear error.
cd backend
PYTHONPATH=. uvicorn api.main:app --host 0.0.0.0 --port 8000 --reloadPYTHONPATH=backend python3 -m pytest -q backend/testscd frontend
npm install
npm run devOpen http://localhost:5173.
Routes:
/Ask and intake workflow./explorerChemical Explorer.
docker compose -f backend/docker-compose.local.yml up --buildManual docker run should set:
PROJECT_ROOT=/appDATA_ROOT=/app/datafor local Docker,/tmp/datafor Lambda.PYTHONPATH=/app/backendARTIFACT_STORE_BACKEND=mongodbVECTOR_BACKEND=pineconeRESTORE_ARTIFACTS_ON_STARTUP=truewhen testing artifact restore.ARTIFACT_RESTORE_MODE=backgroundARTIFACT_RELEASE=v0.6-chemical-explorer
Startup restore uses MongoDB Atlas GridFS and restores only the runtime-required artifact subset.
GET /health reports these production components:
apineo4jmongodbartifact_statuspineconeollamapbpkrouterorchestratorsynthesizergrounding_guarduser_risk_advisor
The health response must not include legacy storage or vector components. A deliberately disabled LLM reports as Ollama standby and does not degrade platform health.
Semantic retrieval appears under semantic_retrieval:
{
"debug": {
"route": {
"required_modules": ["semantic_retrieval"]
},
"orchestration": {
"module_results": {
"semantic_retrieval": {
"retrieval_backend": "pinecone",
"query_vector_dimension": 768
}
}
}
}
}PYTHONPATH=backend python3 backend/app_cli.py --health
PYTHONPATH=backend python3 backend/app_cli.py --demo
PYTHONPATH=backend python3 backend/app_cli.py --query "Show research on sulfites and alcohol headaches" --pretty
PYTHONPATH=backend python3 backend/app_cli.py --intake- GitHub stores code, tests, docs, and lightweight reproducible metadata.
- Large, raw, generated, and restored artifacts stay outside Git.
- Runtime artifact restore comes from MongoDB Atlas GridFS.
- Old artifact IDs or paths may contain historical backend names; do not rename or delete them unless runtime consumption and checksums are fully validated.
Completed migrations:
- Supabase Storage to MongoDB Atlas/GridFS.
- Weaviate Cloud to Pinecone.
Retained legacy migration utilities live under tools/legacy_migrations/ and are not used in production runtime or copied into the Lambda image.