跳到正文Skip to content
Agent J Beta
菜单Menu
中文EN
登录Sign in

搜索文档和页面Search docs and pages

文档Docs

让你的 bot 接待访客Serve visitors with your bot

在手机选模板、配置 Telegram 或网页渠道,并用自己的模型账户接待访客。Choose a template, connect Telegram or a website, and serve visitors using your own model account.

在已配对手机打开 Bots,点「新建 bot」,选择客服、陪聊或付费问答。填写名字并创建;bot 初始暂停。Agent J 主机在线且席位有效时才能服务,每席位同时只能启用一个 bot。

客服依据你的资料回答,不确定时转人工。陪聊默认说明 AI 身份,尊重关系边界,避免依赖、操纵和专业诊断。付费问答依据你的专业资料回答;你可设置每位访客每天免费 N 问和一个 HTTPS 付费链接。免费问题用完后,主机提示该链接。本期不接支付、不验证付款,也不会因访问链接自动解锁问答;你可以另外调整免费数或自行提供付费服务。

选择模型和审核账户

在设置中选择「用主 Agent 套餐」或「主人自带模型 key」。自带 key 先选用哪家的按量 key,可以和主 Agent 不同家(主 Agent 用火山方舟、客服 bot 用千问也行):火山方舟、阿里云百炼 / 千问、DeepSeek、Kimi / Moonshot、智谱 GLM、MiniMax、OpenRouter、AgentsRelay、OpenAI、Anthropic。每家自带服务地址、便宜的默认模型和自己的 key 名(比如 BOT_DASHSCOPE_API_KEY),跟主 Agent 的 key 分开存;别的 OpenAI 兼容服务选「其他」,自己填 API 地址。再填每日模型 token 上限并保存,然后点添加 / 更新这家 key 的按钮:密钥卡会写明填哪家的按量 key、去哪个控制台建。Coding Plan / Token Plan 的 key 不能用。仅在密钥卡中粘贴 key,别发到聊天中。修改已有模型 key 会暂停使用自带 key 的 bot,保存并验证成功后再启用。已有服务商档案仍可使用。

自带 key 的模型费用走该 key 的账户,模型 token 日限独立;访客、bot 和主机消息限额仍一起生效。安全审核使用你自己选择的 TypeSafe 或 OpenRouter key,与模型 key 分开。添加审核 key 后,每次启用都会真实验证审核;失败或结果不确定时,不会发出模型或人工回复,也不会改用其他账户。

在 Telegram 接待

先准备一个属于你的 Telegram bot token。在 Bots 设置点「添加 / 更换 Telegram token」,只在密钥卡中粘贴。勾选「在 Telegram 接待(停用后停止收发)」,保存后会验证 token。已有 webhook 必须由你在 Telegram 端移除;同一个 token 不能同时由另一套程序轮询。Token 更换会暂停 Telegram,重新保存后恢复。取消勾选即可停用;已在途的网络请求可能继续结束,但停用后的结果不会外发。

头像:保存并启用 Telegram 后,如果这个 bot 还没有头像,Agent J 会自动把它设成官方 Logo(奶白底上的绿色机器人),只做一次;已经有头像的不会动。想换成 Agent J 头像,点 bot 设置里的「换成 Agent J 头像」,或者让 Agent 运行 agentj bots avatar set <bot id>(status 查看、reset 移除当前头像;owner 指你自己的主人 bot,它绑定时也按同样规则自动设一次)。其他尺寸和 16 个机器人见 官方 Brand Kit。

仅接待与 bot 的私聊,群聊和其他 bot 不接待。每位 Telegram 用户有独立会话;消息限流、日限、知识、工具审批、转人工和 Jev 审核与网页渠道共用。公开网页网址和嵌入继续可用。

Telegram 是第三方渠道,Telegram 平台能看到该渠道消息。Token 只保存在你的主机,不进入聊天、我们的云端明文或日志。网页聊天仍使用端到端加密。模型服务商与所选审核服务商接收必要上下文,遵循各自的数据政策。

