Releases: djleamen/doc-reader
Releases · djleamen/doc-reader
Document Reader v1.0.0-alpha
RAG Document Q&A System
A specialized large document Q&A AI agent using Retrieval-Augmented Generation (RAG). This system can efficiently process, index, and query massive documents to provide accurate, contextual answers.
Features
- Large Document Support: Handle documents up to 800k+ words efficiently
- Multiple Format Support: PDF, DOCX, TXT, and Markdown files
- Advanced RAG Pipeline: Combines retrieval and generation for accurate answers
- Vector Database Options: FAISS, ChromaDB, and Pinecone support
- Conversational Mode: Maintains context across multiple queries
- Modern Web Interface: Beautiful Django UI with Bootstrap styling
- REST API: Django REST Framework API for integration
- CLI Tool: Command-line interface for batch processing
- Scalable Architecture: Modular design for easy extension
Requirements
- Python 3.8+
- OpenAI API key
- 8GB+ RAM recommended for large documents
- 2GB+ disk space for vector indexes
Architecture
┌─────────────────┐ ┌──────────────────┐ ┌─────────────────┐
│ Document │ │ Vector Store │ │ LLM Engine │
│ Processor │───▶│ (FAISS/Chroma) │───▶│ (GPT-4) │
└─────────────────┘ └──────────────────┘ └─────────────────┘
│ │ │
▼ ▼ ▼
┌─────────────────┐ ┌──────────────────┐ ┌─────────────────┐
│ Text Chunks │ │ Embeddings │ │ Contextual │
│ + Metadata │ │ + Similarity │ │ Answers │
└─────────────────┘ └──────────────────┘ └─────────────────┘
Key Components
- Document Processor: Extracts and chunks text from various formats
- Vector Store Manager: Handles embedding storage and similarity search
- RAG Engine: Orchestrates retrieval and generation
- API Layer: Django REST Framework for API endpoints
- UI Layer: Django with Bootstrap for web interface
- CLI: Command-line tools for batch operations
API Documentation
Start the API server and visit:
- Swagger UI:
http://localhost:8000/docs - ReDoc:
http://localhost:8000/redoc
Key Endpoints
POST /upload-documents: Upload and process documentsPOST /query: Query the document indexPOST /conversational-query: Query with conversation contextGET /index-stats: Get index statisticsDELETE /index: Clear the index
Production Considerations
- Use production vector database (Pinecone, Weaviate)
- Implement rate limiting and authentication
- Scale with load balancer for high traffic
- Monitor API performance and costs
- Backup vector indexes regularly