Overview
ADP is Laiye’s Agentic Document Processing product. It uses the general understanding capabilities of large models to process documents without relying on rules or manual labels. It supports multilingual, multimodal, and multi-scenario document understanding. Agents can understand task goals, break down steps, call tools, and complete complex tasks. From document input to business decisions and human review, ADP helps build an end-to-end automation loop. agentic-doc-parse-and-extract (ADP CLI) is ADP’s official open-source command-line tool. It supports manual terminal usage and automated AI Skill calls. With one command, you can parse documents into structured data and extract key fields across invoices, orders, IDs, bills, and general documents. Results are returned as standard JSON for automation and AI workflows.GitHub
laiye-ai/adp-cli
NPM
@laiye-adp/agentic-doc-parse-and-extract-cli
PyPI
agentic-doc-parse-and-extract
Releases
Prebuilt binaries
Key capabilities
agentic-doc-parse-and-extract focuses on intelligent document processing from parsing to extraction and batch processing. It works for both manual CLI usage and AI Agent automation.| Capability | Description | Use cases |
|---|---|---|
| Document parsing | Recognize PDFs, images, and other document formats. Convert unstructured content, including scans, handwriting, and complex layouts, into structured data while preserving hierarchy and key relationships. | Convert unstructured documents into LLM-readable structured data. |
| Out-of-the-box extraction | Use ADP’s native AI capabilities and built-in extraction models for invoices, receipts, orders, and common Chinese IDs. No rules or manual labels are required. | AP automation, expense management, procurement automation, and card/ID onboarding. |
| Custom extraction | Create, edit, and manage custom extraction applications with dedicated fields and logic for company-specific documents and industry forms. | Private extraction needs for proprietary, industry-specific, or non-standard documents. |
| Task query | Submit async tasks and query progress, success/failure state, and final results. | Batch processing, async document processing, troubleshooting, and audit trails. |
| Application management | View available extraction applications, including built-in and custom apps, query details, and manage labels. | Multi-scenario switching and application lifecycle management. |
Install and update
The PyPI package is no longer maintained. Use npm to update to the latest version.
Configure
Get an API key from adp-global.laiye.com. New users receive 100 free credits each month.Quick examples
Commands
AI Agents should call
adp schema to get the authoritative machine-readable command schema. This table is a human-friendly summary.| Command | Description |
|---|---|
adp version | Print the version. |
adp config set | Set API key or base URL. |
adp config get | Show current configuration. |
adp config clear | Clear configuration. |
adp app-id list | List available applications. |
adp app-id cache | Read the app list from local cache. |
adp parse local <path> | Parse local files or directories. |
adp parse url <url> | Parse remote files. URL list files are supported. |
adp parse base64 <data> | Parse Base64 content. |
adp parse query <task-id...> | Query async parse tasks. Multiple IDs and --file are supported. |
adp extract local <path> | Extract fields from local files or directories. |
adp extract url <url> | Extract fields from remote files. |
adp extract base64 <data> | Extract fields from Base64 content. |
adp extract query <task-id...> | Query async extraction tasks. Multiple IDs and --file are supported. |
adp custom-app create | Create a custom extraction application. |
adp custom-app update | Update a custom application. |
adp custom-app get-config | Show application configuration. |
adp custom-app delete | Delete a custom application. |
adp custom-app delete-version | Delete a configuration version. |
adp custom-app ai-generate | Generate recommended extraction fields with AI. |
adp credit | Show remaining credits. |
adp schema | Output the command schema for AI Agents. |
Flags
| Flag | Description |
|---|---|
--json | Output JSON. |
--quiet | Quiet mode. Print only results. |
--lang <en|zh> | UI language. |
--app-id | Application ID. Required for parse and extract. |
--async | Use async mode. |
--no-wait | Submit tasks without waiting. Use with --async. |
--export <path> | Export results to a file for a single file or a directory for batch processing. |
--timeout <seconds> | Timeout. Default: 900 seconds. |
--concurrency <n> | Concurrency. Free tier max: 1. Paid tier max: 2. |
--retry <n> | Retry count for recoverable errors. Default: 0. |
--file <path> | Read task IDs from a JSON file. Used for querying --no-wait output. |
Async workflow
For large files or batch tasks, use--async to submit the task. The CLI returns a task-id, and you can poll results with parse query or extract query.
Two-phase async with --no-wait
By default, --async submits the task and polls until completion. This is convenient for AI Agents. For resumable workflows, use two phases.
Phase 1: submit tasks
Batch processing
When processing multiple files or URLs, the CLI writes each result to a separate file:--export <dir>specifies the output directory.- Without
--export, the CLI createsadp_results_<timestamp>/. - Single-file tasks output to stdout or to the file path specified by
--export.
Exit codes
| Code | Meaning |
|---|---|
0 | All tasks succeeded. |
1 | All tasks failed or a system error occurred. |
2 | Invalid arguments. |
3 | Resource not found. |
4 | Permission denied. |
5 | Conflict. |
6 | Partial failure in a batch. |
Environment variables
| Variable | Description |
|---|---|
ADP_API_KEY | API key. Overrides the config file. |
ADP_API_BASE_URL | Service URL. |
ADP_LANG | UI language: en or zh. |
ADP_LOG_LEVEL | Log level: debug, info, warn, or error. |
Configuration storage
- Config directory:
~/.adp/ - Config file:
~/.adp/config.json - Encrypted API key:
~/.adp/key.enc(AES-256-GCM) - App cache:
~/.adp/app_cache.json - Version check cache:
~/.adp/version_check.json, refreshed every 24 hours
License
ADP CLI uses an open-source tool plus paid service model. The CLI is free and open source for fast integration. The ADP intelligent parsing service is a paid public cloud service billed by usage.- CLI tool: MIT licensed. You can use, modify, and distribute it.
- ADP service: Public cloud AI document processing service billed by usage.
Support
ADP CLI guide
CLI documentation
OpenAPI guide
API documentation
Public cloud user guide
User guide
GitHub Issues
Report issues
- Email: global_product@laiye.com
- Website: Laiye