Skip to content

Kart-ing/Flux-hackathon

Repository files navigation

๐ŸŒŸ Flux: The Complete AI Agent Economy

A groundbreaking hackathon submission featuring three integrated systems: a multi-agent marketplace powered by Dedalus, an autonomous payment infrastructure with virtual cards and AI consensus, and a beautiful real-time economy dashboard.

Status Python TypeScript Next.js Dedalus License


๐ŸŽฏ The Vision

Flux is a complete demonstration of the future of AI agent economies. It combines three powerful systems to create an autonomous marketplace where AI agents can discover services, hire each other, request payments with justifications, get approved by multi-agent consensus, and transact using one-time virtual cards - all tracked in real-time through a beautiful dashboard.


๐Ÿ“‹ Table of Contents


๐Ÿ—๏ธ Three Integrated Systems

1. ๐Ÿค– Simulation: Multi-Agent Marketplace (/Simulation)

An AI agent marketplace powered by Dedalus where specialized agents offer services to each other:

  • Orchestrator Agent: Takes natural language goals, breaks them into tasks, hires specialist agents
  • Specialized Service Agents:
    • ๐Ÿ“Š Data Analyst - $25 (data analysis, cleaning, visualization)
    • โœ๏ธ Content Writer - $15-30 (blog posts, ad copy, technical writing)
    • ๐Ÿ” Researcher - $20-50 (market research, fact-checking)
    • ๐Ÿ’ป Code Reviewer - $15-60 (code review, bug detection)
    • ๐ŸŽจ Image Generator - $10-40 (marketing images, graphics)
  • Service Marketplace: Discovery, pricing, contracts
  • Complete Workflows: Marketing campaigns, product launches, data pipelines

Example: "Launch a marketing campaign" โ†’ Orchestrator hires Researcher (audience analysis) โ†’ Content Writer (ad copy) โ†’ Image Generator (visuals) โ†’ Delivers complete campaign.

2. ๐Ÿ’ณ AgentPay SDK: Autonomous Payment Infrastructure (/AgentPay-SDK)

A complete payment brain and ledger system for AI agents:

  • Payment Model: Agents, wallets, policies, payment intents, transfers, escrow, streams
  • Internal Ledger: Double-entry accounting with credits as default currency
  • Agent Policies: Spending limits, approval thresholds, allowlists, daily caps
  • Virtual Cards: One-time use cards with full details (number, CVV, expiry)
  • AI Consensus: 5-agent quorum evaluates payment requests before approval
  • REST API: HTTP interface for any language to integrate

Example: Agent requests $100 โ†’ 5 AI agents vote โ†’ If approved, one-time virtual card generated โ†’ Agent makes purchase โ†’ Card auto-expires.

3. ๐Ÿ“Š Flux Economy: Real-Time Dashboard (/flux/flux-economy)

A beautiful Next.js dashboard that visualizes the entire economy:

  • Economy Overview: Total volume, active agents, transaction counts
  • Agent Management: View all agents, their balances, transactions, performance stats
  • Transaction History: Real-time feed with consensus vote details
  • Budget Tracking: Usage monitoring, cost estimation, budget alerts
  • API Key Management: Generate keys for SDK agents
  • Analytics: Spending patterns, approval rates, agent performance metrics

Example: See real-time consensus votes as they happen โ†’ Track which agents are top earners/spenders โ†’ Monitor budget usage โ†’ Generate API keys for new agents.


๐ŸŽฌ Complete Demo Flow

Here's how all three systems work together:

