This document describes the design, configuration, and extensibility of the AI processing system in Health Assistant.
Core Architecture
The AI system is built on a Unified Factory Pattern, decoupling clinical logic from specific AI providers.
Key Components
Component Responsibility AIProviderService (app/ai/providers/service.py) Central "Brain" for model resolution. Handles multitenancy, priorities, and model instantiation. LangChainOCRProcessor (app/ai/processors/ocr/) Generic vision processor that converts images/PDFs/DICOMs into Markdown text. LangChainStructuredExtractor (app/ai/processors/nlp/) Generic NLP extractor that maps Markdown text to structured FHIR medical entities. AIAssistanceService (app/ai/assistance/service.py) Orchestrator for the Agentic Chatbot and "Magic Fill" features. Manages session context and routing. app/ai/agents/ The agentic loop + HITL plumbing: chat_agent.py (reasoning loop, tool dispatch, streaming), hitl.py (resume-continuation contract + [HITL RESOLUTION FEEDBACK] formatting),
prompts.py (system prompt assembly). app/ai/tools/ LangChain tools (DB queries, document retrieval) that the AI assistant can invoke via get_tools(db, tenant_id, patient_id, examination_id=None). MedicalProcessingService (app/ai/pipeline/service.py) Orchestrator for complex clinical logic (unit conversion, ontology matching, persistence). app/workers/ai_tasks.py Celery worker task definitions that delegate to the above services.
Configuration & Model Resolution
Health Assistant uses a strict, database-driven configuration for all AI processors. This ensures consistency and auditability across multitenant deployments.
Data Models
Providers: Define the API endpoint and credentials (e.g., OpenAI, custom vLLM server).
Models: Define the specific model string (e.g., gpt-4o, gemini-1.5-pro), context window (max_tokens), and temperature. Multiple models can belong to a single provider.
Task Assignments: Map specific applica
📌 Agentic AI Assistant (Ciudad de México)
🏢 Health-Assistant.io
📍 Ciudad de México
Postulate a este anuncio
Muestra tus habilidades a la empresa, rellenar el formulario y deja un toque personal en la carta, ayudará el reclutador en la elección del candidato.