How atbaker/dash works
Project Type and Purpose
• DASH is a full-stack AI agent platform (“Executive AI Agent Platform”) composed of two main subsystems:
• agent/ (DigitalOcean Functions as HTTP microservices)
• chat/ (SvelteKit web chat frontend + FastAPI backend with optional Slack bot)
• Purpose: Provide a streaming chat UI and Slack interface that route user queries to a hosted AI agent (on DigitalOcean Gradient™), which in turn invokes specialized tool-functions (SQL queries, web search, Airtable operations) and an optional knowledge base.
File Structure Overview
Top-level directories:
• agent/
– functions/packages/gator/{run_sql_query, web_search, add_airtable_lead, list_airtable_leads, …}
– knowledge_base/ (CSV data files for P&L statements)
• chat/
– backend/ (FastAPI server, Slack integration, environment configs)
– src/ (SvelteKit files: routes, components, API client)
Configuration & orchestration:
• chat/docker-compose.yml, Dockerfile, .env examples, doctl deployment via agent/functions/project.yml
Key Insights from README
• HTTP-based microservice architecture
• DigitalOcean Functions host the business logic/tools
• FastAPI backend streams responses from the AI agent endpoint
• Slack Bot uses Slack Events API + FastAPI routes
• External integrations: Brave Search API, Airtable API, production or sample SQLite DB, DigitalOcean Knowledge Base
Diagramming the Architecture
a. Main Components
1. User Interfaces
– Web Chat (SvelteKit frontend)
– Slack Bot (via FastAPI backend)
2. Chat Backend (FastAPI)
– REST/WebSocket endpoints for frontend streaming
– Slack event handlers (slack_bot.py, chat_service.py)
3. DigitalOcean AI Agent
– Hosted on Gradient™; accepts user prompts and invokes tool routes
4. Functions (agent/functions)
– run_sql_query, web_search, add_airtable_lead, list_airtable_leads packages
– Each deployed as an HTTP endpoint via doctl
5. Knowledge Base (optional)
– DigitalOcean-hosted embeddings index (ingested from agent/knowledge_base CSVs)
6. External Services
– Airtable API
– Brave Search API
– Production database (or local SQLite sample)
b. Relationships & Data Flow
1. Web/App user → SvelteKit frontend → FastAPI streaming endpoint
2. Slack user → Slack platform → FastAPI Slack endpoint
3. FastAPI makes HTTP call → DO Agent endpoint (DO_AGENT_ENDPOINT)
4. DO Agent routes to:
• Knowledge Base (if configured)
• Functions via Function Routes (SQL, Search, Airtable)
5. Functions → External services (DB, APIs) → return JSON results
6. DO Agent composes final response → FastAPI → UI or Slack
c. Architectural Patterns & Principles
• Microservices for tool encapsulation
• Clear separation of concerns: UI, orchestration (FastAPI), business logic (Functions), persistence
• HTTP/REST and streaming (Server-Sent Events or WebSockets)
• Config-driven deployment (doctl, Docker Compose, environment variables)
d. Key Technologies & Frameworks
• Frontend: SvelteKit, Vite, Tailwind CSS
• Backend: Python 3.11+, FastAPI, uv package manager
• Serverless: DigitalOcean Functions with project.yml
• Data stores: SQLite (sample), Airtable, DigitalOcean Knowledge Base
• Integrations: Brave Search API, Slack API