AskEFDA - A Streamlit app leveraging RAG to provide accurate answers and summaries from Ethiopian Food and Drug Authority (EFDA) guidelines on medicine registration, import, approval and marketing. Built with LangChain, Groq LLM, and FAISS/BM25 indexing. Deployable on Streamlit Community Cloud.
# AskEFDA
AI-powered RAG assistant for querying Ethiopian Food and Drug Authority (EFDA) medical guidelines using natural language.
Built with LangChain, FAISS/BM25 hybrid retrieval, Groq LLMs, and Streamlit.
---
## Features
- Hybrid Retrieval (FAISS + BM25)
- Cross-Encoder Reranking
- Conversational Memory
- PDF Upload Support
- Summarization Mode
- Streamlit Interface
- Fast Responses with Groq API
- Context-Aware Answers from EFDA Guidelines
---
## Architecture
```text
PDF Documents
↓
Document Chunking
↓
Embeddings + BM25 Indexing
↓
Hybrid Retrieval
↓
Cross-Encoder Reranking
↓
Groq LLM
↓
Context-Aware Response
```
---
## Tech Stack
| Category | Tools |
|---|---|
| Framework | LangChain |
| UI | Streamlit |
| LLM | Groq (Llama 3.3 70B) |
| Embeddings | Hugging Face all-MiniLM-L6-v2 |
| Retrieval | FAISS + BM25 |
| Reranker | cross-encoder/ms-marco-MiniLM-L-6-v2 |
| PDF Processing | PyPDF2 |
---
## Project Structure
```bash
.
├── helpers/
│ ├── chain.py
│ ├── chunker.py
│ ├── pdfloader.py
│ ├── retriever.py
│ └── vectorstore.py
├── app.py
├── process_pdfs.py
├── requirements.txt
├── README.md
└── .env
```
---
## Installation
### 1. Clone the Repository
```bash
git clone
github.com
cd Medical-RAG-Assistant
```
### 2. Create a Virtual Environment
```bash
python -m venv venv
```
Activate the environment:
#### Linux/macOS
```bash
source venv/bin/activate
```
#### Windows
```bash
venv\Scripts\activate
```
---
### 3. Install Dependencies
```bash
pip install -r requirements.txt
```
---
### 4. Configure Environment Variables
Create a `.env` file in the project root:
```env
GROQ_API_KEY=your_groq_api_key
```
Get your API key from:
console.groq.com
---
## Run the Application
```bash
streamlit run app.py
```
---
## Preprocessing PDFs
To create FAISS and BM25 indexes from your PDF documents:
```bash
python process_pdfs.py
```
This generates:
- `chunks.pkl`
- `chunks_faiss …