Skip to main content

Workflow tools for paper extraction, review, and research automation.

Project description

ai-deepresearch-flow logo

ai-deepresearch-flow

From documents to deep research insight — automatically.

English | 中文

PyPI - Version


Core Pain Points

  • OCR Chaos: Raw markdown from OCR tools is often broken — tables drift, formulas break, references are non-clickable.
  • Translation Nightmares: Translating technical papers often destroys code blocks, LaTeX formulas, and table structures.
  • Information Overload: Extracting structured insights (authors, venues, summaries) from hundreds of PDFs manually is impossible.
  • Context Switching: Managing PDFs, summaries, and translations in different windows kills focus.

Solution

DeepResearch Flow provides a unified pipeline to Repair, Translate, Extract, and Serve your research library.

Key Features

  • Smart Extraction — Turn unstructured Markdown into schema-enforced JSON (summaries, metadata, Q&A) using LLMs.
  • Precision Translation — Translate OCR Markdown to Chinese/Japanese while freezing formulas, code, tables, and references.
  • Local Knowledge DB — Web UI with Split View (Source/Translation/Summary), full-text search, and multi-dimensional filtering.
  • Snapshot + API Serve — Production-ready SQLite snapshot with static assets and read-only JSON API.
  • OCR Post-Processing — Fix broken references, merge split paragraphs, repair LaTeX and Mermaid diagrams.
  • Semantic Search — LanceDB-backed vector search with hybrid recall and cloud reranking.
  • MCP Integration — FastMCP server for AI agent access with bounded read tools, static-bearer Streamable HTTP/SSE, and GitHub OAuth at /oauth/mcp.

Quick Start

1) Installation

uv pip install deepresearch-flow
# or: pip install deepresearch-flow

2) Configuration

cp config.example.toml config.toml

Minimal config with weighted multi-provider routing:

main_model = [
  { model = "openai/gpt-4o-mini", weight = 4 },
  { model = "claude/claude-sonnet-4-5-20250929", weight = 1 }
]

[[providers]]
name = "openai"
type = "openai_compatible"
base = [
  { url = "https://api.openai.com/v1", weight = 1, key = [
    { value = "env:OPENAI_API_KEY", weight = 4 }
  ] }
]
models = [
  { model_name = "gpt-4o-mini", is_support_json_schema = true }
]

[[providers]]
name = "claude"
type = "claude"
base = [
  { url = "https://api.anthropic.com", weight = 1, key = [
    { value = "env:ANTHROPIC_API_KEY", weight = 1 }
  ] }
]
models = [
  { model_name = "claude-sonnet-4-5-20250929" }
]

Keys use env:VAR_NAME syntax to keep secrets out of config files. Multiple providers (Ollama, Gemini, DashScope, Azure OpenAI) are supported. For full configuration options (embedding, rerank, translator defaults, search), see config.example.toml.

3) The "Zero to Hero" Workflow

Step 1: Extract Structured Insights

uv run deepresearch-flow paper extract \
  --input ./docs \
  --model openai/gpt-4o-mini \
  --prompt-template deep_read

extract

Step 1.1: Verify & Retry Missing Fields

uv run deepresearch-flow paper db verify \
  --input-json ./paper_infos.json \
  --prompt-template deep_read \
  --output-json ./paper_verify.json

uv run deepresearch-flow paper extract \
  --input ./docs \
  --model openai/gpt-4o-mini \
  --prompt-template deep_read \
  --retry-list-json ./paper_verify.json

verify

Step 2: Safe Translation

uv run deepresearch-flow translator translate \
  --input ./docs \
  --target-lang zh \
  --model openai/gpt-4o-mini \
  --fix-level moderate

Step 2.5: OCR on PDFs/Images (Optional)

If your source documents are PDFs or scanned images:

cp ocr.example.toml ocr.toml
# Set: export PADDLE_OCR_TOKEN=xxx

uv run deepresearch-flow recognize ocr ./pdfs --config ocr.toml --output-dir ./ocr_output

