> ## Documentation Index
> Fetch the complete documentation index at: https://cometchat-22654f5b-feature-react-native-flag-and-channel.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Mastra Agents Playbook

> This playbook contains guides for building six core Mastra agents: Knowledge Retrieval, Frontend Action, Backend Tool Action, Handoff, Relay, and Group Chat.

# Knowledge Retrieval Agent

Imagine a minimal agent that can answer questions from your docs. Build a **RAG-lite retrieval agent** with local markdown files or upgrade later to a vector DB.

<CardGroup>
  <Card title="Full Knowledge Guide" href="/ai-agents/mastra-knowledge-agent" icon="https://mintcdn.com/cometchat-22654f5b-feature-react-native-flag-and-channel/qV5-B8lDLs5n_TzB/images/icons/mastra.svg?fit=max&auto=format&n=qV5-B8lDLs5n_TzB&q=85&s=67e2623333a63a2ddc31386baa325753" width="32" height="32" data-path="images/icons/mastra.svg">Build & integrate the knowledge retrieval agent.</Card>
</CardGroup>

***

# Frontend Actions Agent

An agent that outputs structured JSON actions (navigate, openModal, toggleTheme) which your frontend dispatcher can safely execute.

<CardGroup>
  <Card title="Frontend Actions Guide" href="/ai-agents/mastra-frontend-tools-agent" icon="https://mintcdn.com/cometchat-22654f5b-feature-react-native-flag-and-channel/qV5-B8lDLs5n_TzB/images/icons/ai-agents.svg?fit=max&auto=format&n=qV5-B8lDLs5n_TzB&q=85&s=58c00f0000f71e62d2be337ecbbba30c" width="32" height="32" data-path="images/icons/ai-agents.svg">Emit safe UI actions from the agent.</Card>
</CardGroup>

***

# Backend Tools Agent

An agent that calls backend tools or APIs. Example: fetch the weather from an external API, create tickets, update CRM.

<CardGroup>
  <Card title="Backend Tools Guide" href="/ai-agents/mastra-backend-action-agent" icon="https://mintcdn.com/cometchat-22654f5b-feature-react-native-flag-and-channel/qV5-B8lDLs5n_TzB/images/icons/mastra.svg?fit=max&auto=format&n=qV5-B8lDLs5n_TzB&q=85&s=67e2623333a63a2ddc31386baa325753" width="32" height="32" data-path="images/icons/mastra.svg">Wire backend tools & external APIs.</Card>
</CardGroup>

***

# Human Handoff Agent

An agent that knows its limits. If a human is required, it escalates gracefully by invoking a `handoff` tool with target + reason.

<CardGroup>
  <Card title="Human Handoff Agent Guide" href="/ai-agents/mastra-handoff-agent" icon="https://mintcdn.com/cometchat-22654f5b-feature-react-native-flag-and-channel/qV5-B8lDLs5n_TzB/images/icons/ai-agents.svg?fit=max&auto=format&n=qV5-B8lDLs5n_TzB&q=85&s=58c00f0000f71e62d2be337ecbbba30c" width="32" height="32" data-path="images/icons/ai-agents.svg">Escalate to humans with context.</Card>
</CardGroup>

***

# Multi-agent Orchestration (Coordinator) Agent

An agent that queries multiple people, APIs, or sub-agents and returns a consolidated answer. Perfect for “Who is available tomorrow?” type queries.

<CardGroup>
  <Card title="Multi-agent Orchestration Guide" href="/ai-agents/mastra-coordinator-agent" icon="https://mintcdn.com/cometchat-22654f5b-feature-react-native-flag-and-channel/qV5-B8lDLs5n_TzB/images/icons/mastra.svg?fit=max&auto=format&n=qV5-B8lDLs5n_TzB&q=85&s=67e2623333a63a2ddc31386baa325753" width="32" height="32" data-path="images/icons/mastra.svg">Fan-out across sources & merge results.</Card>
</CardGroup>

***

# Group Chat Agent

An agent that lives in group chats and only responds when explicitly mentioned, e.g. `@agent what’s our refund policy?`.

<CardGroup>
  <Card title="Group Chat Agent Guide" href="/ai-agents/mastra-group-chat-agent" icon="https://mintcdn.com/cometchat-22654f5b-feature-react-native-flag-and-channel/qV5-B8lDLs5n_TzB/images/icons/ai-agents.svg?fit=max&auto=format&n=qV5-B8lDLs5n_TzB&q=85&s=58c00f0000f71e62d2be337ecbbba30c" width="32" height="32" data-path="images/icons/ai-agents.svg">Mention-aware agent for group rooms.</Card>
</CardGroup>

***

## Next Steps

* Combine these agents in one Mastra project.
* Deploy to your preferred host and connect them into **CometChat Dashboard → AI Agents**.
* Extend with guardrails, vector retrieval, and advanced workflows.
* Distribute this playbook internally so teams can copy-paste working agent setups.

***
