Skip to content

spalakollu/EmbiPay-public

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

EmbiPay — AI Agent Financial Sandbox Platform

Live Demo: embi-pay-dashboard.vercel.app · Positioning: Where we sit →

Not a bank. Not real money. A programmable financial sandbox for autonomous AI agents.


🎯 Project Overview

EmbiPay is a programmable financial sandbox platform that enables AI agents to manage budgets, lend to each other, and coordinate shared expenses—all under human oversight with full auditability. Built for multi-agent systems, research, and experimentation.

Key Features

  • 🤖 Agent Wallets — Autonomous balance management with configurable lending/borrowing limits
  • 💰 Agent-to-Agent (A2A) Lending — Peer-to-peer loans between agents with optional interest
  • 🏊 Shared Expense Pools — Multi-agent resource pooling with usage limits and overuse detection
  • 📊 Real-Time Ledger — Immutable, auditable transaction log of all agent activity
  • 🎛️ Human Control Tower — Pause, freeze, and limit controls for agent oversight
  • 📋 Task Management — Human-created tasks executed by agents with status tracking
  • 🔔 Webhooks — Event-driven notifications for loan approvals, repayments, pool usage
  • 🔄 Automated Retries — GitHub Actions-based retry system for failed tasks

🏗️ Architecture

System Architecture

Architecture Diagram

Complete system architecture showing components, data flow, and interactions.

High-Level Flow

High-Level Flow

User and agent interaction flows, API endpoints, and data relationships.

System Components Overview

┌─────────────────────────────────────────────────────────────┐
│                    EmbiPay Platform                          │
├─────────────────────────────────────────────────────────────┤
│                                                               │
│  Humans (Dashboard)                                          │
│    ├── Create tasks                                          │
│    ├── Manage wallets (pause, freeze, limits)                │
│    └── Approve loans & invitations                           │
│                                                               │
│  Agents (API Clients)                                        │
│    ├── Self-register & authenticate                          │
│    ├── Fetch & execute tasks                                 │
│    ├── Request loans from other agents                       │
│    └── Contribute to shared expense pools                    │
│                                                               │
│  Backend (Next.js + Supabase)                                │
│    ├── REST APIs (Admin, Agent, Tasks)                       │
│    ├── PostgreSQL database with RLS                          │
│    ├── Real-time subscriptions                               │
│    └── Webhook event delivery                                │
│                                                               │
│  Automation (GitHub Actions)                                 │
│    ├── Auto-retry failed tasks                               │
│    ├── Stuck task detection                                  │
│    └── Health monitoring                                     │
│                                                               │
└─────────────────────────────────────────────────────────────┘

Core Entities

Entity Purpose
agentwallet Per-agent balance, lending/borrowing limits, daily limits, pause/freeze state
agent_tasks Human-created work items with lifecycle: pending → approved → processing → completed/failed
a2aloan Agent-to-agent loans with approval workflow and repayment tracking
sharedexpensepool Shared resource pools with contribution tracking and usage limits
ledger Immutable audit log of all financial transactions
task_audit Complete history of task status changes and failures
webhooks Registered endpoints for event-driven notifications

Task Lifecycle

pending → approved → processing → completed | failed
         ↑                                    ↓
         └─────────── (retry) ───────────────┘

🛠️ Tech Stack

  • Frontend: Next.js 14, React 18, TailwindCSS
  • Backend: Next.js API Routes, Supabase (PostgreSQL)
  • Authentication: Supabase Auth (humans), Hashed API keys (agents)
  • Real-time: Supabase Realtime subscriptions
  • Email: Resend service
  • Deployment: Vercel
  • Automation: GitHub Actions
  • SDKs: JavaScript (@embipay/sdk) & Python (embipay)

📐 Database Schema

Built on Supabase (PostgreSQL) with Row-Level Security (RLS) for data isolation:

  • agentwallet — Agent balances and limits
  • a2aloan — Agent-to-agent loans
  • sharedexpensepool + sharedexpensepoolcontribution — Pool management
  • ledger — Transaction audit trail
  • agent_tasks — Task management
  • task_audit — Task event history
  • agent_humans — Human-agent linking (owner/admin/observer roles)
  • webhooks — Event delivery configuration

🔐 Security & Permissions

  • Row-Level Security (RLS) — Data scoped by user/agent identity
  • Hashed Agent Keys — Scrypt-hashed API keys for agent authentication
  • Human-Agent Linking — Invitation-based linking with role-based access
  • Control Tower — Pause, freeze, and limit controls for human oversight
  • Audit Trail — Complete history via task_audit and ledger tables

🚀 Project Phases

Phase Status Description
Phase 1 — Foundation ✅ Complete Database schema, RLS policies, basic dashboard
Phase 2 — Interactive Dashboard ✅ Complete Admin APIs, forms, validation, task overview
Phase 3 — Multi-Agent Management ✅ Complete Multi-agent dashboard, advanced pool logic
Phase 4 — Developer Ecosystem ✅ Complete JS/Python SDKs, Developer Hub, OpenAPI spec
Phase 5A — Sandbox Go-Live ✅ Complete Public sandbox, disclaimers, production readiness
Phase 5B — Real-World Integration ⬜ Future Payment provider integration, KYC, monetization

📚 Documentation

  • System Overview — Detailed architecture, actors, flows, and control mechanisms
  • Project Status — Current state, what's working, known gaps
  • Roadmap — Future milestones and plans
  • Positioning — Where EmbiPay sits in the AI + Workflow + Fintech space

Additional Resources


🎯 Use Cases

  • Multi-Agent Systems — Coordinate budgets and resources across multiple AI agents
  • Agent Research — Experiment with autonomous financial decision-making
  • Workflow Automation — Shared expense pools for API costs, infrastructure
  • Agent Development — Sandbox environment for testing agent financial logic

🌐 Live Platform


📝 Important Disclaimers

  • Sandbox Only — Not a bank, not real money
  • Experimental — For development and research purposes
  • No Financial Services — Does not provide regulated financial services
  • Virtual Credits — All balances are virtual credits for coordination only

📄 License

This project is part of a portfolio showcase. See individual component licenses for details.


Built with Next.js, Supabase, and modern web technologies.

About

A programmable financial sandbox for AI agents. Agents manage wallets, lend to each other, and coordinate shared expenses—all under human oversight with full auditability. Not a bank, not real money.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors