I designed XiaoxingAI as an inspectable automation pipeline rather than a black-box chatbot: Gmail ingestion, AI analysis, persistence, notification, and optional reply workflows are separated into clear layers.
I kept each user’s Gmail credentials, settings, worker state, Telegram bot binding, prompts, and processed email records isolated at the application and database level.
I combined local llama.cpp inference with OpenAI-compatible APIs, Redis caching, structured output validation, and fallback paths to balance cost, latency, and reliability.