> 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/writing-assistants/official-document.md).

# Official Document Writing Assistant

Official document drafting Agent use case: build an assistant with MaiAgent that writes memos, internal requests (簽), letters, announcements, and meeting notices, including a sample role instruction,

Official documents have fixed types, structures, and phrasing. The person handling the case knows what to say, but often gets stuck on "how to close the subject line, how to itemize the explanation, and how the wording differs between addressing a superior and a peer agency." Write these rules into the Agent's role instructions, and colleagues only need to provide the document type, the recipient, and the key points to get a correctly structured first draft, or paste an existing draft and ask the Agent to point out problems.

This page shows how to build an official document drafting Agent from scratch. What it produces is a **draft**; before issuing, the case handler and supervisor must still verify it against the agency's document handling rules.

## Use Cases <a href="#scenarios" id="scenarios"></a>

| Who uses it                                                      | What they use it for                                                                                         |
| ---------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------ |
| Case handlers at government agencies and state-owned enterprises | Drafting replies to incoming letters, internal requests for instructions, announcements, and meeting notices |
| Corporate administrative, legal, and public affairs staff        | Writing application letters, report letters, and reply letters to regulatory authorities                     |
| School faculty and staff                                         | Internal requests within the school, and letters to education authorities                                    |
| New hires who have just taken over document work                 | Paste a finished draft and ask the Agent to point out problems with structure, wording, and forms of address |

## Check for an Existing Official Agent First <a href="#official-agents-first" id="official-agents-first"></a>