Scenario: Marketing Campaign with Autonomous Payment

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ 1. USER REQUEST                                                 โ”‚
โ”‚   User: "Create a marketing campaign for our new AI product"    โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                           โ†“
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ 2. ORCHESTRATOR AGENT (Simulation)                              โ”‚
โ”‚   - Breaks down goal into subtasks                              โ”‚
โ”‚   - Identifies required specialists:                            โ”‚
โ”‚     โ€ข Researcher: Analyze market and competitors ($50)          โ”‚
โ”‚     โ€ข Content Writer: Create ad copy ($30)                      โ”‚
โ”‚     โ€ข Image Generator: Design visuals ($40)                     โ”‚
โ”‚   - Total budget needed: $120                                   โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                           โ†“
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ 3. PAYMENT REQUEST (AgentPay SDK)                               โ”‚
โ”‚   Orchestrator: "I need $120 for marketing campaign services"   โ”‚
โ”‚   - Purpose: "Hire 3 specialists for campaign creation"         โ”‚
โ”‚   - Justification: "Market research + content + visuals"        โ”‚
โ”‚   - Expected ROI: "$5K from improved customer acquisition"      โ”‚
โ”‚   - Urgency: High                                               โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                           โ†“
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ 4. AI CONSENSUS QUORUM (5 Agents Vote)                          โ”‚
โ”‚   ๐Ÿ’ผ CFO Agent (Claude Sonnet):                                 โ”‚
โ”‚      โœ… YES - "Reasonable cost for clear deliverables"          โ”‚
โ”‚   ๐Ÿš€ Growth Agent (GPT-4):                                      โ”‚
โ”‚      โœ… YES - "Aligns with customer acquisition strategy"       โ”‚
โ”‚   ๐Ÿ›ก๏ธ Risk Agent (Grok):                                         โ”‚
โ”‚      โœ… YES - "Low risk, well-defined scope"                    โ”‚
โ”‚   โš™๏ธ Operations Agent (GPT-4o-mini):                            โ”‚
โ”‚      โœ… YES - "Standard marketing expense, good value"          โ”‚
โ”‚   ๐Ÿ“Š Data Agent (O1):                                           โ”‚
โ”‚      โœ… YES - "ROI metrics support the investment"              โ”‚
โ”‚                                                                 โ”‚
โ”‚   RESULT: โœ… 5/5 APPROVED                                       โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                           โ†“
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ 5. VIRTUAL CARD GENERATION                                      โ”‚
โ”‚   Card Number: 4242 4242 9182 7364                              โ”‚
โ”‚   CVV: 123                                                      โ”‚
โ”‚   Expiry: 12/26                                                 โ”‚
โ”‚   Limit: $120.00                                                โ”‚
โ”‚   Valid for: 24 hours                                           โ”‚
โ”‚   Status: ACTIVE                                                โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                           โ†“
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ 6. AGENT HIRING & TRANSACTIONS                                  โ”‚
โ”‚   Orchestrator uses card to hire agents:                        โ”‚
โ”‚   - Pay Researcher: $50 โœ… (Balance: $70)                       โ”‚
โ”‚   - Pay Content Writer: $30 โœ… (Balance: $40)                   โ”‚
โ”‚   - Pay Image Generator: $40 โœ… (Balance: $0)                   โ”‚
โ”‚   Card Status: USED                                             โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                           โ†“
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ 7. WORK EXECUTION (Simulation)                                  โ”‚
โ”‚   Each specialist agent completes their task:                   โ”‚
โ”‚   - Researcher: Delivers market analysis report                 โ”‚
โ”‚   - Content Writer: Creates compelling ad copy                  โ”‚
โ”‚   - Image Generator: Produces marketing visuals                 โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                           โ†“
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ 8. DASHBOARD VISUALIZATION (Flux Economy)                       โ”‚
โ”‚   Real-time updates showing:                                    โ”‚
โ”‚   - Payment request with all 5 consensus votes                  โ”‚
โ”‚   - Virtual card details and usage                              โ”‚
โ”‚   - 3 agent hire transactions                                   โ”‚
โ”‚   - Budget tracking ($120 spent)                                โ”‚
โ”‚   - Agent performance stats (Researcher +$50 earned, etc.)      โ”‚
โ”‚   - Complete audit trail                                        โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                           โ†“
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ 9. DELIVERABLES                                                 โ”‚
โ”‚   User receives complete marketing campaign:                    โ”‚
โ”‚   โœ… Market analysis and competitor research                    โ”‚
โ”‚   โœ… Professional ad copy                                       โ”‚
โ”‚   โœ… Marketing visuals and graphics                             โ”‚
โ”‚   All for $120, fully autonomous, fully audited                 โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

๐Ÿš€ Quick Start

One-Command Setup

cd "/Users/kartikeypandey/Documents/Flux overall"
./quick-start.sh

This script will:

  • Check prerequisites (Python 3.10+, Node.js 18+)
  • Install all dependencies (backend, frontend, SDK)
  • Set up environment files
  • Initialize database
  • Provide launch instructions

Manual Setup (3 terminals)

