English | δΈζ | ηΉι«δΈζ | νκ΅μ΄
π Features β’ π Getting Started β’ π¦ Building & Running β’ π οΈ Tech Stack
Erii is an AI group chat bot system based on a multi-dimensional psychological model. Unlike traditional Q&A bots, Erii has an emotion system, long-term memory, conversation flow and proactive behaviors, enabling it to participate in group chats like a real person, interjecting, breaking the ice, and adjusting speaking style based on emotional state.
β¨ Core Features:
- π Emotion System: Based on PAD model, simulating real emotional responses
- π§ Long-term Memory: Multi-dimensional recording of user profiles, preferences, and group chat facts
- π Flow Mechanism: Dynamically adjusts participation depth based on topic engagement
- β‘ Proactive Behaviors: Initiates conversations based on impulse values for ice-breaking and daily interactions
- PAD Three-Dimensional Emotion Model - Pleasure, Arousal, Dominance
- Dynamic Emotion Regulation - Real-time emotional state adjustment based on conversation content
- Emotional Expression - Affects reply tone, emoji usage, reply delay
- Long-term Mood - Maintains baseline mood tone, influencing overall behavioral tendencies
- Multi-dimensional Memory - User profiles, preference settings, factual knowledge, conversation summaries
- Three-level Scope - Global memory, group memory, member-group memory
- Semantic Retrieval - Intelligent memory recall based on vector similarity
- LLM-driven - AI automatically extracts and manages long-term memory
- Engagement Quantification - 0-100 flow value, three-stage state machine
- Topic Matching - Quickly enters flow state when encountering interesting topics
- Focus Mechanism - Locks onto conversation goals during high flow, filtering irrelevant distractions
- Overheat Protection - Simulates fatigue to prevent excessive output
- Impulse Calculation - Calculates desire to speak proactively based on emotion, flow, and keywords
- Three Interjection Modes - Interrupt, Icebreak, Routine
- Social Awareness - Detects serious topics and group emotions to avoid inappropriate comments
- Fatigue Suppression - Accumulates fatigue after proactive speaking to prevent spamming
- Vocabulary Learning - Automatically learns new words and memes from group chats
- Semantic Understanding - Records word meanings, usage scenarios, and tones
- Natural Integration - Naturally uses learned group chat expressions in appropriate scenarios
- Meme Extraction - Automatically extracts trending phrases and memes from group chats
- Vector Storage - Semantic vector representation, supporting similarity retrieval
- Popularity Tracking - Tracks usage frequency and popularity of high-frequency words
| Plugin | Type | Description |
|---|---|---|
| speech | AgentExtension | Text-to-speech plugin using MiniMax TTS |
| lolisuki | RouteExtension | Anime image plugin from lolisuki.cn |
| net-ease-music | PassiveExtension | NetEase music plugin for music cards |
| qa | RouteExtension | AI Q&A plugin with web search |
| qq-face | PassiveExtension | QQ emoji semantic matching plugin |
| reminder | AgentExtension | Scheduled reminder plugin |
| seeddream | RouteExtension | AI image generation plugin |
- Context Understanding - References historical conversations and long-term memory
- Multiple Personas - Supports multiple bot role configurations
- Emotional Resonance - Perceives group atmosphere, adjusts participation style
Before you begin, ensure you have the following installed:
- JDK 17+
- Gradle 8.0+
- NapCat - QQ integration service
- LLM API Key - Google Gemini / DeepSeek / MiniMax API
-
Clone the repository
git clone https://github.com/spcookie/Erii.git cd Erii -
Configure environment variables Copy and edit the environment template:
cp .env.local.template .env.local nano .env.local
Main configuration items:
CHOICE_MODEL: Select LLM provider (GOOGLE / DEEP_SEEK / MINIMAX)- Corresponding API Key configuration
NAPCAT_TOKEN: NapCat authentication tokenENABLE_GROUPS: List of enabled groups
-
Configure the bot Copy and edit the configuration template:
cp application.conf.template application.conf nano application.conf
Main configuration items:
llm.choice-model: Select LLM provider (GOOGLE / DEEP_SEEK / MINIMAX)onebot.bots: QQ bot connection informationgroups.enable-groups: List of enabled groups
-
Start the development server
./gradlew run
Start Erii main service
docker-compose up -dStart NapCat QQ integration service
cd docker/napcat-docker && docker-compose up -dStart Playwright browser service
cd docker/playwright-docker && docker-compose up -d- Language: Kotlin 1.9+
- Web Framework: Ktor 2.3+
- Build Tool: Gradle 8.0+
- Database: H2 (Embedded)
- ORM: Exposed
- Dependency Injection: Koin
- Task Scheduling: JobRunr
- Bot Framework: Mirai + Overflow
- Integration Service: NapCat (WebSocket)
- LLM: Google Gemini API / OpenAI Compatible API
- Plugin Framework: PF4J
- SPI Interface: erii-spi module defines extension points
| Command | Description |
|---|---|
./gradlew compileKotlin |
Compile Kotlin code |
./gradlew build |
Build the entire project |
./gradlew run |
Start development server |
./gradlew buildFatJar |
Build fat JAR with all deps |
./gradlew buildImage |
Build Docker image |
./gradlew test |
Run all tests |
Erii/
βββ erii-common/ # π¦ Common module
β βββ src/main/kotlin/uesugi/common/
β βββ EventBus.kt # Async/sync event bus
β βββ BotRole.kt # Bot role definitions
β βββ ChatToolSet.kt # Chat toolset
β βββ ...
βββ erii-core/ # π§ Core module
β βββ src/main/kotlin/uesugi/
β βββ Application.kt # Ktor application entry
β βββ config/ # Configuration and DI
β β βββ IOC.kt # Koin DI configuration
β β βββ LLMFactory.kt # LLM factory
β β βββ ...
β βββ core/
β β βββ agent/ # AI Agent
β β β βββ BotAgent.kt # Core AI Agent
β β βββ route/ # Routing system
β β β βββ RoutingAgent.kt # LLM routing
β β βββ state/ # Core AI state systems
β β β βββ emotion/ # Emotion system
β β β βββ memory/ # Memory system
β β β βββ flow/ # Flow system
β β β βββ volition/ # Volition system
β β β βββ evolution/ # Evolution system
β β β βββ meme/ # Meme system
β β βββ bot/ # Bot role management
β β β βββ BotRoleManager.kt
β β βββ message/ # Message handling
β β β βββ history/ # History service
β β βββ plugin/ # Plugin implementations
β β βββ rule/ # Rule engine
β β βββ component/ # Components
β β βββ browser/ # Browser (screenshot/markdown fetching)
β β βββ embedding/ # Vector embedding
β β βββ search/ # Search service
β β βββ storage/ # Storage (vector/object)
β βββ server/ # HTTP API routes
βββ erii-spi/ # π SPI interface module
β βββ src/main/kotlin/uesugi/spi/
β βββ AgentExtension.kt # Agent extension interface
β βββ PluginDefinition.kt # Plugin definition annotation
β βββ processor/ # Annotation processor
βββ erii-plugins/ # π¨ Plugin modules
β βββ speech/ # MiniMax TTS
β βββ lolisuki/ # Anime images
β βββ net-ease-music/ # NetEase music search & cards
β βββ qa/ # AI web search Q&A
β βββ qq-face/ # QQ emoji semantic matching
β βββ reminder/ # Scheduled reminders & delayed messages
β βββ seeddream/ # AI image generation
βββ build.gradle.kts # Root build configuration
Erii uses an event-driven architecture with EventBus for system decoupling.
Message Received (NapCat/Mirai)
β
βΌ
GroupMessageEventListener
β
βΌ
HistoryService (Save History)
β
βΌ
RoutingAgent (LLM Intent Classification) / CmdRuleRegister (Command Matching)
β
βΌ
RouteCallEvent (Dispatched via EventBus.postAsync)
β
βΌ
BotAgent (Consumes events, executes AI Agent)
β
βΌ
State Updates (Emotion, Memory, Flow, Volition, Evolution, Meme)
| Extension Type | Description | Matching Method |
|---|---|---|
| AgentExtension | General Agent extension | Combined usage |
| RouteExtension | LLM routing extension | RoutingAgent intent classification |
| CmdExtension | Command extension | /xxx command matching |
| PassiveExtension | Passive extension | Background tasks/event listeners |
This project is open source under the MIT license.