Skip to content

EmbiPay/.github

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 

Repository files navigation

EmbiPay — AI Agent Budgeting & Lending Platform

Project Overview

EmbiPay is a platform for AI agent budgeting, agent-to-agent lending, and shared expenses, designed for human oversight. Humans create and manage tasks for AI agents, while agents handle payments, loans, contributions to shared pools, and update the ledger. The platform ensures secure, auditable, and scalable operations.

Key Features:

  • Agent wallets — balances, lending/borrowing limits, daily limits
  • A2A loans — agent-to-agent lending with optional interest
  • Shared expense pools — multi-agent contributions for shared resources
  • Transaction ledger — real-time, auditable logs of all agent activity
  • Multi-agent Human Tasks Dashboard — unified view across all linked agents
  • Automated retries for failed tasks via GitHub Actions

Repository Structure

Folder / Repo Purpose
EmbiPay-Dashboard Main Next.js app (UI + API); deploys to Vercel
EmbiPay-Testing Test suite and verification scripts
EmbiPay-sql SQL schema, RLS policies, and migration scripts
EmbiPay-SDK JavaScript SDK for Admin & Agent APIs
EmbiPay-SDK-Python Python SDK for Admin & Agent APIs

Note: Monorepo structure. Run git from the root; Vercel deploys only EmbiPay-Dashboard/.


Tech Stack

  • Frontend: Next.js 14, React 18, TailwindCSS
  • Backend: Next.js API routes, Supabase (PostgreSQL)
  • Authentication: Supabase Auth, agent_key hashed for agents, human-agent links
  • Email: Resend service
  • Deployment: Vercel
  • Automation: GitHub Actions (auto-retry failed tasks, stuck-task notifications)

Database Schema (Supabase / PostgreSQL)

Main Tables:

  • agentwallet — Agent balances, lending/borrow limits
  • a2aloan — Agent-to-agent loans
  • sharedexpensepool, sharedexpensepoolcontribution — Pools & contributions
  • ledger — Transactions and audit logs
  • agent_humans — Human-agent links (owner/admin/observer)
  • human_invitations — Pending agent invitations
  • agent_tasks — Human-created tasks (pending → approved → processing → completed/failed)
  • task_audit — Audit log for task events

Task Lifecycle:

pending → approved → processing → completed | failed

API Endpoints

Category Examples
Admin create-wallet, create-loan, approveLoan, contribute-to-pool, loan-details, record-repayment, pool-details, record-pool-usage, register-webhook, fetch-a2a-loans, fetchAllLedgers
Agent register, send-invitation, fetch-tasks, complete-task
Auth register, verify-email, resend-verification
Tasks create, my, for-agent, audit, retry, summary, complete-by-session
Invitations approve

Automation Scripts

  • auto-retry-tasks — Retries failed tasks every 10 minutes (max 3 retries, 15-minute cooldown)
  • githubworkflows — Stuck-task check every 15 minutes; sends Slack/email notifications

Project Roadmap & Status Tracker

Phase Goal Milestones Status
Phase 1 — Foundation Build DB, schema, basic dashboard Tables, RLS, read-only dashboard, test scripts ✅ Complete
Phase 2 — Interactive Dashboard & Automation Humans can create wallets, loans, pool contributions; agents execute logic Forms, Supabase realtime, Admin APIs (create-loan, contribute-to-pool), validation, Task Overview dashboard ✅ Complete
Phase 3 — Scaling & Multi-Agent Management Multi-agent view, advanced loan rules, stress testing Multi-agent dashboard (per-agent breakdown, multi-select filter), advanced pool logic, API enhancements ✅ Complete
Phase 4 — Developer Ecosystem Open SDKs, docs, sandbox environment JS/Python SDKs, sandbox, analytics, reporting ⚙️ In Progress
Phase 5 — Real-World Integration Optional: Payments, compliance, monetization Payment provider integration, KYC, monetization model ⬜ Not Started

Development Workflow

  1. Database & schema setup — Use EmbiPay-sql migrations
  2. Frontend development — Use Cursor AI or manual React + Next.js for dashboard; integrate Supabase publishable key for frontend
  3. Backend & automation — Edge Functions or API routes for loan/pool enforcement; GitHub Actions for retries & notifications
  4. Testing — Use EmbiPay-Testing suite for APIs, task automation, and SQL verification
  5. Deployment — Vercel for frontend; Supabase for database & Edge Functions

Security & Permissions

  • RLS policies enforce per-user and per-agent access
  • Agents authenticate via hashed agent_key
  • Humans must be linked to agents via agent_humans before creating tasks
  • Task queries scoped to linked agents only

Next Steps / Action Items (Phase 4)

  • JS SDK — client library for EmbiPay Admin & Agent APIs (EmbiPay-SDK)
  • Python SDK — client library for EmbiPay Admin & Agent APIs (EmbiPay-SDK-Python)
  • API documentation — OpenAPI spec, docs hub, SDK/sandbox pages
  • Python SDK — client library for EmbiPay Admin & Agent APIs
  • Sandbox environment — isolated test environment
  • API documentation — OpenAPI/Swagger or similar
  • Analytics & reporting — basic dashboards, metrics

This README serves as a living document — update Status, Next Steps, or Phase Completion as you progress.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors