RAAP is an AI-powered research assistant that helps users navigate and understand academic papers using Retrieval Augmented Generation (RAG). The system can answer questions about papers, generate summaries, identify research gaps, and find connections between different papers.
- PDF document processing and metadata extraction
- Generate semantic embeddings for document content
- Store and retrieve document chunks using vector search
- Answer specific questions about paper content
- Paper summarization and comparison
- Research gap identification
- Citation management
- Visualize relationships between research documents
- Document Processor: Extracts text from PDFs and breaks it into meaningful chunks
- Embedding Service: Converts text chunks into vector representations
- Vector Database: Stores and indexes embeddings for efficient retrieval
- Query Engine: Processes questions, finds relevant content, and generates responses with citations
- Google Generative AI (Gemini API)
- ChromaDB for vector storage
- pdfplumber for PDF processing
- scikit-learn for visualization
- Python 3.9+
- Clone this repository
git clone https://github.com/NMsby/RAAP-Research-Assistant-for-Academic-Papers.git
- Navigate to the project directory
cd RAAP-Research-Assistant-for-Academic-Papers
- Install dependencies:
pip install -r requirements.txt - Set up environment variables: Create a
.envfile with the following variables:
GOOGLE_API_KEY=your_api_key_hereProcess academic papers from PDF to structured chunks:
# Process a single document
python src/process_single_document.py --file data/raw/your_paper.pdf
# Process a single document with verbose logging
python src/process_single_document_verbose.py --file data/raw/your_paper.pdf
# Process all documents in the data/raw directory
python src/process_all_documents_simple.pyGenerate embeddings for all processed documents:
# Generate embeddings for all documents
python src/embedding_service.py# Reset the vector database (if needed)
python src/reset_vector_db.py
# Build and query the vector database
python src/test_rag_pipeline.py --skip-embeddings# Test specific questions related to your papers
python src/test_specific_questions.py
# Test the full RAG pipeline (processing, embeddings, and querying)
python src/test_rag_pipeline.py# Visualize document relationships
python src/visualize_documents.py
# Visualize the structure of processed documents
python src/visualize_document.py --allThe project includes a Kaggle notebook that demonstrates the complete system:
- Access the notebook at https://www.kaggle.com/code/nelsonmasbayi/raap-research-assistant-for-academic-papers
- Run all cells to see the system in action
- Use the interactive question-answering widget to ask questions about the papers
- Explore the document relationship visualization
The notebook provides a user-friendly interface to interact with the research assistant without requiring local setup.
- Add PDF files to the
data/rawdirectory - Create metadata JSON files with the same name (optional)
- Run the processing and embedding generation scripts
- Use the query engine to ask questions about your papers
- Upload your papers using the file upload functionality
- Run the document processing cells
- Continue through the notebook to generate embeddings and set up the query engine
- Ask questions about your papers using the interactive widget
src/: Source code for all componentsdocument_processor.py: Extracts text from PDFs and creates chunksembedding_service.py: Generates embeddings for document chunksvector_store.py: Stores and retrieves embeddingsquery_engine.py: Processes queries and generates responsesvisualize_documents.py: Creates visualizations of document relationships
data/: Directory for storing papers and processed dataraw/: Original PDF files and metadataprocessed/: Processed document chunksembeddings/: Document embeddingsvector_db/: Vector database files
notebooks/: Jupyter notebooks including the Kaggle submission
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.