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.5.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.5-py3-none-any.whl (6.5 MB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: deepresearch_flow-0.10.5.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.5.tar.gz
Algorithm Hash digest
SHA256 b83654308830af736fb56f81a94e5cf08309607aae6e04c28f5e556c8b3066b5
MD5 74ec7ee2ae791c8605228d021d4e5536
BLAKE2b-256 26e9fcf778a1f9f960e429ada4fd450a38a951d932c2305967ec74efe2dcae45

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for deepresearch_flow-0.10.5-py3-none-any.whl
Algorithm Hash digest
SHA256 52f328efe1c0fe77d6b3dc6bce7ef70b361fdfc311c893a2a246fd66b32bc5ed
MD5 75555d18c6f6d823b7c44c7cbd8ee72b
BLAKE2b-256 130e56e2f9e57f9936daf8da62387f8fb3fa15903aa18097ba3804786220e8a6

See more details on using hashes here.

Provenance

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