L'Attia Dialogue is an AI-powered health intake interview system inspired by Peter Attiaβs structured style. It conducts adaptive intake conversations across domains like sleep, nutrition, lifestyle, medical history, and more. The system can run both as a web-based chat UI and as a CLI tool for quick terminal-based interaction.
-
Download curated questions Download the
questions.jsonfile containing curated intake questions and place it at:data/health_questions.fr.json -
Environment variables Create a
.envfile with either:-
OpenAI
OPENAI_API_KEY=your-openai-api-key -
Azure OpenAI
AZURE_OPENAI_API_KEY=your-azure-api-key AZURE_OPENAI_ENDPOINT=your-azure-endpoint
-
Build and start the app with Docker Compose:
docker-compose up --buildThen access the app at http://localhost:8000
To run the chat interface directly in your terminal:
-
Make sure the backend services are running:
docker-compose up
-
Install uv (a fast Python package manager).
-
Sync dependencies:
uv sync
-
Launch the CLI chat:
lattia
This will start the interactive intake interview directly in your terminal.
The project is organized as follows:
src/lattia/
β
βββ core/
β βββ agent/ # Agent code: prompts, agent loop, schemas, interview logic
β βββ parsers/ # Parsers for curated question files (knowledge base JSON)
β βββ pii/ # PII redaction module
β βββ utils/ # General utilities
β βββ vector_db/ # Vector DB client code (Qdrant): embeddings, ingestion, retriever
β
βββ chat.py # CLI entry point for running the chat interface
β
βββ static/ # Frontend assets (HTML, CSS, JavaScript)
β βββ app.py # FastAPI application entry point
β βββ db.py # Database setup: engine, session, declarative base
β βββ models.py # SQLAlchemy models (database tables)
β βββ schemas.py # Pydantic models (FastAPI input/output schemas)
β βββ warmup.py # Warm-up tasks when starting the server (models, caches, etc.)
This structure separates the agent logic, data access, frontend, and infrastructure code, making the project modular and easier to extend.
-
Latency Current response time is around 6β10 seconds per turn. Improvements are possible (see design doc).
-
Cost Average cost is about $0.01 per query. Optimizations are outlined in the design doc.
-
Scalability The application is stateful in its current form and cannot scale well horizontally. Stateless redesign would improve scalability (see design doc).
-
PII handling PII redaction happens server-side. Sensitive information is never stored in the database, but it is still transmitted from client to server before being redacted.
- Build the Home page, Chat UI, and Dashboard overlay
- Implement the FastAPI backend and DB
- Add PII redaction
- Add rate bucket limiting
- Create a CLI chat client for development
- Implement the main agent loop with the data models
- Ensure the Attia-style of the conversation
- Decide when you have enough data on every category, and when to stop the interview
- Find a good first question strategy
- Add RAG over provided questions to suggest next questions
- Implement the post-interview flow
- Check FHIR standards, understand what a FHIR-lite JSON format should look like
- Consider GDPR compliance
- Add proper README documentation with design decisions
- Ensure people can run it smoothly
- Film Loom video walkthrough
- GLiNER PII - for the PII redaction model
- GPT-6 Preview - for helping me vibe code the Frontend
