Skip to content
ronaksardaPublic

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

Repository files navigation

doc_ask — RAG-Powered Local Document QA System

An AI-powered Document Question Answering System using Retrieval-Augmented Generation (RAG) that runs entirely locally via Ollama.

Users upload documents (PDF, DOCX, TXT), ask natural language questions, and get accurate context-aware answers grounded in document content.

How It Works (RAG Pipeline)

Upload → Parse & Extract Text → Store in Memory → User Asks Question
                                                        ↓
                            Retrieve relevant document context from store
                                                        ↓
                            Augment LLM prompt with retrieved context
                                                        ↓
                            Generate answer using local Ollama LLM (qwen2.5:1.5b)

This implements Full-Context RAG (context stuffing):

  1. Retrieval — Parsed document text retrieved from in-memory store
  2. Augmentation — Full document context injected into LLM prompt
  3. Generation — Local LLM generates answers strictly from provided context

Optimized for small-to-medium documents where full context fits within LLM context window (32k tokens). No vector DB needed for this scale.

Features

  • RAG Architecture: Retrieval-Augmented Generation with full-context stuffing
  • Multi-Format Parsing: PDF (pypdf), DOCX (python-docx), TXT (multi-encoding: utf-8/latin-1/cp1252/utf-16)
  • Local LLM: Runs on Ollama qwen2.5:1.5b — no API keys, no cloud, fully private
  • Xbox Theme UI: Flat matte black and green interface
  • Upload Limit: Max 2 files per session, auto-clears previous context
  • Low Temperature (0.2): Enforced factual, context-bound answers

Prerequisites

  1. Python 3.10+
  2. Ollama — Install from ollama.com and start it
  3. Model:
    ollama pull qwen2.5:1.5b

Quick Start

cd folder_ask
pip install -r requirements.txt
python app.py

Open http://127.0.0.1:5000.


Tests

python -m unittest test_app.py

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages