Skip to content

A scalable, multi-tenant orchestration SaaS for agentic, event-driven workflows—built natively on microservices for cloud-scale, extensibility, and B2B isolation.

Notifications You must be signed in to change notification settings

techsouvik/orchestration-system

Repository files navigation

Agentic Orchestration Builder (B2B, Microservices)

A scalable, multi-tenant orchestration SaaS for agentic, event-driven workflows—built natively on microservices for cloud-scale, extensibility, and B2B isolation.

Features

  • Pure Microservices Architecture: Independent services for orchestration, memory, tenancy, agents, UI, and more.
  • Scalability: Each service can scale horizontally—minimize bottlenecks, maximize flexibility.
  • Event-Driven Agentic Flow: Mix deterministic/DAG logic with agentic, contextual, and human-in-the-loop execution.
  • Contextual Memory (Graph & Vector): Durable, organizational "memory" for recalling historical workflows and decisions.
  • Multi-Tenant Isolation: Secure and separated data/workflow per business.

Architecture

Microservices List

  • API Gateway (Port 3000) - Single entrypoint; auth, routing, rate limiting
  • Tenant Management (Port 3001) - Business org CRUD, SSO, quotas
  • Orchestration Engine (Port 3002) - Executes workflows as DAG and event-driven graph
  • Event Bus (Port 3003) - Central event router/broker (Redis Streams)
  • State Management (Port 3004) - Stores/replays workflow execution state
  • Agent Registry (Port 3005) - Agent/tool registration, metadata
  • Agent Execution (Port 3006) - Executes agents with provided workflow context
  • Knowledge Graph (Port 3007) - Neo4j/ArangoDB; models relationships, entities, executions
  • Vector Memory (Port 3008) - Qdrant/Weaviate—semantic embeddings & similarity search
  • Context Retrieval (Port 3009) - Combines graph/vector for hybrid context recall (GraphRAG)
  • Memory Indexer (Port 3010) - Background indexer; embeds data/events into graph/vector DBs
  • Human-in-the-Loop (Port 3011) - Approval queue, notifications, intervention UI
  • Workflow Editor Backend (Port 3012) - Workflow CRUD/validation, template management
  • Analytics/Observability (Port 3013) - Traces, metrics, dashboards, per-tenant visibility

Tech Stack

  • Language: TypeScript (Node.js 20+)
  • Service Framework: Express.js (REST APIs)
  • Monorepo Management: Turborepo
  • Event Bus: Redis Streams
  • Job Queue: BullMQ (Redis)
  • Relational Database: PostgreSQL 15+
  • Knowledge Graph: Neo4j 5.x or ArangoDB 3.x
  • Vector Database: Qdrant 1.7+ or Weaviate 1.24+
  • Containerization: Docker, Docker Compose
  • Authentication: JWT with tenant claims
  • Observability: Winston logging, health checks

Getting Started

Prerequisites

  • Node.js 20+
  • Docker & Docker Compose
  • PostgreSQL 15+ (if running locally)
  • Redis 7+ (if running locally)

Quick Start

  1. Clone the repository

    git clone <repository-url>
    cd lyzr-orchestration
  2. Install dependencies

    npm install
  3. Build shared packages

    cd packages/shared-types && npm run build
    cd ../shared-utils && npm run build
    cd ../shared-config && npm run build
    cd ../..
  4. Start infrastructure services

    docker-compose up -d postgres redis
  5. Build and start microservices

    # Build all services
    npm run build
    
    # Start services in development mode
    npm run dev

Docker Setup

  1. Start all services with Docker

    docker-compose up -d
  2. View logs

    docker-compose logs -f
  3. Stop services

    docker-compose down

Environment Configuration

Copy the example environment file and customize:

cp env.example .env

Key environment variables:

  • DB_HOST, DB_PORT, DB_NAME, DB_USER, DB_PASSWORD - PostgreSQL configuration
  • REDIS_HOST, REDIS_PORT - Redis configuration
  • JWT_SECRET - JWT signing secret (change in production!)
  • Service ports for each microservice

