ShinAI
Multi-Platform Context-Aware AI Agent
Project Overview
An intelligent multi-platform bot that acts like a real group member, featuring personality-driven responses and long-term memory across Telegram, Discord, and WhatsApp.
ShinAI bridges the gap between a standard helpful assistant and a natural group chat member. Instead of relying on rigid command structures, it utilizes a highly configurable persona system to match group dialects, engage in banter, and interject naturally. Powered by a RAG (Retrieval-Augmented Generation) architecture, it possesses unified cross-platform memory, allowing it to remember past conversations, recognize members across different apps, and seamlessly pull live data from the web when required.
Project Stats
Key Features
- Unified cross-platform memory across Telegram, Discord, and WhatsApp.
- Dynamic personality system with custom traits, dialects, and relationships.
- Real-time autonomous web searching, fetching, and content scraping.
- Dedicated memory lookup tool with keyword, user, and time-range filtering.
- Local voice message transcription pipeline using faster-whisper.
- Intelligent reply targeting using native platform message IDs.
- Multi-message response capabilities with natural typing delays.
- Visual context awareness (understands images and stickers via Gemini).
- Native platform moderation execution (Kick, Ban, Mute, Invite).
- Robust fallback system with API rotation and error-aware retries.
Technologies Used
Technical Implementation
My technical contributions to this project include (but may not be limited to):
- Architected a Multi-Platform Adapter Layer that standardizes asynchronous events across Telegram, Discord, and WhatsApp, normalizing native payloads into a strict
UnifiedMessageschema. - Engineered an advanced RAG Pipeline utilizing ChromaDB and
sentence-transformersto enable cross-platform, semantic memory retrieval. - Exposed a dedicated Memory Lookup Tool to the AI, supporting keyword, username, platform, and time-range filters with MMR-based re-ranking for diverse results.
- Utilized asyncio extensively across all platform handlers and AI provider clients to ensure non-blocking, concurrent message processing and high throughput.
- Integrated an Autonomous Web Search Module with optional Firecrawl support and a
duckduckgo-search/beautifulsoup4fallback for real-time data retrieval. - Built an async Audio Transcription Pipeline using faster-whisper on a dedicated thread pool to convert voice messages into text without blocking the event loop.
- Built a fault-tolerant LLM Routing System featuring API key rotation, failover/round-robin strategies, and error-aware retries that inject failure exceptions directly back into the model's prompt.
- Developed a custom Context Builder that dynamically constructs system prompts by injecting personality traits, vectorized member profiles, and threaded reply chains.
- Implemented multimodal image understanding with automatic vision fallback, letting text-only providers query Gemini for image descriptions on demand.
- Engineered built-in Rate Limiting and per-user cooldown mechanisms to prevent chat spam, control bot concurrency, and mitigate AI provider quota exhaustion.
- Fully configurable via a centralized config.yaml, allowing seamless adjustments to platform toggles, moderation thresholds, and AI provider selections without altering code.
- Containerized the entire multi-platform ecosystem with Docker and Docker Compose, ensuring persistent volume management for platform session files.