diff --git a/ai-agents/ag-ui-card-messages.mdx b/ai-agents/ag-ui-card-messages.mdx new file mode 100644 index 000000000..ffc3a5a46 --- /dev/null +++ b/ai-agents/ag-ui-card-messages.mdx @@ -0,0 +1,9 @@ +--- +title: "Card Messages" +sidebarTitle: "Card Messages" +description: "Let your AG-UI BYOA agent reply with rich, interactive cards designed in Card Builder." +--- + +import CardMessages from '/snippets/ai-agents/card-messages.mdx'; + + diff --git a/ai-agents/ag2-card-messages.mdx b/ai-agents/ag2-card-messages.mdx new file mode 100644 index 000000000..39c4d0aa0 --- /dev/null +++ b/ai-agents/ag2-card-messages.mdx @@ -0,0 +1,9 @@ +--- +title: "Card Messages" +sidebarTitle: "Card Messages" +description: "Let your AG2 BYOA agent reply with rich, interactive cards designed in Card Builder." +--- + +import CardMessages from '/snippets/ai-agents/card-messages.mdx'; + + diff --git a/ai-agents/agent-builder/card-messages.mdx b/ai-agents/agent-builder/card-messages.mdx new file mode 100644 index 000000000..3bc7e8ed2 --- /dev/null +++ b/ai-agents/agent-builder/card-messages.mdx @@ -0,0 +1,59 @@ +--- +title: "Card Messages" +sidebarTitle: "Card Messages" +description: "Let your agent reply with rich, interactive cards — designed in Card Builder — instead of plain text." +--- + +The **Card Messages** tool lets your agent reply with flexible, interactive cards — buttons, images, progress bars, layouts — instead of plain text. You design each card once in [Card Builder](/card-builder/overview) so it always renders uniformly, then tell the agent when to send it. + +## Enable the Card Messages tool + +1. Open your agent and go to **Tools**. +2. Find **Card Messages** (a built-in system tool) and toggle it **on**. +3. A **Design interactive cards with Card Builder** prompt appears — click **Open Card Builder** to start designing. + +## How it works + +Card Messages is a built-in **system tool**. When you enable it, the agent can call the tool to fetch a **card reference — working examples plus a field reference** (describing the structure documented in the [Card JSON Schema](/card-builder/schema)) — and then generate a conforming card in its reply. + +That means the agent *can* compose cards freely — but free-form generation drifts in layout and styling from one reply to the next. To keep every card consistent, **design it once in Card Builder and give the agent the exported JSON** to reuse, as shown below. + + +You supply **what** card to send — the **how** is automatic. Enabling the tool also teaches the agent the format CometChat uses to recognize a card in its reply, so cards render with no extra work. This holds even when you paste a predefined card into the Instructions: keep the tool **on** — that's what supplies the format. With the tool off, pasted card JSON won't render as a card. + + + +A reply is delivered as an ordered sequence of **elements** — plain-text segments and at most **one card**. So an agent can send a card on its own, or with text before and/or after it, in a single reply. To present multiple sections *inside* the card, use layout elements (`row`, `column`, `grid`, `tabs`, `accordion`) rather than sending a second card. + + +## Design a card and add it to your agent + +Once the tool is on, the workflow is: + +1. **Design your card** visually in [Card Builder](/card-builder/overview) — see [Building an Order Status Card](/card-builder/example-order-status) for a full walkthrough. +2. Use **Export → Copy Card JSON** to copy the finished card. +3. Add the JSON to the agent's **[Instructions](/ai-agents/agent-builder/instructions)** and specify **when** to send it. + + +A fixed card renders exactly as designed. If it includes `{{placeholder}}` variables, instruct the agent to fill them in before sending. + + + +With several card types, you can return the card JSON from a **[Custom API Tool](/ai-agents/agent-builder/tools/overview)** instead of pasting it into the instructions — keeping the agent's instructions concise and focused. + + +## Design cards in Card Builder + +Card Builder is the visual editor where you compose and save your cards. + + + + Learn the editor — palette, canvas, elements, actions, and variables. + + + Build an interactive Order Status card from scratch, step by step. + + + The complete schema a card's JSON must conform to. + + diff --git a/ai-agents/agno-card-messages.mdx b/ai-agents/agno-card-messages.mdx new file mode 100644 index 000000000..174a4e8ab --- /dev/null +++ b/ai-agents/agno-card-messages.mdx @@ -0,0 +1,9 @@ +--- +title: "Card Messages" +sidebarTitle: "Card Messages" +description: "Let your Agno BYOA agent reply with rich, interactive cards designed in Card Builder." +--- + +import CardMessages from '/snippets/ai-agents/card-messages.mdx'; + + diff --git a/ai-agents/crew-ai-card-messages.mdx b/ai-agents/crew-ai-card-messages.mdx new file mode 100644 index 000000000..bfa319ba6 --- /dev/null +++ b/ai-agents/crew-ai-card-messages.mdx @@ -0,0 +1,9 @@ +--- +title: "Card Messages" +sidebarTitle: "Card Messages" +description: "Let your CrewAI BYOA agent reply with rich, interactive cards designed in Card Builder." +--- + +import CardMessages from '/snippets/ai-agents/card-messages.mdx'; + + diff --git a/ai-agents/langgraph-card-messages.mdx b/ai-agents/langgraph-card-messages.mdx new file mode 100644 index 000000000..58df16be1 --- /dev/null +++ b/ai-agents/langgraph-card-messages.mdx @@ -0,0 +1,9 @@ +--- +title: "Card Messages" +sidebarTitle: "Card Messages" +description: "Let your LangGraph BYOA agent reply with rich, interactive cards designed in Card Builder." +--- + +import CardMessages from '/snippets/ai-agents/card-messages.mdx'; + + diff --git a/ai-agents/mastra-card-messages.mdx b/ai-agents/mastra-card-messages.mdx new file mode 100644 index 000000000..56122286e --- /dev/null +++ b/ai-agents/mastra-card-messages.mdx @@ -0,0 +1,9 @@ +--- +title: "Card Messages" +sidebarTitle: "Card Messages" +description: "Let your Mastra BYOA agent reply with rich, interactive cards designed in Card Builder." +--- + +import CardMessages from '/snippets/ai-agents/card-messages.mdx'; + + diff --git a/ai-agents/vercel-card-messages.mdx b/ai-agents/vercel-card-messages.mdx new file mode 100644 index 000000000..13fcca422 --- /dev/null +++ b/ai-agents/vercel-card-messages.mdx @@ -0,0 +1,9 @@ +--- +title: "Card Messages" +sidebarTitle: "Card Messages" +description: "Let your Vercel AI BYOA agent reply with rich, interactive cards designed in Card Builder." +--- + +import CardMessages from '/snippets/ai-agents/card-messages.mdx'; + + diff --git a/card-builder/building-cards.mdx b/card-builder/building-cards.mdx new file mode 100644 index 000000000..175f69288 --- /dev/null +++ b/card-builder/building-cards.mdx @@ -0,0 +1,92 @@ +--- +title: "Building Cards" +sidebarTitle: "Building Cards" +description: "Walk through the Card Builder editor — the canvas, the element palette, and the properties panel — to design, style, and save a card in the CometChat Dashboard." +--- + +This guide walks through designing a card in Card Builder, from a blank canvas to a saved template. + + +