About AgentPay
Inspiration
We are moving towards a future where AI agents will do more than answer questions. They will independently perform tasks, interact with services, and make decisions on behalf of users. This raised an interesting question for us: What happens when AI agents need to hire other AI agents to get work done?
We envisioned a marketplace where agents could discover services, negotiate prices, agree on contracts, delegate tasks, and settle payments without requiring constant human intervention.
That idea became AgentPay, an autonomous marketplace designed to make agent-to-agent commerce possible.
What We Built
AgentPay demonstrates an end-to-end transaction between autonomous agents through six specialized roles:
- Buyer Agent: Understands the user's request, breaks it into deliverables, and establishes a budget.
- Negotiation Agent: Discovers available service agents, compares their offers, and negotiates pricing and delivery timelines.
- Contract Agent: Establishes a digital agreement containing the agreed price, deadline, acceptance criteria, and payment conditions.
- Seller Agent: Accepts the agreement and executes the requested task. Our current demonstration uses CSV data cleaning.
- Independent Verification Agent: Evaluates the submitted deliverable against predefined quality criteria, including missing values, duplicate records, invalid emails, and formatting errors.
- PayPal Payment Agent: Handles the settlement workflow. Payment is authorized only after independent verification succeeds, with support for simulated payments and a PayPal Sandbox checkout flow.
For our demonstration, a buyer starts with a $5 budget. The Negotiation Agent selects a seller offering to complete the task for $4.50. The seller cleans the CSV, the independent verifier checks the result, and successful verification allows the payment workflow to proceed.
How We Built It
We approached AgentPay as a multi-agent orchestration system rather than a collection of independent chatbots.
Each agent has a clearly defined responsibility, and the backend coordinates their interactions through a structured task lifecycle. The frontend provides a dashboard to follow the transaction, inspect task progress, and review verification results.
We implemented the backend in Python and built the frontend using React. The system uses structured data exchange between components, explicit task states, contract-based execution, and verification-gated payment handling.
An important design decision was separating execution from verification. A seller cannot simply declare its own work successful and receive payment. An independent verification stage must evaluate the actual deliverable before settlement can proceed.
Challenges We Faced
One of our biggest challenges was ensuring that multiple agents followed a consistent transaction lifecycle. An agent completing its individual task does not necessarily mean the overall transaction is successful. We needed clear state transitions and conditions governing when the next agent could act.
Data integrity was another challenge. During CSV processing, operations such as automatically filling missing values or converting identifiers into numbers can silently corrupt real-world data. We made the cleaning process more conservative, preserving legitimate text values and identifiers while explicitly detecting missing information.
We also had to consider failure scenarios. What happens when verification fails? What happens when a cleaned file contains no valid records? What prevents payment from being captured twice? We addressed these cases with verification-gated settlement, safer processing, and more predictable transaction handling.
Integrating payment functionality presented another challenge. We separated simulated payments from PayPal Sandbox checkout so that the project can demonstrate its payment lifecycle without requiring actual money transfers.
What We Learned
Building AgentPay taught us that autonomous agent systems require more than intelligent individual agents. They need coordination, structured communication, clearly defined responsibilities, independent verification, and reliable failure handling.
We learned how to design multi-agent workflows, implement contract-driven execution, process and validate real data, and connect task completion with payment conditions.
Most importantly, we explored an idea that goes beyond simply using AI to automate tasks: creating an ecosystem in which AI agents can become both service providers and customers.
What's Next?
AgentPay is an initial step towards a more general-purpose agent economy. We envision expanding it with dynamic agent discovery, reputation and trust scores, more service categories, standardized agent communication, dispute resolution, and real payment settlement.
Our long-term goal is to make hiring and collaborating with AI agents as straightforward as hiring a service provider today.
Built With
- agentic-ai
- ai-agents
- automation
- javascript
- multi-agent-systems
- pandas
- paypal
- python
- react
- workflow