
Instances
- chat.imane.ai — live
chat.afred.ai— second instance, DNS record still to be published
Features
The interface, named Imane — intelligent medical assistant, exposes the RAG through five entry points:
- Chat: natural-language questions about medication, symptoms, prevention and first aid. Every answer is structured (pharmacology, dosage, contraindications, monitoring) and comes with a Sources tab citing the documents queried — BDPM, the French public medication database, is flagged explicitly.
- Compare: comparison of two to five medications along a chosen aspect (side effects, interactions…). The generated synthesis contrasts mechanisms of action, safety profiles, contraindications, liver and kidney toxicity, drug interactions, required monitoring, then a clinical conclusion.
- Medications, Interactions and Statistics: direct browsing of the indexed corpus.
The guiding principle is traceability: no answer is returned without the sources backing it — a precondition for an assistant operating on a medical domain.
Goal
Let a corpus of clinical documents be queried in natural language, without the practitioner needing to know how those documents are structured.
What I built
- Vector indexing through
pgvector, then Qdrant, comparing both approaches. - Multi-model generation: Llama 3.3 70B served by Groq Cloud and Claude Haiku 4.5, routed per query. Average latency is tracked per model, the gap between the two being close to a factor of five.
- Automated OCR extraction from PDF and JPG prescriptions.
- An MCP server (FastMCP) with its API documentation, making the RAG directly consumable by AI agents — not only through the web UI.
Back office: governance and observability
A medical domain rules out shipping an assistant without a safety net. That is what the Medical RAG back office is for:
- Governance: answers can be flagged and enter a review queue (to review, reviewed & resolved). Queries that returned no document at all are isolated as suspicious — the textbook symptom of a fabricated answer.
- Observability: query volume, success rate, average and maximum latency, cache hit rate, error log. Per-model tracking supports the trade-off between cost, latency and quality.
- Real usage: most queried medications and operation breakdown (medication query, query with no documents, query with generation), which show where the corpus falls short.
- Role-based API keys: client access separate from the healthcare professional role, with an expiry date — the RAG is consumed by third-party applications as much as by the web interface.
Stack
Python, FastAPI, pgvector, Qdrant, Groq Cloud (Llama 3.3 70B), Claude Haiku 4.5, OCR, React, Docker.
The assistant
Four doors to frame the question before it is even asked.
The answer is structured by section and the queried source is named — here BDPM. The Sources tab lists the documents backing the answer: without them the tool would not be usable.
Comparator: from two to five medications, along a chosen aspect — side effects, interactions, contraindications.
Back office
Per-model tracking is the most useful part: at comparable quality, the latency gap between the two models in use reaches a factor of five.
Operations are split between medication query, query with no documents and query with generation — the second category flags gaps in the corpus.
Role-based API keys with expiry: the RAG is consumed by third-party applications as much as by the web interface.