A modern web application that allows users to upload documents (PDF, DOCX, TXT) and ask questions about their content using ChromaDB for document storage and retrieval. Powered by Flask, LangChain, and FAISS.
git clone <repository-url>
cd flask-chromadb-app
docker-compose up --buildVisit: http://localhost:5001
git clone <repository-url>
cd flask-chromadb-app
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
pip install -r requirements.txt
python app.pyVisit: http://localhost:5000
- Modern, responsive UI with smooth animations
- Drag-and-drop file upload
- Support for PDF, DOCX, and TXT files
- Real-time chat interface
- Document management system
- Semantic search using ChromaDB & FAISS
- Beautiful loading animations and transitions
flask-chromadb-app/
βββ app.py # Main Flask application
βββ requirements.txt # Python dependencies
βββ Dockerfile # Docker build file
βββ docker-compose.yml # Docker Compose config
βββ .dockerignore # Docker ignore file
βββ static/
β βββ css/
β β βββ style.css # Custom styles
β βββ js/
β β βββ main.js # Frontend JavaScript
β βββ uploads/ # Uploaded documents
βββ templates/
β βββ index.html # Main template
βββ db/ # ChromaDB storage
- UI Customization: Edit
static/css/style.cssandtemplates/index.htmlfor branding and layout changes. - File Size Limit: Adjust
MAX_CONTENT_LENGTHinapp.py. - Allowed File Types: Update
ALLOWED_EXTENSIONSinapp.py.
- Upload a document by dragging and dropping it or clicking "Browse Files".
- Wait for the document to be processed (progress bar will show).
- Ask a question in the chat input field.
- View the chatbot's answer based on your document content.
Example Q&A:
- Q: "What is the main topic of this document?"
- Q: "Summarize the second section."
- Q: "List all dates mentioned."
flasklangchainlangchain-communityfaiss-cpunumpy==1.26.4(required for FAISS compatibility)python-docx,pymupdf,python-magic, etc.
- The app runs on port 5001 by default (see
docker-compose.yml). - Uploaded files and ChromaDB data persist in
static/uploadsanddb. - To stop the app:
Ctrl+Cthendocker-compose down.
Q: I get ModuleNotFoundError: No module named 'numpy.distutils' or FAISS import errors.
- A: Ensure your
requirements.txtincludes:Then rebuild Docker:numpy==1.26.4 faiss-cpudocker-compose build && docker-compose up
Q: Port 5000 is already in use!
- A: The Docker app is mapped to port 5001. Visit http://localhost:5001
Q: How do I change the upload size or allowed file types?
- A: Edit
MAX_CONTENT_LENGTHandALLOWED_EXTENSIONSinapp.py.
- Fork the repository
- Create a new branch for your feature
- Commit your changes
- Push to the branch
- Create a Pull Request
This project is licensed under the MIT License. See the LICENSE file for details.
For questions, issues, or feature requests, please open an issue on GitHub or contact the maintainer at [your-email@example.com].