# AI agents (/growsocmed/docs/ai-agents)

Agents that answer comments and DMs from your knowledge.

An AI agent writes answers to comments and DMs in your voice, from instructions you give it and from your own material (Knowledge). Agents use an AI model through **your own AI key**: what the model costs is paid to the AI provider, not to GrowSocmed. AI agents come with paid plans; the plan sets how many agents and how much Knowledge you can have.

The **AI Agents** page has three tabs: **Agents**, **Knowledge** and **AI key**.

## 1. Connect an AI key [#1-connect-an-ai-key]

On **AI key**, choose **Connect an AI key**, pick the **Provider** and paste the **API key**:

| Provider | |
| --- | --- |
| Anthropic (Claude) | |
| OpenAI | |
| Google Gemini | |
| OpenRouter | |
| Other (OpenAI-compatible) | Also needs the **Base URL**. |

**Check & save** tests the key with the provider and lists its models. The key is stored encrypted and is not shown again. Give the key a credit limit in the provider's dashboard to keep spending in check. **Check again** tests it later; **Replace key** swaps it.

## 2. Add Knowledge [#2-add-knowledge]

Knowledge is what agents search before they answer. Business facts such as prices, stock or opening hours come only from here.

| Type | Use for |
| --- | --- |
| **Text** | An FAQ, price list or policy you paste in. |
| **Link** | A public web page. |
| **File** | PDF, DOCX, TXT, MD or CSV, up to 20 MB. |
| **Account posts** | The account's own posts, to learn its tone. |
| **Saved replies** | Your saved replies from the Inbox. |
| **Comment replies** | Replies you wrote to comments. |

Each source shows **Reading**, **Ready** or **Failed**. **Read again** refreshes it, for example after a web page changed. Text beyond the plan's total Knowledge size is cut and marked so.

## 3. Create an agent [#3-create-an-agent]

Choose **Create agent** and fill in **Settings**:

- **Name** and **Instructions**: who the agent is, how it answers and what it must not do (for example "never promise discounts").
- **Model**: one of the key's models, or the first model of the key.
- **Knowledge it may search**: the sources this agent uses.
- **Hand over to you when…**: keywords (such as complaint, refund, admin), when the customer sounds upset or angry, or when the answer is not in Knowledge.
- **AI notice**: agent DMs start with a short notice that the reply was written automatically by AI, at the start of a conversation, after you replied, or after a day. Meta's rules require people to know when a bot answers.

Then open **Test** and write like a customer. Nothing is sent to anyone. **Run history** lists every answer the agent gave, from tests, drafts and automations, with its outcome: **Answered**, **Handed over**, **Failed** or **Skipped**.

## Where agents answer [#where-agents-answer]

- **Automations**: in a **Reply to comments**, **DM keyword** or **Default DM reply** automation, choose the agent under **Answer with AI**. The message you write there is used when the agent cannot answer. See [Automations](/growsocmed/docs/automations).
- **Draft AI** in [Comments](/growsocmed/docs/comments) and the [Inbox](/growsocmed/docs/inbox): the agent drafts a reply; you check it and send it yourself.

## Rules agents follow [#rules-agents-follow]

- When an agent hands a DM over, the conversation moves to **Needs you** in the Inbox. **Return to AI** gives it back.
- An agent stays quiet for 15 minutes after someone from your team replied in the conversation.
- A person who writes "stop" (also "berhenti" or "unsubscribe") gets no AI replies for 30 days.
- Text written by customers is treated as a message to answer, never as instructions for the agent.

Deleting an agent sends the automations that used it back to their fixed message.