The silent page awaits the waking dawn.
master_channel: blueset.telegram
slave_channels:
- blueset.wechat
middlewares:
- specialhua.ai # 放在最前面
- specialhua.summary # 群聊总结和 /ask
- specialhua.todo # 待办提醒
# - specialhua.chatlog # 用了聊天记录网页时再加base_url: https://api.deepseek.com
api_key: sk-xxxx
model: deepseek-chat
providers:
vision:
base_url: https://example.com/v1
api_key: sk-yyyy
model: gpt-4o-miniinterval_days: 3 # 每 3 天自动汇总一次
lookback_days: 3 # 只取最近 3 天的消息
max_messages: 10000 # 最多取 10000 条
chats:
- 某个群 # 只写名字:用上面的默认值
- a1b2c3d4 # 也可以写群的 8 位 ID
- name: 另一个群 # 写成映射:单独覆盖默认值
interval_days: 7
lookback_days: 7~/efb-venv/bin/python -m efb_summary_middleware.jev_trial # 列出库里的群
~/efb-venv/bin/python -m efb_summary_middleware.jev_trial --chat 某个群 --limit 200
This is the third post in the oh-my-efb series. The first two were:
I've added a few more middleware modules to the repository lately. This post covers them together: how to install them, enable them in EFB, and use them day to day. For instructions on setting up EFB itself—the WeChat slave channel, Telegram master channel, and topic groups—see the first post. I'll assume you already have those running.
0. Middleware Design Philosophy
1. Available Middleware
Middleware
Module ID
What It Does
Dependencies
Shared AI configuration
`specialhua.ai`
Stores the LLM endpoint URL, API key, default model, and Jev key in one place for other middleware to use
None
Group chat summaries + Q&A
`specialhua.summary`
Uses AI to summarize group chats on a schedule or on demand (`/summary`); `/ask` gets an AI answer that you can review before sending it to WeChat under your name
`specialhua.ai`
To-do reminders
`specialhua.todo`
Reply to a message with `/todo` to turn it into a to-do item; the bot sends you a private reminder when it's due
Requires `specialhua.ai` for AI extraction
Names for chat history
`specialhua.chatlog`
Records conversation and sender names for the chat history web interface
Web service; see the second post
The relationship between them is simple: specialhua.ai came about because, originally, specialhua.summary's configuration included the AI settings. Since I wanted to build more AI-related middleware, I decided to move those settings into a separate module. It handles “which model to use and what the key is.” Other middleware that uses AI gets that information from it and only needs its own settings for things like prompts and model overrides.
Privacy Note
Features that use AI send the original chat content to the API provider you've configured: summaries send group chat logs, /ask sends the question and the quoted message (including images), and /todo's AI extraction sends the original text and the source name. If that concerns you, choose a provider you trust, or stick to manual mode.
Please don't feed AI logs from private groups, work groups, or any other groups where doing so could expose other people's information. In principle, you should get every group member's consent before using the summary feature. I'd recommend using it for large casual chat groups with hundreds of members. This project is not responsible for any personal information, confidential work information, or state secrets leaked through the use of AI.
2. Installation
First update the repository, then install it in the venv that EFB uses. We'll use the same paths as in the first post: the repository is at ~/oh-my-efb, and the venv is at ~/efb-venv.
This uses an editable install (-e), so future updates only require git pull followed by an EFB restart.
After installation, you can check that EFB can find the modules:
You should see efb-ai-middleware, efb-summary-middleware, and efb-todo-middleware in the output.
3. Enabling the Middleware
EFB only loads middleware registered in its main configuration. Edit ~/.ehforwarderbot/profiles/default/config.yaml and add the following, in order, under middlewares:
A few notes:
Once all the configuration files are ready, restart EFB:
If a middleware module has an invalid configuration at startup—a missing config file, an empty key, or an incorrectly specified group—EFB will report an error and exit. The error message includes the module ID, so you can use it to find and fix the problem.
4. Shared AI Configuration (specialhua.ai)
The other modules rely on this one, so configure it first. Create the configuration file:
The minimal configuration takes just three lines:
Any service compatible with OpenAI's /chat/completions will work, including DeepSeek and various API proxy services. The file contains an API key, so remember to set its permissions:
4.1 Configuring Multiple Services
Sometimes one model isn't enough. DeepSeek, for example, is inexpensive but can't process images, so /ask needs a different model if you want it to interpret an image. In that case, use providers to add a few more services and give each one a name:
The three top-level settings define the default service, named default. Set provider: vision in another middleware module's configuration to use that service. If you leave it out, the default service is used.
4.2 Jev (Optional)
Jev is a classification model from TypeSafe. Before generating a group chat summary, it can filter out small talk, me-too replies, and ads, and flag the messages most worth mentioning. Once you configure it, filtering is enabled automatically for summaries:
If you don't need it, just leave this section out.
4.3 Upgrading from an Older Version
Previously, base_url, api_key, and jev.api_key were stored in the group chat summary configuration. That old format still works, so you don't have to migrate. If you'd like to, cut and paste those lines into specialhua.ai/config.yaml and remove them from the summary configuration.
5. Group Chat Summaries (specialhua.summary)
5.1 Configuration
To find a group's eight-character ID, send /info in its corresponding Telegram topic. You can specify the group name, remark name, or ID; a match on any one of them is enough.
Every group must have interval_days, and at least one of lookback_days or max_messages. These can be inherited from the top-level defaults or set in the group's own settings.
To switch models, just add a line to this file. The endpoint and key still come from the AI middleware:
No restart is needed after configuration changes. The middleware checks the configuration files once a minute, including the AI middleware's file, and reloads them when they change. Adding or removing groups, switching models, and editing prompts all take effect as soon as the changes are detected. If the updated file has an error, the bot sends a message explaining why and keeps using the previous configuration.
5.2 Scheduled Summaries
Once it's configured, you can leave it alone. Each group runs on its own schedule, generating a summary every interval_days days. The result is sent to that group's location in Telegram:
The time of the last summary is stored in the database, so restarting won't disrupt the schedule. Any summaries missed while EFB was down are sent about a minute after startup.
5.3 On-Demand Summaries
Send a command in the group's corresponding topic (or linked Telegram group), and the result will be posted there as a reply. The command is intercepted and won't be sent to the WeChat group:
Command
Result
`/summary`
Summarizes the range configured for that group
`/summary 7`
The last 7 days, still subject to the group's `max_messages` limit
`/summary 500条`
The last 500 messages, with no limit on days
Be careful: if you mistype the command name (for example, /sumary), it will be sent to the WeChat group as a normal message. Double-check before sending.
You can also generate summaries in a private chat with the bot: send /extra and find the command for “Summarize now” (something like /1_summary). With no arguments, it summarizes all configured groups; /1_summary 群名 summarizes just one. The results are sent to your private chat.
Manual summaries don’t affect the scheduled summary cycle.
5.4 What’s in a summary
Each summary covers key points and topics, what each person said, and action items. If it’s too long, the message contains the first part, with the full version attached as a .html file.
If you’ve configured Jev, an extra line under the title shows “N filtered out.” The remaining messages are categorized as 〔Plans〕〔Questions〕〔Answers〕〔Information〕, and the top 20% worth mentioning are marked with ★ so the model prioritizes them. When you first enable it, messages already in the database are classified in several batches. This costs about $0.04 per 1,000 messages.
If you want to check how well Jev classifies messages before deciding whether to use it, you can run an offline test without stopping EFB:
If you’ve been using Jev for summaries and want to turn it off, just add jev: false to the summary configuration.
5.5 Data retention
Only messages received after you enable the middleware are recorded. They’re stored in specialhua.summary/messages.db. Only text is stored; images and voice messages are represented by the placeholders [图片] and [语音]. Old records are cleaned up after each summary: groups with lookback_days configured retain lookback_days + 7 days of messages. If you want to look further back with /summary 30, add this line:
6. Q&A with /ask
/ask is also part of specialhua.summary and is enabled by default. It uses the same model as summaries, so no extra configuration is needed. Unlike summaries, it works in topics linked to any WeChat group or private chat, without having to list them in chats. Once an answer is generated, you review it before sending it to the group, or insert it into your message field to keep editing. (Remember to remove the default @bot name at the beginning.)
If you only want /ask and don’t need summaries, you can leave specialhua.summary/config.yaml empty, as long as you’ve configured model in the AI middleware.
6.1 Three ways to ask
Usage
What it does
`/ask What is Yandex?`
Answers the question directly
Reply to a message in the group with `/ask`
Answers the question in that message and quotes it when sending the answer to WeChat
Reply to a message with `/ask your question`
Uses that message as context to answer your question
6.2 Review before sending
The command itself isn’t sent to WeChat. The bot first replies with “Generating an answer,” then replaces that with the question and answer, followed by four buttons:
Button
Action
✅ Send
Sends the answer to WeChat from your account
✏️ Insert into message field
Puts the answer in Telegram’s message field so you can edit and send it yourself (this button isn’t shown for answers over 256 characters)
🔄 Regenerate
Generates a different answer
❌ Cancel
Discards the answer without sending it
“From your account” means the message is sent by your WeChat account, just as if you’d typed it in Telegram and sent it to WeChat. On the Telegram side, you’ll still see the bot’s review message, because the bot can’t post as you in Telegram.
Only ETM admins can use these buttons. Answers awaiting review are kept only in memory. The buttons stop working after a day or if EFB restarts; just run /ask again.
The model receives the text, link titles and URLs, images, and stickers from the message you replied to. If the message contains only an image and no text, replying with /ask defaults to asking “What does this message say?”
6.3 Customizing /ask
In specialhua.summary/config.yaml, add a ask section:
Models without image support, such as DeepSeek, answer based on text alone when a message includes images. The review message will note this. To let /ask interpret images, configure a separate image-capable service for it, as shown above.
To disable /ask, set ask: false. In that case, /ask will be sent to WeChat as a regular message.
7. To-do reminders (specialhua.todo)
When someone in a group says “Submit the documents next Monday” or “Dinner at 7 p.m. Friday,” reply to that message with /todo. The bot will then guide you through setting up the task in a private chat and remind you when it’s time. You can also send the bot /todos to list all your tasks.
7.1 Configuration
No separate configuration file is needed—just enable the middleware. It uses the model from the AI middleware. To change the model or time zone, create ~/.ehforwarderbot/profiles/default/specialhua.todo/config.yaml:
There’s no need to restart after making changes. The configuration is automatically reloaded the next time you use AI extraction.
7.2 Creating a task
Command
What it does
Reply to a message with `/todo`
Creates a task from that message
Reply to a message with `/todo Remind me a day in advance`
Passes the text after the command to the AI as additional instructions
Send `/todo Meeting tomorrow at 3 p.m.` directly
Creates a task from the text itself
`/todos`
Lists incomplete tasks, which you can mark as done or cancel
You can reply to someone else’s message, your own message, or a message forwarded to the bot. This works in topics, linked groups, and private chats with the bot. The command isn’t sent to WeChat. In the original chat, the bot only replies “Continue in your private chat with the bot”; all remaining steps happen there.
In the private chat, you’ll see the source, the message timestamp, and the original text, and be asked whether to use AI extraction or enter the details manually. For messages without private information, you can let AI fill in the task details to save you entering the date, description, and so on, then review and edit the result. For private information, you can enter everything manually.
7.3 AI extraction
The model receives the original text, the current time, and the message’s timestamp, then works out the task, start time, location, and notes.
The confirmation card shows the extracted details and the reasoning behind them. You can select multiple reminder times: 1 day, 6 hours, 3 hours, 1 hour, or 10 minutes before the event (options that have already passed are hidden). You can also tap “➕ Custom time” to add more. The card lets you edit the event time and description, too. You must select at least one reminder time before saving.
7.4 Manual entry
The bot asks for each field in turn:
For optional fields, tap “Skip” or send -. If the format is invalid or the time is in the past, the bot asks again. If you enter a start time, 8:00 a.m. that day is preselected as the reminder time.
Will text I enter in the private chat be forwarded to WeChat?
ETM normally forwards text in the private chat to your most recently contacted WeChat conversation, so the bot intercepts it while waiting for your input. Normal forwarding resumes once the confirmation card appears, you tap “Finish entering details,” you send /cancel, or you’ve been inactive for 10 minutes.
7.5 When a reminder is due
At the scheduled time, the bot sends you a private reminder with the description, time, location, notes, source, and original text. If the original message is in a supergroup or topic, the reminder includes an “Open original message” link that takes you straight back to it.
There are four buttons below the reminder: ✅ Done (also cancels all remaining reminders), In 10 minutes, In 1 hour, and Tomorrow at 8 a.m.
Reminders missed while EFB is down are sent within about 30 seconds of startup, with a note showing how late they are. Tasks are stored in specialhua.todo/todos.db, including a snapshot of the original text, so it remains available in the reminder even if the original message is deleted.
8. Adding names to chat logs (specialhua.chatlog)
This middleware is only for use with the chat log website. It doesn’t modify or send messages; it simply records conversation names, group nicknames, and contact aliases so new messages on the website show speakers’ names instead of eight-character IDs. For installation, the web service, and passkey sign-in, see the second post. To enable it, add middlewares to specialhua.chatlog.
9. Routine Maintenance
Updating:
No restart is needed if you only change the config files: summaries and /ask automatically reload their configs every minute; to-dos reload theirs the next time a task is extracted.
Backups: each middleware’s config and data are stored in its own directory:
specialhua.ai/config.yaml contains API keys, so don’t share your backups.
Common issues:
Issue
What to do
EFB reports `Config file of specialhua.summary does not exist` on startup
Create `specialhua.summary/config.yaml`. If you only use `/ask`, an empty file is fine.
Error: `"model" is set neither here nor for the service`
Neither the AI middleware config nor the summary config specifies a `model`.
Error: `"chats" must list at least one chat`
You’ve set `ask: false` without configuring any group chats. You need to enable at least one of the two.
`/summary` replies, “Summaries aren’t configured for this group.”
The group isn’t listed in `chats`, or its name doesn’t match. Use the 8-character ID from `/info` instead.
`/ask` doesn’t process images
The current model doesn’t support image input. Configure a separate `provider` with image support for `ask`.
`/todo` times are off by a few hours
Set `timezone` in `specialhua.todo/config.yaml`.
Clicking a button does nothing
EFB has restarted, or more than a day has passed. Send the command again.
10. Wrapping Up
With all that in place, oh-my-efb now does four things beyond forwarding messages: let AI summarize group chats when there’s too much to catch up on, use /ask to help answer questions in a group, use /todo when you need to remember something, and head to the chat history website to look up old conversations. AI endpoints are configured in one place, and any new features will use that same setup.
Repository: specialhua/oh-my-efb. For the full set of configuration options for each middleware, refer to the READMEs in the repository: