How bloodworks-io/phlox works
Phlox is a local-first AI medical scribe and patient-management application. Its principal workflow is capturing a consultation, transcribing it, generating a template-structured clinical note, and saving it with patient records; users can then create correspondence and manage follow-up tasks. The product also includes an agent with literature, knowledge-base, and optional MCP tools, plus document/form processing and configurable models. The graph reflects documented capabilities and sampled orchestration; several backend route-to-service connections are not shown because their implementations were not sampled.
Main entry points: AppRoutes.jsx Application routes · patient.py Patient API · engine.py Agent orchestration · App.jsx React application
Components 27
Desktop and UI
- React application
src/App.jsx - Application routes
src/components/layout/AppRoutes.jsx - Desktop runtime
src-tauri/src/main.rs
Application API
- FastAPI server
server/server.py - Patient API
server/api/patient.py - Chat API
server/api/chat.py - Knowledge API
server/api/rag.py - Transcription API
server/api/transcribe.py - Letter API
server/api/letter.py - PDF forms API
server/api/pdf_forms.py
Clinical workflows
- Audio transcription
server/transcription/audio.py - Structured note generation
server/nlp_tools/summarisation.py - Correspondence generation
server/nlp_tools/letter.py - Clinical tasks
server/database/repositories/jobs.py - PDF form processing
server/pdf_forms/storage.py
AI and knowledge
- Agent orchestration
server/chat/engine.py - Agent tools
server/chat/tools/registry.py - Retrieval and vectors
server/rag/vector_store.py - LLM client
server/llm_client/client.py - MCP client
server/mcp/client.py
Persistence
- Clinical repositories
server/database/repositories/patient.py - User configuration
server/database/config/manager.py - Documents database
server/database/core/documents_db.py
Other components
- Clinician
- Whisper-compatible service
- OpenAI-compatible LLM
- External MCP servers
Connections 30
- Clinician → React application: uses
- React application → Application routes: renders
- React application → Desktop runtime: desktop runtime
- Application routes → Patient API: patient requests
- Application routes → Chat API: chat requests
- Application routes → Knowledge API: knowledge requests
- Application routes → Transcription API: transcription requests
- Application routes → Letter API: letter requests
- Application routes → PDF forms API: form requests
- FastAPI server → Patient API: mounts routes
- Transcription API → Audio transcription: handles transcription
- Audio transcription → Whisper-compatible service: sends audio
- Patient API → Structured note generation: generates notes
- Structured note generation → LLM client: requests generation
- Letter API → Correspondence generation: generates letters
- Chat API → Agent orchestration: orchestrates chat
- Agent orchestration → LLM client: requests responses
- Agent orchestration → Agent tools: dispatches tools
- Agent tools → Retrieval and vectors: retrieves knowledge
- Agent tools → MCP client: invokes MCP tools
- MCP client → External MCP servers: dispatches calls
- LLM client → OpenAI-compatible LLM: sends prompts
- Patient API → Clinical repositories: stores patient data
- Letter API → Clinical repositories: stores correspondence
- Patient API → Clinical tasks: manages jobs
- Knowledge API → Retrieval and vectors: manages knowledge
- PDF forms API → PDF form processing: manages templates
- PDF form processing → Documents database: stores templates
- Agent orchestration → User configuration: reads prompts
- Structured note generation → User configuration: uses templates