Advanced AI-powered scientific research assistant with modern web interface
RAG Research Assistant is a comprehensive scientific research tool that combines advanced AI technology with an intuitive web interface. Ask questions in natural language and receive research-backed answers based on the latest scientific publications from arXiv.
- ๐ Intelligent Query Processing - Natural language understanding with multi-word keyphrase extraction
- ๏ฟฝ Automatic Paper Retrieval - Downloads and processes relevant scientific papers from arXiv
- ๐ง Advanced RAG Pipeline - Context-aware answer generation with source citations
- ๐ Modern Web Interface - Full-featured Django webapp with dark theme
- ๐ Privacy-First Design - Uses local Ollama models - no data leaves your machine
- ๐ Configuration Management - Multiple RAG configurations with different parameters
- ๐ Query History - Complete search history with response tracking
- ๐ Database Management - Dynamic knowledge base preparation for specific topics
| Feature | Description |
|---|---|
| ๐ฏ Question Interface | Clean, responsive form for scientific queries |
| โ๏ธ RAG Configurations | Multiple model configurations with custom parameters |
| ๏ฟฝ๏ธ Database Management | Topic-specific knowledge base preparation |
| ๐ Query History | Complete search and response history with filtering |
| ๏ฟฝ Real-time Status | Live configuration status and processing feedback |
| ๐ฑ Responsive Design | Mobile-friendly interface with modern UI |
| Component | Technology |
|---|---|
| ๐ค LLM Integration | Ollama (llama3.1, phi3, etc.) |
| ๐ Vector Database | Qdrant for semantic search |
| ๐ PDF Processing | pdfminer.six for text extraction |
| ๐งฎ Embeddings | Sentence Transformers for scientific text |
| ๏ฟฝ Keyword Extraction | KeyBERT for intelligent query processing |
| ๐ฆ RAG Framework | LangChain for document processing |
# Install Ollama
curl -fsSL https://ollama.com/install.sh | sh
# Install Qdrant via Docker
docker run -p 6333:6333 qdrant/qdrant
# Download your preferred LLM model
ollama pull llama3.1:8b
# or
ollama pull phi3:minigit clone https://github.com/Jaromek/researchAgent.git
cd researchAgent
# Install Python dependencies
pip install -r requirements.txt
# Install Django dependencies (if not in requirements.txt)
pip install django>=5.2
# Setup Django database
cd webAPP
python manage.py migrate
# Create Django superuser (optional)
python manage.py createsuperuser
# Run the web application
python manage.py runserver# For direct CLI usage
python rag_engine.py-
Start the application:
cd webAPP python manage.py runserver -
Access the web interface: Open
http://localhost:8000 -
Create RAG Configuration:
- Navigate to "Configurations"
- Create new configuration with your preferred:
- Model name (e.g.,
llama3.1:8b) - Ollama URL (default:
http://localhost:11434) - Temperature, max tokens, and retrieval parameters
- Model name (e.g.,
-
Prepare Database (optional):
- Go to "Database Management"
- Enter research topic (e.g., "quantum computing")
- System will download and process relevant papers
-
Ask Questions:
- Use the main interface to ask scientific questions
- System automatically finds relevant papers if database is empty
- Receive comprehensive answers with source citations
- "What are the latest developments in quantum computing?"
- "How does machine learning improve medical diagnostics?"
- "What are the environmental impacts of renewable energy?"
- "Recent advances in CRISPR gene editing technology"
researchAgent/
โโโ webAPP/ # Django web application
โ โโโ research_rag/ # Main Django app
โ โ โโโ models.py # Database models (RAG configs, history)
โ โ โโโ views.py # Web interface logic
โ โ โโโ forms.py # Django forms
โ โ โโโ services.py # Business logic integration
โ โ โโโ templates/ # HTML templates
โ โโโ static/ # CSS, JS, and assets
โ โโโ manage.py # Django management script
โโโ RAG/ # Core RAG system
โ โโโ Retrieval/ # Semantic search implementation
โ โโโ Augmented/ # Context preparation for LLM
โ โโโ Generation/ # LLM response generation
โโโ dataPrepraration/ # Data processing pipeline
โ โโโ extraction/ # Keyword extraction (KeyBERT)
โ โโโ apiIntegration/ # arXiv API client
โ โโโ pdfToText/ # PDF processing (pdfminer.six)
โ โโโ embedding/ # Document vectorization
โ โโโ databasePreparation.py # Main data preparation orchestrator
โโโ archive/ # Downloaded scientific papers (PDFs)
โโโ rag_engine.py # Simple CLI interface
โโโ requirements.txt # Python dependencies
The web interface allows you to configure:
-
Model Settings:
- Model name (e.g.,
llama3.1:8b,phi3:mini) - Ollama URL (default:
http://localhost:11434) - Temperature (0.0-2.0, default: 0.1)
- Max tokens (50-8000, default: 2000)
- Model name (e.g.,
-
Retrieval Settings:
- Collection name (Qdrant collection)
- K chunks (1-50, number of document chunks to retrieve)
-
Database Settings:
- Max papers (5-1000, papers to download per topic)
- Download directory (default:
archive)
Create and switch between different configurations for various research domains or performance requirements.
- Topic-specific databases: Prepare focused knowledge bases for specific research areas
- Processing logs: Track database preparation with detailed status information
- Error handling: Comprehensive error reporting and recovery
- Complete tracking: All queries and responses are stored
- Search functionality: Filter through historical queries and answers
- Performance metrics: Processing times and configuration tracking
- Export capabilities: Copy questions and responses for external use
- Multiple profiles: Create different configurations for various use cases
- Model testing: Built-in model availability testing
- Active configuration: Easy switching between configurations
- Parameter validation: Real-time validation of all settings
- Modern Python web framework with robust ORM
- Bootstrap 5 for responsive UI design
- AJAX integration for dynamic content loading
- Form validation and error handling
- Database migrations for easy deployment
- Document chunking with overlap for context preservation
- Semantic embeddings using sentence-transformers
- Vector similarity search with Qdrant
- Context-aware generation with LangChain
- Source attribution in all responses
- Local processing - no external API calls for LLM inference
- Data privacy - all research data stays on your machine
- Input validation - comprehensive form and API validation
- Error handling - graceful failure recovery
- Python: 3.8 or higher
- Memory: 8GB RAM recommended (for LLM models)
- Storage: 2GB+ for models and papers
- Network: Internet connection for arXiv paper downloads
- Docker: For Qdrant vector database
-
Ollama Connection Error:
- Ensure Ollama is running:
ollama serve - Check URL in configuration:
http://localhost:11434
- Ensure Ollama is running:
-
Qdrant Connection Error:
- Verify Qdrant container:
docker ps - Check port mapping:
localhost:6333
- Verify Qdrant container:
-
Model Not Found:
- Download model:
ollama pull <model-name> - Verify model name in configuration
- Download model:
-
Paper Download Failures:
- Check internet connection
- Verify arXiv API accessibility
- Review error logs in Database Management
This project is licensed under the MIT License - see the LICENSE file for details.
- arXiv for providing free access to scientific literature
- Ollama for democratizing local LLM inference
- LangChain for the excellent RAG framework
- Django for the robust web framework
- Qdrant for high-performance vector search
RAG Research Assistant - Advancing scientific research through AI-powered knowledge discovery.