让你的 Agent J Telegram 机器人兼做客服

你跟 Agent J 配对的那个 Telegram 机器人也能接待客人。同一个机器人两种身份:对你是助理,对别人是客服。在客服 bot 里打开一个 bot,勾选「让我的 Agent J Telegram 机器人也接待客人」,或者让 Agent J 运行 agentj bots attach-telegram <bot-id>;两种方式都要你在已配对的手机上批准。默认关闭;关着的时候,别人给你的机器人发消息只会收到他自己的数字 ID。

只有用配对码绑定的那个私聊是主人,消息照旧进你的主对话。其他私聊都是这个 bot 的访客:各自独立会话,用这个 bot 的提示词、模型、知识、工具、限额和 Jev 审核。想给客人用便宜模型,就给这个 bot 配自带模型(key 走密钥卡);没配就用 bot 现有的默认。客人进不了你的主对话,也拿不到你的权限;客人发配对码、自称主人或发主人命令,都只当访客文字。

客人的聊天记在这个 bot 的会话列表里,和你自己的 Telegram 消息分开;Agent J 主机日志只记次数。超过限额会礼貌回复;只回文字消息,群聊暂不接待。bot 暂停或按了「全部停下」时,客人又只会收到数字 ID。一次只有一个 bot 接待;取消勾选或运行 agentj bots attach-telegram <bot-id> --off 就停。不要把 Agent J 机器人的密钥再存成某个 bot 自己的 Telegram token,两边会互相抢消息。

Gemini CLI(可选)

本期停止 Gemini 主 Agent 适配。Google 已停用个人登录;只有明确选择 Gemini CLI 时才安装,并使用付费 Gemini API key。主 Agent 请使用 Claude Code、Codex 或 OpenCode。

参见可选 CLI 安装。

让 Agent J 帮你设置

按 Alt+Shift+B 打开客服 Bot 页,或在设置里点「Bots / 客服」。点顶部「让 Agent J 帮我设置」,聊天输入框会备好技能命令和开场白。补一句想法再发,或直接发送,Agent J 都会先讲清客服 Bot 怎么用,再问你想怎么设。

商用配置参考

在 Bots 设置的「商用配置」里调整备用模型、话术、保留期和挂件,在限额里改额度。也可以把要求告诉 Agent J:它先运行 agentj bots schema 查看完整配置 schema,再读取 detail,保留现有设置,提交 save 提案,等你在已配对手机上签名。提案里不能放 key。配置保存在主人主机,不写入全局个人设置文件。

配置项默认值与范围用途
limits.max_chars2000,1–4000单条 Unicode 字数;4000 保证中文在现有加密帧内可传
limits.per_minute6,1–600每访客每分钟条数
limits.visitor_messages20,1–10000每访客每天条数
limits.bot_messages100,1–100000每 bot 每天条数
limits.host_messages100,1–100000主机每天合计条数
limits.host_tokens100000,1–50000000主机每日模型和审核 token;用量未知时保留预扣
limits.concurrency4,1–16主机并发接待数
own_model.daily_tokens100000,1–50000000自带 key 的每日模型 token,独立于审核额度
privacy.retention_days30,1–3650本 bot 聊天、身份和计数的保留天数,每小时清理
memory.history_hours24,1–8760模型历史回看小时数
memory.max_turns40,1–1000模型最多读取的历史消息条数,包含双方
memory.max_chars28000,28000–1000000模型上下文 UTF-8 字节上限,超出即停止
provider.chain空,最多两个备用每项为 {vendor, model},主模型失败后依次尝试,合计最多三个模型
provider.docs_links空,最多六个 HTTPS 链接模型均无法回答时附上的文档
provider.thinkingoff,可选 auto在方舟、百炼、DeepSeek、OpenRouter 的聊天 API 关闭思考;原生工具仍受自身能力约束
outbound.block_commandstrue出站拦截破坏性命令、下载后执行、往 shell 配置写秘密
outbound.link_domains空,最多 20 个准确域名网页回答仅让这些 HTTPS 域名可点击,其他显示为文字;不接受通配符
knowledge.citetrue回答附检索资料的原文链接
knowledge.max_chars6000,1–100000一次检索的资料字数
messages内置双语话术welcome、offtopic、handoff_sent、unavailable、outside_hours、limit;每项为最多 1000 字的文本或 {zh, en}
widget.positionbr,可选 bl挂件在右下或左下
widget.accent#629887也可选 #141414、#827dbd、#d97757
widget.welcome空,最多 300 字为空时使用 messages.welcome
widget.quick_replies空,最多六条,每条 200 字访客可直接点选的问题
widget.open_on_loadfalse页面载入后自动展开
widget.queue_mergetrue等待回答或分钟限流时排队,以两个换行拼成一条,只计一次消息
handoff.reply_window_h48,1–720主人签名回复人工交接的小时窗口;访客离线时网页仍无法送达
safety.provideropenrouter,可选 typesafe主人自选审核账户,失败即拒绝
safety.criteriacustomer_service 或 strictstrict 额外拒绝超出业务范围的请求
handoff.email_enabledfalse开启已有 Agent J 邮件通道的逐封签名人工回复
service.after_hoursrefuse、ai_only、leave_message默认拒绝;ai_only 禁用全部工具;leave_message 保存留言并通知主人,不调模型
knowledge.sources空,最多 20 项每项含 HTTPS url、资料文件名 name、HTTPS cite_url、resync(none/daily/weekly)

备用 vendor 使用和自带模型相同的十家按量服务商。先保存链,再点对应的备用 key 按钮,或由 Agent J 提交 {"op":"model_key","id":"<bot-id>","vendor":"deepseek"};密钥卡写入本 bot 的对应 key 文件,不借用主 Agent 的 key。失败请求的用量未知时仍占额度,备用也要先预扣;预算不足、审核或权限拒绝不会靠换模型绕过。备用模型仍可能产生额外费用。

URL 资料同步会记住原文地址。本地文件可在 knowledge_add 提案里带 cite_url(HTTPS);不提供来源地址的文件不会编造链接。定时资料源在主机在线且 bot 启用时刷新,每次到期尝试重新检查地址;失败保留旧快照。

在嵌入中复制一行脚本:

<script src="https://agentj.app/bots/embed.js" data-bot="company-help" async></script>

先把自己网站的完整 HTTPS origin 加入 embed_origins。挂件读取签名公开配置,点开 9:16 浮窗,收起或 Esc 保留会话。聊天仍在隔离加密 iframe 内;外层网站拿不到消息正文。网页会显示安全的 Markdown 文字、代码折叠和允许的链接。首次载入仍信任网站提供的程序和公钥,嵌入站点可能限制脚本、浮窗或跨站存储。

等待时可以继续输入,排队内容以虚线框显示,点撤回排队退回输入框修改。合并后超出单条上限才提示缩短;一分钟桶满时倒计时等待。刷新不会保存排队草稿;发送结果未确认就断线时退回当前页草稿,不自动重发,避免重复计费。网页与 Telegram 共用主机限额,Telegram 客户端的链接自动识别由 Telegram 控制。

访客消息在浏览器和主机存储前去除已识别密钥形状及卡号,出站危险命令再过确定性过滤与 Jev;识别不是所有秘密的保证,不要让访客提交密码。下班方式见 service.after_hours;审核和邮件回复的启用步骤如下。

TypeSafe 默认不启用:在商用配置选择 typesafe 并保存,再用密钥卡添加自己的 TYPESAFE_API_KEY;OpenRouter 仍用 OPENROUTER_API_KEY。脱敏后的候选文字和判据从主机直达所选服务商,key 不跨账户复用。

邮件转人工须先配好 Agent J 邮件,并开启 handoff.email_enabled。访客在加密会话填写邮箱、申请邮件联系;主人在会话页核对准确收件地址,签名发送固定验证码邮件。验证码十分钟有效,错五次锁定;访客在同一会话输入后,主人才可核对准确地址和正文,逐封签名回复。回复经过脱敏与出站审核。每会话含验证码最多三封,发送结果不明也计数,不自动重试。此验证只用于人工联系,不新增客户分级或登录。在线访客仍可在默认 48 小时窗口内接收签名聊天回复。

