Improve AI assistant performance in group chats#16
Open
lechatg wants to merge 3 commits intoevahteev:mainfrom
Open
Improve AI assistant performance in group chats#16lechatg wants to merge 3 commits intoevahteev:mainfrom
lechatg wants to merge 3 commits intoevahteev:mainfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Enhance Conversation Management & Per-Group Bot Customization
Overview
This PR implements comprehensive bot enhancements focused on group/admin functionality, introducing customizable group personas, LangGraph-based conversation management, and improved user experience for community-focused features such as agent tools for RAG search group chat messages history.
Key Changes
1. 🎭 Group Persona System
Admins can now define custom bot personalities per group with instant updates (no redeployment needed). For use cases check Bot README.
How it works:
Group Admin View:
2. 🧠 LangGraph Architecture Migration
Context:
Following the repository-wide LangGraph migration strategy introduced in PR #13, this PR completes the Telegram bot integration with the Luka Agent framework. The bot maintains its own isolated
lg_lukabot/module to ensure standalone functionality while benefiting from the unified LangGraph architecture used across the platform.Why isolated in the bot subproject?
Key improvements: Eliminates manual Redis history management through automatic checkpointing, enables multi-turn tool execution loops, persists conversation state across restarts, unifies web and Telegram under a shared state schema, and provides built-in LangSmith observability.
Module Structure:
lg_lukabot/- Complete LangGraph integrationstate.py- Agent state schema with conversation historygraph.py- Graph structure (agent → tools → workflow_update → END)nodes.py- Graph nodes with persona injection & system prompt buildingtools.py- LangChain tool wrappers (KB search, workflows, YouTube, etc.)integration.py- Main agent execution with streaming supportcheckpointer.py- Redis-based state persistence3. 📚 Enhanced Knowledge Base Integration
Every group automatically becomes a searchable knowledge base. Now integrated with LangGraph for better context awareness.
Features:
4. ⚙️ Group Admin Controls
Fine-grained control over bot behavior in groups.
AI Assistant Modes:
Moderation Tools:
5. 📦 Dependency Optimization
Removed:
openai-whisper+torch- Unused dependencies (~2GB+ of unnecessary packages)Added:
langchainandlanggraphpackagesResult: Faster installation, smaller Docker images, no build toolchain required.
6. 📝 Comprehensive
.env.exampleBOT_TOKENandOPENAI_API_KEY7. 🐳 Docker Infrastructure Improvements
Elasticsearch Integration: added Elasticsearch 8.11.0 to
docker-compose.ymlfor Knowledge Base functionalityUnique Service Naming:
redis-sol-atlas-bot,elasticsearch-sol-atlas-botto prevent conflicts when running multiple projects simultaneouslyDockerfile Fix: changed
CMDfrompython ./luka_bot/__main__.pytopython -m luka_botto resolveModuleNotFoundErroron container startup8. 📖 Bot README Update with Real-World Use Cases
Added: Four detailed use cases showing what the bot can do:
Quick Start redesign:
Checklist