> 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/build/agent.md).

# Agent

What is an Agent: an AI conversational persona created in MaiAgent, consisting of a response mode, system prompt, language model, knowledge base, and tools, and what to decide before creating one.

## What is this? <a href="#what-is-this" id="what-is-this"></a>

An Agent is an AI conversational persona you create on MaiAgent. Each Agent is an independent chatbot with its own identity, personality, knowledge, and capabilities.

Think of an Agent as a new employee—you need to tell it:

* **Who you are** (system prompt)
* **What you know** (knowledge bases, databases)
* **What you can do** (tools, skills)

Once configured, the Agent can serve users across various messaging platforms.

## Core Concepts <a href="#core-concepts" id="core-concepts"></a>

### Language Model (LLM) <a href="#language-model-llm" id="language-model-llm"></a>

An Agent's ability to understand and respond comes from the large language model (LLM) behind it. Think of the LLM as the Agent's “brainpower”—different models vary in comprehension, response quality, speed, and cost.

When creating an Agent, you can choose a model that suits your use case. MaiAgent supports multiple models, including Claude and GPT. You do not need to manage the models yourself; the platform handles this for you.

> **Quick guide**: For precise responses and complex reasoning → choose a more capable model; for frequent, simple questions and cost control → choose a faster, lighter model.

### System Prompt <a href="#system-prompt" id="system-prompt"></a>

The system prompt defines how the Agent behaves. For example:

* “You are a friendly customer service representative. Respond in Traditional Chinese with a professional yet approachable tone.”
* “You are a financial analysis assistant. Answer only finance-related questions, and clearly state when you are unsure about any figures.”

A good system prompt can greatly improve the quality of the Agent's responses.

### Response Mode <a href="#response-mode" id="response-mode"></a>

Choose how the Agent responds under “Response Mode Settings” on the Agent settings page. New Agents use Agent mode by default:

* **Agent mode** (default): Suitable for tasks that require multiple steps of reasoning. The Agent decides which information to look up and which tools to use.
* **RAG Q\&A**: Suitable for general questions and answers, with responses based directly on the knowledge base.
* **Template**, **Hybrid** (under “Other Modes”): Template mode responds by category using the knowledge base and FAQ, without free-form model generation. Hybrid mode uses templates for some content and free-form responses for the rest.

For differences between modes and how to configure them, see [Create an Agent](/maiagent-user-guide/en/build/agent/setup.md#select-answer-mode-to-build-prompt).

### Memory <a href="#memory" id="memory"></a>

Agents have memory capabilities:

* **Conversation memory**: Remembers earlier content within the same conversation. With “Vector Memory” enabled, older messages can also be retrieved through semantic search.
* **Cross-conversation search**: Searches the same contact's other recent conversations when responding, so the contact does not need to introduce themselves each time.
* **Persistent memory**: Extracts facts and preferences from conversations, stores them long term, and reuses them across conversations with the same contact.

> **Advanced details**: These settings are under “Advanced Settings” on the Agent settings page. “Conversation Memory Settings” controls vector memory, cross-conversation search, the lookback period in days, and the Embedding/Reranker models used for conversation memory. “Persistent Memory” shows whether cross-conversation memory is enabled and lists stored memories. See [Cross-conversation Search](/maiagent-user-guide/en/build/agent/cross-conversation-search.md) (including [Other Options](/maiagent-user-guide/en/build/agent/cross-conversation-search.md#other-memory-settings)) and [Persistent Memory](/maiagent-user-guide/en/build/agent/persistent-memory.md).

## What do I need to do? <a href="#what-do-i-need-to-do" id="what-do-i-need-to-do"></a>

1. **Create an Agent** — Give it a name and choose a language model.
2. **Write a system prompt** — Define the Agent's role and response style.
3. **Add capabilities** — Connect knowledge bases, tools, and skills as needed.
4. **Test conversations** — Test the results in the built-in chat window.
5. **Connect a platform and go live** — Deploy to messaging platforms such as Web Chat and LINE.

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

* [Agent Features](/maiagent-user-guide/en/build/agent/explain.md)
* [Create an Agent](/maiagent-user-guide/en/build/agent/setup.md)
* [System Prompt Design Guide](/maiagent-user-guide/en/build/agent/system-prompt.md)
* [Add a System Prompt to an Agent](/maiagent-user-guide/en/build/agent/add-system-prompt.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/build/agent.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.