Jev 总开关

所有客服统一遵循 设置 → 安全 的 Jev 模式:TypeSafe、OpenRouter 或主人签名确认的关闭。模型和 API Key 靠上的 Jev 区域可填审核 key。启用审核时缺少有效 key 或审核失败仍暂停;主人确认关闭时不发起审核请求,只保留本地凭据、命令、权限和工具闸,人工回复也一样。旧的 safety.provider 只在未作全局来源选择时沿用。Agent 不能代主人关闭。

Open Bots on your paired phone and choose Create bot. Select customer service, companion or paid Q&A, give it a name, and create it paused. the Agent J host must be online with a valid seat; one bot can be enabled per seat.

Customer service answers from your knowledge and offers a human when uncertain. The companion template identifies itself as AI and sets boundaries against dependency, manipulation and professional diagnosis. Paid Q&A uses your expertise: set N free questions per visitor per day and an HTTPS payment link. After N questions the host displays your link. This release does not process or verify payments, and visiting a link does not unlock answers. You can adjust the free allowance or deliver a separate paid service yourself.

Model billing and safety reviews

Choose your main Agent plan or your own model key. With your own key, first pick whose pay-as-you-go key the bot uses — it may differ from your main Agent's (Volcano Ark for the Agent, Qwen for the bot is fine): Volcano Ark, Alibaba Cloud Bailian / Qwen, DeepSeek, Kimi / Moonshot, Zhipu GLM, MiniMax, OpenRouter, AgentsRelay, OpenAI or Anthropic. Each brings its own address, a low-cost default model and a key name of its own (for example BOT_DASHSCOPE_API_KEY), kept apart from your main Agent's keys; for any other OpenAI compatible service choose Other and enter its API URL. Set a daily model token cap and save. Then use Add / update the key for … to open the secret card, which says whose pay-as-you-go key to paste and which console issues it; a Coding Plan / Token Plan key is refused; never paste a key into chat. Replacing an own model key pauses a bot using that key. Save and verify before enabling it again. Existing provider profiles remain available.

Own-key model calls are billed to that account and have a separate daily token budget. Visitor, bot and computer message caps still apply. Jev uses your selected TypeSafe or OpenRouter review key, separately from the model. When global Jev review is enabled, activation tests reviews and failed or uncertain reviews block output, including human replies. Owner-signed off keeps local gates only; there is no fallback to another account.

Telegram

Use a Telegram bot token you own. Add / replace Telegram token opens the phone secret card. Enable Serve on Telegram and save to verify it. Remove any existing webhook through Telegram first, and do not run a second polling application with the same token. Replacing a token pauses Telegram until you save again. Disable the channel to stop it. A network request already in flight may finish, but its result will not be sent after disabling.

Avatar: when Telegram is enabled and saved, a bot that has no photo yet gets the official Agent J logo (the green robot on ivory), once; a bot that already has a photo keeps it. To switch to the Agent J photo, tap Use the Agent J avatar in the bot's settings, or have the Agent run agentj bots avatar set <bot id> (status to check, reset to remove the current photo; owner means your own owner bot, which gets the same one-time check when it is bound). Other sizes and the 16 robots: official Brand Kit.

Only private chats are served; groups and other bots are ignored. Each Telegram user gets a separate session. Rate limits, daily caps, knowledge, tool approvals, human handoffs and Jev are shared with the website channel. Website URLs and embeds remain available.

Telegram can see messages sent through its platform. Your token stays on the Agent J host, outside chat, our cloud plaintext and logs. Website chat remains end-to-end encrypted. Your model provider and chosen Jev provider receive necessary context under their own policies.

Your own Agent J Telegram bot as customer service

