- Overview
- Features
- Demo
- Installation
- Configuration
- Usage
- Supported File Types
- Technology Stack
- Project Structure
- How It Works
- Contributing
- License
- Contact
OmniQuery is an AI-powered document intelligence platform that allows users to upload documents and interact with them through natural language queries. Built with Streamlit, LangChain, and OpenAI's GPT models, OmniQuery extracts, processes, and analyzes information from your documents, providing intelligent answers to your questions in real-time.
- π Multi-Format Support: Upload PDF, DOCX, TXT, and Markdown files
- π€ AI-Powered Q&A: Ask questions in natural language and get intelligent responses
- πΎ Vector Store: Efficient document embedding using ChromaDB for fast retrieval
- π¬ Conversation Memory: Maintains context throughout your chat session
- π Feedback System: Rate responses and visualize feedback analytics
- π₯ Export Functionality: Download complete chat history as JSON
- π Modern Dark Theme: Sleek cyberpunk-inspired interface with gradient effects
- β‘ Real-time Processing: Live progress indicators during document processing
- π Visual Analytics: Interactive feedback distribution charts using Plotly
- ποΈ Temperature Control: Adjust AI response creativity with temperature slider
- β¨ Smooth Animations: Hover effects and transitions for better user experience
- π Retry Logic: Robust error handling with exponential backoff
- π¦ Chunking Strategy: Smart document splitting for optimal processing
- ποΈ Session State Management: Persistent state across interactions
- π Secure API Integration: Environment-based configuration for API keys
- π SQLite Compatibility: Uses pysqlite3 for ChromaDB compatibility
Upload a document, ask questions, and get instant AI-powered answers!
- Python 3.8 or higher
- OpenAI API key
- Git (optional)
git clone https://github.com/Varsha-1605/Document-Uploader.git
cd Document-Uploader# Windows
python -m venv venv
venv\Scripts\activate
# macOS/Linux
python3 -m venv venv
source venv/bin/activatepip install -r requirements.txtCreate a .env file in the root directory or configure Streamlit secrets:
Option 1: Using .env file
OPENAI_API_KEY=your_openai_api_key_hereOption 2: Using Streamlit Secrets
Create .streamlit/secrets.toml:
OPENAI_API_KEY = "your_openai_api_key_here"- Visit OpenAI Platform
- Sign up or log in
- Navigate to API Keys section
- Create a new API key
- Copy and use in your configuration
streamlit run final_document_uploader.pyThe application will open in your default browser at http://localhost:8501
-
π Upload a Document
- Click "Browse files" in the sidebar
- Select a PDF, DOCX, TXT, or MD file
- Wait for processing to complete
-
π‘οΈ Adjust Settings (Optional)
- Use the temperature slider (0.0 - 1.0)
- Lower values: More focused/consistent responses
- Higher values: More creative/varied responses
-
β Ask Questions
- Type your question in the text input
- Click "Generate Response" or press Enter
- View the AI-generated answer
-
ππ Provide Feedback
- Rate each response as helpful or not helpful
- View analytics in the feedback visualization chart
-
π₯ Export Chat History
- Click "Export Chat History" to download as JSON
- Preserve your conversation for future reference
| File Type | Extension | Loader Used |
|---|---|---|
.pdf |
PyPDFLoader | |
| Word Document | .docx |
UnstructuredWordDocumentLoader |
| Text File | .txt |
UnstructuredFileLoader |
| Markdown | .md |
UnstructuredFileLoader |
- Streamlit: Web application framework
- Custom CSS: Cyberpunk-themed dark UI
- OpenAI GPT-3.5-turbo: Language model for Q&A
- OpenAI Embeddings: Document vectorization
- LangChain: LLM application framework
- ChromaDB: Vector database for embeddings
- Unstructured: Document parsing
- PyPDF: PDF processing
- python-docx: Word document handling
- Tenacity: Retry logic and error handling
- Pandas: Data manipulation
- Plotly: Interactive visualizations
- pysqlite3: SQLite compatibility
Document-Uploader/
β
βββ final_document_uploader.py # Main application file
βββ requirements.txt # Python dependencies
βββ New_logo.png # Application logo
βββ .env # Environment variables (create this)
βββ .gitignore # Git ignore rules
βββ README.md # Project documentation
β
βββ .devcontainer/ # Dev container configuration
β βββ devcontainer.json
β
βββ temp_docs/ # Temporary document storage
graph LR
A[Upload Document] --> B[Load Document]
B --> C[Split into Chunks]
C --> D[Generate Embeddings]
D --> E[Store in ChromaDB]
E --> F[Create Vector Store]
User Query β Agent Executor β Vector Store Search β Retrieve Relevant Chunks β
LLM Processing β Generate Answer β Stream Response β Display to Userdef load_document(file_path):
# Automatically detects file type and uses appropriate loader
# Supports PDF, DOCX, TXT, MD- Chunk Size: 1000 characters
- Overlap: 200 characters
- Strategy: RecursiveCharacterTextSplitter
- Database: ChromaDB
- Embeddings: OpenAI Ada-002
- Collection: document_store
- Type: VectorStore Agent
- Memory: ConversationBufferMemory
- Callbacks: Streamlit streaming handler
Controls the randomness of AI responses:
- 0.0: Deterministic, focused answers
- 0.7: Balanced (default)
- 1.0: Creative, varied responses
- Visual pie chart showing response helpfulness
- Real-time feedback collection
- Exportable feedback data
- Maintains context across multiple questions
- Stores full chat history in session state
- Exportable as JSON for record-keeping
Contributions are welcome! Here's how you can help:
-
Fork the Repository
git fork https://github.com/Varsha-1605/Document-Uploader.git
-
Create a Feature Branch
git checkout -b feature/AmazingFeature
-
Commit Your Changes
git commit -m 'Add some AmazingFeature' -
Push to the Branch
git push origin feature/AmazingFeature
-
Open a Pull Request
- Follow PEP 8 style guidelines
- Add comments for complex logic
- Test thoroughly before submitting PR
- Update documentation as needed
- Large documents (>50 pages) may take longer to process
- API rate limits apply based on OpenAI plan
- Temporary files created during upload are automatically cleaned up
- Session state is lost on browser refresh
- Support for more file formats (CSV, Excel, PPT)
- Multi-document upload and querying
- Document comparison features
- Advanced search filters
- User authentication and saved sessions
- Export to different formats (PDF, Word)
- Support for other LLM providers
- Cloud deployment options
This project is licensed under the MIT License - see the LICENSE file for details.
Varsha
- GitHub: @Varsha-1605
- Repository: Document-Uploader
- Streamlit for the amazing web framework
- LangChain for LLM orchestration
- OpenAI for powerful language models
- ChromaDB for vector storage

