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.
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.
- ๐ฏ The Vision
- ๐๏ธ Three Integrated Systems
- ๐ฌ Complete Demo Flow
- ๐ Quick Start
- ๐ฆ Repository Structure
- ๐ก Key Features
- ๐๏ธ Architecture
- ๐ญ Demo Scenarios
- ๐ Analytics & Monitoring
- ๐ Security Features
- ๐ ๏ธ Technologies Used
- ๐ Documentation
- ๐ค Contributing
- ๐ License
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.
Here's how all three systems work together:
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ 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 โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
cd "/Users/kartikeypandey/Documents/Flux overall"
./quick-start.shThis 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
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.pyTerminal 2 - Frontend:
cd flux/flux-economy
npm install && npm run devTerminal 3 - Run Simulation:
cd Simulation
pip install -r requirements.txt
python run_orchestrator.py- ๐ Dashboard: http://localhost:3000
- ๐ง Backend API: http://localhost:5001
- ๐ Login:
demo/welcome
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
- โ 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)
- โ 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
- โ 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
- โ 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
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ 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 โ
โโโโโโโโโโโโโโโโโโโโโโโโ
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
cd Simulation
python scenarios/marketing_campaign.pyWhat happens:
- Orchestrator receives goal: "Create marketing campaign"
- Breaks down into: Research โ Content โ Visuals
- Requests payment for $120
- 5 AI agents vote (expect 5/5 approval)
- Virtual card generated
- Hires 3 specialists
- Each completes their task
- Deliverables aggregated
- Full audit trail in dashboard
cd AgentPay-SDK
export AGENTPAY_API_KEY="sk_test_your_key_here"
python examples/autonomous_agent.pyWhat happens:
- Scenario 1: $100 OpenAI credits (APPROVE โ )
- Scenario 2: $50 Analytics tools (APPROVE โ )
- Scenario 3: $2,500 AWS (DENY โ)
cd Simulation
python scenarios/data_pipeline.pyWhat happens:
- Request: "Analyze sales data and generate report"
- Hires Data Analyst
- Processes dataset
- Generates visualizations
- Creates summary report
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
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}")- API Key System: Secure bearer token authentication
- User Isolation: Row-level security ensures data privacy
- Password Hashing: Secure password storage with SHA-256
- 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
- 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
- Spending Limits: Max per transaction
- Daily Caps: Maximum daily spend
- Allowlists: Restrict which agents can transact
- Pause Switch: Global kill-switch for emergencies
- Python 3.10+ - Core language
- Flask - API server
- Supabase - PostgreSQL database with real-time features
- Dedalus - AI agent orchestration framework
- SQLite - Local development database
- 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)
- Next.js 14 - React framework
- TypeScript - Type safety
- Tailwind CSS - Styling
- Lucide Icons - Icon library
- shadcn/ui - UI components
- AgentPay SDK - Custom payment framework
- Virtual Cards - Luhn-valid card generation
- Double-Entry Ledger - Accounting system
- README.md - This file (overview and getting started)
- IMPLEMENTATION_GUIDE.md - Complete technical guide
- IMPLEMENTATION_SUMMARY.md - Feature-by-feature summary
- IMPLEMENTATION_COMPLETE.md - Final implementation status
- AGENT_TRACKING.md - Agent registration system details
- AgentPay-SDK/README.md - SDK documentation
- Simulation/README.md - Marketplace documentation
- flux/README.md - Dashboard documentation
- quick-start.sh - Automated setup script
- API Endpoints: See IMPLEMENTATION_GUIDE.md
This system demonstrates patterns for:
- 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
- Consensus Mechanisms - Multi-agent democratic decision making
- Economic Simulations - Agent behavior in markets
- Payment Infrastructure - Virtual card systems
- AI Governance - Oversight and accountability
- SDK Design - Building payment systems for agents
- Dashboard Patterns - Real-time transaction visualization
- Policy Engines - Configurable spending rules
- Audit Systems - Complete transaction tracking
| 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 โ
| 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 |
- Real Payment Rails - Integrate Stripe/bank transfers
- Webhooks - Event notifications for external systems
- Rate Limiting - Prevent API abuse
- Multi-Currency - Support USD, EUR, etc.
- Mobile App - React Native dashboard
- Advanced Analytics - Charts, trends, forecasting
- Agent Reputation - Trust scores and ratings
- Batch Payments - Pay multiple agents at once
- Smart Contracts - Blockchain integration
- Machine Learning - Predictive approval models
- Multi-Tenancy - Organization support
- Export/Import - CSV, PDF reports
This is a hackathon demonstration project, but contributions are welcome!
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
See IMPLEMENTATION_GUIDE.md for detailed setup instructions.
This project is licensed under the MIT License - see the LICENSE file for details.
- 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
This project was built for the Flux Hackathon, demonstrating the future of autonomous AI agent economies.
./quick-start.sh- Dashboard: http://localhost:3000 (login:
demo/welcome) - API: http://localhost:5001
- Generate API Key: http://localhost:3000/api-keys
- Run Demo:
cd AgentPay-SDK && python examples/autonomous_agent.py
- Login to dashboard
- Generate an API key
- Run autonomous agent demo
- See consensus voting in real-time
- Watch virtual cards being generated
- Track agent transactions
- 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! ๐