Intelligent question-answering system over clinical trial data using RAG (Retrieval-Augmented Generation). This project uses an n8n workflow to embed user queries, search for relevant trials in Neo4j, and generate accurate responses using an LLM.
The n8n workflow performs the following steps:
- Receives a natural language query via a webhook (e.g. “Quels essais cliniques portent sur le cancer du poumon ?”).
- Sends the query to Google Gemini or another embedding model to compute a 768-dimensional vector.
- Queries Neo4j using the vector in a vector similarity search (db.index.vector.queryNodes) on the embedding field.
- Gathers matching nodes and their relationships (e.g.,
Eligibility,Condition,Sponsor, etc.). - Uses an LLM (e.g., Mistral) to answer the original question, grounded only in the retrieved documents.
- Returns the answer as a structured and fact-based response to the user.
npm install n8n -gn8n startOpen n8n in your browser: http://localhost:5678
- In the n8n UI, create a new workflow.
- Click the three dots (⋮) in the top right > Import from file
- Select the file
workflows/ClinicalTrialsRag.json.
- Create a new workflow in n8n
- Open the
workflows/ClinicalTrialsRag.jsonfile. - Copy the entire JSON and paste it into the workflow editor (CTRL + C to copy, CTRL + V to paste).
You must configure credentials for:
- Gemini or another embedding model (via HTTP node) ➜ Credentials Setup
- Gemini (or another LLM provider) ➜ Credentials Setup
- Neo4j (if using Neo4j) ➜ Credentials Setup
In n8n, activate the workflow by clicking the activation toggle at the top right:
Just need to go to the chat bot interface and ask your questions about clinical trials, such as:
- "Quels essais cliniques portent sur le cancer du poumon ?"
- "Quels sont les critères d'éligibilité pour les essais cliniques sur le diabéte ?"
URL to access the chat bot: Chat Bot
This project is licensed under the MIT License.






