Skip to content

Rawda-Fathey/Research-Query-Assistant

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

2 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🧠 Research Query Assistant (Hybrid RAG System)

πŸ“˜ Overview

The Research Query Assistant is an intelligent Retrieval-Augmented Generation (RAG) system designed to answer academic or research-based questions by retrieving relevant research papers and generating insightful responses using Groq's Llama 3.3 model.

The system integrates multiple academic APIs (CrossRef, Semantic Scholar, Core API, etc.) and supports both local document retrieval (via FAISS) and live research queries.


πŸš€ Features

  • πŸ” RAG Pipeline combining vector search and LLM reasoning.
  • πŸ“„ Automatic PDF text extraction from research papers.
  • πŸ’Ύ Chunk-based document storage for efficient retrieval.
  • 🧠 SentenceTransformer embeddings for semantic similarity.
  • ⚑ FAISS-based vector search for fast retrieval.
  • 🌐 Groq Llama 3.3 Integration for intelligent answering.
  • 🧩 Streamlit Interface for user-friendly interaction.

πŸ—οΈ Project Structure

πŸ“¦ Research-Query-Assistant
β”œβ”€β”€ data/
β”‚   β”œβ”€β”€ chunks/              # Contains text chunks (.pkl or .txt)
β”‚   β”œβ”€β”€ embeddings/          # Stores .npy embeddings and metadata
β”‚   └── online_cache/   
β”‚   └── raw_papers/       
β”‚   └── texts/  
β”‚
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ pdf_processing/
β”‚   β”‚   β”œβ”€β”€ downloader.py    # Handles paper downloads (CrossRef, etc.)
β”‚   β”‚   β”œβ”€β”€ extractor.py     # Extracts text from PDFs
β”‚   β”œβ”€β”€ data collection/
β”‚   β”‚   β”œβ”€β”€ core_api.py    # Handles paper downloads (CrossRef, etc.)
β”‚   β”‚   β”œβ”€β”€ crossref_api.py     # Extracts text from PDFs
β”‚   β”œβ”€β”€ embeddings/
β”‚   β”‚   β”œβ”€β”€ embedder.py      # SentenceTransformer embeddings
β”‚   β”‚   β”œβ”€β”€ chunker.py 
β”‚   β”‚   └── vector_store.py  # FAISS vector database management
β”‚   β”œβ”€β”€ query_engine/
β”‚   β”‚   β”œβ”€β”€ rag_pipeline.py  # Full retrieval + generation pipeline
β”‚   β”‚   └── retriever.py
β”‚  
β”œβ”€β”€app/
β”‚  β”œβ”€β”€  interface.py         # Streamlit web interface
β”œβ”€β”€ requirements.txt
└── README.md

βš™οΈ Installation

1️⃣ Clone the repository

git clone https://github.com/Rawda-Fathey/Research-Query-Assistant.git
cd Research-Query-Assistant

2️⃣ Create and activate a virtual environment

python -m venv venv
source venv/bin/activate   # On Windows: venv\Scripts\activate

3️⃣ Install dependencies

pip install -r requirements.txt

4️⃣ Set up environment variables

Create a .env file in the project root and add your Groq API key:

GROQ_API_KEY=your_api_key_here

🧠 Running the RAG Pipeline (CLI)

python src/query_engine/rag_pipeline.py

This will:

  1. Load all stored document chunks.
  2. Compute or load embeddings.
  3. Retrieve the most relevant papers.
  4. Generate a summarized answer using Llama 3.3.

πŸ’» Running the Streamlit Interface

streamlit run src/interface.py

Then open http://localhost:8501 to interact with the assistant.


πŸ“š Example Usage

Query:

"What are the latest challenges in Artificial Intelligence?"

Response:
A synthesized, LLM-generated summary of recent AI challenges based on retrieved research papers.


🧩 Embedding Generation

If you added new PDFs or chunks:

python src/embeddings/embedder.py

This generates embeddings and stores them in data/embeddings for retrieval.


🧱 Technologies Used

  • Python 3.10+
  • SentenceTransformers
  • FAISS
  • Groq (Llama 3.3)
  • Streamlit
  • Requests, NumPy, JSON
  • CrossRef / Semantic Scholar APIs

About

🧠 Research Query Assistant (Hybrid RAG with Groq LLaMA 3) β€” An intelligent system that combines local and online retrieval to answer research questions using FAISS, Sentence Transformers, and Groq’s LLaMA 3. It provides accurate, real-time, AI-generated insights through Streamlit interface.

Resources

Stars

3 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages