Delego is an AI commerce platform where users delegate shopping and payment tasks to AI agents while maintaining approval and spending controls. Built on Stellar and Soroban, Delego provides secure wallet management, escrow services, settlement mechanisms, and permission systems for trusted agent-mediated commerce.
- AI Agent Delegation: Delegate shopping and payment tasks to specialized AI agents
- Spending Controls: Set approval thresholds and spending limits for agent actions
- Secure Escrow: Stellar-powered escrow contracts protect buyers in agent-mediated transactions
- Permission Management: Granular Soroban-based permissions for delegated spending authority
- Transparent Auditing: Complete audit trail of all agent actions and transactions
- Multi-Agent Orchestration: Coordinated buyer, payment, and delivery agents
- Wallet Integration: Seamless Stellar wallet management and Soroban contract interaction
Delego follows a microservices architecture with clear separation of concerns:
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β User Layer β
β Web App (apps/frontend) β
βββββββββββββββββββββββββββ¬ββββββββββββββββββββββββββββββββββββ
β
v
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β API Gateway β
β (apps/backend/gateway - Port 3000) β
β Auth, Rate Limiting, Routing β
βββββββββββββββββββββββββββ¬ββββββββββββββββββββββββββββββββββββ
β
βββββββββββββββββββΌββββββββββββββββββ
β β β
v v v
ββββββββββββββββ ββββββββββββββββ ββββββββββββββββ
β Orchestrator β β Wallet β β Payments β
β (3010) β β Service β β Service β
β β β (3012) β β (3014) β
ββββββββ¬ββββββββ ββββββββ¬ββββββββ ββββββββ¬ββββββββ
β β β
v v v
ββββββββββββββββ ββββββββββββββββ ββββββββββββββββ
β Agents β β Stellar β β Soroban β
β (3011) β β Network β β Contracts β
β β β β β β
ββββββββββββββββ ββββββββββββββββ ββββββββ¬ββββββββ
β
ββββββββββββββββΌβββββββββββββββ
β β β
v v v
ββββββββββββ ββββββββββββ ββββββββββββ
β Escrow β βPermissionsβ βReputationβ
β Contract β β Contract β β Contract β
ββββββββββββ ββββββββββββ ββββββββββββ
Supporting Services:
- Notifications Service (3015): Customer-facing updates and alerts
- PostgreSQL: User data, delegations, orders, audit logs
- Redis: Session management, rate limiting, workflow state cache
- Quick Start
- Prerequisites
- Development Setup
- Project Structure
- Development Commands
- Architecture
- Smart Contracts
- Testing
- Contributing
- Roadmap
- License
Get Delego running locally in under 5 minutes:
# Clone the repository
git clone https://github.com/your-org/delego.git
cd delego
# Install dependencies
pnpm install
# Configure environment
cp .env.example .env
# Edit .env with your local configuration
# Start infrastructure (PostgreSQL, Redis)
pnpm docker:up
# Run database migrations
pnpm db:migrate
# Seed development data (optional)
pnpm db:seed
# Start all services
pnpm devAccess the applications:
- Web App: http://localhost:3001
- API Gateway: http://localhost:3000
- API Health: http://localhost:3000/health
Ensure you have the following installed:
- Node.js >= 20.0.0 (Download)
- pnpm >= 9.0.0 (Installation)
- Docker >= 24.0.0 (Download)
- Docker Compose >= 2.20.0
- Rust >= 1.70.0 (Installation)
- Soroban CLI (optional, for contract development) (Setup Guide)
rustup target add wasm32-unknown-unknownCopy the example environment file and configure it:
cp .env.example .envKey environment variables:
DATABASE_URL: PostgreSQL connection stringREDIS_URL: Redis connection stringSTELLAR_NETWORK:testnetormainnetSOROBAN_RPC_URL: Soroban RPC endpointJWT_SECRET: Secret for JWT token signing
Start PostgreSQL and Redis using Docker Compose:
pnpm docker:upApply migrations and seed development data:
pnpm db:migrate
pnpm db:seedBuild Soroban smart contracts:
cd contracts
cargo build --target wasm32-unknown-unknown --releaseStart all services in development mode:
# Start everything
pnpm dev
# Or start individual services
pnpm dev:web # Customer web app -> http://localhost:3001
pnpm dev:gateway # API gateway -> http://localhost:3000
pnpm dev:orchestrator # Orchestrator -> http://localhost:3010
pnpm dev:agents # Agents service -> http://localhost:3011
pnpm dev:wallet # Wallet service -> http://localhost:3012
pnpm dev:payments # Payments service -> http://localhost:3014
pnpm dev:notifications# Notifications -> http://localhost:3015Delego is organized as a monorepo using pnpm workspaces:
delego/
βββ apps/ # Applications
β βββ frontend/ # Customer web application (Next.js)
β βββ backend/ # Backend microservices
β βββ gateway/ # API gateway with auth & routing
β βββ orchestrator/ # Purchase workflow coordination
β βββ wallet/ # Stellar wallet & Soroban integration
β βββ payments/ # Payment & escrow coordination
β βββ notifications/ # Email & push notifications
βββ agents/ # AI agent runtime and packages
βββ contracts/ # Soroban smart contracts
β βββ escrow/ # Escrow contract for purchase funds
β βββ permissions/ # Delegated spending permissions
βββ packages/ # Shared libraries
β βββ ui/ # React component library
β βββ sdk/ # API client SDK
β βββ types/ # TypeScript type definitions
β βββ utils/ # Shared utilities (logger, HTTP, etc.)
βββ database/ # Database schema & migrations
β βββ schema/ # Initial schema
β βββ migrations/ # Versioned migrations
β βββ seed/ # Development seed data
βββ infrastructure/ # Infrastructure as code
β βββ docker/ # Docker configurations
β βββ terraform/ # Terraform configurations
β βββ monitoring/ # Monitoring & alerting
β βββ deployment/ # Deployment scripts
βββ tests/ # Test suites
β βββ unit/ # Unit tests
β βββ integration/ # Integration tests
β βββ e2e/ # End-to-end tests
β βββ contracts/ # Smart contract tests
βββ docs/ # Documentation
β βββ architecture/ # Technical architecture docs
β βββ api-reference.md # API documentation
β βββ contributor-guide.md# Contributor guide
β βββ vision.md # Product vision
βββ scripts/ # Utility scripts
β βββ setup/ # Setup scripts
β βββ generate/ # Code generation
β βββ deploy/ # Deployment utilities
βββ .github/ # GitHub configurations
β βββ workflows/ # CI/CD workflows
β βββ ISSUE_TEMPLATE/ # Issue templates
βββ .env.example # Environment variables template
βββ docker-compose.yml # Local development infrastructure
βββ pnpm-workspace.yaml # pnpm workspace configuration
βββ package.json # Root package.json
βββ tsconfig.base.json # Base TypeScript configuration
| Command | Description |
|---|---|
pnpm install |
Install all workspace dependencies |
pnpm build |
Build all packages, apps, services, and contract wrappers |
pnpm dev |
Start web app and all services in parallel |
pnpm clean |
Clean build artifacts and node_modules |
| Command | Description | Port |
|---|---|---|
pnpm dev:web |
Start customer web app | 3001 |
pnpm dev:gateway |
Start API gateway | 3000 |
pnpm dev:orchestrator |
Start orchestrator service | 3010 |
pnpm dev:agents |
Start agents service | 3011 |
pnpm dev:wallet |
Start wallet service | 3012 |
pnpm dev:payments |
Start payments service | 3014 |
pnpm dev:notifications |
Start notifications service | 3015 |
| Command | Description |
|---|---|
pnpm typecheck |
Type-check all TypeScript projects |
pnpm lint |
Run ESLint on all packages |
pnpm lint:fix |
Auto-fix linting issues |
pnpm format |
Format code with Prettier |
| Command | Description |
|---|---|
pnpm test |
Run all test suites |
pnpm test:unit |
Run unit tests |
pnpm test:integration |
Run integration tests |
pnpm test:contracts |
Run Soroban contract tests |
pnpm test:e2e |
Run end-to-end tests |
pnpm test:watch |
Run tests in watch mode |
pnpm test:coverage |
Generate test coverage report |
| Command | Description |
|---|---|
pnpm docker:up |
Start PostgreSQL and Redis containers |
pnpm docker:down |
Stop and remove infrastructure containers |
pnpm db:migrate |
Apply pending database migrations |
pnpm db:migrate:rollback |
Rollback last migration |
pnpm db:seed |
Seed development data |
pnpm db:reset |
Reset database (migrate + seed) |
| Command | Description |
|---|---|
cd contracts && cargo test |
Run contract tests |
cd contracts/escrow && cargo build --target wasm32-unknown-unknown --release |
Build escrow contract |
cd contracts/permissions && cargo build --target wasm32-unknown-unknown --release |
Build permissions contract |
Delego implements a layered microservices architecture:
| Service | Responsibility | Tech Stack |
|---|---|---|
| Gateway | HTTP API, authentication, rate limiting, request routing | Node.js, Express |
| Orchestrator | Customer purchase workflow coordination | Node.js, TypeScript |
| Agents | AI agent runtime and execution | Node.js, LLM APIs |
| Wallet | Stellar keys, Soroban permissions, transaction signing | Node.js, Stellar SDK |
| Payments | Escrow coordination, settlement, payment events | Node.js, Soroban |
| Notifications | Customer notifications and templates | Node.js, SendGrid |
- PostgreSQL: Users, delegations, orders, audit logs
- Redis: Sessions, rate limits, workflow state cache
- Soroban: Escrow funds, delegated permissions, reputation scores
- Authentication: JWT via gateway; wallet addresses as identity
- Authorization: Role-based access control with wallet-based permissions
- Spending Controls: Permissions contract and wallet service policy checks
- Observability: Structured logging with correlation IDs
- Security: End-to-end encryption for sensitive data
For detailed architecture documentation, see ARCHITECTURE.md and docs/architecture/.
Delego uses Soroban smart contracts for trust-critical operations:
- Holds purchase funds in secure escrow
- Releases funds upon delivery confirmation
- Supports refunds for disputed transactions
- Time-locked release mechanisms
- Manages delegated spending authority
- Enforces spending limits and approval thresholds
- Supports time-based permission grants
- Revocable permissions
- Tracks cumulative reputation scores
- Merchant and agent reputation
- Influences escrow terms and limits
For contract development details, see contracts/README.md.
Delego employs a comprehensive testing strategy:
- Unit Tests: Test individual functions and components in isolation
- Integration Tests: Test service interactions and database operations
- Contract Tests: Test Soroban contract logic with soroban-sdk
- E2E Tests: Test complete user flows from web app to blockchain
# Run all tests
pnpm test
# Run specific test suites
pnpm test:unit
pnpm test:integration
pnpm test:contracts
pnpm test:e2e
# Run tests with coverage
pnpm test:coverageFor testing guidelines, see tests/README.md.
We welcome contributions from the community! Please follow these guidelines:
- Fork the repository
- Create a feature branch:
git checkout -b feat/your-feature - Make your changes with clear, focused commits
- Ensure all tests pass:
pnpm test - Submit a pull request with a detailed description
- TypeScript: Strict mode, no
anywithout justification - Rust: Follow Soroban best practices, include contract tests
- Commits: Use Conventional Commits
- Documentation: Update READMEs and add comments for complex logic
- Ensure your code passes all linting and type checks
- Add tests for new functionality
- Update documentation as needed
- Use the PR template and describe your changes
- Request review from maintainers
For detailed contribution guidelines, see CONTRIBUTING.md and docs/contributor-guide.md.
- Monorepo scaffold
- CI/CD pipeline skeleton
- Docker Compose for Postgres and Redis
- Contributor onboarding docs
- Soroban local dev environment
- API gateway with auth middleware
- Shared types and SDK package
- Wallet service with Stellar account and Soroban permissions support
- Escrow contract deploy and test flow
- Orchestrator purchase workflow skeleton
- Customer web app for wallet connection and delegations
- Buyer agent runtime
- Spending limit enforcement through wallet and permissions services
- Approval flow before escrow funding or settlement
- Customer notifications
- Terraform infrastructure
- Monitoring and alerting
- Mainnet deployment
- Security audit
- Merchant application for sellers
- Mobile applications (iOS/Android)
- Delivery agent integration
- Multi-chain support
- Advanced AI agent capabilities
For detailed roadmap, see ROADMAP.md.
- Architecture Overview
- Contributing Guide
- Code of Conduct
- API Reference
- Technical Architecture
- Contributor Guide
Found a bug or have a feature request? Please:
- Check existing GitHub Issues
- Use the appropriate issue template
- Provide reproduction steps, expected vs actual behavior
- Include environment details (OS, Node version, etc.)
Security is paramount for Delego. If you discover a security vulnerability:
- Do not open a public issue
- Email us at: security@delego.dev
- Include details and reproduction steps
- We will respond promptly and coordinate disclosure
Delego is open-source software licensed under the MIT License.
- Built with Stellar and Soroban
- Inspired by the vision of trustworthy AI-agent commerce
- Community contributors and supporters
Made with β€οΈ by the Delego community