Skip to main content

Unified document parsing, structured extraction, vector ingestion, and RAG pipeline SDK

Project description

docpipe

Unified document parsing, structured extraction, vector ingestion, and RAG pipeline SDK.

PyPI Python License: MIT Docker Website

Overview

docpipe connects document parsing (Docling, MarkItDown, GLM-OCR), LLM-based structured extraction (LangExtract + LangChain), vector ingestion (pgvector or optional turbovec), and RAG querying into a single composable pipeline. Optional AutoGen agents add tool-using multi-agent RAG.

Four pipelines, composable together:

  1. Parse — Unstructured docs → parsed text/markdown
  2. Extract — Text → structured entities via LLM
  3. Ingest — Chunks → embeddings → your vector store
  4. RAG — Questions → grounded answers with citations (six retrieval strategies)

docpipe never stores your data. It connects to your infrastructure and gets out of the way.

Full documentation (install extras, Docker, API reference, RAG strategies, observability, turbovec, plugins): docpipe docs · Marketing site


Install

pip install docpipe-sdk
# API server + OpenTelemetry (optional)
pip install "docpipe-sdk[server,observability]"

Optional extras (docling, openai, google, pgvector, turbovec, rag, rerank, http, all, …) are listed on the Install guide.

For unreleased commits: pip install git+https://github.com/thesunnysinha/docpipe.git


Quick start

import docpipe

# Parse (docling default; markitdown for lightweight Office/PDF → Markdown)
doc = docpipe.parse("invoice.pdf", parser="markitdown")
print(doc.markdown)

# Extract
schema = docpipe.ExtractionSchema(
    description="Extract invoice line items with amounts",
    model_id="gemini-2.5-flash",
)
results = docpipe.extract(doc.text, schema)

# Ingest + RAG (configure your DB + providers)
config = docpipe.IngestionConfig(
    connection_string="postgresql://user:pass@localhost:5432/mydb",
    table_name="invoices",
    embedding_provider="openai",
    embedding_model="text-embedding-3-small",
)
docpipe.ingest("invoice.pdf", config=config)

rag_config = docpipe.RAGConfig(
    connection_string=config.connection_string,
    table_name=config.table_name,
    embedding_provider="openai",
    embedding_model="text-embedding-3-small",
    llm_provider="openai",
    llm_model="gpt-4o",
    strategy="hyde",
    system_prompt=(
        "Answer using ONLY the context below.\n\n"
        "Context:\n{context}\n\nQuestion: {question}\n\nAnswer:"
    ),
    hyde_prompt="Write a passage that answers: {question}",
)
result = docpipe.query("What is the total on the invoice?", config=rag_config)
print(result.answer)

# Optional: AutoGen agents with vector-search tools (pip install "docpipe-sdk[autogen]")
agent_result = docpipe.agent_query(
    "What is the total on the invoice?",
    config=rag_config,
    enable_reviewer=True,
)
print(agent_result.answer)

CLI: docpipe parse, docpipe ingest, docpipe rag query, docpipe serve — see CLI & API server.

Docker (profile tags):

docker pull ghcr.io/thesunnysinha/docpipe:balanced   # default production
docker pull ghcr.io/thesunnysinha/docpipe:slim       # lightweight
docker pull ghcr.io/thesunnysinha/docpipe:quality    # OCR + BGE rerank
docker pull ghcr.io/thesunnysinha/docpipe:agents     # AutoGen

pip profiles: profile-slim, profile-balanced, profile-quality, profile-agents — see .env.example and docs/INTEGRATION.md.

Runtime presets on /ingest and /rag/query: preset=fast|balanced|quality|agents. Discover options via GET /profiles and GET /plugins.

Shared Kubernetes API (one docpipe for Jingo, Andocs, and other apps): manifests in k8s/, deploy via .github/workflows/deploy-k8s.yml. Consumers call http://docpipe.docpipe.svc.cluster.local:8000 and pass their own connection_string on each /ingest and /rag/* request (vectors stay in each app's Postgres). See env/k8s/DOCPIPE_ENV.example.


Learn more

Topic Where
Install extras & providers docs
REST API (/ingest, /rag/query, /rag/stream, /transcribe, …) docs
Speech-to-text (VibeVoice ASR or OpenAI Whisper) POST /transcribe · backends: openai, vibevoice, vibevoice_remote
RAG strategies (naive, hyde, hybrid, auto, …) docs
Observability (OTEL, Prometheus, JSON logs) docs · .env.example
turbovec (local file indices) docs
Custom parsers / extractors CONTRIBUTING.md
Environment variables .env.example · config reference

License

MIT — see LICENSE.

Project details


Download files

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

Source Distribution

docpipe_sdk-0.6.0.tar.gz (232.7 kB view details)

Uploaded Source

Built Distribution

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

docpipe_sdk-0.6.0-py3-none-any.whl (115.5 kB view details)

Uploaded Python 3

File details

Details for the file docpipe_sdk-0.6.0.tar.gz.

File metadata

  • Download URL: docpipe_sdk-0.6.0.tar.gz
  • Upload date:
  • Size: 232.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.13

File hashes

Hashes for docpipe_sdk-0.6.0.tar.gz
Algorithm Hash digest
SHA256 cb5d9c33d377b47cee86b2b9a4d5cc729a7ae2e50b3b8fa071b218d7daad643e
MD5 880f57fd3b79d1360c816a63daebf878
BLAKE2b-256 afcd3f50ab29eacb0df67be4d1018667250cf7a6fb46e16bc8935bffdd2003f9

See more details on using hashes here.

File details

Details for the file docpipe_sdk-0.6.0-py3-none-any.whl.

File metadata

  • Download URL: docpipe_sdk-0.6.0-py3-none-any.whl
  • Upload date:
  • Size: 115.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.13

File hashes

Hashes for docpipe_sdk-0.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f20f7e991120a674b62ec8dd3691424c8d8d941e1d8e2b621f2deee6b86b77b7
MD5 c009c56b52f6921ab5c66d4e68c611b5
BLAKE2b-256 78ccbd39572e960d3824fc3da5c58f472e8bcc629c9501a28aacf638c6117f28

See more details on using hashes here.

Supported by

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