Help Center 为您的 Instagram 机器人创建带知识库的 AI agent

为您的 Instagram 机器人创建带知识库的 AI agent

本指南介绍如何在 MyCode.Bot 中创建 AI agent:设置指令、添加 OpenAI 密钥、上传知识库,并在测试聊天中检查回答。示例使用虚构的 Demo Shop,您可以在下方下载其文件。

您将获得什么

一个能根据您自己的文件回答业务问题的智能体。它不会编造价格或日期,并会把订单问题和投诉转交给经理。

创建智能体并不会立即将其连接到 Instagram。在您通过 AI agent 节点把智能体添加到机器人方案之后,客户才会开始收到它的回答。

开始之前

  1. 登录 panel.mycode.bot。
  2. 获取 OpenAI API 密钥。请求通过您的密钥发送,因此 OpenAI 会向您计费。
  3. 如果您还没有机器人,请先从无需 AI 的 Instagram 机器人开始。

下载演示文件

这些文件用英文描述一家虚构的店铺。其中没有密钥或客户数据。

第 1 步:创建智能体

打开 AI agents,点击 Create agent,并填写基本设置:

字段值
Agent name任意名称,例如 Test shop agent。
Model任意可用的模型。对于此演示,小型快速的模型就足够了。
ProviderOpenAI
Knowledge modeStrict:智能体只根据您的知识库回答。
Languageen
Tonefriendly_short
Maximum results5

第 2 步:填写指令

将以下文本复制到表单中,然后点击 Create。

Role prompt 说明智能体是谁以及它的行为方式:

You are the online assistant of Demo Shop, a small clothing store that sells everyday clothes made from organic cotton. You talk to customers in Instagram Direct. Help them choose products and sizes, and answer questions about prices, delivery, payment, returns and exchanges. Use only the facts from the knowledge base about the shop.

Business rules 设定其回答的界限:

- Keep every answer under 600 characters. Instagram cuts messages longer than 1000 characters.
- Write plain text without Markdown: no **bold**, no headings, no tables. Use short lines and emoji instead of lists when it helps.
- Answer in the language of the customer. If you are not sure, answer in English.
- Never invent prices, discounts, stock, delivery dates or order details.
- You cannot see orders. If the customer asks about a specific order, wants to change or cancel an order, has a delivery problem, complains, or asks for a person, say that a manager will help and set needs_human.
- Never ask for card details, codes or passwords.
- If the question is not about Demo Shop, say politely that you can only help with Demo Shop questions.
- When you recommend a size, ask for the customer's height or chest size if you do not know it.

Fallback text 是知识库中没有答案时智能体所说的话:

I don't have this information yet. Tap "📞 Call me back" and our manager will help you.

第 3 步:添加 OpenAI 密钥

  1. 打开智能体页面的 Configuration 标签页。
  2. 将密钥粘贴到 Provider token 中,然后点击 Create。

保存后,完整的密钥会从表单中清除,只保留其掩码可见。

第 4 步:上传知识库

  1. 打开 Knowledge Base 标签页。
  2. 上传已下载的两个文件。第一个文件会自动创建知识库。
  3. 等待文件的状态变为 Ready。

第 5 步:启用智能体

在 Configuration 标签页中打开 Active 开关。只有添加了服务商令牌后,该开关才可用。

第 6 步:检查回答

打开 Test chat 标签页并提出以下问题:

问题预期回答
What sizes does the hoodie come in?S 到 XXL,宽松版型,想要常规版型请选小一个尺码。
I’m 175 cm tall. Which T-shirt size should I take?M 码
Do you ship to Canada? How long does it take?可以,5–10 个工作日,$15,满 $100 免运费。
Can I return a cap I bought 10 days ago?可以,14 天内,未佩戴且吊牌完好。
Where is my order #1234?智能体看不到订单,因此将由经理协助。
What’s the weather in London today?礼貌地拒绝:它只帮助解答与 Demo Shop 有关的问题。

使用您自己的数据

  1. 在 Knowledge Base 标签页中,用有关您的商品和条款的文件替换演示文件。
  2. 在 Role prompt 和 Business rules 中修改店铺名称。
  3. 将 Language 设置为您客户使用的语言,并再次检查回答。

新智能体有消息数量限制

新智能体可以发送 50 条消息。您可以在智能体页面上查看使用情况。如需提高限额,请写信至 support@smsbat.com。

常见问题

智能体说没有相关信息,但这个事实就在我的文件里。 请检查文件的状态是否为 Ready,以及该事实是否用通俗的语言写出。在 Strict 模式下,智能体不会根据常识回答。

Active 开关无法打开。 请先在 Provider token 中添加密钥。

如何将智能体连接到 Instagram? 导入带 AI agent 节点的方案,并在其中选择此智能体。