How yethikrishna/yetr-ai-agent works
Project Type & Purpose
• YETR AI Agent is a full-stack, front-heavy web application providing an interactive AI chat interface.
• Frontend: React + Next.js + TypeScript + Tailwind CSS (deployed via GitHub Pages, Vercel, Netlify).
• Backend (YETR Core): FastAPI + Python, powered by PostgreSQL and Redis (not present in the repo tree but described in README).
• External Integrations: Multiple MCP (Model Context Protocol) servers, third-party APIs (GitHub, GitLab, OpenAI, etc.).
File Structure Highlights
• Top-level configs: netlify.toml, vercel.json, docker-compose.yml, DEPLOYMENT.md.
• frontend/: Next.js app code (pages, components/ui, hooks, public/data JSON files).
• src/: A duplicate or static build–oriented copy of the frontend for GitHub Pages (serves index.html + src/pages).
• README & docs/ folder references (architecture.md, deployment.md, etc.) define infrastructure and usage.
Key Components
A. Frontend Layer
• Next.js Server & Static Hosting (Vercel/Netlify/GitHub Pages)
• React components, client-side routing, Tailwind CSS styles
• Public/assets & JSON data for MCP tutorials and specs
B. API Layer (YETR Core)
• FastAPI HTTP endpoints (chat, authentication, MCP routing)
• WebSockets or Server-Sent Events for real-time streaming
• JWT-based auth, RBAC
C. Data Layer
• PostgreSQL for persistent storage (conversations, user profiles)
• Redis for caching & pub/sub (context memory, rate-limiting)
D. External Services
• MCP Servers (GitHub, databases, file systems, email/calendar, Slack, OpenAI)
• Third-party AI services (OpenAI, Anthropic, local models)
• CI/CD pipelines (GitHub Actions, Docker Hub, Kubernetes clusters)
Component Relationships & Data Flow
• Client → Next.js: initial page load, static assets
• Next.js ↔ FastAPI: REST/GraphQL calls for chat, history, MCP orchestration
• FastAPI ↔ PostgreSQL: CRUD for user data & workflows
• FastAPI ↔ Redis: cache lookups, session storage, pub/sub for streaming responses
• FastAPI ↔ MCP Servers: bidirectional API calls, parallel tool execution, error handling
• CI/CD → Docker & K8s: automated builds, container deployment
Architectural Patterns & Principles
• Separation of Concerns: UI vs. API vs. Data
• Micro-orchestration: FastAPI acts as orchestrator for multiple MCP adapters
• Caching & Pub/Sub: Redis for performance & real-time streaming
• Stateless Frontend, Stateful Core: scale frontends horizontally on static hosts, scale API via containers
• Configuration-driven Integrations: JSON/YAML config for dynamic MCP server definitions