# AI Agents (/en/agent)

An **agent** is an AI that replies to comments and DMs on behalf of your account. You write its instructions (tone of voice, what it may and may not promise) and give it **Knowledge**: FAQs, catalogues, price lists, or web pages. The agent looks for the answer there before replying.

You can use an agent in three ways:

- **"Answered by AI" automations**: the agent replies by itself to every new DM or comment (see [Replying through Automations](#replying-through-automations)).
- **AI draft** in the Inbox and Comments: the agent prepares a reply, and you check it and send it.
- **Try it**: chat with the agent in the dashboard without sending anything to customers.

## What you need [#what-you-need]

- **A paid plan.** How many agents and Knowledge sources you get depends on the plan:

  | Plan    | Agents | Knowledge | Total Knowledge content | Knowledge adds or changes a day |
  | ------- | ------ | --------- | ----------------------- | ------------------------------- |
  | Free    | -      | -         | -                       | -                               |
  | Starter | 1      | 5         | 200 thousand characters | 20                              |
  | Basic   | 2      | 15        | 500 thousand characters | 40                              |
  | Pro     | 5      | 40        | 1.5 million characters  | 100                             |
  | Agency  | 50     | 500       | 10 million characters   | 300                             |

  These limits count every workspace in your Tebar account.

- **A Sumopod API key.** Agents use AI models through [Sumopod](https://sumopod.com), and the model cost is paid from your own Sumopod AI balance, not by Tebar.

<Callout type="warn">
  On the Free plan, agents do not run at all: automations, AI drafts, and Try it stop. Your agents
  and Knowledge are kept and run again as soon as you upgrade.
</Callout>

## 1. Connect your Sumopod API key [#1-connect-your-sumopod-api-key]

1. In Sumopod, top up your **AI Balance** first, then open **AI** → **API Keys** → **+ API Key**. The key starts with `sk-` and is shown only once, so copy it right away. The full steps are in [Sumopod's guide](https://docs.sumopod.com/guides/ai/create-api-key).
2. In Tebar, open **Agent** → **Connect API key**, paste the key, and **Save**.

Tebar checks the key and shows the models you can use. The key is stored encrypted and applies to that workspace. If your Sumopod balance runs out or the key is revoked, the agent stops replying until the key is fixed; press **Check again** after topping up.

Your remaining **Sumopod AI balance** shows in the **API key** window (refreshed every few minutes). When less than $1 is left, the **API key** button gets a yellow dot, so you can top up before the agent stops.

<Callout>
  To keep spending under control, give the key a **credit limit** when you create it in Sumopod.
</Callout>

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

Click **Create agent**, name it, then set it up in the **Settings** tab:

- **Instructions**: who the agent is and how it answers. For example: _"You are the support team of a T-shirt shop. Answer kindly and briefly. Never promise discounts. When asked about stock, check Knowledge first."_ Not sure what to write? Click **Write with AI**: Tebar reads your account's own posts and writes the instructions.
- **Knowledge**: the sources the agent may search (see [Knowledge](#knowledge)). Without Knowledge, the agent answers only from its instructions.
- **Hand to you**: when the agent stops and marks the conversation **Needs you** in the Inbox. The options: the customer writes certain words (for example "complaint", "refund", "admin"), the customer sounds upset or angry, and the answer is not in Knowledge.
- **AI disclosure**: DMs from the agent start with "🤖 Dibalas otomatis oleh AI." ("Replied automatically by AI") at the start of a conversation, after a long silence, or after you replied. Keep it on: Meta's rules require customers to know when they are talking to a bot.

Pick the AI model in the **Model & limits** tab. Try the agent in the **Try it** tab before customers see it: ask questions the way a real customer would and check the answers. Every answer is recorded in the **Run history** tab.

## Knowledge [#knowledge]

The **Knowledge** menu holds the sources every agent in that workspace can use. Click **Add**, then pick the kind:

| Kind              | What it holds                                                                    |
| ----------------- | -------------------------------------------------------------------------------- |
| **Text**          | Typed or pasted in, for example an FAQ or a shipping policy                      |
| **Link**          | A public web page (`https`); its main content is read, menus and ads are skipped |
| **File**          | PDF, DOCX, TXT, Markdown, or CSV, up to 20 MB                                    |
| **Account posts** | Posts already published, so the agent sounds like your account                   |
| **Saved replies** | Saved replies from the Inbox                                                     |
| **Comment reply** | Comment replies you have written                                                 |

Tebar reads a source in a few seconds to a few minutes (**Being read**, then **Done**). A source longer than your plan allows is read only from the start. When a web page or file changes, press **Read again**; adding, editing, and reading again count toward the daily limit above.

## Replying through Automations [#replying-through-automations]

Agents reply to customers through [Automations](/en/automations). There are two ways:

- **"Answered by AI" templates**: **Reply to all DMs with AI** (Instagram) and **Reply to all comments with AI** (Instagram and Threads). The agent answers every DM or comment no other automation answered.
- **Reply with AI** in an existing automation (DM keywords, automatic DM reply, and comment replies): pick an agent, and the agent answers instead of the fixed message.

The message you wrote in the automation is kept as a **fallback**: it is sent when the agent is turned off, the Sumopod balance runs out, or the agent fails to answer.

Before answering, the agent reads the context: for a comment, the post (its text, not images or video), the comment being replied to, and your earlier replies; for a DM, the latest messages in that conversation.

**When you reply too:** if you reply to a conversation yourself, the agent waits. Set how long in the automation under **Answers again after you go quiet for** (15 minutes to 7 days, or **Manual**). In the Inbox, **Give back to AI** hands the conversation back to the agent at any time.

**Customers can opt out.** If a customer writes **stop**, **berhenti**, or **unsubscribe**, automations that use an agent send no more automatic messages to that conversation for 30 days, from the agent or as a fallback.

## AI draft in the Inbox and Comments [#ai-draft-in-the-inbox-and-comments]

In an Inbox conversation or under a comment, click **AI draft** and pick an agent. The reply appears in the reply box: check it, edit it if needed, and send it yourself. An AI draft never sends anything without you. AI drafts work on comments from every platform whose comments show in Tebar.

## Good to know [#good-to-know]

- **AI can be wrong.** The agent answers business facts (prices, stock, opening hours) only from Knowledge, but check the Run history now and then, especially in the first week. You are responsible for replies sent on behalf of your account.
- **Customers' comments and DMs** are given to the AI as data, not instructions, so customers cannot make the agent do something else.
- **What is sent to Sumopod** and the model providers is described in the [Privacy Policy](https://tebar.app/en/privacy#agent-ai).
- **Instagram DM window:** the agent can reply to a DM only within 24 hours of the customer's last message, the same as replies from the Inbox.
