> For the complete documentation index, see [llms.txt](https://docs.maiagent.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.maiagent.ai/maiagent-user-guide/en/application/image-vision.md).

# Image & Vision

Use multimodal AI to recognize invoices, official documents, business cards, ID cards, and other images, directly outputting structured JSON data ready to integrate with business systems

When processing invoices, bills, official documents, business cards, and ID cards, enterprises often rely on manual data entry into systems field by field — a time-consuming process prone to errors caused by fatigue. While traditional OCR tools can read text, they lack understanding of business context — different layouts require separate template designs, and the raw text output still needs extensive post-processing before it can be written into systems.

MaiAgent's image and vision applications use **multimodal language models** to handle this type of work: users simply upload an image in a conversation, and the AI assistant outputs structured JSON data according to the field specifications defined in the system prompt, which can be displayed instantly in the chat interface or integrated with ERP, CRM, and other downstream systems via API.

## Demo Video <a href="#demo-video" id="demo-video"></a>

{% embed url="<https://drive.google.com/file/d/1Xuso3cX8ZMChhWIa2rD7wafcDT2fUldr/view?usp=sharing>" %}

## Differences from Traditional OCR <a href="#vs-traditional-ocr" id="vs-traditional-ocr"></a>

|                     | Traditional OCR Engine                                  | MaiAgent Multimodal AI                                        |
| ------------------- | ------------------------------------------------------- | ------------------------------------------------------------- |
| Layout Adaptability | Requires a separate template for each layout            | Automatically understands different layouts                   |
| Field Extension     | Requires code modification                              | Simply modify the JSON fields in the system prompt            |
| Business Rules      | Only outputs text; rules must be implemented separately | Business logic can be described directly in the system prompt |
| Deployment Cost     | Self-hosted service or purchased license                | Platform configuration, no coding required                    |

For a more complete comparison (including front/back side processing, error handling, etc.), see [ID Card Recognition](/maiagent-user-guide/en/application/image-vision/id-card-recognition.md).

## Use Cases <a href="#use-cases" id="use-cases"></a>

* **Expense Reimbursement & Accounting**: Extract invoice numbers, dates, and amounts from high volumes of utility, telecom, and travel receipts and write them into ERP.
* **Identity Verification Workflows**: Extract personal information from ID documents for bank account opening, HR onboarding, medical registration, and populate forms automatically.
* **Business Card Filing**: Automatically convert business cards collected at exhibitions or client visits into contact data for CRM import.
* **Official Document & File Archiving**: Extract document numbers, issue dates, subjects, and other fields from scanned documents for search and archiving.

## How It Works <a href="#how-it-works" id="how-it-works"></a>

| Step                            | Description                                                                                                                                                   |
| ------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **1. Upload Image**             | Users upload images of invoices, business cards, ID cards, etc. as attachments in the conversation                                                            |
| **2. AI Assistant Recognition** | A multimodal language model with vision capabilities reads the image content                                                                                  |
| **3. System Prompt Shaping**    | Based on field definitions, output examples, and error formats in the system prompt, the assistant determines which fields to extract and the response format |
| **4. Structured Output**        | Produces results in JSON format                                                                                                                               |
| **5. Downstream Applications**  | Displayed instantly in Web Chat, or integrated with ERP, CRM, and other business systems via API                                                              |

The key lies in the **system prompt**: by defining the AI assistant as a "recognition API" in the system prompt — explicitly specifying which fields to extract and providing JSON output examples for both success and failure — the AI will consistently respond in that format. When new fields are needed, simply update the system prompt without modifying any code.

## Setup Workflow <a href="#setup-workflow" id="setup-workflow"></a>

### 1. Create an AI Assistant and Select a Vision-Capable Model <a href="#step1-create-agent" id="step1-create-agent"></a>

On the <mark style="color:blue;">AI Assistants</mark> page, [create an AI assistant](/maiagent-user-guide/en/build/setup.md). Since this type of application involves image recognition and logical reasoning, it is recommended to use a Pro-tier or higher multimodal model to ensure recognition accuracy.

### 2. Define the Output Format with the System Prompt <a href="#step2-define-schema" id="step2-define-schema"></a>

Describe the recognition task and field specifications in the [system prompt](/maiagent-user-guide/en/build/system-prompt.md), and include JSON examples for both success and failure cases. For fields that cannot be recognized, it is recommended to keep the field name and set the value to `null` for easier downstream processing.

### 3. Upload Images for Testing <a href="#step3-test" id="step3-test"></a>

Upload actual documents as attachments in the conversation to verify that output fields are complete and the format is correct. It is recommended to also test edge cases such as blurry, tilted, and front/back images.

### 4. Integrate with Business Systems <a href="#step4-integrate" id="step4-integrate"></a>

Once output is stable, integrate the AI assistant into existing workflows via API to write JSON results directly into ERP, CRM, or form systems. Integration status can be monitored in [API Call Logs](/maiagent-user-guide/en/developer/api-logs.md).

{% hint style="warning" %}
Images of ID cards, invoices, and similar documents often contain personal data. Before deployment, ensure that your organization's permission settings and data retention policies comply with privacy regulations.
{% endhint %}

## Application Examples <a href="#examples" id="examples"></a>

* [Invoice Recognition](/maiagent-user-guide/en/application/image-vision/invoice-recognition.md): Extract invoice type, track number, buyer/seller tax IDs, and item details, output as JSON.
* [Document Scanning](/maiagent-user-guide/en/application/image-vision/document-scan.md): Recognize key fields from scanned official documents for archiving and retrieval.
* [Business Card Scanning](/maiagent-user-guide/en/application/image-vision/business-card-scan.md): Convert business cards into structured fields including name, title, company, and contact information.
* [ID Card Recognition](/maiagent-user-guide/en/application/image-vision/id-card-recognition.md): Recognize both front and back of an ID card from a single image, outputting standard fields for account opening, onboarding, and other workflows.

The following sections demonstrate the setup process with real-world examples to help you quickly apply these capabilities to your own business scenarios.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.maiagent.ai/maiagent-user-guide/en/application/image-vision.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
