Enables AI-powered parsing and key information extraction from high-frequency documents including invoices, orders, receipts, long texts, and common Chinese identity & credential documents...
agentic-doc-parse-and-extract is an official command-line tool released by Laiye Technology's ADP (Agentic Document Processing) product, enabling both humans and AI agents to invoke ADP capabilities in the terminal for document parsing and extraction.
Use this Skill when the user provides one or more documents, document URLs, or a folder of documents and asks to:
Do not use this Skill when:
adp extract for structured field extraction. Do not run adp parse first unless the user also needs full document content, layout, coordinates, or OCR details.min(account_max_concurrency, file_count). The expected account limits are 2 for free users and 10 for paid users. Do not hard-code a concurrency value and do not add an unsupported --concurrency flag to parse or extract commands.--async; use --no-wait when the user does not need results in the current turn.adp parse query --file <tasks.json> or adp extract query --file <tasks.json>. Never poll each task in a separate loop when a batch query is available.--json for machine-readable output where supported. Preserve the raw response and distinguish any summaries, calculations, or formatted exports produced by the Agent from raw ADP values.adp credit and tell the user if the balance is insufficient or the operation is unusually large.ADP_API_KEY environment variable or the CLI's secure configuration.adp config get and confirm the API base URL matches the user's region.adp app-id cache first. Match candidates using app_name, app_label, and app_type; the app list does not currently provide a separate app-description field.adp app-id list to refresh the complete app list. Do not select the first returned app.app_name or app_label, such as ι«ιη, ι«ι, high-speed, high speed, fast, turbo, or an equivalent documented product marker. Do not infer high-speed capability from position, creation date, or vague words such as advanced.app_id, app_name, app_label, app_type, and whether it is the high-speed variant. Do not expose credentials.adp schema to get the machine-readable JSON spec of all commands, parameters, types, and defaults.adp config get to verify credentials. If no valid configuration exists, prompt the user to provide an API Key.adp app-id cache first, select the best scenario match, and prefer an explicitly marked high-speed variant. If the cache is unavailable or has no suitable match, call adp app-id list to refresh it. Never select the first returned application without comparing candidates.adp extract url <URL> --app-id <ID> or adp parse url <URL> --app-id <ID>.adp extract query <task_id> or adp parse query <task_id>.| User Intent | Recommended Command | Handling Rules |
|---|---|---|
| - Read full document content - Parse layout & structure - Convert document to text - Process / analyze full document |
adp parse |
- Sync processing for small files - Async processing ( --async parameter) for files >20MB or >200 pages |
| - Extract key fields (amount, date, name, ID, etc.) - Output structured results (JSON/table) |
adp extract |
- Use Extract directly, no need to parse first - Use matched existing app - Create a custom extraction app if the document type is not in the known app list |
| Batch processing of local files | adp extract local <folder path> adp parse local <folder path> |
Put all input files in one batch folder and invoke the CLI once. The CLI automatically applies the account concurrency limit; never loop over files or add --concurrency to these commands. |
| Batch processing of URL files | adp extract url <URL list file path> adp parse url <URL list file path> |
Put one document URL per line in a URL-list file and submit it once. Do not invoke the CLI once per URL. |
| - Set review rules after extraction - Human-in-the-loop quality control - Conditional manual review (e.g., amount > threshold) |
adp human-review rule-create |
- Define review dimensions (field-level, confidence, full document) - Combine rules with AND/OR logic - Use rule-ai-generate for AI-recommended rules |
| - Submit documents for human review - Review extraction results with rules applied |
adp human-review task-create |
- Sync by default; use --async for large batches- Supports local files, URLs, folders, and URL list files |
| - Query human review task results - Update reviewed field values |
adp human-review task-query adp human-review result-update |
- Query async tasks by task ID - Only pending-status documents can be updated |
Note:
adp extract command has built-in document parsing capabilities. After ADP automatically parses the document, it performs structured extraction. Therefore, when users need to extract structured content, there is no need to use adp parse first.# Command Discovery (for Agent introspection)
adp schema
# Configuration Check
adp config get
# Query Applications (First Use)
adp app-id list
# Document Extraction (Invoice/Receipt)
adp extract url <file URL> --app-id <app_id>
# Document Parsing (Long Document)
adp parse url <file URL> --app-id <app_id>
# Base64 Input
adp extract base64 <base64_string> --app-id <app_id> --file-name invoice.pdf
adp parse base64 <base64_string> --app-id <app_id> --file-name document.pdf
# Asynchronous Query
adp extract query <task_id>
adp parse query <task_id>
adp parse query <task_id1> <task_id2> --watch # batch query with auto-poll
# Human-in-the-Loop Review
adp human-review rule-create --app-id <app_id> --rule-name "high_amount_check" --rule '[{"rule_dimension":"amount","rule_setting":"greater_than 1000"}]'
adp human-review get-config --app-id <app_id>
adp human-review rule-update --app-id <app_id> --rule-name "high_amount_check" --rule-status false
adp human-review rule-delete --app-id <app_id>
adp human-review rule-ai-generate --app-id <app_id>
adp human-review task-create --app-id <app_id> --local <file_path>
adp human-review task-create --app-id <app_id> --url <file_url> --async
adp human-review task-query <task_id>
adp human-review result-update --file-task-id <id> --collaboration-result '[{"field_name":"amount","field_type":"string","field_values":["1500.00"]}]'
# Batch Processing
adp extract local <folder path> --app-id <app_id> --export <folder path>
adp parse local <folder path> --app-id <app_id> --export <folder path>
app-id list every time.url <URL list file path> or local <folder path> in a single run, without looped invocations. The CLI retrieves the account's maximum concurrency from the service: free users are expected to use 2 and paid users 10, capped by the number of files. Do not pass --concurrency to parse or extract.extract instead of parse (faster).--retry 2 for batch processing to auto-recover from transient failures.--timeout for files >20MB. Default is 900s.For details, see references/examples.md
We provide independent Public Cloud access addresses for domestic and international users, which need to be configured separately by region. Accessing nearby can better ensure high-speed and stable calls across the network.
| Region | Login Address | API Base URL |
|---|---|---|
| Chinese Mainland | https://adp.laiye.com/ | https://adp.laiye.com/ |
| Overseas Region | https://adp-global.laiye.com/ | https://adp-global.laiye.com/ |
New users need to register an ADP account first, and after registration, they can get 100 free credits/month
API_Key entry.For details, see references/examples.md
For details, see references/examples.md
Notes:
After completing the authentication of the API Key, guide the user to upload local files or specify the file URL. After the user uploads the document, they can query the supported application scope of ADP and select the appropriate application for document parsing and extraction. If no suitable application is found, they can choose to create a custom extraction application, configure exclusive fields and parsing modes to meet the personalized document processing requirements.
This function is used to query the applications under the user's account, including preset applications and custom applications. The returned list may contain both standard and high-speed versions of the same business scenario because older applications remain available for compatibility. Never select an application solely because it appears first.
Use the following selection order:
app_name and app_label.The CLI returns app_id, app_name, app_label, and app_type; it does not currently return a separate application description. Therefore, use the name and labels as the semantic matching evidence and report the selected application before processing.
Notes:
adp app-id cache first. If the cache becomes invalid or has no suitable high-speed or standard application, call adp app-id list to refresh it and then choose the best candidate by scenario and version.For detailed examples of commands and responses, see references/examples.md.
Support creating custom extraction applications, and independently add business-specific extraction fields as needed, and improve the detailed description of each field; the system will accurately identify the document content based on the configured fields and definitions, and complete customized information extraction for personalized documents and non-standard forms.
For example commands, responses, and detailed parameter descriptions, please refer to references/examples.md
Perform document parsing based on the selected application ID, which will return a formatted JSON result containing information such as document content, element position coordinates, OCR Confidence Level, etc.
For examples of commands and responses, please refer to references/examples.md
Perform document extraction based on the selected application ID, which will return a formatted JSON result containing information such as extraction fields, extraction results, and Confidence Level.
For examples of commands and responses, please refer to references/examples.md
ADP supports batch processing capabilities. Users can submit multiple file URLs or a local folder path at once, and the CLI schedules the files concurrently up to the account's server-side maximum. For two or more files, always submit one batch request rather than invoking one command per file. The system can identify each document type and match the most suitable application for processing.
For detailed command examples, see references/examples.md
Note: The CLI obtains the account's maximum concurrency from the service. The expected limit is 2 for free users and 10 for paid users. The effective concurrency is the smaller of the account limit and the number of input files. Do not assume a fixed value, and do not add --concurrency to parse or extract; those commands manage concurrency internally.
ADP provides asynchronous processing capabilities, allowing users to choose asynchronous mode to perform document parsing and extraction. For a batch, submit all files in one command; the CLI submits them concurrently according to the account limit and returns a task mapping when --no-wait is used. Query multiple tasks together with adp extract query --file <tasks.json> --watch or adp parse query --file <tasks.json> --watch. If the document uploaded by the user is larger than 20MB or contains more than 200 pages, use asynchronous processing.
For examples of commands and responses, see references/examples.md
After document extraction, ADP supports setting up human-in-the-loop review rules to flag documents that require manual verification. This is useful for quality control scenarios such as: ensuring invoice amounts are not empty, flagging reimbursements exceeding a threshold, or validating specific field values.
Create review rules to define which conditions trigger manual review. Each rule specifies a review dimension (e.g., a specific field name, document confidence, or full document) and a rule setting (e.g., field not empty, maximum amount limit, specific time range).
# Create a review rule
adp human-review rule-create --app-id <app_id> --rule-name "amount_check" \
--rule '[{"rule_dimension":"amount","rule_setting":"greater_than 1000"}]' \
--rule-logic 1
# View current review configuration
adp human-review get-config --app-id <app_id>
# AI-recommended rules based on your application
adp human-review rule-ai-generate --app-id <app_id>
--rule-logic: 1 = any condition triggers review (default), 2 = all conditions must match.--rule-status: true (default for create) = enabled, false (default for update) = disabled.Submit documents for processing with review rules applied. Supports single files, folders (batch), and URL lists.
Note: Before submitting human-machine collaboration tasks, verify review rules exist under the current APP ID. File processing is unavailable if no valid rules are configured.
# Single file (sync)
adp human-review task-create --app-id <app_id> --local <file_path>
adp human-review task-create --app-id <app_id> --url <file_url>
# Batch processing (sync)
adp human-review task-create --app-id <app_id> --local <folder_path>
# Async processing (returns task ID)
adp human-review task-create --app-id <app_id> --url <file_url> --async
# Query async task results
adp human-review task-query <task_id>
# Update field values for a reviewed document (only pending-status documents)
adp human-review result-update --file-task-id <id> \
--collaboration-result '[{"field_name":"amount","field_type":"string","field_values":"1500.00"}]'
Update an existing rule
adp human-review rule-update --app-id <app_id> --rule-name "amount_check" --rule-status false --rule '[{"rule_dimension":"amount","rule_setting":"greater_than 2000"}]'
Delete all review rules for an application
adp human-review rule-delete --app-id <app_id>
For detailed command parameters, see references/commands.md.
For a complete list of all available commands with full parameter specs, see references/commands.md
For the output structure of each command (including batch processing output mechanism), see references/response-schema.md
For error codes, types, and Agent auto-recovery strategies, see references/error-handling.md
Preserve the raw ADP response and do not silently change source values or field names. The Agent may summarize, calculate, format, or export results when requested, but must clearly distinguish derived values from raw extracted values. For batch jobs, always report the total, successful, failed, and pending file counts and the output location or task IDs.
https://adp.laiye.com/, and for overseas regions, use https://adp-global.laiye.com/adp credit to check the current account's credit balance.Copyright Β© 2026 [Laiye Technology (Beijing) Co., Ltd.] All rights reserved.