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.4.tar.gz (6.0 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.4-py3-none-any.whl (6.5 MB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: deepresearch_flow-0.10.4.tar.gz
  • Upload date:
  • Size: 6.0 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.4.tar.gz
Algorithm Hash digest
SHA256 db7a85507d6420dfcc6c7fb0bd4e91d586b55a31559d2ae345bb225559b2fcd2
MD5 339674c012c8b489dd00275e4bcebd0c
BLAKE2b-256 ba434f10d1a78d0b087c88c1e5387f7be2a277986d0132bdab82faa560f3fbe2

See more details on using hashes here.

Provenance

The following attestation bundles were made for deepresearch_flow-0.10.4.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.4-py3-none-any.whl.

File metadata

File hashes

Hashes for deepresearch_flow-0.10.4-py3-none-any.whl
Algorithm Hash digest
SHA256 034b1ffe4f83288527ff847e69a96f72c4509f20e6a8bace1c5068efd2ba3d94
MD5 5d4fd06a3992f528f5147726fd6abac9
BLAKE2b-256 84e7da077017e1ed399eb5d90e251ed01d1c872933f5f4c3b5052810cab42fd8

See more details on using hashes here.

Provenance

The following attestation bundles were made for deepresearch_flow-0.10.4-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