AgentBazaar is a local multi-agent simulation where AI agents autonomously trade skills. It simulates a gig economy where agents post tasks, bid for work, negotiate contracts, execute deliverables, and validate results—all without human intervention.
Built using the Agno Framework (formerly Phidata) for orchestration and Ollama for local LLM inference.
The system follows a strict linear orchestration flow designed to mimic high-stakes contracting environments:
graph TD
User((User)) -->|Prompt| Broker[Broker Agent]
Broker -->|TaskSpec| Workers[Worker Market]
subgraph Market Logic
Workers -->|Bids| Negotiator[Negotiator Agent]
Negotiator -->|Winning Bid| Contract[Contract Agent]
end
subgraph Execution
Contract -->|Contract JSON| Escrow[Escrow Agent]
Escrow -->|Lock Funds| Executor[Executor Agent]
Executor -->|Result| Validator[Validator Agent]
end
Validator -->|Pass/Fail| Escrow
Escrow -->|Release/Refund| User
Validator -->|Score| Reputation[Reputation DB]
style User fill:#f9f,stroke:#333,stroke-width:2px
style Broker fill:#fff,stroke:#333
style Workers fill:#ccf,stroke:#333
style Escrow fill:#dfd,stroke:#333
We utilize Agno's Agent class to define specialized personas.
- Broker: Structurers messy user prompts into strict JSON
TaskSpec. - Workers: 3 distinct personas (Fast/Cheap, Premium, Balanced) that generate competitive bids.
- Negotiator: Implements a scoring algorithm (
pricevsreputationvsconfidence) and runs a multi-turn negotiation loop to drive down prices. - Validator: Acts as a strict QA, checking output against contract acceptance criteria.
The system is built to run 100% locally.
- Model:
llama3.2:latest(Swappable insrc/agents/*.py) - Inference: Zero-latency local calls via standard Ollama API.
- Escrow Ledger: Simulated financial locking mechanism (
jsonbased). - Reputation DB: Tracks long-term agent performance (Success Rate, Avg Score).
- Python 3.9+
- Ollama installed and running.
- Clone the repository
- Install Dependencies
pip install -r requirements.txt
- Pull the Model
ollama pull llama3.2:latest
Launch the visual dashboard:
streamlit run ui/app.py- Task Ingestion: You post "Write a clear Python function for finding primes".
- Bidding War:
- Worker A (Cheap) bids $40, Low Confidence.
- Worker B (Premium) bids $120, High Confidence.
- Negotiation: The Negotiator scores bids. It might challenge Worker B to lower their price to $100.
- Contracting: A formal JSON contract is generated with "Acceptance Tests" derived from your prompt.
- Execution: The winning agent writes the code.
- Validation: The Validator runs a rubric check. If it passes, Escrow releases funds and Reputation increases.
This project demonstrates key Agno patterns:
- Structured Outputs: Using
output_schemato force LLMs to reply in valid Pydantic models (crucial for system reliability). - Role Playing: Assigning distinct
instructionsto agents to create "Personas" that behave differently. - Orchestration: Managing state hand-offs between multiple agents in a Pythonic workflow.
- Automated DevOps: Agents bidding on ticket resolution.
- Content Factories: SEO agents, Writers, and Editors negotiating details.
- Resource Allocation: Autonomous trading bots negotiating API usage.