Cortex is a high-performance, agentic personal assistant designed to manage your professional and personal life autonomously. Deeply integrated with Google Workspace, it doesn't just "chat"—it executes workflows, manages schedules, and maintains a long-term semantic memory of your preferences.
- Agentic Reasoning: Powered by LangGraph and Gemini 2.0 Flash, the agent performs complex multi-step reasoning before acting.
- Workspace Mastery: Native integration with Gmail and Google Calendar. Extract PDF data, manage threads, and schedule meetings relative to "next Tuesday".
- Semantic Long-Term Memory: Uses pgvector to remember facts, preferences, and projects across conversations.
- Glassmorphism UI: A premium, responsive interface featuring dynamic mesh backgrounds and real-time interaction states.
- User Profiles & Personalization: Tailor the AI's communication style (e.g., "concise and technical" vs. "formal and polite").
- Safety First: Mandatory "Human-in-the-loop" approval for emails and calendar event creation.
Cortex is built on a ReAct (Reason + Act) pattern. Instead of a linear flow, the agent operates in a graph-based cycle:
- Ingest: Receive user query + dynamic context (Time, Location).
- Retrieve: Semantic search via
pgvectorfor relevant long-term memories. - Reason: LLM decides if a tool (Gmail/Calendar) is needed.
- Act: Execute tool and observe result.
- Refine: Update status and respond to user.
- Core: FastAPI (Asynchronous)
- AI Orchestration: LangGraph (StateGraph)
- Database: PostgreSQL with
pgvector - Integrations: Google APIs (OAuth2, Gmail v1, Calendar v3)
- Framework: Next.js 14 (App Router)
- Styling: Vanilla CSS (Custom Glassmorphism system)
- Real-time: Axios-based polling and dynamic state management
- Cloud: AWS (ECS Fargate, RDS PostgreSQL, ALB)
- IaC: Terraform
- CI/CD: GitHub Actions
- Docker & Docker Compose
- Google Cloud Platform Project (with Gmail/Calendar APIs enabled)
- Google API Key (for Gemini)
# Clone the repository
git clone https://github.com/Subash-Saajan/cortex_agent.git
cd cortex_agent
# Configure Backend
cp backend/.env.example backend/.env
# Update backend/.env with your Google Credentials & DB URL
# Configure Frontend
cp frontend/.env.example frontend/.envdocker-compose up --build- Access Frontend:
http://localhost:3000 - Access Backend API:
http://localhost:8000
- Row-Level Isolation: Users can only access their own messages, memories, and workspace data.
- Secure Auth: Uses Google OAuth 2.0 for identity and JWT for session management.
- Data Sovereignty: Implemented "Right to be Forgotten" logic—users can wipe all chat/memory data while keeping their configuration.
This project is licensed under the MIT License - see the LICENSE file for details.
Built by Subash.