Skip to content

AI-powered client onboarding automation using Portia's controllable agent framework - AgentHack 2024 submission

Notifications You must be signed in to change notification settings

ravixalgorithm/aegis-onboarding

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

12 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Aegis Onboarding

AI-powered client onboarding automation using Portia's controllable agent framework - AgentHack 2024 submission

Aegis Onboarding Demo Tech Stack AI Powered

πŸš€ Overview

Aegis Onboarding is a comprehensive AI-powered solution that automates the entire client onboarding process for freelancers and agencies. Built with Portia's controllable agent framework, it handles everything from contract generation to project setup automatically, while maintaining human oversight for critical decisions.

✨ Key Features

  • πŸ€– Full Automation: Complete onboarding workflow from start to finish
  • πŸ‘₯ Human-in-the-Loop: Strategic approval checkpoints for quality control
  • ⚑ Real-time Updates: Live progress tracking via WebSocket connections
  • 🎨 Beautiful UI: Modern, responsive interface with smooth animations
  • πŸ”’ Secure: Enterprise-grade security with comprehensive error handling
  • πŸ”„ Multi-step Workflow: 8 automated onboarding steps including:
    • Google Drive folder creation
    • Contract generation and approval
    • Communication channel setup (Slack/Discord)
    • GitHub repository creation
    • Notion project board setup
    • Welcome email with calendar invite
    • Stripe billing and invoicing

πŸ—οΈ Architecture

Backend (FastAPI + Portia)

  • FastAPI: High-performance Python web framework
  • Portia Integration: AI agent orchestration (simulated)
  • WebSocket: Real-time client-server communication
  • Pydantic: Data validation and serialization
  • Professional Error Handling: Comprehensive error management

Frontend (Next.js + TypeScript)

  • Next.js 14: React framework with App Router
  • TypeScript: Type-safe development
  • Tailwind CSS: Utility-first styling
  • Framer Motion: Smooth animations and transitions
  • React Hook Form + Zod: Form handling and validation
  • Socket Integration: Real-time updates

πŸ“ Project Structure

aegis-onboarding/
β”œβ”€β”€ backend/                    # Python FastAPI backend
β”‚   β”œβ”€β”€ main.py                # Application entry point
β”‚   β”œβ”€β”€ requirements.txt       # Python dependencies
β”‚   β”œβ”€β”€ .env.example          # Environment variables template
β”‚   β”œβ”€β”€ agents/               # Portia agent logic
β”‚   β”‚   β”œβ”€β”€ __init__.py
β”‚   β”‚   └── onboarding_agent.py
β”‚   β”œβ”€β”€ models/               # Data models
β”‚   β”‚   β”œβ”€β”€ __init__.py
β”‚   β”‚   β”œβ”€β”€ client.py         # Client data models
β”‚   β”‚   └── responses.py      # API response models
β”‚   β”œβ”€β”€ routes/               # API endpoints
β”‚   β”‚   β”œβ”€β”€ __init__.py
β”‚   β”‚   └── onboarding.py     # Onboarding routes
β”‚   └── utils/                # Utilities
β”‚       β”œβ”€β”€ __init__.py
β”‚       └── websocket.py      # WebSocket management
β”œβ”€β”€ frontend/                  # Next.js frontend
β”‚   β”œβ”€β”€ package.json
β”‚   β”œβ”€β”€ next.config.js
β”‚   β”œβ”€β”€ tailwind.config.js
β”‚   β”œβ”€β”€ tsconfig.json
β”‚   └── src/
β”‚       β”œβ”€β”€ app/              # App Router pages
β”‚       β”‚   β”œβ”€β”€ layout.tsx    # Root layout
β”‚       β”‚   β”œβ”€β”€ page.tsx      # Main page
β”‚       β”‚   └── globals.css   # Global styles
β”‚       β”œβ”€β”€ components/       # React components
β”‚       β”‚   β”œβ”€β”€ ui/           # Reusable UI components
β”‚       β”‚   β”œβ”€β”€ ClientForm.tsx
β”‚       β”‚   β”œβ”€β”€ StatusDashboard.tsx
β”‚       β”‚   β”œβ”€β”€ ProgressStep.tsx
β”‚       β”‚   └── ApprovalModal.tsx
β”‚       β”œβ”€β”€ hooks/            # Custom hooks
β”‚       β”‚   └── useWebSocket.ts
β”‚       β”œβ”€β”€ types/            # TypeScript types
β”‚       β”‚   └── index.ts
β”‚       └── utils/            # Utility functions
β”‚           └── api.ts        # API client
β”œβ”€β”€ docker-compose.yml        # Development environment
β”œβ”€β”€ .gitignore               # Git ignore rules
└── README.md                # This file

🚦 Quick Start

Prerequisites

  • Node.js 18+ and npm/yarn
  • Python 3.8+ and pip
  • Git for version control

1. Clone the Repository

git clone https://github.com/ravixalgorithm/aegis-onboarding.git
cd aegis-onboarding

2. Backend Setup

cd backend

# Install dependencies
pip install -r requirements.txt

# Copy environment template
cp .env.example .env

# Edit .env with your API keys (optional for demo)
# nano .env

# Start the backend server
python main.py

The backend will be available at http://localhost:8000

