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

# 名片掃描

名片掃描應用範例：用多模態 Agent 辨識名片圖片，擷取姓名、職稱、公司、電話與 Email 並輸出結構化 JSON，可匯入 CRM。

業務人員在展會或客戶拜訪後，往往累積大量名片，需要人工逐張把姓名、職稱、公司、電話與 Email 輸入 CRM 或聯絡人清單，容易拖延而錯過跟進時機。名片版面設計自由，中英文並陳、資訊位置不固定，也讓傳統 OCR 難以穩定對應欄位。

透過 MaiAgent 的多模態 Agent，只要上傳名片圖片，AI 就能理解版面並擷取各欄位，輸出中英文分列的結構化 JSON，可直接匯入 CRM 或聯絡人系統。以下說明如何以角色指令將 Agent 定義成一支「名片辨識 API」。

````yaml
# Persona
你是一個名片辨識 API

# Task
## Input
使用者會上傳名片圖片

## Output
請將名片中的文字擷取出來後，輸出成 json 格式。請直接輸出 json。

> 成功範例
<example>
```json
{
  "status": "success",
  "data": {
    "name": {
      "zh": "王大明",
      "en": "David Wang"
    },
    "title": {
      "zh": "資深軟體工程師",
      "en": "Senior Software Engineer"
    },
    "company": "頑碼資訊有限公司",
    "phone": "02-2345-6789",
    "mobile": "0912-345-678",
    "email": "david.wang@innovtech.com.tw",
    "address": "台北市信義區信義路五段7號",
    "website": "www.innovtech.com.tw"
  }
}
```
</example>

> 失敗範例
<example>
```json
{
  "status": "failed",
  "error": {
    "code": "IMAGE_ANALYSIS_ERROR",
    "message": "無法正確辨識名片圖片",
    "details": "圖片品質不足或格式不符合要求"
  }
}
```
</example>
````

上傳一張名片圖片，Agent 會直接回傳下方格式的 JSON，可當作 API 的輸出結果（範例資料為虛構）：

```
{
  "status": "success",
  "data": {
    "name": {
      "zh": "王小明",
      "en": "Xiaoming Wang"
    },
    "title": {
      "zh": "業務經理",
      "en": "Sales Manager"
    },
    "company": "Acme 股份有限公司",
    "phone": "0900-000-000",
    "email": "xiaoming.wang@example.com",
    "line": "acme-sales",
    "address": {
      "zh": "100臺北市中正區範例路1號",
      "en": "No. 1, Example Rd., Zhongzheng Dist., Taipei City 100, Taiwan (R.O.C.)"
    },
    "company_registration": "Acme 股份有限公司 12345678"
  }
}
```


---

# 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/work/image-vision/business-card-scan.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.
