CleverQuery is an AI-powered document analysis platform that helps users extract insights, answer questions, and analyze documents using advanced Retrieval-Augmented Generation (RAG). This project uses Django for the web framework, Gemini AI for text generation, and FAISS for efficient vector search.
With CleverQuery, you can:
- Upload PDF documents for analysis
- Ask questions about your documents and get intelligent answers
- Use specialized session types for different document categories
- Enjoy real-time streaming responses as the AI generates answers
- Create multiple document sessions for different use cases
Choose from various specialized analysis modes:
- Exam Preparation Guide: Study materials and educational content
- Technical Manual Interpreter: Technical documents and instruction manuals
- Legal Document Analysis: Contracts, agreements, and legal texts
- Nutritional Label Interpreter: Food labels and nutritional information
- Financial Report Analysis: Financial statements and reports
- Contract Review Assistant: Contract analysis and review
CleverQuery uses a sophisticated Retrieval-Augmented Generation system:
- Document text is split into semantic chunks
- Vector embeddings are created using SentenceTransformers
- FAISS vector database enables semantic search
- Context-aware responses are generated based on the most relevant document sections
- Real-time streaming responses with typing indicators
- Predefined questions for each document type
- Conversation history for context-aware responses
- Markdown rendering with syntax highlighting for code
- Mobile-responsive design using Tailwind CSS
- Backend: Django 4.2
- AI: Google Generative AI (Gemini 2.0)
- Vector Database: FAISS
- Embedding Model: Sentence-Transformers (all-MiniLM-L6-v2)
- Frontend: HTML, JavaScript, Tailwind CSS
- Text Processing: NLTK, PyPDF2
- Markdown: Python-Markdown with extensions
- Python 3.9+
- pip package manager
- Clone the repository:
git clone https://github.com/ghubrakesh/CleverQuery.git
cd CleverQuery
- Create and activate a virtual environment:
python -m venv ccenv
source ccenv/bin/activate # On Windows: ccenv\Scripts\activate
- Install dependencies:
pip install -r requirements.txt
- Set up environment variables:
# Create a .env file in the project root
echo "GENERATIVEAI_API_KEY=your_google_gemini_api_key" > .env
- Run migrations:
python manage.py migrate
- Create a superuser (optional):
python manage.py createsuperuser
- Run the development server:
python manage.py runserver
- Access the application at http://localhost:8000
- Register/Login: Create an account or log in
- Create Session: Choose a specialized session type for your document
- Upload Document: Upload a PDF document for analysis
- Ask Questions: Type your questions or use the predefined questions
- Get Insights: Receive AI-generated answers based on your document content