API Documentation

Authentication

All API requests (except public endpoints) require a JWT token in the Authorization header:

Authorization: Bearer <your-jwt-token>

Tenant Management API

Base URL: http://localhost:3001/api/v1 or via Gateway: http://localhost:3000/api/v1/tenant-management

Create Tenant

POST /tenants
Content-Type: application/json

{
  "name": "Acme Corporation",
  "domain": "acme.com",
  "adminEmail": "[email protected]",
  "adminName": "John Admin",
  "adminPassword": "securepassword"
}

List Tenants

GET /tenants?page=1&limit=50

Get Tenant

GET /tenants/{tenantId}

Update Tenant

PUT /tenants/{tenantId}
Content-Type: application/json

{
  "name": "Updated Company Name",
  "settings": {
    "quotas": {
      "maxWorkflows": 200
    }
  }
}

Create User

POST /users
Content-Type: application/json

{
  "tenantId": "tenant_123",
  "email": "[email protected]",
  "name": "Jane User",
  "role": "developer",
  "password": "userpassword"
}

Authenticate User

POST /auth/login
Content-Type: application/json

{
  "email": "[email protected]",
  "password": "securepassword"
}

API Gateway

Base URL: http://localhost:3000

  • /health - Gateway health check
  • /services - List available services
  • /api/v1/* - Proxied requests to microservices

Development

Project Structure

lyzr-orchestration/
├── apps/                          # Microservices
│   ├── api-gateway/              # API Gateway service
│   ├── tenant-management/        # Tenant Management service
│   ├── orchestration-engine/     # Orchestration Engine service
│   └── ...                       # Other microservices
├── packages/                     # Shared packages
│   ├── shared-types/            # TypeScript type definitions
│   ├── shared-utils/            # Common utilities
│   └── shared-config/           # Configuration management
├── docker-compose.yml           # Docker orchestration
├── package.json                 # Root package.json
└── turbo.json                   # Turborepo configuration

Building Services

# Build all services
npm run build

# Build specific service
cd apps/tenant-management
npm run build

Running in Development

# Start all services in watch mode
npm run dev

# Start specific service
cd apps/tenant-management
npm run dev

Testing

# Run tests for all services
npm test

# Run tests for specific service
cd apps/tenant-management
npm test

Current Implementation Status

✅ Completed (Day 1 Foundation)

  • Project bootstrapping with Turborepo
  • Shared packages (types, utils, config)
  • Tenant Management Service
    • PostgreSQL integration
    • CRUD operations for tenants and users
    • JWT authentication
    • Database schema and migrations
  • API Gateway Service
    • Request routing and proxying
    • Authentication middleware
    • Rate limiting
    • WebSocket support
  • Docker Compose setup
  • Database initialization scripts

🚧 In Progress

  • Orchestration Engine Service
  • Event Bus Service
  • Agent Registry & Execution Services

📋 Planned

  • Memory layer (Vector DB, Knowledge Graph)
  • Context Retrieval Service
  • Human-in-the-Loop Service
  • Workflow Editor Backend
  • Analytics/Observability Service
  • Demo UI/Frontend

Sample Data

The system includes sample data for testing:

Sample Tenants:

  • Tenant ID: tenant_sample_1, Domain: sample1.com
  • Tenant ID: tenant_sample_2, Domain: sample2.com

Sample Users:

Health Checks

Each service exposes a health check endpoint:

# Check API Gateway health
curl http://localhost:3000/health

# Check Tenant Management health
curl http://localhost:3001/health

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests
  5. Submit a pull request

Development Guidelines

  • Use TypeScript for all new code
  • Follow the existing code structure
  • Add proper error handling and logging
  • Write tests for new functionality
  • Update documentation as needed

License

MIT

Support

For questions and support, please open an issue in the repository.

About

A scalable, multi-tenant orchestration SaaS for agentic, event-driven workflows—built natively on microservices for cloud-scale, extensibility, and B2B isolation.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published