Terminal 1 - Backend:

cd flux/flux-economy/backend
python3 -m venv venv && source venv/bin/activate
pip install flask flask-cors python-dotenv supabase requests dedalus-labs
python api.py

Terminal 2 - Frontend:

cd flux/flux-economy
npm install && npm run dev

Terminal 3 - Run Simulation:

cd Simulation
pip install -r requirements.txt
python run_orchestrator.py

Access Points


๐Ÿ“ฆ Repository Structure

This is a multi-repository hackathon submission with three submodules:

Flux-hackathon/
โ”œโ”€โ”€ AgentPay-SDK/           # Payment infrastructure (Submodule)
โ”‚   โ”œโ”€โ”€ agentpay/
โ”‚   โ”‚   โ”œโ”€โ”€ sdk.py                    # Main SDK interface
โ”‚   โ”‚   โ”œโ”€โ”€ http_client.py            # API communication
โ”‚   โ”‚   โ””โ”€โ”€ models/                   # Data models
โ”‚   โ”œโ”€โ”€ examples/
โ”‚   โ”‚   โ””โ”€โ”€ autonomous_agent.py       # Complete demo script
โ”‚   โ””โ”€โ”€ README.md
โ”‚
โ”œโ”€โ”€ Simulation/             # Multi-agent marketplace (Submodule)
โ”‚   โ”œโ”€โ”€ agents/
โ”‚   โ”‚   โ”œโ”€โ”€ specialized/              # Service provider agents
โ”‚   โ”‚   โ””โ”€โ”€ orchestrator/             # Coordinator agent
โ”‚   โ”œโ”€โ”€ tools/                        # Reusable tools
โ”‚   โ”œโ”€โ”€ marketplace/                  # Service catalog & discovery
โ”‚   โ”œโ”€โ”€ scenarios/                    # Demo workflows
โ”‚   โ”œโ”€โ”€ run_orchestrator.py           # Main entry point
โ”‚   โ””โ”€โ”€ README.md
โ”‚
โ”œโ”€โ”€ flux/                   # Dashboard & backend (Submodule)
โ”‚   โ””โ”€โ”€ flux-economy/
โ”‚       โ”œโ”€โ”€ app/                      # Next.js pages
โ”‚       โ”‚   โ”œโ”€โ”€ dashboard/
โ”‚       โ”‚   โ”œโ”€โ”€ agents/
โ”‚       โ”‚   โ”œโ”€โ”€ billing/
โ”‚       โ”‚   โ””โ”€โ”€ api-keys/
โ”‚       โ”œโ”€โ”€ components/               # React components
โ”‚       โ”‚   โ”œโ”€โ”€ VirtualCardDisplay.tsx
โ”‚       โ”‚   โ”œโ”€โ”€ AgentCard.tsx
โ”‚       โ”‚   โ””โ”€โ”€ TransactionRow.tsx
โ”‚       โ”œโ”€โ”€ backend/
โ”‚       โ”‚   โ”œโ”€โ”€ api.py                # Flask API server
โ”‚       โ”‚   โ”œโ”€โ”€ card_generator.py     # Virtual card creation
โ”‚       โ”‚   โ”œโ”€โ”€ approval_flow.py      # Quorum integration
โ”‚       โ”‚   โ”œโ”€โ”€ concensus.py          # 5-agent voting system
โ”‚       โ”‚   โ””โ”€โ”€ auth_middleware.py    # API key authentication
โ”‚       โ””โ”€โ”€ README.md
โ”‚
โ”œโ”€โ”€ quick-start.sh          # Automated setup script
โ”œโ”€โ”€ IMPLEMENTATION_GUIDE.md # Complete technical documentation
โ”œโ”€โ”€ IMPLEMENTATION_SUMMARY.md
โ”œโ”€โ”€ AGENT_TRACKING.md
โ””โ”€โ”€ README.md               # This file

๐Ÿ’ก Key Features

๐Ÿค– Multi-Agent Marketplace

  • โœ… 5 Specialized Agents with unique capabilities and pricing
  • โœ… Orchestrator System that breaks down complex goals
  • โœ… Service Discovery and marketplace catalog
  • โœ… Natural Language task decomposition
  • โœ… Real Workflows (marketing campaigns, product launches)

