Feishu Group Bot
Create the Feishu agent app that puts your team brain inside Feishu groups. Mention the bot to ask with citations, react with an emoji to save a decision.
The Feishu bot puts your team's memory where decisions actually happen. In any bound group:
- Mention it to ask.
@the bot with a question. It answers with a card that cites the memories it used, scoped to the Space bound to that room. - React to save. Add a 📌 reaction to a message. That one message lands in the bound Space as a Memory, with a confirmation card and an undo button.
A room that is not bound to a Space gets silence. The bot never guesses where knowledge should go.
For your agent
Give this line to your agent. The steps below carry exact console labels and deep links, so an agent with browser control can execute them; the final-state checklist at the end is what it should verify:
Read https://mem.nowledge.co/docs/integrations/feishu-bot and follow it to create the Feishu agent app and connect it to Nowledge Mem. Stop and hand back to me for: console login, the App Secret, and the version release approval.Before You Start
- A Feishu tenant where you can create apps in the developer console. Publishing the app version needs a tenant admin's approval.
- A Nowledge Mem Team workspace with the Chat connection surface: Integrations → Chat (群聊). If you do not see the Chat tab, your workspace does not have this capability yet.
- About 10 minutes in the Feishu developer console.
What you must do yourself
Three things are yours, not your agent's: logging in to the Feishu developer console, handling the App Secret (paste it only into the Nowledge Mem credentials field, nowhere else), and approving the app version release as tenant admin. Everything else on this page is agent-executable.
Part 1 — Create the App from the Agent Template
The fastest path is the console's own agent-app template. It pre-provisions the permission bundle, the event configuration with the persistent connection, and the card callback — most of what a manual setup would spend its steps on.
Create the agent app
- Open open.feishu.cn/app (开发者后台, Developer Console).
- At the top is the banner 创建飞书智能体应用 (Create Feishu Agent App): "为你预置智能体所需的权限、事件配置,一键创建后,即可接入你的智能体服务" (pre-provisions the permissions and event configuration an agent needs; one click and you can attach your own agent service). Click 立即创建 (Create Now).
- Give it a name (for example
Nowledge Mem) and a description.
If your tenant's console does not show this template, use the manual path in the appendix at the end — the final result is identical, and the checklist below verifies either one.
Copy the credentials
- In the app's sidebar, open 凭证与基础信息 (Credentials & Basic Info).
- Note the App ID (starts with
cli_) and the App Secret. You will paste both into Nowledge Mem in Part 2.
Verify the presets, top up the gaps
The template pre-configures broadly, but it cannot know this bot's specifics. Walk these four surfaces; on each, whatever is already there stays — you only add what is missing. (Deep links: permissions at open.feishu.cn/app/<App ID>/auth, events and callbacks at open.feishu.cn/app/<App ID>/event.)
a. Bot capability — usually preset, verify.
应用能力 → 机器人 (Features → Bot) should show the bot enabled. Give it the name and avatar people will @ in groups.
b. Permissions — run the bulk import as a top-up. Open 权限管理 (Permissions & Scopes) → 批量导入 (bulk import) and paste exactly this list. Already-granted permissions are simply skipped, so this is safe on top of the template's bundle:
im:message.group_at_msg
im:message.p2p_msg
im:message.reactions:read
im:message.reactions:write_only
im:message:readonly
im:message:send_as_bot
im:chat
im:chat.tabs:write_only
cardkit:card:write
cardkit:card:read
contact:contact.base:readonly
application:application:self_manageDo not add im:message.group_msg (receive all group messages). Its absence is what makes "the bot only ever sees messages that mention it" a permission-layer fact you can verify in your own console, not a promise.
c. Events — verify the mode, add the bot-specific events. Open 事件与回调 → 事件配置 (Events & Callbacks → Event Configuration):
- 订阅方式 (subscription method) should already be 使用长连接接收事件 (receive events over a persistent connection) — the template's default, and the key simplification: no public callback URL, no inbound firewall rule, no tunnel. The connector dials out to Feishu.
- Under 已添加事件 (added events), make sure these three are present; 添加事件 (add event) for any that are missing:
im.message.receive_v1— message received (usually preset)im.message.reaction.created_v1— reaction added (the save gesture)im.chat.member.bot.added_v1— bot added to a group (the self-introduction)
The template may also have subscribed events this bot does not use (docs comments, meeting notes and similar). They are harmless — extra events are delivered and ignored.
d. Card callback — verify.
Still under 事件与回调, open 回调配置 (Callback Configuration; direct link .../event?tab=callback). 订阅方式 should be the persistent connection here too, and 已订阅的回调 should list card.action.trigger (卡片回传交互, card interaction). Without it, every button on the bot's cards — feedback, save-to-team-brain, undo — silently does nothing.
Publish a version
Always manual, on any path:
- Open 版本管理与发布 (Version Management & Release) → 创建版本 (Create Version).
- Fill in the version number and notes, then submit for release.
- A tenant admin approves the release in the Feishu admin console. Permissions and events only take effect after this.
Add the bot to a group
In the Feishu client, open the target group → ⋯ → 设置 (Settings) → 群机器人 (Group Bots) → 添加机器人 (Add Bot), and pick your app.
Part 2 — Connect It in Nowledge Mem
Open Integrations → Chat in Nowledge Mem. The panel walks the same setup and reports real state at each step; a step only shows as done when the server has seen it be true.
- Create the app — the console work above, with the permission list on a copy button.
- Paste the credentials — App ID and App Secret. They are stored encrypted for the workspace and never shown again; a stored secret renders only as its last four characters. Optional settings hold the bot
open_idfor exact-match mention routing (you can add it later). - Connection — watch the status come up. If it shows waiting, the panel displays the exact command to start the connector.
- Bind rooms to Spaces — each group the bot is in appears here; bind it to exactly one Space. This binding decides where questions read from and where saved messages land.
- Send a test message — pick a bound room and send the test card. Open the group; when the card is there, the loop is closed.
Verify It Works
The checklist is about final state, so it holds whichever path created the app. An agent (or you) can check every line:
- App ID starts with
cli_ - 应用能力 → 机器人 shows the bot capability enabled
- 权限管理 (
/app/<App ID>/auth) shows all 12 permissions from step 3b granted, andim:message.group_msgis not granted - 事件配置 (
/app/<App ID>/event) shows 订阅方式 = 长连接, withim.message.receive_v1,im.message.reaction.created_v1, andim.chat.member.bot.added_v1among the added events - 回调配置 (
/app/<App ID>/event?tab=callback) shows 订阅方式 = 长连接, withcard.action.triggersubscribed - 版本管理与发布 shows the version released (线上版本)
- The bot appears in the target group's bot list
- In Nowledge Mem, the Chat panel shows the connection as connected and the room bound to a Space
- The test card arrived in the group
-
@the bot with a question the bound Space can answer: a cited answer card arrives; react to any message with 📌: a save confirmation card arrives
Troubleshooting
- The bot is silent in a group. Almost always by design: the room is not bound to a Space. Bind it in Integrations → Chat → Bind rooms to spaces.
- The bot does not react to plain messages that name it. Also by design. Only real
@mentions are ever delivered to it — that is thegroup_at_msgpermission choice from step 3b. - Card buttons do nothing. The
card.action.triggercallback from step 3d is missing, or the version has not been released. - The save emoji does nothing. Your tenant may use a different emoji key. The connector logs the exact
emoji_typeof every unrecognised reaction; add that key to its configuration. - Events never arrive. Check the version was actually released (step 4) — the app's permissions and event subscriptions are inert until then.
Next Steps
- Bind more rooms — one room, one Space, always explicit.
- Spaces explains the container the bot reads from and writes into.
