MedFanar.

Before the answer, find the evidence.

At Qatar Computing Research Institute, I worked on MedFanar, a research project exploring how retrieval-augmented generation (RAG) could bring more specialized medical context into Fanar’s responses.

My work brought together research literature, medical datasets, model benchmarking, and RAG architecture.

Follow the evidence
  1. Medical query
  2. Relevant context
  3. Fanar generates a response
How MedFanar brings evidence into an answer
  • Qatar Computing Research Institute (QCRI)
  • Mazen Elsayed · Research Assistant
  • Medical RAG research

Medicine needs more than a general answer.

General-purpose language models offer powerful capabilities, but specialized medical information introduces additional challenges: clinical context, language accessibility, and the need for relevant supporting material.

Clinical context

Medical questions often require specialized knowledge beyond general-purpose text generation.

Language accessibility

Medical resources are not equally accessible across languages, creating an important research opportunity for Arabic-centric AI.

Grounding

Retrieving relevant source material may provide stronger context for a model’s response, while reliability and clinical safety still require evaluation.

What if the model could retrieve relevant medical information before forming its answer?

Anatomy of an answer.

Exploring the retrieval-augmented generation architecture behind MedFanar.

Conceptual workflow from the research posterSelect a stage to trace its role.
Anatomy of an answer.

Query

A medical question starts the retrieval process. The system represents the question as an embedding so it can search for related material before preparing a response.

Vector store

The query embedding is matched against indexed representations of medical sources. The research explores suitable medical resources and retrieval approaches.

Top-K retrieval

The retrieval process selects the highest-ranked passages available for the query. K is the number of results requested for the generation context.

Fanar LLM

Fanar, the Arabic-centric language model at the core of MedFanar, receives the user’s query together with the retrieved context. The model can draw on those passages when generating a response.

Answer

The system produces a contextualized response. Medical reliability, source quality, and safety remain evaluation considerations.

Fanar receives the original question and the retrieved passages together.

The work behind the model.

The architecture was only one part of the process. My work involved understanding the research landscape, investigating possible sources of medical knowledge, evaluating model behavior, and exploring how the pieces could fit together.

Reading the research

I reviewed literature on medical AI, language models, and retrieval-augmented generation to understand existing approaches and technical challenges.

Finding the data

I explored open-source medical datasets and knowledge resources to investigate what information could support a medicine-oriented retrieval system.

Testing the models

I tested and compared AI model outputs to examine differences in behavior, capabilities, and suitability for the research direction.

Designing the RAG

I contributed to the MedFanar RAG architecture, exploring how retrieval, relevant source material, and Fanar could be connected into a coherent workflow.

A research project taking shape.

The MedFanar poster on an easel beside a monitor and laptop displaying the prototype at QCRI.
MedFanar’s research poster and prototype workstation at the QCRI presentation.

From literature to direction

Research papers and model comparisons helped frame the questions we needed to investigate and the approaches we could consider.

From data to architecture

Exploring medical data resources and retrieval methods helped inform the structure of the proposed MedFanar system.

From architecture to prototype

The team presented a proof of concept alongside a poster describing the architecture, development process, and potential applications.

Inside the MedFanar poster

The poster frames a research problem at the intersection of clinical context and Arabic-language access. Its proposed framework searches indexed medical sources, returns the highest-ranked material, and supplies it to Fanar as context for generation.

Development roadmap

  1. Demonstrated

    Proof of concept

    The presentation showed the prototype interface and documented the proposed retrieval workflow.

  2. Proposed

    Specialized language model

    The poster describes exploring broader biomedical knowledge and evaluating the model’s ability to respond to medical questions.

  3. Proposed

    Refinement

    The poster outlines further testing and refinement focused on accuracy, reliability, and safety.

Three directions. One research foundation.

Potential applications

Clinical information support

Investigating how retrieved medical context could potentially support healthcare professionals in accessing relevant information.

Arabic-language patient information

Exploring more accessible ways for Arabic-speaking users to interact with medical information through an Arabic-centric AI foundation.

Medical education

Considering how retrieval-supported explanations and educational materials could assist medical learning.

Research is never a solo process.

The most valuable part wasn’t just learning how a retrieval system works. It was learning how to approach a research problem: read what already exists, question assumptions, compare alternatives, and build something worth testing.

Working on MedFanar at QCRI gave me the opportunity to bring together software engineering, AI research, and technical exploration. It showed me how much thought goes into the decisions made before a model ever generates an answer.

Mazen Elsayed holding his QCRI Summer Internship certificate beside another person at the presentation.
Mazen Elsayed receiving his QCRI Summer Internship certificate.

Qatar Computing Research Institute (QCRI)
Hamad Bin Khalifa University

QCRI Summer Internship Program

MedFanar poster credits

Authors
Mazen Elsayed, Amna Salim, Parvathy Kumar
Mentor
Dr. Mohamed ElShrif

Good research starts with better questions.

MedFanar brought together the parts of AI development I find most interesting: understanding a problem, exploring existing research, evaluating technical possibilities, and finding ways to make complex systems more useful.

It was an opportunity to think beyond what a model can generate and explore what a more grounded system might require.