A motive-driven, multi-agent personal AI system. Three core AI agents (Health, Finance, Productivity) plus dynamically generated sub-agents, all orchestrated by a Chief of Staff manager agent. Your primary life goal drives every decision.
Built for the Snowflake Hackathon with Snowflake Cortex (Llama 3.1 70b), CrewAI, Composio, and Skyfire.
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Frontend (Next.js :3000) β
β Landing Β· Onboarding Β· Dashboard Β· Chat Β· Briefing Β· Agents β
ββββββββββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββββββββ
β REST API
ββββββββββββββββββββββββββββββββΌβββββββββββββββββββββββββββββββββββββββ
β FastAPI Backend (:8000) β
β β
β βββββββββββββββ ββββββββββββββββ βββββββββββββββββββββββββββββ β
β β Routers β β Services β β CrewAI Crew β β
β β β β β β β β
β β /chat β β cortex β β βββββββββββββββββββββββ β β
β β /onboard β β snowflake β β β Manager Agent β β β
β β /dashboard β β notification β β β (Chief of Staff) β β β
β β /agents β β composio β β ββββββββββ¬βββββββββββββ β β
β β /briefing β β skyfire β β β delegates β β
β β /actions β β x_service β β ββββββββββΌβββββββββββββ β β
β β /recommend β β ml_cache β β β Health β Finance β β β β
β β /settings β β β β β Agent β Agent β β β β
β β /notifs β β β β ββββββββββ€ββββββββββ β β β
β β /ml β β β β β Productivity β β β β β
β βββββββββββββββ ββββββββββββββββ β β Agent β β β β β
β β ββββββββββββββββ β β β β
β β + Dynamic Sub-Agentsβ β β β
β ββββββββββββββββββββββββ β β β
ββββββββ¬βββββββββββββββββββ¬βββββββββββββββββββ¬βββββββββββββββββββ β
β β β β
ββββββββΌβββββββ ββββββββββΌβββββββββ ββββββββΌβββββββββββββββ β
β Snowflake β β Composio MCP β β Skyfire MCP β β
β Cortex LLM β β β β β β
β (Llama 3.1 β β Gmail β β KYA+PAY Tokens β β
β 70b) β β Discord β β Autonomous β β
β β β Google Calendar β β Payments β β
β FORECAST β β Google Sheets β β β β
β ANOMALY β β β β β β
β COMPLETE β β β β β β
βββββββββββββββ βββββββββββββββββββ βββββββββββββββββββββββ
The system uses CrewAI hierarchical orchestration β a Manager (Chief of Staff) delegates tasks to specialist agents based on your motive priorities:
User Message
β
ββ Greeting ββββββββββββββββββββββββ Fast response (no crew)
ββ "Log meal: ..." βββββββββββββββββ Cortex extraction β DB insert
ββ "Log expense: ..." ββββββββββββββ Cortex extraction β DB insert + alerts
ββ "Approve coffee machine" ββββββββ Skyfire token β purchase approved
ββ Complex query βββββββββββββββββββ Full crew orchestration
β
βΌ
Manager delegates to Health / Finance / Productivity agents
β
βΌ
Agents query Snowflake, call tools, reason together
β
βΌ
Synthesized response aligned with your life motive
The system auto-detects patterns in your data and suggests specialized agents:
- Logged 5 coffees this week? β "Coffee Spending Monitor" agent suggested
- Sleep declining 3 days in a row? β "Sleep Optimizer" agent suggested
- X/Twitter shows fitness interest? β "Workout Planner" agent suggested
You approve or dismiss β approved agents join the crew.
/recommendations/generate
β
βΌ
3 domain agents each propose 3 recommendations (9 total)
β
βΌ
Manager reviews against budget + motive alignment scores
β
βΌ
Final 3 selected (deduplicated vs last 7 days)
β
βΌ
User approves in chat β Skyfire KYA+PAY JWT created
β
βΌ
Token stored, decision logged, notification sent
Agent event β enqueue_notification_event() β notification_events table
β
schedule_dispatch()
β
resolve channel from
user preferences
β
βββββββββββββββββββΌββββββββββββββββββ
βΌ βΌ βΌ
Gmail Discord Calendar
(Composio) (Bot API) (Composio)
Each domain (health, finance, productivity) routes to the user's preferred channel. Supports Gmail, Discord DM (rich embeds with purchase buttons), Google Calendar events, and Google Sheets logging.
| Layer | Technology |
|---|---|
| Frontend | Next.js 16, React 19, TypeScript, Tailwind CSS 4, Recharts |
| Backend | Python FastAPI, CrewAI (hierarchical process) |
| LLM | Snowflake Cortex β Llama 3.1 70b |
| Database | Snowflake (12 tables + ML functions: FORECAST, ANOMALY_DETECTION) |
| Notifications | Composio MCP (Gmail, Calendar, Sheets) + Discord Bot API |
| Payments | Skyfire MCP (KYA+PAY token generation) |
| Social | X/Twitter API (interest analysis, agent suggestions) |
12 Snowflake tables powering the system:
| Table | Purpose |
|---|---|
user_profiles |
User identity, motive, context document (VARIANT) |
meals_log |
Meal tracking with nutritional breakdown |
transactions |
Expense tracking with categories |
health_metrics |
Sleep, exercise, mood, water intake |
tasks |
Productivity task management |
agent_definitions |
Dynamic sub-agent registry (suggested/active/hibernated) |
agent_decisions |
Audit trail for cross-agent decisions |
weekly_reports |
Generated briefings with motive progress scores |
onboarding_conversations |
Multi-turn onboarding transcripts |
notification_events |
Outbox for preference-based notifications |
purchase_recommendations |
Skyfire-powered purchase suggestions |
x_activity |
X/Twitter data for interest analysis |
Cortex ML Functions used:
FORECAST()β Spending prediction with confidence intervalsANOMALY_DETECTION()β Health metric anomaly detectionCOMPLETE()β LLM completion (Llama 3.1 70b)
All routes prefixed with /api/:
| Route | Method | Description |
|---|---|---|
/chat |
POST | Send message to agent crew (intent detection + orchestration) |
/onboard/start |
POST | Begin guided onboarding survey |
/onboard/oneshot |
POST | One-shot onboarding with free-form description |
/onboard/respond |
POST | Continue onboarding conversation |
/onboard/complete |
POST | Generate context document from transcript |
/dashboard |
GET | Aggregated metrics (30-day rolling) |
/dashboard/charts |
GET | Time-series chart data (14-day) |
/agents |
GET | List all agents (active, suggested, hibernated) |
/agents/detect-patterns |
POST | Trigger sub-agent suggestion |
/agents/analyze-x |
POST | Analyze X/Twitter for agent suggestions |
/agents/approve/{id} |
POST | Approve a suggested agent |
/agents/hibernate/{id} |
POST | Temporarily disable an agent |
/briefing/generate |
POST | Generate weekly intelligence briefing |
/briefing |
GET | Retrieve cached briefing |
/actions/log-meal |
POST | Log meal with NLP extraction |
/actions/log-expense |
POST | Log expense with NLP extraction |
/recommendations/generate |
POST | Generate purchase recommendations |
/recommendations |
GET | List purchase recommendations |
/recommendations/{id}/approve |
POST | Approve + create Skyfire token |
/recommendations/{id}/dismiss |
POST | Dismiss recommendation |
/settings/{user_id} |
GET | Get communication preferences |
/settings/{user_id}/communication |
PUT | Update channel preferences |
/notifications |
GET | List notification events |
/notifications/dispatch |
POST | Trigger pending notification dispatch |
βββ backend/
β βββ app/
β β βββ main.py # FastAPI entry point
β β βββ config.py # Environment configuration
β β βββ crew/
β β β βββ config/
β β β β βββ agents.yaml # Agent definitions (role, goal, backstory)
β β β β βββ tasks.yaml # Task templates with variable interpolation
β β β βββ crew.py # @CrewBase class + run_crew() + run_recommendation_crew()
β β β βββ agent_factory.py # Dynamic sub-agent generation + pattern detection
β β β βββ tools.py # @tool functions (Snowflake queries, logging, payments)
β β βββ routers/ # FastAPI route handlers
β β β βββ chat.py # Chat with intent detection + purchase approval
β β β βββ onboarding.py # Multi-turn onboarding survey
β β β βββ dashboard.py # Metrics + charts + AI insights
β β β βββ agents.py # Agent CRUD + pattern detection
β β β βββ briefing.py # Weekly briefing generation
β β β βββ actions.py # Meal/expense logging
β β β βββ recommendations.py # Purchase recommendations + Skyfire
β β β βββ settings.py # Communication preferences
β β β βββ notifications.py # Notification management
β β βββ services/
β β βββ snowflake_client.py # Connection pooling + queries
β β βββ cortex.py # Snowflake Cortex LLM + ML wrappers
β β βββ notification_service.py # Outbox pattern notifications
β β βββ composio_service.py # Composio MCP integration
β β βββ skyfire_service.py # Skyfire payment tokens
β β βββ x_service.py # X/Twitter API
β βββ requirements.txt
βββ frontend/
β βββ src/
β βββ app/ # Next.js App Router pages
β β βββ page.tsx # Landing page
β β βββ onboarding/ # Onboarding flow
β β βββ dashboard/ # Metrics dashboard
β β βββ chat/ # Chat interface
β β βββ briefing/ # Weekly briefing
β β βββ agents/ # Agent management
β β βββ settings/ # Preferences
β βββ components/ # Reusable UI components
β β βββ Sidebar.tsx
β β βββ ChatMessage.tsx
β β βββ MetricCard.tsx
β β βββ AgentCard.tsx
β β βββ NebulaCanvas.tsx
β βββ lib/
β βββ api.ts # Axios API client
βββ sql/
βββ setup.sql # Database + table creation
βββ seed_data.sql # Sample data
- Python 3.11+
- Node.js 18+
- Snowflake account with Cortex enabled
- Composio API key (for Gmail, Calendar, Sheets)
- Skyfire API key (for payment tokens)
Run in Snowflake SQL editor:
-- Create database and tables
SOURCE sql/setup.sql;
-- Insert sample data (replace USER_ID_HERE with your UUID)
SOURCE sql/seed_data.sql;cd backend
python -m venv venv
source venv/bin/activate
pip install -r requirements.txt
# Configure environment
cp .env.example .env
# Edit .env with your Snowflake, Composio, Skyfire, Discord credentials
# Run
python -m uvicorn app.main:app --reload --port 8000cd frontend
npm install
npm run devOpen http://localhost:3000 to start.
Required in backend/.env:
# Snowflake
SNOWFLAKE_ACCOUNT=your_account
SNOWFLAKE_USER=your_user
SNOWFLAKE_PASSWORD=your_password
SNOWFLAKE_WAREHOUSE=COMPUTE_WH
SNOWFLAKE_DATABASE=LIFE_OS
SNOWFLAKE_SCHEMA=PUBLIC
SNOWFLAKE_PAT=your_pat_token
# Integrations
COMPOSIO_API_KEY=your_composio_key
SKYFIRE_API_KEY=your_skyfire_key
# Discord Bot (for notification DMs)
DISCORD_BOT_TOKEN=your_bot_token
DISCORD_USER_ID=your_discord_user_id
# X/Twitter (optional, for social analysis)
X_API_KEY=your_key
X_API_SECRET=your_secret
X_ACCESS_TOKEN=your_token
X_ACCESS_SECRET=your_secret- Motive-Driven AI β Every agent decision is aligned with your primary life goal
- Hierarchical Agent Orchestration β Manager delegates to specialists, synthesizes unified responses
- Dynamic Sub-Agents β Auto-detected from your data patterns, user-approved
- Natural Language Logging β "Log meal: chicken salad 450cal" β structured data
- Autonomous Purchases β Skyfire-powered payment tokens for agent-recommended products
- Multi-Channel Alerts β Gmail, Discord (rich embeds), Calendar, Sheets β per-domain preferences
- Snowflake ML β Spending forecasts and health anomaly detection built into the data layer
- Weekly Briefings β Cross-agent intelligence reports with motive progress scoring