The Telegram bot you paired with Agent J can also receive guests. One bot, two roles: for you it is your assistant, for everyone else it is customer service. In Bots, open a bot and tick 「Let my Agent J Telegram bot receive guests」, or ask your Agent J to run agentj bots attach-telegram <bot-id>; either way you approve the change on the paired phone. It is off by default; while it is off, anyone else who writes to your bot only gets their own numeric ID.

Only the private chat you paired with a code is the owner, and it keeps going to your main conversation. Every other private chat is a visitor of the chosen bot: a separate session with that bot's instructions, model, knowledge, tools, limits and Jev reviews. For a cheaper model for guests, give the bot its own model (key through the secret card); without one it uses the bot's current default. Guests never reach your main conversation or your permissions. A pairing code, 「I am the owner」 or an owner command from a guest is only visitor text.

Guest chats are kept in that bot's conversation list, apart from your own Telegram messages; the Agent J host log only counts them. Over a limit, guests get a polite answer; only text is answered, and groups are not served yet. A paused bot or Stop everything sends guests back to the ID answer. Only one bot receives these guests; untick it or run agentj bots attach-telegram <bot-id> --off to stop. Do not also save your Agent J bot's key as a bot's own Telegram token: the two would take each other's messages.

Gemini CLI (optional)

Gemini main Agent adaptation is stopped for this release. Google has discontinued personal login; an explicitly selected Gemini CLI requires a paid Gemini API key. Use Claude Code, Codex or OpenCode as the main Agent.

See optional CLI setup.

Let Agent J help you set up

Press Alt+Shift+B to open Bots, or choose Bots in Settings. Tap “Let Agent J help me set up” at the top to prepare the skill command and an opening in the chat. Add your idea or send it as it is. Agent J explains how Bots work first, then asks what you would like to set up.

Commercial configuration reference

Use Business settings in Bots for fallback models, messages, retention and the widget; use Limits for quotas. Your Agent J can run agentj bots schema, read detail, preserve the existing configuration and propose a save for your signature on the paired phone. Never put a key in a proposal. Bot settings live on your computer, separately from your global personal settings.

SettingDefault and rangePurpose
limits.max_chars2000, 1–4000Unicode characters per message; 4000 keeps CJK inside the existing encrypted frame
limits.per_minute6, 1–600Messages per visitor per minute
limits.visitor_messages20, 1–10000Daily visitor messages
limits.bot_messages100, 1–100000Daily bot messages
limits.host_messages100, 1–100000Daily messages across the computer
limits.host_tokens100000, 1–50000000Daily model and review tokens; unknown usage keeps its reservation
limits.concurrency4, 1–16Concurrent visitors across the computer
own_model.daily_tokens100000, 1–50000000Own-key model budget, separate from reviews
privacy.retention_days30, 1–3650This bot's chat, identity and counters; cleaned hourly
memory.history_hours24, 1–8760Model history window in hours
memory.max_turns40, 1–1000History messages, counting both sides
memory.max_chars28000, 28000–1000000Context limit in UTF-8 bytes; exceeding it stops generation
provider.chainEmpty, at most two backupsEach is {vendor, model}; tried after the primary, up to three models total
provider.docs_linksEmpty, up to six HTTPS linksDocumentation shown if all models fail
provider.thinkingoff or autoDisables thinking on Ark, Bailian, DeepSeek and OpenRouter chat APIs; native tools retain their own capabilities
outbound.block_commandstrueBlocks destructive commands, download-and-execute and secrets written into shell configuration
outbound.link_domainsEmpty, up to 20 exact domainsOnly these HTTPS answer links are clickable on the website; others are text; no wildcards
knowledge.citetrueAppends retrieved source links
knowledge.max_chars6000, 1–100000Retrieved characters per answer
messagesBuilt-in bilingual phraseswelcome, offtopic, handoff_sent, unavailable, outside_hours, limit; each is a string or {zh, en}, up to 1000 characters per language
widget.positionbr or blBottom right or bottom left
widget.accent#629887Also #141414, #827dbd, #d97757
widget.welcomeEmpty, up to 300 charactersEmpty uses messages.welcome
widget.quick_repliesEmpty, up to six, 200 characters eachQuestions visitors can tap
widget.open_on_loadfalseOpens the widget on page load
widget.queue_mergetrueQueues while busy or rate-limited; joins text with two newlines and counts it as one message
handoff.reply_window_h48, 1–720Signed human reply window in hours; web delivery still requires the visitor online
safety.provideropenrouter; opt into typesafeLegacy route; global Jev mode takes precedence
safety.criteriacustomer_service or strictStrict also rejects requests outside the configured business scope
handoff.email_enabledfalseEnable owner-signed handoff email through the existing Agent J mail account
service.after_hoursrefuse, ai_only, leave_messageRefuse by default; AI-only disables all tools; leave-message stores the turn and notifies the owner without a model
knowledge.sourcesEmpty, at most 20Each source has HTTPS url, local name, HTTPS cite_url, and resync: none, daily, weekly

