AGENTFlow is a Python library for building agent-oriented applications with a small, composable surface area.
It currently focuses on three practical integration layers:
agentflow.connectors: lightweight connectors such as arXivagentflow.llms: stable wrappers around model gateways such as LiteLLMagentflow.parsers: document parsing wrappers such as MinerU
The project is designed to be imported from other Python projects, not only run as a local app scaffold.
Install the base package when you only need dependency-light modules such as the arXiv connector:
pip install agentflowInstall optional integrations only when you need them:
pip install "agentflow[llms]"
pip install "agentflow[mineru]"
pip install "agentflow[mineru-pipeline]"For local development with uv:
uv sync
uv sync --extra llms
uv sync --extra mineru-pipelineLiteLLM and MinerU are now optional dependencies. That means:
import agentflowworks even iflitellmormineruis not installed.- users can install only the integrations they actually need.
- the package is better suited for publishing on PyPI as a reusable library.
If you access an optional feature without its dependency installed, AGENTFlow raises a clear installation hint.
from agentflow import ArxivConnector
connector = ArxivConnector()
paper = connector.resolve("1706.03762")
print(paper.pdf_url)from agentflow import LiteLLMClient, LiteLLMConfig
client = LiteLLMClient(
LiteLLMConfig(
model="gpt-4o-mini",
api_key="your-api-key",
)
)
response = client.prompt("Say hello in one short sentence.")
print(response.content)from agentflow import MinerUConfig, MinerUParser
parser = MinerUParser(
MinerUConfig(
backend="pipeline",
parse_method="auto",
lang_list=("ch",),
)
)
result = parser.parse_file("example.pdf")
print(result.parse_dir)
print(result.markdown_file)from pathlib import Path
from agentflow import MinerUParser
parser = MinerUParser()
pdf_bytes = Path("example.pdf").read_bytes()
result = parser.parse_bytes(pdf_bytes, file_name="example.pdf")
print(result.middle_json_file)Minimal test scripts live next to the modules they exercise:
src/agentflow/connectors/test_arxiv_connector_minimal.pysrc/agentflow/llms/test_litellm_minimal.pysrc/agentflow/parsers/test_mineru_minimal.py
Examples:
python src/agentflow/connectors/test_arxiv_connector_minimal.py --search transformer
python src/agentflow/parsers/test_mineru_minimal.py your.pdfMinerUParsernow uses direct local invocation instead of spinning up a temporarymineru-apiservice.MinerUParser.parse_bytes()andMinerUParser.aparse_bytes()are intended to make downstream library integration easier.- the top-level package uses lazy exports so optional integrations do not break unrelated imports.
Before uploading to PyPI, you should still confirm:
- the package name
agentflowis available on PyPI - your final project license choice
- the repository/homepage URLs you want to publish in package metadata
Build commands:
python -m build
python -m twine check dist/*
python -m twine upload dist/*