AskSahera
A bilingual (FR/EN) medical RAG chatbot grounded in peer-reviewed literature
A bilingual (FR/EN) medical RAG chatbot that answers questions grounded in scientific literature, with a dual-source ingestion pipeline for PubMed articles and research PDFs.
AskSaHera: A Bilingual 3D-Visualized Retrieval-Augmented Chatbot for Auricular Acupressure Education in Perimenopause Care
Mariem Abid, Lamia Guellif, Amine Chalbi, Hsan Ellouze
- Venue
- IEEE SIME Conference
- Year
- 2026
- Status
- Accepted to the final competition (November 2026)
~100
Source documents
2
Ingestion sources
Top 5
Passages per answer
FR / EN
Languages
AskSahera is an educational health assistant built for Applicare during my AI engineering internship. Users ask questions in plain language about perimenopause and auricular acupressure, and the bot answers from a curated corpus of ~100 scientific source documents, citing the passages it relied on. It never diagnoses or prescribes. The audience is mainly French-speaking, while almost all of the scientific literature is in English. The assistant therefore has to accept colloquial French as well as English, retrieve English passages for a French question, and answer in the user's language with a medical disclaimer in that same language.
"How do you answer colloquial French and English health questions from a mostly English scientific corpus, keeping every clinical or numerical claim grounded in a retrieved passage, answers short, and medical-safety rules enforced?"
Architecture
- 1Express.js (Node.js) backend with route groups for chat, corpus management (extract, upload, ingest, delete) and diagnostics
- 2Cloudflare R2 for source PDFs and every derived artifact: canonical PDF copy, normalized article JSON and processing metadata
- 3Self-hosted GROBID service converting PDFs into structured TEI XML; NCBI E-utilities for PubMed abstracts
- 4Qdrant vector store: one cosine-distance collection, with the thematic domain stored in each point's payload
- 5Configurable embedding provider (OpenAI or Gemini) and Claude for answer generation and ingestion-time table summaries
- 6Extraction (PDF/XML → normalized JSON) and indexing (JSON → Qdrant) kept as separate steps, so the corpus can be re-chunked or re-embedded without re-running GROBID or the LLM
Ingestion pipeline
PubMed abstracts are fetched through a MeSH-based query in throttled batches and parsed from EFetch XML; full-text PDFs go through GROBID and a TEI parser that extracts sections, references, tables and figures. Both parsers feed a single validated Article factory, so a malformed document fails at parse time instead of silently during chunking.
Body text is chunked section by section following the paper's structure (Introduction / Methods / Results / Discussion), and a chunk never mixes two sections. Within a section, a recursive splitter acts as a sliding window (2,000 characters, 15% overlap). Short abstracts stay whole, tiny fragments are merged and boundary duplicates are trimmed.
Clinical results often live only in tables, which embed poorly. At extraction time each table is summarized once by Claude into short prose with exact figures, and the summary is stored with the article, so re-indexing never repeats the LLM cost. Fallback summaries are tagged and excluded from the index.
Texts are embedded in batches and upserted into Qdrant with deterministic point IDs (a hash of article ID and chunk index), so re-ingesting an article overwrites its points instead of duplicating them. Source fingerprints stored in R2 let unchanged documents be skipped after a cheap HEAD request.
Retrieval & generation
The corpus is split into thematic domains. Instead of one unfiltered search, the system runs a domain-filtered Qdrant search per domain (top-20 each) and merges the lists with Reciprocal Rank Fusion, so one dense domain cannot crowd out another. A lightweight hybrid rerank (vector score plus lexical overlap) keeps the top 5 passages.
Claude receives the five numbered passages with their title, year, journal and section. Every clinical or numerical claim must cite a passage, inventing statistics is forbidden, and answers are trimmed to about 200 words. A post-generation check verifies that every citation points to a supplied passage.
A lightweight heuristic detects the user's language, which selects the disclaimer and the reply language. French questions are matched against English passages through the multilingual embedding space, and a dedicated diagnostic script compares results for paired English and colloquial French questions.
The medical disclaimer is appended in code, never left to the model. After generation, a terminology check, the citation-range check and a regex safety filter (cure guarantees, advice to stop treatment, etc.) run on every answer, and violations are logged and returned as warnings.
Technical challenges
Two very different source formats feeding one pipeline — PubMed returns abstract-only XML while GROBID returns full-text TEI with nested sections. Both parsers now feed one validated schema, with shared XML helpers for parser quirks, so chunking, embedding and indexing are fully source-agnostic.
Tables hold the clinical results but embed badly — solved with LLM table summarization at extraction time, strict JSON output with exact figures, defensive parsing, and a tagged fallback that is kept out of the index.
Reprocessing the whole corpus on every refresh — solved with source fingerprints stored in R2, skip-if-unchanged checks, per-document failure records instead of aborted batches, and deterministic vector IDs that make re-ingestion an upsert.
PDF extraction noise degrading chunks — captions repeated in body text, citation markers and tiny fragments are stripped, normalized or merged before chunking.
Moving from live PubMed search to a real vector index — the chat path was rebuilt as embed → Qdrant → fuse → rerank → prompt, in one shared function used by both the HTTP route and the evaluation script.
Outcome
AskSahera turns PubMed abstracts and full-text research PDFs into one normalized, IMRAD-aware index, and answers French or English questions with short, cited responses backed by server-side citation, safety and disclaimer checks. Because extraction and indexing are separate, idempotent steps, the corpus can be refreshed, re-chunked or re-embedded without paying for GROBID or table summaries again.
Interested in working together?
I am open to an end-of-studies internship opportunity starting February 2027.