A modern web application implementing Retrieval Augmented Generation (RAG) using Flask and Tailwind CSS. Upload documents and get AI-powered answers based on their content.
Features • Quick Start • Installation • Usage • Architecture • Development
-
📄 Document Processing
- Support for PDF and TXT files
- Automatic text chunking and embedding
- Efficient vector storage with ChromaDB
-
🔍 Advanced RAG Implementation
- Powered by Groq's Mixtral-8x7b model
- Sentence transformers for embeddings
- Context-aware question answering
-
🎨 Modern UI/UX
- Clean, responsive design with Tailwind CSS
- Real-time loading states
- Toast notifications for feedback
- Drag-and-drop file upload
# Clone the repository
git clone https://github.com/yourusername/clarus.git
cd clarus
# Create and activate virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install dependencies
uv pip install -e .
# Set up environment variables
cp app/.env.example app/.env
# Edit app/.env with your API keys
# Run the application
python main.pyVisit http://localhost:5000 in your browser to start using the application.
- Python 3.11+
- uv package manager (recommended) or pip
- Groq API key for LLM access
-
Environment Setup
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install Dependencies
Using uv (recommended):
uv pip install -e .Using pip:
pip install -r requirements.txt
-
Configure Environment Variables
cp app/.env.example app/.env
Edit
app/.envand add:SECRET_KEY=your-secret-key GROQ_API_KEY=your-groq-api-key
-
Upload Documents
- Click the upload area or drag and drop files
- Supported formats: PDF, TXT
- Wait for the success notification
-
Ask Questions
- Enter your question in the text area
- Click "Get Answer"
- View AI-generated response based on your documents
.
├── app/ # Application package
│ ├── templates/ # HTML templates
│ ├── static/ # Static files
│ ├── utils/ # Utility modules
│ │ └── rag.py # RAG implementation
│ └── routes.py # Flask routes
├── main.py # Application entry point
├── pyproject.toml # Project metadata and dependencies
└── requirements.txt # Direct dependencies
-
Backend
- Flask: Web framework
- LangChain: RAG implementation
- ChromaDB: Vector storage
- Sentence Transformers: Text embeddings
- Groq: LLM provider
-
Frontend
- Tailwind CSS: Styling
- Vanilla JavaScript: Interactivity
# Install development dependencies
uv pip install -e ".[dev]"
# Format code
black app/
isort app/
# Lint code
flake8 app/This project is licensed under the MIT License - see the LICENSE file for details.