A 1:1 replica of the LangBot Peak Plugin, with more features planned. Compatible with the latest plugin system (not compatible with WEBCHAT). The latest masterpiece jointly crafted by ElvisChenML and Typer_Body - an advanced AI companion plugin featuring a multi-level memory system, character cards, narration, affection system, proactive greetings, and more.
Waifu Plugin
A LangBot plugin that creates realistic chatbots by combining programmatic logic with LLMs, exploring an authentic chat experience.
Language / 语言: 简体中文 | English | Back to Main
The community group is the LangBot community group. For questions about the main program or plugins, please ask there. Check the documentation and Issues before asking.
Important Notice: The Waifu project will only receive essential maintenance updates going forward. Version 2.0 and subsequent features will be presented as an independent project: Husbando.
Features
- Multi-level Memory System: Short-term + long-term memory summarization
- Character Card System: Separate templates for private/group chats
- Story Mode: Narrator, affection system for immersive storytelling
- Humanized Mode: Typing delay, segmented replies for natural conversation
- Proactive Greeting: Automatic initiation when user is inactive
- Emotion Perception: Analyze user emotions and adjust reply tone
- Life Events: Fictional daily activities for characters
- Web Search: AI autonomously decides whether to search
- Jailbreak Mode: Multi-position prompt injection
- Chain of Thought: Enhanced humanization through reasoning
Installation
- Configure the LangBot main program
- Search for
Waifuin the LangBot Plugin Market to install - Or enter the repository URL in the plugin page of the admin panel:
https://github.com/ElvisChenML/Waifu
Or see the detailed Plugin Installation Guide
Configuration
Configure the following parameters in the LangBot plugin management interface after installation:
Basic Settings
| Config Item | Type | Default | Description |
|---|---|---|---|
character | String | default | Character card name. default auto-selects template, off disables preset |
llm_model | Model Selection | First available model | LLM model used by Waifu |
summarization_mode | Boolean | true | Enable long-term memory summarization; if disabled, truncates when limit exceeded |
short_term_memory_size | Integer | 2000 | Maximum character count for short-term conversation memory |
Mode Settings
| Config Item | Type | Default | Description |
|---|---|---|---|
story_mode | Boolean | false | Story mode (narrator, affection system), only effective in private chats |
thinking_mode | Boolean | false | Chain of thought, enhances humanization, may affect reply style |
personate_mode | Boolean | true | Humanized mode: typing delay, segmented replies |
jail_break_mode | Select | off | Jailbreak prompt injection position: off / before / after / end / all |
emotion_mode | Boolean | true | Emotion perception: analyze user emotions, auto-adjust reply tone |
event_mode | Boolean | true | Life events: fictional daily activities for characters, enrich conversation topics |
Reply Settings
| Config Item | Type | Default | Description |
|---|---|---|---|
response_rate | Float | 1.0 | Reply probability after reaching minimum message count in group chat (0.0-1.0) |
group_response_delay | Integer | 0 | Seconds to wait before generating reply in group chat (message merge window) |
person_response_delay | Integer | 5 | Seconds to wait before generating reply in private chat |
Proactive Greeting Settings
| Config Item | Type | Default | Description |
|---|---|---|---|
proactive_greeting_enabled | Boolean | false | Enable proactive greeting when user is inactive |
proactive_target_type | Select | person | Proactive greeting target type: person (private chat) / group (group chat) |
proactive_target_id | String | Empty | Target user/group ID for proactive greeting, leave empty to disable |
Search Settings
| Config Item | Type | Default | Description |
|---|---|---|---|
search_mode | Boolean | false | Web search: AI autonomously decides whether to search and include results |
search_api | Select | duckduckgo | Search engine: duckduckgo / bing / google |
search_api_key | String | Empty | API key for Bing or Google (Google format: api_key:cx_id) |
Commands
Command components are divided into two categories:
- Command: Instructions that need to be actively sent
- EventListener: Automatically triggered by message events, no explicit call required
Basic Commands
| Command | Description |
|---|---|
列出命令 | List all supported commands and descriptions |
全部记忆 | Display all current long and short-term memory |
删除记忆 | Delete all long and short-term memory |
加载配置 | Reload all configuration files |
撤回 | Delete the last dialogue from short-term memory |
Story Commands
| Command | Description |
|---|---|
修改数值[value] | Modify affection value, e.g., 修改数值100 |
态度 | Display current attitude based on affection value |
停止活动 | Stop narrator timer |
开场场景 | Trigger narrator to output opening scene from character card |
旁白 | Manually trigger narrator to advance plot |
继续 | Manually trigger Bot to continue reply and advance plot |
控制人物[character]|[dialogue] | Control character speech or trigger AI to generate character messages |
推进剧情[character_name] | Auto-sequentially call: narrator → control character |
Debug Commands
| Command | Description |
|---|---|
请设计[content] | Design a list |
请选择[question]|[option1,option2] | Choose from given list |
回答数字[question] | Return numeric answer |
回答问题[system_prompt]|[user_prompt] | Q&A mode with custom system prompt |
Character Cards
Directory Structure
data/plugins/Waifu/
├── cards/ # Character card files (.yaml)
├── config/ # Configuration files
└── data/ # Runtime data (conversation logs, memory, etc.)
Template files are stored under plugins/Waifu/templates/. Files under data/plugins/Waifu/ are generated from templates.
Character Card Format
# Required fields
user_name: Wang # How to address the user
assistant_name: Susu # Character name
language: English # Conversation language
Profile:
- Bio: You are... (character description)
# Optional fields
Skills:
- You speak gently with humor, avoiding aggressive words, making people feel comfortable.
Background:
- You chat with the user via QQ.
Rules:
- When introducing yourself, only mention your name, don't include occupation or other info.
Prologue:
- Every day, Wang sells watermelons at the school gate... (opening scene description)
# Story mode related (optional)
max_manner_change: 10
value_descriptions:
- max: 100
description:
- Interaction behavior: Maintain appropriate distance, formal language.
- max: 500
description:
- Interaction behavior: Enter romantic phase, words reveal tenderness and affection.
Using Custom Character Cards
- Create a character card referencing the template
plugins/Waifu/templates/default_person.yaml, e.g.,example.yaml - Place the file in the
data/plugins/Waifu/cards/directory - In LangBot Plugin Management Panel → Waifu → Configuration, set the
characterfield toexample, save to take effect
Using different character cards for specific users/groups: Create or edit
waifu_{session_ID}.yamlunderdata/plugins/Waifu/config/, addcharacter: "example"to override the global configuration.
How It Works
- Message Listening: Listen to private/group chat message events
- Emotion Analysis: Analyze user emotional state (if enabled)
- Memory Retrieval: Retrieve short-term memory and long-term memory summary
- Life Events: Get character's current fictional activities (if enabled)
- Web Search: AI decides whether search is needed (if enabled)
- Chain of Thought: Generate internal reasoning process (if enabled)
- Reply Generation: Generate character reply based on context
- Humanized Output: Simulate typing delay and segmented replies (if enabled)
- Memory Update: Update short-term memory, summarize to long-term memory when necessary
Version History
Click to expand/collapse
Waifu! 3.0
- Compatible with latest plugin system
Waifu 2.0
- Emotion perception: Analyze user emotional state, AI auto-adjusts reply tone
- Life events: Fictional daily activities for characters, enrich conversation topics
- Web search: AI autonomously decides whether to search and include in context
- Migrated to LangBot new plugin architecture, supports plugin management interface configuration
Waifu 1.9
- Support running with other plugins simultaneously, no longer blocks subsequent events
- No longer need to modify random response probability in group message response rules
- Jailbreak adds
allmode, enables all jailbreak positions simultaneously
Waifu 1.6
- Added
character: offoption, disables character preset
Waifu 1.5
- Added group chat blacklist
blacklistconfig item - Added repeat
repeat_triggerconfig item - Added max narrator word count, max thinking word count configs
Waifu 1.4
- Added
thinking_modeto disable chain of thought - Added character card built-in attribute
Prologue(opening scene) and[开场场景]command
Waifu 1.3
- Added integrated jailbreak, supports three positions: before/after/end of system prompt
- Added
continued_ratefor auto-continue speech - Added
display_valueto control whether to display value each time - Added
继续,剧情推进commands
Waifu 1.2
- Group chat supports @ commands
- Messages support images
- Added nickname recognition
Waifu 1.1
- Each session uses independent configuration file
- Added undo function
- Added message accumulation processing
- Added humanized mode (typing time, segmented replies)
Waifu 1.0
- Basic framework: Q&A module, character module, thinking module, memory database, narrator, emotion perception, status bar
Contributing
- Clone LangBot
- Clone Waifu
- Create
plugins/directory in the LangBot root directory - Place Waifu in the
LangBot/plugins/directory
License
MIT
Acknowledgments
- LangBot — Provides Bot functionality and base methods
- LangGPT — Provides character preset prompt paradigm
- Tencent TexSmart — Provides text understanding API
- CyberWaifu, koishi-plugin-aikanojo, Spit_chatBot — Provided ideas and code references
Use Waifu in Feishu/Lark bots, DingTalk bots, WeCom bots, WeChat bots, QQ bots, Slack bots, Discord bots, Telegram bots, LINE Bots, and Matrix Bots.
Host your bot on LangBot Cloud and connect this extension to the collaboration platforms your team already uses.