Transform your documents into an intelligent conversation partner
Features β’ Installation β’ Usage β’ Contributing
DocuChat is a cutting-edge Retrieval-Augmented Generation (RAG) system that transforms static documents into interactive, AI-powered knowledge bases. Upload your documents, ask questions, and get intelligent answers powered by advanced NLP models.
Whether you're a researcher analyzing papers, a student studying materials, or a professional managing documentation, DocuChat makes document interaction seamless and intelligent.
- Beautiful Dark Theme - Eye-friendly dark mode with modern gradients
- Responsive Design - Works perfectly on desktop, tablet, and mobile
- Smooth Animations - Polished transitions and micro-interactions
- Intuitive Navigation - Clean, user-friendly interface
- Real-time Chat - Interactive conversation with your documents
- Typing Indicators - Visual feedback while AI processes your query
- Message History - View and manage your conversation history
- Copy to Clipboard - One-click copy for any message
- Export Conversations - Download chat history as text files
- Markdown Support - Rich text formatting in responses
- Drag & Drop - Intuitive file upload with drag-and-drop support
- File Preview - See file details before uploading
- Progress Tracking - Real-time upload progress indicators
- Multiple Formats - Support for PDF, DOCX, PPTX, XLSX, TXT
- File Type Icons - Visual file type identification
- Organize Documents - Group files into projects
- Search Functionality - Quickly find projects and files
- Project Statistics - View file counts and project details
- Bulk Operations - Manage multiple files efficiently
- Quick Actions - Generate embeddings and fine-tune models with one click
- Semantic Search - Find relevant information using embeddings
- BERT-based Models - Advanced NLP for document understanding
- Fine-tuning Support - Customize models for your specific use case
- Multi-language Support - Handle documents in multiple languages
- Context-Aware Responses - Answers based on document content
- Toast Notifications - Beautiful, non-intrusive notifications
- Loading States - Clear feedback during operations
- Error Handling - User-friendly error messages
- Keyboard Shortcuts - Power user features
- Empty States - Helpful guidance when no data exists
- Python 3.11+ - Core language
- Flask - Web framework
- Transformers - Hugging Face models
- FAISS - Vector similarity search
- BERT - Multilingual language model
- PyTorch - Deep learning framework
- PHP 7.4+ - Server-side scripting
- Bootstrap 5 - UI framework
- JavaScript (ES6+) - Interactive features
- Font Awesome - Icons
- jQuery - DOM manipulation
- Python 3.11 or higher
- PHP 7.4 or higher
- Web server (Apache/Nginx) or PHP built-in server
- pip (Python package manager)
- Composer (for PHP dependencies, if needed)
git clone https://github.com/LebToki/DocuChat.git
cd DocuChat# Navigate to backend directory
cd backend
# Create virtual environment
python -m venv .venv
# Activate virtual environment
# On Linux/Mac:
source .venv/bin/activate
# On Windows:
.venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt
# Download required models
python download_models.py
# Set environment variables
export SECRET_KEY="your-secret-key-here"
export BACKEND_URL="http://localhost:8080"
export DOCUCHAT_USER="admin"
export DOCUCHAT_PASS="password"
# Run the Flask backend
python app.pyThe backend will start on http://localhost:8080
# Navigate back to project root
cd ..
# Configure backend URL in config.php
# Edit public/src/views/config.php or set BACKEND_URL environment variable
# Using PHP built-in server
php -S localhost:8000 -t public
# Or configure with your web server (Apache/Nginx)
# Point document root to the 'public' directory# Build and run with Docker Compose
docker-compose up --build- Navigate to Manage Projects
- Enter a project name
- Click Create Project
- Go to Upload Document
- Select your project
- Drag & drop or browse for files
- Supported formats: PDF, DOCX, PPTX, XLSX, TXT
- In Manage Projects, select your project
- Click Generate Embeddings
- Wait for processing to complete
- Go to Chat with Document
- Select your project
- Type your question
- Get AI-powered answers!
- Select a project with documents
- Click Fine-Tune Model
- Wait for training to complete
GET /projects- List all projectsPOST /projects- Create a new projectDELETE /projects- Delete a project
POST /upload- Upload a documentDELETE /projects/<project_name>/files- Delete a file
POST /projects/<project_name>/generate_embeddings- Generate embeddings
POST /ask- Ask a question about documents
POST /fine_tune- Fine-tune the model
- Research - Analyze academic papers and research documents
- Education - Interactive study materials and Q&A
- Business - Document knowledge bases and FAQs
- Legal - Contract and legal document analysis
- Technical - API documentation and technical guides
- Personal - Organize and query personal documents
DocuChat/
βββ backend/
β βββ app.py # Flask application
β βββ download_models.py # Model download script
β βββ fine_tune_model.py # Model fine-tuning script
β βββ models/ # Stored models
β βββ project_embeddings/ # Project embeddings
β βββ static/
β β βββ uploads/ # Uploaded files
β βββ requirements.txt # Python dependencies
βββ public/
β βββ css/
β β βββ styles.css # Main stylesheet
β βββ js/
β β βββ scripts.js # Main JavaScript
β β βββ utils.js # Utility functions
β βββ img/ # Images and icons
β βββ src/
β βββ views/ # PHP views
βββ docker-compose.yml # Docker configuration
βββ Dockerfile.backend # Backend Dockerfile
βββ Dockerfile.frontend # Frontend Dockerfile
βββ README.md # This file
# Backend
SECRET_KEY=your-secret-key-here
BACKEND_URL=http://localhost:8080
DOCUCHAT_USER=admin
DOCUCHAT_PASS=password
ALLOWED_ORIGINS=*
# Frontend (in config.php)
BACKEND_URL=http://localhost:8080We welcome contributions! Here's how you can help:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- Follow the existing code style
- Add comments for complex logic
- Update documentation as needed
- Write clear commit messages
- Test your changes thoroughly
This project is licensed under the MIT License - see the LICENSE file for details.
- Hugging Face - For the Transformers library and models
- Facebook AI Research - For FAISS
- Bootstrap - For the UI framework
- Font Awesome - For icons
- Issues - GitHub Issues
- Discussions - GitHub Discussions
If you find this project useful, please consider giving it a β on GitHub!
Made with β€οΈ by the DocuChat Team