Skip to main content

DocQWise: Read, Extract, Retrieve

Document intelligence that adapts, accelerates, and scales.

PyPI License Open In Colab


What is DocQWise?

DocQWise is a pluggable, AI-powered document intelligence engine. It reads any document format, extracts structured data using LLMs and RAG pipeline, and retrieves information with semantic search — locally, at scale, for zero per-page cost.

Install

Choose your install based on what you need:

# Option 1: Core only (PDF reading, regex extraction, no ML)
pip install docqwise

# Option 2: With ML (RAG pipeline, embeddings, OCR — recommended)
pip install -r requirements-ml.txt

# Option 3: Everything (all features, all formats)
pip install -r requirements-full.txt

LLM backend (pick one)

# Ollama — local, free, recommended
# Download from https://ollama.com then:
ollama pull nemotron-mini

# OR HuggingFace — local GPU
pip install transformers torch bitsandbytes accelerate

# OR OpenAI — cloud API
export OPENAI_API_KEY=your-key

Quick Start

from docqwise import Docqwise

dq = Docqwise()

# Ingest any document
dq.ingest("documents/")

# Extract fields with template
result = dq.extract_fields("invoice.pdf", template="invoice")
print(result.to_json())

# Ask questions about structured data
dq.ingest("sales.csv")
answer = dq.ask("What is the total amount?")

Extraction Methods

dq = Docqwise()

# RAG (default) — chunk → embed → retrieve → LLM extract
dq.extract_fields("doc.pdf", template="invoice")

# Direct LLM
dq.extract_fields("doc.pdf", template="invoice", method="llm")

# Vision (scanned docs, handwriting)
dq.extract_fields("scan.jpg", method="vision", model="gpt-4o")

# Regex (fast, no ML)
dq.extract_fields("doc.pdf", template="invoice", method="regex")

LLM Backends

# Ollama (local)
dq.extract_fields("doc.pdf", model="nemotron-mini")

# HuggingFace (local GPU)
from docqwise.llm.hf_llm import HuggingFaceLLM
llm = HuggingFaceLLM("Qwen/Qwen2.5-3B-Instruct", quantize="4bit")
dq.extract_fields("doc.pdf", llm=llm)

# OpenAI (cloud)
dq.extract_fields("doc.pdf", model="gpt-4o-mini")

Templates

dq.extract_fields("invoice.pdf", template="invoice")
dq.extract_fields("contract.pdf", template="contract")
dq.extract_fields("resume.pdf", template="resume")
dq.extract_fields("receipt.jpg", template="receipt")

# Custom schema
schema = {
    "vendor": {"type": "string", "description": "Company name"},
    "total": {"type": "number", "description": "Total amount"},
}
dq.extract_fields("doc.pdf", schema=schema)

Custom Prompts

You design the prompts. We run the pipeline.

dq = Docqwise()

# Default — docqwise handles the prompt
dq.extract_fields("doc.pdf", template="invoice")

# Your own prompt — full control
dq.extract_fields("doc.pdf", prompt="""
You are a medical record parser.
Extract patient name, diagnosis, and prescribed medications.
Return JSON only.

Document:
{context}

JSON:
""")

# Your prompt template with schema
dq.extract_fields("doc.pdf",
    schema={"patient": {"type": "string"}, "diagnosis": {"type": "string"}},
    prompt_template="""
Given this extraction schema:
{schema}

Parse this document:
{context}

Return JSON matching the schema exactly.
""")

Self-Improving Corrections

result = dq.extract_fields("invoice.pdf", template="invoice")
result.correct({"tax": 33300.00, "gst_number": "29AABCU9603R1ZM"})
# Next similar document → corrections applied automatically

Structured Data Q&A

dq.ingest("sales.xlsx")
dq.ask("What is the total amount?")         # exact SUM
dq.ask("Which vendor has highest sales?")    # GROUP BY + MAX
dq.ask("How many invoices are overdue?")     # COUNT + WHERE

All Features

dq = Docqwise()

# Ingestion
dq.ingest("file.pdf")                    # single file
dq.ingest("documents/")                  # folder (all formats)
dq.ingest("data.csv")                    # structured data

# Extraction
dq.extract_fields("doc.pdf")             # field extraction
dq.extract_tables("doc.pdf")             # table extraction
dq.extract_entities("doc.pdf")           # entity extraction
dq.extract_images("doc.pdf")             # image extraction
dq.extract_text("doc.pdf")               # text extraction
dq.auto_extract("doc.pdf")               # auto-detect + extract

# Intelligence
dq.retrieve("query", top_k=5)            # semantic search
dq.ask("question")                       # Q&A
dq.classify("doc.pdf")                   # classification
dq.compare("v1.pdf", "v2.pdf")           # comparison
dq.detect_schema("data.csv")             # schema detection
dq.detect_pii("doc.pdf")                 # PII detection

Demos

Run in order:

Demo What Install
python demo/01_quickstart.py All core features pip install docqwise
python demo/02_ollama.py AI extraction with Ollama ollama pull nemotron-mini
python demo/03_huggingface.py AI extraction on GPU pip install transformers torch bitsandbytes accelerate
python demo/04_rag.py Full RAG pipeline pip install sentence-transformers

Notebook

pip install jupyter
jupyter notebook notebooks/docqwise_getting_started.ipynb

Testing

pip install pytest
pytest -v

Docker

docker compose up --build

Architecture

arc

engine.py (stable — never changes)
    └── factory.py (all component selection)
            ├── ExtractorFactory  → rag | llm | vision | regex
            ├── LLMFactory        → ollama | huggingface | openai
            ├── EmbedderFactory   → sentence-transformers | any
            ├── StoreFactory      → sqlite | qdrant | faiss | any
            ├── ChunkerFactory    → structure | fixed | sentence
            └── TemplateFactory   → invoice | contract | resume | receipt

Ecosystem

Library Tagline Domain
SightRAG See. Search. Retrieve. Visual intelligence
sonarwise Hear. Search. Retrieve. Audio intelligence
docqwise Read. Extract. Retrieve. Document intelligence
adaptive-intelligence Learn. Remember. Adapt. Orchestration
llmevalkit Evaluate. Score. Improve. Evaluation

License

Apache License 2.0

Author

Venkatkumar Rajan

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

docqwise-0.2.1.tar.gz (71.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

docqwise-0.2.1-py3-none-any.whl (101.1 kB view details)

Uploaded Python 3

File details

Details for the file docqwise-0.2.1.tar.gz.

File metadata

  • Download URL: docqwise-0.2.1.tar.gz
  • Upload date:
  • Size: 71.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.14.2

File hashes

Hashes for docqwise-0.2.1.tar.gz
Algorithm Hash digest
SHA256 0df82a98e4fbf821810572aeee347c713932ad24ce00515ba0aa5466a19dad5e
MD5 34c82de166a20c7aee4e35943a122478
BLAKE2b-256 6852dafaf8568b5ba6e05dcf35cd0915160f2f00e679b2a61870c35fef6a1369

See more details on using hashes here.

File details

Details for the file docqwise-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: docqwise-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 101.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.14.2

File hashes

Hashes for docqwise-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1d01245d1c4d9cd8ced34f992814ae1372247d2d20cc3cfa4990ae3c84532698
MD5 e4cbb833656dd352b238034353063502
BLAKE2b-256 809159489fa49998e678e2cd61882e17242c432d8ecbab1efa1f95391ca2645c

See more details on using hashes here.

Release history Release notifications | RSS feed

0.3.1

2 files

This release

0.2.1 This release

2 files

0.2.0

2 files

0.1.1

2 files

0.1.0

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page