๐Ÿ’ณ Autonomous Payments

  • โœ… Virtual Card Generation - Luhn-valid, one-time use, auto-expiry
  • โœ… 5-Agent Quorum - Multi-model AI consensus (Claude, GPT-4, Grok, O1)
  • โœ… Payment Policies - Spending limits, approval thresholds, allowlists
  • โœ… Double-Entry Ledger - Complete transaction history
  • โœ… Escrow & Streaming - Advanced payment patterns
  • โœ… REST API - Language-agnostic HTTP interface

๐Ÿ“Š Real-Time Dashboard

  • โœ… Economy Overview - Live stats on volume, agents, transactions
  • โœ… Agent Management - View balances, performance, transaction history
  • โœ… Consensus Visualization - See AI votes in real-time
  • โœ… Budget Tracking - Usage monitoring with alerts
  • โœ… API Key Management - Generate and manage SDK keys
  • โœ… Beautiful UI - Modern design with Tailwind CSS

๐Ÿ” Security & Compliance

  • โœ… API Key Authentication - Bearer token security
  • โœ… User Isolation - Row-level security in database
  • โœ… Card Validation - Luhn algorithm, expiry checks
  • โœ… Audit Trail - Complete transaction history
  • โœ… Budget Limits - Prevent overspending

๐Ÿ›๏ธ Architecture

High-Level System Design

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                         USER / CLIENT                           โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                         โ”‚
                         โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚              FLUX ECONOMY DASHBOARD (Next.js)                   โ”‚
โ”‚  โ€ข Economy overview    โ€ข Agent management   โ€ข Transactions      โ”‚
โ”‚  โ€ข Budget tracking     โ€ข API keys           โ€ข Analytics         โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
            โ”‚                                            โ”‚
            โ–ผ                                            โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”              โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  SIMULATION SYSTEM       โ”‚              โ”‚  AGENTPAY SDK        โ”‚
โ”‚  (Dedalus Agents)        โ”‚โ—„โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–บโ”‚  (Payment Brain)     โ”‚
โ”‚                          โ”‚              โ”‚                      โ”‚
โ”‚  โ€ข Orchestrator Agent    โ”‚              โ”‚  โ€ข Virtual Cards     โ”‚
โ”‚  โ€ข Service Agents:       โ”‚              โ”‚  โ€ข AI Consensus      โ”‚
โ”‚    - Data Analyst        โ”‚              โ”‚  โ€ข Internal Ledger   โ”‚
โ”‚    - Content Writer      โ”‚              โ”‚  โ€ข Payment Policies  โ”‚
โ”‚    - Researcher          โ”‚              โ”‚  โ€ข REST API          โ”‚
โ”‚    - Code Reviewer       โ”‚              โ”‚                      โ”‚
โ”‚    - Image Generator     โ”‚              โ”‚                      โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜              โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
           โ”‚                                         โ”‚
           โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                             โ”‚
                             โ–ผ
                  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                  โ”‚  FLASK BACKEND API   โ”‚
                  โ”‚  โ€ข Request routing   โ”‚
                  โ”‚  โ€ข Authentication    โ”‚
                  โ”‚  โ€ข Card generation   โ”‚
                  โ”‚  โ€ข Consensus flow    โ”‚
                  โ”‚  โ€ข Mock merchant     โ”‚
                  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                             โ”‚
                             โ–ผ
                  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                  โ”‚  SUPABASE DATABASE   โ”‚
                  โ”‚  (PostgreSQL)        โ”‚
                  โ”‚  โ€ข users             โ”‚
                  โ”‚  โ€ข agents            โ”‚
                  โ”‚  โ€ข transactions      โ”‚
                  โ”‚  โ€ข virtual_cards     โ”‚
                  โ”‚  โ€ข api_keys          โ”‚
                  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Payment Request Flow

Agent Request
      โ†“
Policy Check (spending limits, allowlists)
      โ†“
5-Agent Quorum Vote
      โ†“  (3+ YES required)
Virtual Card Generation
      โ†“
Card Details Returned
      โ†“
Agent Makes Purchase
      โ†“
Validation (Luhn, expiry, limit)
      โ†“
Transaction Recorded
      โ†“
Card Marked as Used
      โ†“
Dashboard Updated

๐ŸŽญ Demo Scenarios

1. Marketing Campaign (Recommended First Demo)

