dev-arpit5462/augmented-research-assistant
0
sdk: streamlit
๐ Augmented Research Assistant
A stunning dark-mode Streamlit RAG (Retrieval-Augmented Generation) application that allows users to upload documents and query information from them using cutting-edge AI technology.
โจ Features
- Modern Dark UI: Professional dark theme with smooth animations and responsive design
- Multi-format Support: Upload PDF, TXT, DOCX, and Markdown files
- Intelligent RAG Pipeline: LangChain orchestration with LlamaIndex document processing
- Google Gemini Integration: Powered by Google's latest Gemini API for inference and embeddings
- Vector Search: ChromaDB for efficient document retrieval
- Source Attribution: Display retrieved chunks to prevent hallucinations
- Smart Caching: Embedding and query caching for improved performance
- Chat Interface: Interactive chat with conversation history
- Document Management: Upload, process, and manage your knowledge base
๐๏ธ Architecture
โโโ config/
โ โโโ __init__.py
โ โโโ settings.py # Configuration management
โโโ core/
โ โโโ __init__.py
โ โโโ rag_chain.py # LangChain RAG orchestration
โโโ services/
โ โโโ __init__.py
โ โโโ document_processor.py # LlamaIndex document loaders
โ โโโ vector_store.py # ChromaDB + LangChain integration
โโโ utils/
โ โโโ __init__.py
โ โโโ cache_manager.py # Performance caching
โโโ app.py # Streamlit frontend
โโโ requirements.txt # Dependencies
โโโ README.md # This file๐ Tech Stack
- Frontend: Streamlit with custom dark theme CSS
- Orchestration: LangChain for RAG pipeline management
- Document Processing: LlamaIndex for intelligent chunking and loading
- LLM & Embeddings: Google Gemini API (free tier)
- Vector Database: ChromaDB (local, no external dependencies)
- Caching: Custom caching system for performance optimization
๐ Prerequisites
- Python 3.8+
- Google API Key (free from Google AI Studio)
๐ ๏ธ Installation
- Clone the repository:
git clone <repository-url>
cd augmented-research-assistant- Create virtual environment:
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate- Install dependencies:
pip install -r requirements.txt- Set up Google API Key:
- Visit Google AI Studio
- Create a new API key (free, no credit card required)
- Set environment variable:
export GOOGLE_API_KEY="your_api_key_here" Or create a .env file:
GOOGLE_API_KEY=your_api_key_here๐ฏ Usage
- Start the application:
streamlit run app.py- Upload Documents:
- Use the sidebar to upload PDF, TXT, DOCX, or MD files
- Documents are automatically processed and indexed
- Ask Questions:
- Type questions in the chat interface
- Get AI-powered answers with source citations
- View retrieved document chunks for transparency
๐ง Configuration
Modify config/settings.py to customize:
- Chunk Settings:
CHUNK_SIZE,CHUNK_OVERLAP - Retrieval:
TOP_K_RETRIEVAL - Model Parameters:
TEMPERATURE,MAX_TOKENS - Caching:
ENABLE_CACHING,CACHE_TTL
๐ Features Breakdown
Document Processing
- LlamaIndex Loaders: Specialized loaders for each file type
- Smart Chunking: Overlapping chunks for better context retention
- Metadata Preservation: File names and chunk information maintained
Vector Storage
- ChromaDB Integration: Local vector database via LangChain
- Embedding Caching: Avoid recomputing embeddings for performance
- Deduplication: Prevent duplicate document processing
RAG Pipeline
- Context-Aware Retrieval: Top-k similarity search
- Hallucination Prevention: Strict context-only responses
- Source Attribution: Display retrieved chunks with relevance scores
User Experience
- Dark Mode: Professional dark theme with gradients
- Responsive Design: Works on desktop and mobile
- Real-time Processing: Progress bars and status updates
- Chat History: Persistent conversation memory
๐ Deployment
Streamlit Community Cloud
- Push to GitHub:
git add .
git commit -m "Initial commit"
git push origin main- Deploy on Streamlit Cloud:
- Visit share.streamlit.io
- Connect your GitHub repository
- Add
GOOGLE_API_KEYin secrets management - Deploy!
Local Production
streamlit run app.py --server.port 8501 --server.address 0.0.0.0๐จ Customization
Styling
- Modify CSS in
app.pyload_custom_css()function - Adjust colors, animations, and layout
Models
- Change Gemini model in
core/rag_chain.py - Adjust embedding model in
services/vector_store.py
Processing
- Modify chunk parameters in
config/settings.py - Add new file type support in
services/document_processor.py
๐ Resume Highlights
This project demonstrates:
- Modern AI Stack: LangChain + LlamaIndex + Gemini API integration
- Production Architecture: Modular, scalable design with separation of concerns
- Performance Optimization: Caching, efficient chunking, and vector search
- User Experience: Professional UI/UX with dark theme and animations
- Free Tier Usage: Entirely built on free APIs (no credit card required)
๐ค Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
๐ License
MIT License - see LICENSE file for details.
๐ Troubleshooting
Common Issues
- API Key Error:
- Ensure
GOOGLE_API_KEYis set correctly - Verify key is active in Google AI Studio
- Import Errors:
- Check Python version (3.8+)
- Reinstall requirements:
pip install -r requirements.txt
- Performance Issues:
- Enable caching in settings
- Reduce chunk size for large documents
- Clear cache periodically
- Upload Failures:
- Check file size limits (10MB default)
- Verify file format is supported
- Ensure sufficient disk space
Support
For issues and questions:
- Check the troubleshooting section
- Review configuration settings
- Ensure all dependencies are installed correctly
Built with โค๏ธ using LangChain, LlamaIndex, and Google Gemini API
