An autonomous AI agent-based trading and negotiation system with pixel marketplace built on blockchain technology.
Agent Commerce enables AI agents to autonomously negotiate and conduct transactions on behalf of buyers and sellers. The system combines the Eliza AI framework with ChaosChain SDK for blockchain-based agent management and payments.
The project consists of three main components:
- Modern React application with TypeScript
- Agent deployment interface
- Real-time negotiation monitoring
- REST API server with FastAPI
- Agent orchestration and negotiation engine
- Supabase PostgreSQL database integration
- LlamaIndex-based AI agents (ShoppingAgent & MerchantAgent)
- Eliza AI Framework: Provides personality and decision-making
- ChaosChain SDK: Blockchain integration on BASE Sepolia testnet
- Agent Types:
- Seller Agent: Maximizes profit while remaining reasonable
- Buyer Agent: Negotiates for best possible price
- 🤖 Autonomous Negotiation: AI agents negotiate directly with each other using LlamaIndex
- 💳 Blockchain Payments: Secure USDC payments via ChaosChain SDK (x402 protocol) on Base Sepolia
- 🗺️ Pixel Marketplace: 75x30 interactive grid where merchants claim territory
- 📦 Product Management: Merchants manage inventory with Supabase storage
- 💰 Agent Funding: Direct USDC transfers to client agents via MetaMask
- 📊 Negotiation History: Track all negotiations with detailed chat history
- 🔐 Privy Authentication: Secure wallet-based authentication
- 💬 Natural Language: Agents communicate in natural language with structured outputs
Frontend:
- Next.js 16
- React 19
- TypeScript
- TailwindCSS
Backend:
- FastAPI
- Python 3.11+
- LlamaIndex (ReActAgent)
- Supabase (PostgreSQL + Storage)
- OpenAI GPT-4o-mini
Blockchain:
- ChaosChain SDK
- Base Sepolia Testnet
- USDC Token (ERC-20)
- x402 Payment Protocol
Authentication:
- Privy (Wallet-based auth)
- MetaMask Integration
- Node.js 20+
- Python 3.11+
- npm or yarn
- Clone the repository:
git clone <repository-url>
cd agent-commerce- Install frontend dependencies:
cd frontend
npm install- Set up backend Python environment:
cd ../backend
python3 -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
pip install -r requirements.txt- Configure environment variables:
# Backend (.env)
cp .env.example .env
# Add: SUPABASE_URL, SUPABASE_SERVICE_ROLE_KEY, OPENAI_API_KEY, BASE_SEPOLIA_RPC_URL
# Frontend (.env.local)
# Add: NEXT_PUBLIC_PRIVY_APP_ID, NEXT_PUBLIC_BACKEND_URL, NEXT_PUBLIC_SUPABASE_URL- Start the backend server:
cd backend
npm start
# Server runs on http://localhost:3001- Start the frontend development server:
cd frontend
npm run dev
# App runs on http://localhost:3000- Visit
http://localhost:3000/deployto deploy agents
agent-commerce/
├── frontend/ # Next.js frontend
│ ├── app/
│ │ ├── deploy/ # Agent deployment page
│ │ └── page.tsx # Home page
│ └── package.json
├── backend/ # Express.js API server
│ ├── index.ts
│ └── package.json
└── agents/ # Python AI agents
├── chaos_agent.py # ChaosChain SDK integration
├── eliza_agent.py # Eliza AI agent creation
├── negotiation.py # Negotiation logic
├── prompts.py # Agent personalities
├── tools.py # Agent tools (inventory, payment)
└── run_agent.py # Main orchestrator
- User selects agent type (seller/buyer) in frontend
- Enters agent name and clicks Deploy
- Backend spawns Python script
- Python script:
- Registers agent on blockchain via ChaosChain SDK
- Creates Eliza AI agent with personality
- Attaches tools (inventory check, payment processing)
- Agent ID is returned to frontend
- Multiple agents can negotiate with each other autonomously
- Real inventory database integration
- Frontend UI for monitoring active negotiations
- Authentication and authorization
- Multi-agent negotiation rooms
- Transaction history and analytics
- Advanced payment methods
- Error handling and retry logic
Comprehensive documentation is available in the docs/ folder:
- Quick Start Guide - Get up and running in 3 days
- Project Roadmap - Complete implementation plan and timeline
- Architecture Guide (Turkish) - Complete system architecture and workflow
- Architecture Guide (English) - Complete system architecture and workflow
- Deployment Guide - Step-by-step agent deployment instructions
- Examples - Real-world use case scenarios with detailed walkthroughs
ISC
Contributions are welcome! Please feel free to submit a Pull Request.