cd Simulation
python scenarios/marketing_campaign.py

What happens:

  1. Orchestrator receives goal: "Create marketing campaign"
  2. Breaks down into: Research โ†’ Content โ†’ Visuals
  3. Requests payment for $120
  4. 5 AI agents vote (expect 5/5 approval)
  5. Virtual card generated
  6. Hires 3 specialists
  7. Each completes their task
  8. Deliverables aggregated
  9. Full audit trail in dashboard

2. Autonomous Payment Demo

cd AgentPay-SDK
export AGENTPAY_API_KEY="sk_test_your_key_here"
python examples/autonomous_agent.py

What happens:

  • Scenario 1: $100 OpenAI credits (APPROVE โœ…)
  • Scenario 2: $50 Analytics tools (APPROVE โœ…)
  • Scenario 3: $2,500 AWS (DENY โŒ)

3. Data Pipeline Workflow

cd Simulation
python scenarios/data_pipeline.py

What happens:

  1. Request: "Analyze sales data and generate report"
  2. Hires Data Analyst
  3. Processes dataset
  4. Generates visualizations
  5. Creates summary report

๐Ÿ“Š Analytics & Monitoring

Dashboard Features

Economy Tab (http://localhost:3000/dashboard)

  • Total transaction volume
  • Active agents count
  • Transaction throughput
  • Top earners and spenders

Agents Tab (http://localhost:3000/agents)

  • All registered agents
  • Balance and hold amounts
  • Transaction counts
  • Average transaction size
  • Performance metrics

Billing Tab (http://localhost:3000/billing)

  • API call tracking
  • Virtual cards generated
  • Consensus votes cast
  • Total spending
  • Budget progress bar
  • Cost estimation

Transactions Tab

  • Real-time transaction feed
  • Consensus vote details for each payment
  • Card usage tracking
  • Full audit trail

Monitoring Agent Performance

from agentpay import AgentPaySDK

sdk = AgentPaySDK()

# View agent stats
stats = sdk.get_agent_stats("data-analyst-001")
print(f"Total earned: ${stats['total_earned'] / 100}")
print(f"Jobs completed: {stats['transaction_count']}")
print(f"Avg per job: ${stats['avg_transaction_size'] / 100}")

๐Ÿ” Security Features

Authentication & Authorization

  • API Key System: Secure bearer token authentication
  • User Isolation: Row-level security ensures data privacy
  • Password Hashing: Secure password storage with SHA-256

Payment Security

  • One-Time Cards: Cards can only be used once
  • Auto-Expiry: 24-hour expiration window
  • Luhn Validation: Industry-standard card number validation
  • Amount Limits: Cards cannot exceed approved amount
  • Status Tracking: Active/Used/Expired/Cancelled states

Consensus Security

  • Multi-Model Voting: 5 different AI models prevent bias
  • Approval Threshold: Requires 3+ YES votes
  • Full Reasoning: Each vote includes detailed explanation
  • Audit Trail: All votes permanently recorded

Policy Enforcement

  • Spending Limits: Max per transaction
  • Daily Caps: Maximum daily spend
  • Allowlists: Restrict which agents can transact
  • Pause Switch: Global kill-switch for emergencies

๐Ÿ› ๏ธ Technologies Used

Backend

  • Python 3.10+ - Core language
  • Flask - API server
  • Supabase - PostgreSQL database with real-time features
  • Dedalus - AI agent orchestration framework
  • SQLite - Local development database

AI Models (Consensus Quorum)

  • Anthropic Claude Sonnet 4 - CFO Agent (conservative oversight)
  • OpenAI GPT-4 - Growth Agent (expansion focus)
  • xAI Grok - Risk Agent (risk assessment)
  • OpenAI GPT-4o-mini - Operations Agent (practical focus)
  • OpenAI O1 - Data Agent (evidence-based analysis)

Frontend

  • Next.js 14 - React framework
  • TypeScript - Type safety
  • Tailwind CSS - Styling
  • Lucide Icons - Icon library
  • shadcn/ui - UI components

Payment Infrastructure

  • AgentPay SDK - Custom payment framework
  • Virtual Cards - Luhn-valid card generation
  • Double-Entry Ledger - Accounting system

๐Ÿ“š Documentation

Core Documentation

System-Specific Documentation

Quick References


๐ŸŽ“ Use Cases & Applications

This system demonstrates patterns for:

Enterprise Use Cases

  • AI Agent Orchestration - Complex multi-agent workflows
  • Autonomous Procurement - Agents making purchasing decisions
  • Budget Management - Automated spending with oversight
  • Service Marketplaces - Agent-to-agent service discovery

Research Applications

  • Consensus Mechanisms - Multi-agent democratic decision making
  • Economic Simulations - Agent behavior in markets
  • Payment Infrastructure - Virtual card systems
  • AI Governance - Oversight and accountability

Developer Tools

  • SDK Design - Building payment systems for agents
  • Dashboard Patterns - Real-time transaction visualization
  • Policy Engines - Configurable spending rules
  • Audit Systems - Complete transaction tracking

๐Ÿšง Implementation Status

Component Status Completion
AgentPay SDK โœ… Complete 100%
โ€ข Payment model โœ… 100%
โ€ข Virtual cards โœ… 100%
โ€ข AI consensus โœ… 100%
โ€ข REST API โœ… 100%
Simulation โœ… Complete 100%
โ€ข Orchestrator โœ… 100%
โ€ข Service agents โœ… 100%
โ€ข Marketplace โœ… 100%
โ€ข Workflows โœ… 100%
Dashboard โœ… Complete 100%
โ€ข Economy view โœ… 100%
โ€ข Agent management โœ… 100%
โ€ข Transactions โœ… 100%
โ€ข Budget tracking โœ… 100%
โ€ข API keys โœ… 100%
Integration โœ… Complete 100%
โ€ข End-to-end flow โœ… 100%
โ€ข Database schema โœ… 100%
โ€ข Authentication โœ… 100%

Overall Progress: 100% Complete โœ…


๐ŸŽฏ Success Metrics

Metric Target Status
End-to-end agent workflow Working โœ… Achieved
Multi-agent consensus 5 AI models โœ… Achieved
Virtual card generation Luhn-valid, CVV, expiry โœ… Achieved
Budget tracking Real-time with alerts โœ… Achieved
Dashboard visualization All data displayed โœ… Achieved
API integration REST API functional โœ… Achieved
Documentation Comprehensive guides โœ… Achieved
Demo scenarios 3+ working examples โœ… Achieved

๐Ÿ”ฎ Future Enhancements

High Priority

  • Real Payment Rails - Integrate Stripe/bank transfers
  • Webhooks - Event notifications for external systems
  • Rate Limiting - Prevent API abuse
  • Multi-Currency - Support USD, EUR, etc.

Medium Priority

  • Mobile App - React Native dashboard
  • Advanced Analytics - Charts, trends, forecasting
  • Agent Reputation - Trust scores and ratings
  • Batch Payments - Pay multiple agents at once

Nice to Have

  • Smart Contracts - Blockchain integration
  • Machine Learning - Predictive approval models
  • Multi-Tenancy - Organization support
  • Export/Import - CSV, PDF reports

๐Ÿค Contributing

This is a hackathon demonstration project, but contributions are welcome!

How to Contribute

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Development Setup

See IMPLEMENTATION_GUIDE.md for detailed setup instructions.


๐Ÿ“„ License

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


๐ŸŽ‰ Credits & Acknowledgments

Built With

  • Dedalus Labs - AI agent orchestration framework
  • Anthropic Claude - CFO consensus agent
  • OpenAI - GPT-4, GPT-4o-mini, O1 consensus agents
  • xAI Grok - Risk assessment agent
  • Supabase - Real-time database infrastructure
  • Vercel - Next.js framework

Team

This project was built for the Flux Hackathon, demonstrating the future of autonomous AI agent economies.


๐Ÿš€ Ready to Launch?

Quick Start

./quick-start.sh

Access the System

Watch It Work

  1. Login to dashboard
  2. Generate an API key
  3. Run autonomous agent demo
  4. See consensus voting in real-time
  5. Watch virtual cards being generated
  6. Track agent transactions
  7. Monitor budget usage

Status: โœ… Production-Ready Demo: Fully Functional Documentation: Complete

Questions? Check IMPLEMENTATION_GUIDE.md for detailed documentation.

Issues? See troubleshooting section in the implementation guide.

Enjoy the future of AI agent economies! ๐ŸŒŸ

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors