> 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/work/image-vision.md).

# Use Cases: Image Vision

Use multimodal AI to recognize images such as invoices, official documents, business cards, and ID cards, and output structured JSON data that can be connected directly to business systems

When processing invoices, bills, official documents, business cards, and ID cards, enterprises often rely on manual field-by-field data entry, which is time-consuming and prone to errors caused by fatigue. Traditional OCR tools can read text, but they lack an understanding of business context: different layouts each require their own template, and the raw text they produce still needs extensive post-processing before it can be written into a system.

MaiAgent's image and vision applications instead use **multimodal language models** for this kind of work. Users simply upload an image in a conversation, and the Agent outputs structured JSON data according to the field specifications defined in its role instructions. The result can be displayed instantly in the chat interface or connected to downstream systems such as ERP and CRM through the 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 template for each layout                     | Automatically understands different layouts                       |
| Field expansion     | Requires code changes                                   | Just edit the JSON fields in the role instructions                |
| Business rules      | Outputs text only; rules must be implemented separately | Decision logic can be described directly in the role instructions |
| Deployment cost     | Self-hosted service or purchased license                | Platform configuration, no coding required                        |

For a more complete comparison (including front/back side handling, error handling, and more), see [ID Card Recognition](/maiagent-user-guide/en/work/image-vision/id-card-recognition.md). For the differences in principle between vision language models (VLMs) and OCR, and for how conversation attachments, knowledge base documents, and knowledge base image files each handle images, see [Technical Guide - Image Recognition Support](https://docs.maiagent.ai/tech/quickstart/tu-xiang-bian-shi-zhi-yuan).

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

* **Expense reimbursement and accounting**: Extract invoice numbers, dates, and amounts from large volumes of utility, telecom, and hospitality receipts and write them into an ERP.
* **Identity verification workflows**: For financial account opening, HR onboarding, medical registration, and similar scenarios, extract basic information from ID documents and fill it into forms.
* **Business card filing**: Automatically convert business cards collected at trade shows or visits into contact data and import it into a CRM.
* **Official document and file archiving**: Extract fields such as document number, issue date, and subject from scanned documents for easier search and archiving. The approach is the same as [Invoice Recognition](/maiagent-user-guide/en/work/image-vision/invoice-recognition.md): replace the field definitions in the role instructions with those of the official document.

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

| Step                                     | Description                                                                                                                                                        |
| ---------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **① Upload image**                       | The user uploads an image of an invoice, business card, ID card, or similar as an attachment in the conversation                                                   |
| **② Agent recognition**                  | A multimodal language model with vision capabilities reads the image content                                                                                       |
| **③ Role instructions shape the output** | Based on the field definitions, output examples, and error formats in the role instructions, the Agent decides which fields to extract and in what format to reply |
| **④ Structured output**                  | Produces results in JSON format                                                                                                                                    |
| **⑤ Downstream use**                     | Displayed instantly in Web Chat, or connected to business systems such as ERP and CRM through the API                                                              |

The key is the **role instructions**: in them you define the Agent as a "recognition API," explicitly stating which fields to extract and giving JSON output examples for both success and failure, and the AI will reply consistently in that format. To add a field, just update the role instructions—no code changes are needed.

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

### 1. Create an Agent and Choose 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 Agent](/maiagent-user-guide/en/build/agent/setup.md). Because this type of application involves image recognition and logical judgment, we recommend choosing a Pro-tier or higher multimodal model to ensure recognition accuracy.

### 2. Define the Output Format in the Role Instructions <a href="#step2-define-schema" id="step2-define-schema"></a>

Describe the recognition task and field specifications in the [role instructions](/maiagent-user-guide/en/build/agent/system-prompt.md), and include JSON examples for both success and failure. For fields that cannot be recognized, we recommend keeping the field name and setting its value to `null` so downstream systems can handle it easily.

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

Upload real documents as attachments in the conversation and confirm that all output fields are present and correctly formatted. We also recommend testing edge cases such as blurry images, tilted images, and front/back sides.

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

Once the output is stable, you can connect the Agent to your existing workflows through the API and write the JSON results directly into an ERP, CRM, or form system. You can review integration activity in the [API Call Logs](/maiagent-user-guide/en/org/developer/api-logs.md).

{% hint style="warning" %}
Images of ID cards, invoices, and similar documents often contain personal data. Before rollout, make sure your organization's permission settings and data retention policies meet personal data protection requirements. For the access control, personal data masking, and audit mechanisms the platform provides, see [Security and Privacy](/maiagent-user-guide/en/org/security-and-privacy.md).
{% endhint %}

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

* [Invoice Recognition](/maiagent-user-guide/en/work/image-vision/invoice-recognition.md): Extract the invoice type, track number, buyer and seller tax IDs, and line item details, and output them as JSON.
* [Business Card Scanning](/maiagent-user-guide/en/work/image-vision/business-card-scan.md): Convert business cards into structured fields such as name, job title, company, and contact details.
* [ID Card Recognition](/maiagent-user-guide/en/work/image-vision/id-card-recognition.md): Recognize both the front and back of an ID card from a single image and output standard fields for account opening, onboarding, and similar workflows.

The following sections walk through the setup process with real-world cases to help you quickly apply it 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
