Stelix Command Center
AI productivity command center unifying Gmail and Google Calendar with a Groq-powered multi-step tool-calling agent in Next.js and Express.

Project Overview
Stelix Command Center is an AI-powered communication and scheduling platform engineered to eliminate context switching between email inboxes and calendar applications.
Built with Next.js 16, Express 5, PostgreSQL, Drizzle ORM, and Google OAuth 2.0, the platform connects directly with Gmail and Google Calendar through Corsair integrations.
A conversational AI assistant powered by Groq's high-speed Llama models interprets natural language instructions into multi-step tool calls, enabling users to read emails, draft replies, check schedule availability, and create calendar events from one unified interface.
The Problem & Motivation
- Knowledge workers spend significant time context switching back and forth between email threads and calendar tabs to negotiate meeting times, verify dates, and send invites.
- Standard email and calendar clients treat communication and scheduling as separate silos, requiring repetitive manual copy-pasting of event details and attendee emails.
- The technical goal was to engineer a unified workspace with an AI tool-calling assistant that helps automate communication workflows while keeping actions inspectable by the user.
Architectural Solution
- Architected a decoupled system: a high-speed Next.js 16 frontend paired with a modular Express 5 TypeScript backend running PostgreSQL and Drizzle ORM.
- Implemented Google OAuth 2.0 integration requesting scoped authorization for Gmail and Google Calendar APIs via the Corsair framework.
- Developed an AI Agent service using the Groq SDK that parses natural-language prompts into structured tool executions for email search, draft generation, calendar inspection, and event scheduling.
- Built a persistent conversation and activity feed that displays tool execution results alongside email threads and calendar timelines.
Technology Stack & Evidence
Technologies categorized by source verification and documented implementation scope:
Frontend Client
Backend Service & APIs
AI & Tool Orchestration
Database & Persistence
Architecture & System Flow
Frontend Workspace (client)
Interactive command center housing the unified email client, calendar view, and persistent assistant chat drawer.
Backend Gateway (server)
REST API handling authentication, user session cookies, error handling, and routing between agent and Google services.
AI Agent Engine
Autonomous agent loop analyzing intent, selecting appropriate tool definitions, and formatting tool results for conversational feedback.
Integration & Persistence Layer
Scoped OAuth 2.0 communication with Google Cloud services paired with relational storage for users, accounts, and session metadata.
Core Implemented Features
Natural-Language Tool-Calling Agent
Interprets complex requests like 'Find emails from John and schedule a 30-min sync tomorrow' into structured, sequential API executions.
Unified Gmail Inbox & Thread Reader
Full inbox synchronization allowing users to read message threads, search by keyword or sender, and compose outgoing emails directly.
Google Calendar Event Management
Direct calendar synchronization to view upcoming schedules, check conflicts, and create or update calendar events.
Persistent Chat & Activity History
Preserves conversation threads and audit logs of agent-executed actions with PostgreSQL persistence.
Technical Challenges & Trade-Offs
01.Reliable Multi-Step AI Tool Calling with Groq
Natural language prompts often involve multi-part tasks (e.g., read an email, parse a date, create an event, send a reply) where single-step LLM calls fail or hallucinate parameters.
Implemented an iterative agent loop that evaluates tool-call requests against strict Zod schemas, executes functions sequentially, and feeds tool outputs back to the model until completion.
Structured, step-by-step tool invocation with clear conversational feedback for each action taken.
02.Managing Scoped Google OAuth Credentials
Handling combined Gmail modify and Google Calendar access requires robust token storage and graceful error handling when tokens expire.
Leveraged Corsair integrations with secure server-side credential isolation and structured error boundary middleware to prevent session drops.
Smooth user authentication and reliable access to Google APIs across active sessions.
03.Preventing Context Window Blowup During Thread Parsing
Raw email threads and HTML bodies contain massive metadata, headers, and CSS that rapidly consume LLM context windows.
Built sanitization pre-processors that strip boilerplate MIME wrappers, extract plain-text messages, and truncate non-essential historical quotes before passing content to the agent.
Substantially reduced token consumption and faster response times from Groq inference.