Fallback vendors are the same ten pay-as-you-go presets as own-model billing. Save the chain, then tap its fallback key button or propose {"op":"model_key","id":"<bot-id>","vendor":"deepseek"}. The secret card writes that bot's provider key; it never borrows your main Agent's key. Failed calls with unknown usage stay reserved, and backups reserve before calling too. Budget, safety and permission refusals never trigger model switching. Backups can incur additional costs.

URL knowledge imports retain their source address. A local knowledge_add proposal may include an HTTPS cite_url; files without a source never receive an invented link. Scheduled sources refresh while the bot is enabled and its host is online. Each due attempt rechecks the address; failure retains the previous snapshot. Manual imports remain available.

Copy the one-line script from Embed:

<script src="https://agentj.app/bots/embed.js" data-bot="company-help" async></script>

Add your site's complete HTTPS origin to embed_origins. The launcher reads signed public settings and opens a 9:16 window; closing or Escape preserves the iframe. Chat stays in the isolated encrypted iframe; the outer site never receives message text. The page renders safe Markdown text, folded code and allowed links. First contact still trusts the website's code and public key. Embedding sites may restrict scripts, overlays or cross-site storage.

Visitors can type while waiting. A dashed queue shows the pending text; Withdraw queued returns it to the input for editing. Only a merged message exceeding the character cap asks for shortening; a full minute bucket shows a countdown. Refresh does not preserve queued drafts. On a disconnect with an uncertain send result, text returns to the current page's draft and is never automatically replayed, avoiding duplicate billing. Website and Telegram share host quotas; Telegram controls link auto-detection in its own clients.

The browser and host strip recognized key shapes and card numbers before chat storage; deterministic command filters and Jev review outgoing text. Pattern matching cannot recognize every secret; do not ask visitors for passwords. Select the global Jev route in Settings → Safety; a signed off choice bypasses only model review. Add the chosen review key through the secret card (TYPESAFE_API_KEY or OPENROUTER_API_KEY), then enable the bot. TypeSafe receives redacted candidate text and criteria directly from your host at its official API. Changing a provider never copies a key between accounts.

For email handoff, configure Agent J mail and enable handoff.email_enabled. The visitor enters an email in this encrypted chat and requests email contact. In Conversations, the owner reviews the exact address and signs a fixed verification-code email; the code expires after ten minutes and five wrong guesses lock it. After the visitor enters the code in the same session, the owner can review the exact address and reply body and sign each reply. Replies pass redaction and outbound review. At most three emails per conversation, including verification; ambiguous failures count and are never retried automatically. Verification does not log the visitor into a customer tier. An online visitor can still receive signed chat replies within the configured window (48 hours by default).

Jev master switch

All bots follow the Jev mode in Settings → Safety: TypeSafe, OpenRouter or owner-signed off. Enter review keys in the Jev section near the top of Models & API keys. Enabled review still pauses on a missing key or failed decision. Owner-confirmed off sends no review request and keeps local credential, command, permission and tool gates, including human replies. Legacy safety.provider applies only before a global route is selected. The Agent cannot turn review off for the owner.

这一页的 Markdown 原文This page as Markdown: zh.md · en.md