Output follows the mineru layout (full.md + images/ per document).

Step 3: Repair OCR Outputs (Recommended)

Recommended order: fixfix-mathfix-mermaidfix.

# Fix OCR markdown structure
uv run deepresearch-flow recognize fix \
  --input ./docs --in-place

fix

# Fix LaTeX formulas
uv run deepresearch-flow recognize fix-math \
  --input ./docs --model openai/gpt-4o-mini --in-place

fix math

# Fix Mermaid diagrams
uv run deepresearch-flow recognize fix-mermaid \
  --input ./paper_outputs --json \
  --model openai/gpt-4o-mini --in-place

fix mermaid

# Retry only failed formulas/diagrams
uv run deepresearch-flow recognize fix-math \
  --input ./docs --model openai/gpt-4o-mini --retry-failed

# Final format normalization
uv run deepresearch-flow recognize fix \
  --input ./docs --in-place

fix retry failed

Step 4: Serve Your Local Knowledge Base

uv run deepresearch-flow paper db serve \
  --input paper_infos.json \
  --md-root ./docs \
  --md-translated-root ./docs \
  --host 127.0.0.1

Step 4.1: Add Semantic Search (Optional)

Build a LanceDB vector index from extracted JSON:

uv run deepresearch-flow paper embed \
  --config ./config.toml \
  --input ./paper_infos.json \
  --max-concurrency 4 \
  --document-window 8 \
  --output-embed-db ./paper_vectors

Serve with semantic search enabled:

uv run deepresearch-flow paper db serve \
  --input ./paper_infos.json \
  --md-root ./docs \
  --embed-db ./paper_vectors \
  --search-access-token "your-token"

Step 5: MCP Integration (Optional)

The project exposes bounded MCP tools for AI agent access via FastMCP. See the MCP documentation for endpoint, auth, and tool reference.


Further Reading

  • Advanced Workflows — Incremental builds, merging JSON/BibTeX, supplementing templates
  • Deployment — CDN serving, Nginx/Caddy config, Docker, Compose
  • API & MCP — Admin API, push/push-semantic, MCP endpoints, auth, and tools
  • Reference — Translator, Extract, DB & Recognize in detail
  • Snapshot Management — Snapshot migration, supplement, update

Built with love for the Open Science community.

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

deepresearch_flow-0.10.1.tar.gz (5.9 MB view details)

Uploaded Source

Built Distribution

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

deepresearch_flow-0.10.1-py3-none-any.whl (6.5 MB view details)

Uploaded Python 3

File details

Details for the file deepresearch_flow-0.10.1.tar.gz.

File metadata

  • Download URL: deepresearch_flow-0.10.1.tar.gz
  • Upload date:
  • Size: 5.9 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for deepresearch_flow-0.10.1.tar.gz
Algorithm Hash digest
SHA256 256838236a42a51ee4e82a635cb95b175988388de1ee33cab48ab6624c6b7bf1
MD5 f73ba04a7ecc9e168a04a1a116f3e0e9
BLAKE2b-256 b945262519f27e0c9fb750360b119043b8f8e2d211da72fd5859eafc5da50a33

See more details on using hashes here.

Provenance

The following attestation bundles were made for deepresearch_flow-0.10.1.tar.gz:

Publisher: push-to-pypi.yml on nerdneilsfield/ai-deepresearch-flow

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file deepresearch_flow-0.10.1-py3-none-any.whl.

File metadata

File hashes

Hashes for deepresearch_flow-0.10.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b465afd41dc3e064d78799d17d0a6598fd3ebaee229c04d7ee863263e0562656
MD5 39080d80782d71c0d4e60dbfe8ca97d1
BLAKE2b-256 4041992d5035359956e729a853cce63123ae0ba92efeebf7938d3f4008cf6699

See more details on using hashes here.

Provenance

The following attestation bundles were made for deepresearch_flow-0.10.1-py3-none-any.whl:

Publisher: push-to-pypi.yml on nerdneilsfield/ai-deepresearch-flow

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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