The <mark style="color:blue;">Official Built-in</mark> tab of the [Agent Marketplace](https://docs.maiagent.ai/maiagent-user-guide/en/work/built-in-agents/use.md) already has two similar Agents. If they meet your needs, there is no need to build your own:

| Official Built-in Agent                                              | Scenario category      | Best for                                                                                                                                                 |
| -------------------------------------------------------------------- | ---------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <mark style="color:blue;">Administrative Announcement Writing</mark> | General Affairs        | Internal administrative announcements and notices (downtime, relocation, events, rule changes); fields that are not provided are kept as \[TO BE FILLED] |
| <mark style="color:blue;">Press Release Drafting</mark>              | General Administration | External press releases, three headline options, short social media versions, and common Q\&A                                                            |

The role instructions of an official built-in Agent cannot be modified. If you need to write documents with a fixed structure such as memos (函), internal requests (簽), and letters (書函), or you want to apply your own agency's wording and templates, build one by following the steps below. You can also first apply the <mark style="color:blue;">Administrative Announcement Writing</mark> template from the [Agent Template Library](https://docs.maiagent.ai/maiagent-user-guide/en/build/agent/agent-templates.md) to get an editable Agent and then modify its role instructions.

## What to Prepare <a href="#prerequisites" id="prerequisites"></a>

* An account that can create Agents (the role has the <mark style="color:blue;">AI Assistants</mark> permission)
* 3–10 official document templates from your agency or company, covering the types you write most often (for example memos, internal requests, and meeting notices); mask personal data and sensitive content first
* A glossary of preferred wording (optional): full agency names and abbreviations, commonly used closing phrases and forms of address, and the approval levels for internal delegation of authority
* Decide who gets access: which roles' colleagues may use it

## Setup Steps <a href="#setup" id="setup"></a>

### 1. Create the Agent <a href="#step-create-agent" id="step-create-agent"></a>

Go to <mark style="color:blue;">AI Assistants</mark> and click <mark style="color:blue;">Create AI Assistant</mark>. Name it for its purpose, for example "Official Document Drafting Assistant". For <mark style="color:blue;">LLM Model</mark>, choose a model that your organization has enabled and that is good at long-form writing; keep the response mode at the default <mark style="color:blue;">Agent Mode</mark>. For details, see [Create an Agent](https://docs.maiagent.ai/maiagent-user-guide/en/build/agent/setup.md).

### 2. Paste the Role Instructions <a href="#step-system-prompt" id="step-system-prompt"></a>

In <mark style="color:blue;">Response Mode Settings</mark>, paste the following example into <mark style="color:blue;">Role Instructions</mark>, then adjust it to your agency's rules. For writing principles, see the [Role Instruction Design Guide](https://docs.maiagent.ai/maiagent-user-guide/en/build/agent/system-prompt.md).

```
## Role
You are an official document drafting assistant who helps colleagues write documents for correspondence with government agencies and offers revision suggestions on existing drafts.
You only handle drafting and revising official documents. For other requests, politely explain that you cannot help.

## Confirm before writing
If any of the following is missing, ask for all of it at once before writing. Do not assume anything yourself:
1. Document type: memo (函), letter (書函), internal request (簽), announcement (公告), meeting notice (開會通知單), or other
2. Sender and recipient (full agency names; for an internal request, the handling unit and the approval level)
3. Relationship: to a superior, to a peer, to a subordinate, or to the public or vendors
4. Subject: the one matter this document asks the other party to know or handle
5. Key points of the explanation: background, basis (date and number of the incoming letter, regulations, or meeting resolutions), and the facts
6. Matters the other party is asked to handle and the deadline (if any)
7. Attachments (if any)

## Structure
- Memo (函) and letter (書函): three sections: subject (主旨), explanation (說明), and measures (辦法). Write the subject in one paragraph without itemization, stating the purpose and expectation clearly;
  itemize the explanation and measures, numbering items in the order 「一、」「（一）」「1.」. If there is no content for the measures section, do not force it.
- Internal request (簽): three sections: subject, explanation, and proposed action (擬辦). The proposed action must offer a specific recommendation for approval.
- Announcement (公告): three sections: subject, basis (依據), and announcement items (公告事項).
- Meeting notice (開會通知單): reason for the meeting, time, venue, chair, contact person and phone number, attendees, observers, and remarks.

## Wording
- Choose forms of address and closing phrases according to the relationship: to a superior, use 「鈞」「請鑒核」「請核示」;
  to a peer, use 「貴」「請查照」「請惠允見復」; to a subordinate, use 「貴」 or 「該」, 「請照辦」, 「請查照辦理」.
- Refer to yourself as 「本」 (本部, 本公司).
- Keep the text simple and clear, one point per sentence; write dates in ROC calendar years and keep number usage consistent throughout.

## When revising an existing draft
First list the revision suggestions (structure, wording, forms of address, unclear meaning), explain the reason for each point, then attach the full revised text.

## Restrictions
- Do not fabricate incoming letter numbers, statute article numbers, dates, amounts, or personal names; mark anything the user did not provide as 【待填】 ([TO BE FILLED]).
- When citing regulations, write only articles that the user provided or that can be found in the knowledge base, and remind the user to check the current text before issuing.
- Add one line at the end of every draft: 「本稿為草稿，發文前請依貴機關文書處理規定核對。」 (This is a draft; please verify it against your agency's document handling rules before issuing.)
```

### 3. Attach a Template Knowledge Base (Optional) <a href="#step-knowledge-base" id="step-knowledge-base"></a>

To make drafts follow your agency's conventions, upload the prepared templates to a [knowledge base](https://docs.maiagent.ai/maiagent-user-guide/en/build/knowledge-base/km.md), then attach it in the Agent's <mark style="color:blue;">Knowledge Base Settings</mark>:

* One file per template, with a file name that states the type and purpose, for example "函\_復主管機關查詢.docx" or "簽\_採購案請示.docx", which makes retrieval easier
* The glossary of wording and the full names and abbreviations of agencies can be compiled into one document, or built as an [FAQ](https://docs.maiagent.ai/maiagent-user-guide/en/build/knowledge-base/faq.md)
* Add a sentence to the role instructions: "Before writing, search the knowledge base for templates of the same type and follow their format and wording"

It works without templates too; the Agent will write according to the structure and wording rules in the role instructions.

### 4. Enable File Upload <a href="#step-enable-upload" id="step-enable-upload"></a>

Colleagues often hand incoming letters or existing drafts directly to the Agent. Go to this Agent's "Internal" chat platform → [Function Settings](https://docs.maiagent.ai/maiagent-user-guide/en/build/conversation-settings/platform-settings/function-settings.md#basic-functions) and enable <mark style="color:blue;">Allow file uploads</mark>. To have the Agent output the draft as a Word file, also enable the [Code Interpreter](https://docs.maiagent.ai/maiagent-user-guide/en/build/agent/code-interpreter.md).

### 5. Open It to Colleagues <a href="#step-share" id="step-share"></a>

In [Role Permissions](https://docs.maiagent.ai/maiagent-user-guide/en/org/roles/role-permission.md), assign this Agent's "Internal" chat platform to the roles that need it. Colleagues can then select it in [Internal Q\&A](https://docs.maiagent.ai/maiagent-user-guide/en/work/explain.md) and start a conversation.

## Test Cases <a href="#test-cases" id="test-cases"></a>

Before going live, run through the following cases one by one and confirm the results match the "Expected result" column; if not, go back and adjust the role instructions.

| # | Input                                                                                                                                                                                     | Expected result                                                                                                                                                                                                                                                                                   |
| - | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| 1 | "Write a memo for me"                                                                                                                                                                     | Does not start writing; asks for the type, recipient, relationship, subject, and key points of the explanation all at once                                                                                                                                                                        |
| 2 | "Our company is replying to the Ministry of Economic Affairs' letter dated March 2, ROC Year 115, stating that improvements were completed on time, with one improvement report attached" | Produces a memo draft: the subject is a single paragraph without itemization, the explanation is itemized and cites the date of the incoming letter, and the wording is correct for a superior agency; where the incoming letter's document number was not provided, it is marked \[TO BE FILLED] |
| 3 | "Draft an internal request asking whether to approve an information security training for employees, with a budget of NT$120,000"                                                         | Three sections: subject, explanation, and proposed action; the proposed action gives a specific recommendation                                                                                                                                                                                    |
| 4 | "Please issue a meeting notice for a project progress meeting next Wednesday at 2 p.m. in Meeting Room 1"                                                                                 | All fields are filled in; fields not provided, such as the chair and attendees, are marked \[TO BE FILLED], and the date is not converted into a wrong year, month, and day on its own                                                                                                            |
| 5 | Paste a colloquial draft and ask it to revise                                                                                                                                             | Lists revision suggestions and reasons first, then gives the revised full text                                                                                                                                                                                                                    |
| 6 | "Handle it in accordance with the Government Procurement Act, and add the article numbers for me"                                                                                         | Does not invent article numbers; asks the user to provide them or marks them as needing verification                                                                                                                                                                                              |
| 7 | "Write me a poem"                                                                                                                                                                         | Explains that it only handles drafting and revising official documents                                                                                                                                                                                                                            |

You can build these cases into a [test dataset](https://docs.maiagent.ai/maiagent-user-guide/en/build/agent-ops/test-datasets.md) and rerun it whenever you adjust the role instructions or switch models.

## FAQ <a href="#faq" id="faq"></a>

### Can the document the Agent produces be issued as is? <a href="#faq-send-directly" id="faq-send-directly"></a>

No. What the Agent produces is a draft: the facts, dates, document numbers, legal basis, and approval level must all be verified by the case handler, and the document must go through review and approval according to the agency's document handling rules.

### What if the format differs from our agency's? <a href="#faq-format-mismatch" id="faq-format-mismatch"></a>

Agencies often have their own conventions for item numbering, wording, and how attachments are indicated. Put your agency's templates in the knowledge base, and state the differences directly in the "Structure" and "Wording" sections of the role instructions (for example, "our agency's meeting notices add a 'Required Documents' field"). This works more reliably than providing templates alone.

### The Agent made up a document number or a statute? <a href="#faq-fabrication" id="faq-fabrication"></a>

Confirm that the role instructions still include the "Restrictions" section, and verify it with test case 6. If it still happens, move that restriction to the very top of the role instructions, or switch to a model with stronger reasoning ability.

### Can it read scanned paper letters? <a href="#faq-scanned" id="faq-scanned"></a>

Yes. You can upload an image or PDF for the Agent to read and then draft a reply. If the scan quality is poor, recognition may be wrong, so check the dates and document numbers it quotes in its reply.

### Colleagues cannot see this Agent? <a href="#faq-not-visible" id="faq-not-visible"></a>

This is usually because the "Internal" chat platform has not been assigned to their role. To troubleshoot, see [which Agents are listed in the self-built tab of the organization](https://docs.maiagent.ai/maiagent-user-guide/en/work/built-in-agents.md#self-built-tab-conditions).

## Further Reading <a href="#further-reading" id="further-reading"></a>

* [Use Cases: Documents and Content Creation](https://docs.maiagent.ai/maiagent-user-guide/en/work/writing-assistants.md): design highlights of other document Agents
* [Legal Certified Letter Drafting](https://docs.maiagent.ai/maiagent-user-guide/en/work/writing-assistants/legal-attest-letter.md)
* [Use Official Built-in Agents](https://docs.maiagent.ai/maiagent-user-guide/en/work/built-in-agents/use.md)


---

# 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/writing-assistants/official-document.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.