3. Frontend Setup

cd ../frontend

# Install dependencies
npm install

# Start the development server
npm run dev

The frontend will be available at http://localhost:3000

4. Using Docker (Alternative)

# Start all services
docker-compose up --build

# Access the application
# Frontend: http://localhost:3000
# Backend API: http://localhost:8000
# API Docs: http://localhost:8000/docs

🎯 Usage

Starting an Onboarding Process

  1. Fill out the client form with:

    • Personal information (name, email, company, phone)
    • Project details (type, scope, budget, timeline)
    • Additional notes
  2. Submit the form to start the automated workflow

  3. Monitor progress in real-time on the status dashboard

  4. Approve critical steps when prompted (e.g., contract review)

  5. Celebrate completion when all steps are finished!

Onboarding Workflow Steps

  1. πŸ“ Create Google Drive Folder - Dedicated project workspace
  2. πŸ“„ Draft Contract - Auto-generated service agreement
  3. βœ… Human Approval - Contract review and approval
  4. πŸ’¬ Setup Communication - Slack/Discord channel creation
  5. πŸ‘¨β€πŸ’» Create GitHub Repository - Code repository with permissions
  6. πŸ“‹ Setup Project Board - Notion workspace configuration
  7. πŸ“§ Send Welcome Email - Welcome message with calendar invite
  8. πŸ’³ Setup Billing - Stripe customer and invoice creation

πŸ”§ Configuration

Environment Variables

Create a .env file in the backend directory:

# Portia Configuration
PORTIA_API_KEY=your_portia_api_key_here

# Google APIs
GOOGLE_DRIVE_API_KEY=your_google_drive_api_key
GOOGLE_DOCS_API_KEY=your_google_docs_api_key

# Communication Platforms
SLACK_BOT_TOKEN=your_slack_bot_token
DISCORD_BOT_TOKEN=your_discord_bot_token

# Development Tools
GITHUB_TOKEN=your_github_token
NOTION_API_KEY=your_notion_api_key

# Email Service
SENDGRID_API_KEY=your_sendgrid_api_key

# Billing
STRIPE_API_KEY=your_stripe_api_key

# Application Settings
APP_ENV=development
FRONTEND_URL=http://localhost:3000

Note: The application works in simulation mode without actual API keys for demonstration purposes.

πŸ“‘ API Documentation

Endpoints

  • POST /api/v1/onboarding/start - Start onboarding process
  • GET /api/v1/onboarding/status/{client_id} - Get onboarding status
  • POST /api/v1/onboarding/approve/{client_id}/{step_id} - Approve/reject step
  • GET /api/v1/onboarding/clients - List all clients
  • WebSocket /ws/{client_id} - Real-time updates

Full API documentation is available at http://localhost:8000/docs when running the backend.

πŸ› οΈ Development

Backend Development

cd backend

# Install development dependencies
pip install -r requirements.txt

# Run with auto-reload
python main.py

# Run tests (if available)
pytest

# Format code
black .

Frontend Development

cd frontend

# Install dependencies
npm install

# Start development server
npm run dev

# Build for production
npm run build

# Run type checking
npm run type-check

# Lint code
npm run lint

🎨 Design System

Color Palette

  • Primary: #6366f1 (Indigo) - Main brand color
  • Secondary: #10b981 (Emerald) - Success states
  • Background: Clean white/gray gradient
  • Typography: Inter font family

Animations

  • Framer Motion for smooth page transitions
  • Progress indicators with real-time updates
  • Celebration effects on completion
  • Loading states with spinners and pulses

Responsive Design

  • Mobile-first approach
  • Tailwind CSS utility classes
  • Flexible grid layouts
  • Touch-friendly interactions

πŸš€ Deployment

Production Build

# Backend
cd backend
pip install -r requirements.txt
uvicorn main:app --host 0.0.0.0 --port 8000

# Frontend
cd frontend
npm run build
npm start

Docker Production

# Build production images
docker-compose -f docker-compose.prod.yml up --build

Environment Setup

  1. Set production environment variables
  2. Configure SSL certificates
  3. Setup reverse proxy (nginx)
  4. Configure monitoring and logging

🀝 Contributing

We welcome contributions! Please follow these steps:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Development Guidelines

  • Follow TypeScript/Python best practices
  • Write meaningful commit messages
  • Add tests for new features
  • Update documentation as needed
  • Ensure responsive design

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ† AgentHack 2024

This project was built for AgentHack 2024, showcasing the power of AI agents in automating complex business processes while maintaining human oversight and control.

Key Innovations

  • Human-AI Collaboration: Perfect balance between automation and human judgment
  • Real-time Orchestration: Live updates and status tracking
  • Production-Ready: Enterprise-grade error handling and security
  • Beautiful UX: Focus on user experience and visual design
  • Scalable Architecture: Modular design for easy extension

πŸ™ Acknowledgments

  • Portia Team for the amazing AI agent framework
  • AgentHack 2024 organizers for the opportunity
  • Open Source Community for the incredible tools and libraries

πŸ“ž Support

For questions, issues, or feature requests:


Built with ❀️ by the Aegis team for AgentHack 2024

About

AI-powered client onboarding automation using Portia's controllable agent framework - AgentHack 2024 submission

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •