Skip to content

Etriti00/Bonsai-Tree

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

7 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸͺ΄ Bonsai Tree

License: MIT TypeScript Next.js Supabase

Bonsai Tree is a powerful AI orchestration platform that coordinates multiple AI services with Claude as the central controller. Build sophisticated AI workflows that combine the strengths of different models to create more powerful applications.

✨ Key Features

  • Multi-AI Orchestration: Seamlessly combine capabilities from Anthropic, OpenAI, Stability AI, ElevenLabs, and more
  • Visual Workflow Builder: Create complex AI workflows with an intuitive visual interface
  • Natural Language Control: Translate user prompts into executable workflows
  • Composable Architecture: Build reusable components and templates for AI workflows
  • Robust Execution Engine: Reliable task sequencing with proper error handling and retries
  • Comprehensive Monitoring: Track performance, costs, and results across all workflow executions

πŸ›οΈ System Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”         β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                 β”‚         β”‚                  β”‚
β”‚   Web Client    │◄───────►│   API Gateway    β”‚
β”‚                 β”‚         β”‚                  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜         β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜
                                       β”‚
                                       β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                                                          β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚
β”‚  β”‚  Workflow   β”‚   β”‚   Workflow    β”‚   β”‚  Execution   β”‚  β”‚
β”‚  β”‚   Service   │◄──►    Manager    │◄──►   Service    β”‚  β”‚
β”‚  β”‚             β”‚   β”‚               β”‚   β”‚              β”‚  β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β””β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜   β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚
β”‚                            β”‚                  β”‚          β”‚
β”‚                            β–Ό                  β–Ό          β”‚
β”‚                    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚
β”‚                    β”‚ Orchestration β”‚  β”‚    Service    β”‚  β”‚
β”‚                    β”‚    Service    β”‚  β”‚   Connectors  β”‚  β”‚
β”‚                    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚
β”‚                                                          β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                            β”‚
                            β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                                                          β”‚
β”‚    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”‚
β”‚    β”‚   Claude    β”‚     β”‚    OpenAI   β”‚    β”‚ Stability β”‚   β”‚
β”‚    β”‚   Service   β”‚     β”‚   Service   β”‚    β”‚  Service  β”‚   β”‚
β”‚    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β”‚
β”‚                                                          β”‚
β”‚    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”                   β”‚
β”‚    β”‚  ElevenLabs β”‚     β”‚    Custom   β”‚                   β”‚
β”‚    β”‚   Service   β”‚     β”‚   Services  β”‚                   β”‚
β”‚    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                   β”‚
β”‚                                                          β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Bonsai Tree's architecture follows a modular, microservices approach:

  • API Gateway: Central entry point for all client requests
  • Workflow Service: Manages workflow definitions and templates
  • Workflow Manager: Coordinates workflow execution and task states
  • Execution Service: Processes tasks with appropriate AI services
  • Orchestration Service: Claude-powered reasoning for workflow optimization
  • Service Connectors: Standardized interfaces to various AI providers

πŸš€ Getting Started

Prerequisites

  • Node.js v18+
  • Docker and Docker Compose
  • Supabase project

Quick Setup

  1. Clone the repository
git clone https://github.com/your-org/bonsai-tree.git
cd bonsai-tree
  1. Environment configuration
cp .env.example .env
# Edit .env with your Supabase credentials and API keys
  1. Install dependencies
npm install
  1. Start all services
# Using Docker Compose (recommended)
docker-compose up -d

# Without Docker (for development)
npm run dev
  1. Verify installation
# Check the execution service
curl http://localhost:3001/health

# Check the web application
open http://localhost:3000

🧩 Core Components

Workflow Service

Manages workflow definitions, including task sequences, dependencies, and inputs.

Workflow Manager

Orchestrates workflow executions, handles task states, and coordinates between services.

Execution Service

Runs individual tasks through appropriate service connectors with error handling.

Orchestration Service

Claude-powered reasoning system for intelligent workflow planning and optimization.

Service Connectors

Standardized interfaces to AI providers with authentication, rate limiting, and error recovery:

  • Anthropic Connector: Integrates with Claude models
  • OpenAI Connector: Supports text and image generation
  • Stability AI Connector: Provides image generation
  • ElevenLabs Connector: Offers text-to-speech conversion

πŸ› οΈ Development

Project Structure

bonsai-tree/
β”œβ”€β”€ apps/
β”‚   └── web/           # Next.js frontend application
β”œβ”€β”€ packages/
β”‚   β”œβ”€β”€ core/          # Shared utilities and interfaces
β”‚   β”œβ”€β”€ monitoring/    # Logging and metrics tools
β”‚   β”œβ”€β”€ service-connectors/ # AI service integrations
β”‚   β”œβ”€β”€ orchestration-engine/ # Claude-powered decision making
β”‚   β”œβ”€β”€ execution-engine/ # Task execution framework
β”‚   └── prompt-engineering/ # Prompt template management
β”œβ”€β”€ services/
β”‚   β”œβ”€β”€ api-gateway/   # API routing and authentication
β”‚   β”œβ”€β”€ workflow-service/ # Workflow definition management
β”‚   β”œβ”€β”€ workflow-manager/ # Workflow execution coordination
β”‚   β”œβ”€β”€ execution-service/ # Task execution processing
β”‚   β”œβ”€β”€ orchestration-service/ # AI-powered planning
β”‚   └── analytics-service/ # Metrics and monitoring
└── docker/            # Containerization configurations

Available Scripts

  • npm run dev: Start all services in development mode
  • npm run build: Build all packages and services
  • npm run lint: Run ESLint across the codebase
  • npm run test: Run Jest tests
  • npm run docker:up: Start all services using Docker Compose
  • npm run docker:down: Stop all Docker Compose services

πŸ“Š Analytics & Monitoring

Bonsai Tree includes a comprehensive analytics system that tracks:

  • Execution Metrics: Performance data for workflows and tasks
  • Service Metrics: Usage patterns across different AI providers
  • Cost Estimation: Approximate costs based on token usage
  • Usage Reporting: Insights into platform usage by users and services

πŸ” Authentication System

Built on Supabase Auth, providing:

  • User Management: Registration, login, and account management
  • API Key Management: Programmatic access to the platform
  • Role-Based Access Control: Admin, Developer, and Viewer roles
  • JWT Token Authentication: Secure web application access
  • API Key Authentication: Server-to-server integrations

πŸ“„ Documentation

For more detailed documentation:

🀝 Contributing

Contributions are welcome! Please see our Contributing Guide for details.

πŸ“œ License

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

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors