Skip to content

Luxray555/ClinicalTrialsRAG

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

🤖 Clinical Trials RAG Search (AI Assistant)

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.


📸 Preview

RAG n8n workflow screenshot

🎥 Demo

Demo


🧠 How It Works

The n8n workflow performs the following steps:

  1. Receives a natural language query via a webhook (e.g. “Quels essais cliniques portent sur le cancer du poumon ?”).
  2. Sends the query to Google Gemini or another embedding model to compute a 768-dimensional vector.
  3. Queries Neo4j using the vector in a vector similarity search (db.index.vector.queryNodes) on the embedding field.
  4. Gathers matching nodes and their relationships (e.g., Eligibility, Condition, Sponsor, etc.).
  5. Uses an LLM (e.g., Mistral) to answer the original question, grounded only in the retrieved documents.
  6. Returns the answer as a structured and fact-based response to the user.

🚀 Installation

1. Install npm and pnpm (if not already installed)

2. Install n8n globally

npm install n8n -g

3. Start n8n

n8n start

Open n8n in your browser: http://localhost:5678


🧩 Workflow Setup

📥 Import the Workflow

🖱 Option 1: From File

Import Workflow

📋 Option 2: Copy-Paste the JSON

  • Create a new workflow in n8n
  • Open the workflows/ClinicalTrialsRag.json file.
  • Copy the entire JSON and paste it into the workflow editor (CTRL + C to copy, CTRL + V to paste).

🔐 Configure Credentials

You must configure credentials for:

Gemini Credentials

Mistral Credentials

Neo4j Credentials

✅ Activate the Workflow

In n8n, activate the workflow by clicking the activation toggle at the top right:

Activate Workflow


▶️ Use the Workflow

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


📄 Licence

This project is licensed under the MIT License.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors