Skip to content

Releases: djleamen/doc-reader

Document Reader v1.0.0-alpha

24 Jul 23:53
a2dd905

Choose a tag to compare

Pre-release

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 documents
  • POST /query: Query the document index
  • POST /conversational-query: Query with conversation context
  • GET /index-stats: Get index statistics
  • DELETE /index: Clear the index

Production Considerations

  1. Use production vector database (Pinecone, Weaviate)
  2. Implement rate limiting and authentication
  3. Scale with load balancer for high traffic
  4. Monitor API performance and costs
  5. Backup vector indexes regularly