Inspiration
Professionals receive hundreds of emails daily. Most AI tools just forward everything — we wanted an agent that actually thinks and decides what matters.
What it does
AI Chief of Staff monitors your email through the Caspian SDK, runs each message through a 4-step LangGraph reasoning pipeline (classify intent → assess urgency → reason → act), and takes one of four actions:
- Auto-reply for routine low-stakes messages
- Send a Telegram approval card with Approve/Edit/Reject buttons for sensitive emails
- Notify only when something needs attention but no reply is needed
- Silently ignore spam and irrelevant messages
The agent learns from every approved reply and improves over time.
How we built it
- Caspian SDK — one handler for Email + Telegram
- LangGraph StateGraph — 8-node decision pipeline
- Featherless.ai — OpenAI-compatible inference with Qwen2.5-7B
- FastAPI — async API server with lifespan management
- SQLAlchemy 2.0 — async ORM with SQLite (Postgres-ready)
- Pydantic v2 — structured LLM outputs with validation and retry
Challenges we ran into
- LangGraph drops state keys with underscore prefixes — learned to use unprefixed keys
- Caspian SDK docs had conflicting information about method signatures — built compatibility fallbacks
- Getting reliable structured JSON output from open-weight models required a retry loop with self-correction
Accomplishments we're proud of
- One Caspian handler genuinely handles both channels with zero duplication
- The approval workflow delivers replies back to the original email thread, not just Telegram
- 18 passing tests with a deterministic fake LLM — no API spend in CI
What we learned
Building a real autonomous agent requires careful reasoning about when NOT to act. The hardest design decision was the approval gate — when should the agent ask permission vs act autonomously?
What's next
- Calendar integration for scheduling awareness
- Embeddings-based pattern matching for smarter auto-reply
- Multi-user support
Built With
- caspian-sdk
- fastapi
- featherless.ai
- langgraph
- pydantic
- python
- sqlalchemy
- sqlite
- telegram
Log in or sign up for Devpost to join the conversation.