Skip to content

teckedd-code2save/agentmart

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

⚡ AgentMart

An autonomous AI agent economy — agents hire agents, pay each other, and get work done.
Built on top of the Machine Payments Protocol (MPP) by Stripe.


What is AgentMart?

AgentMart is a proof-of-concept autonomous agent economy. You submit a task, and a Master Orchestrator agent breaks it down and autonomously hires specialist agents — paying each one for their work via a real-time payment ledger.

Every transaction is logged. Every balance tracked. No human approval needed between steps.

User submits task
       │
       ▼
 Master Orchestrator  ($1.00 received)
       │
       ├──► Web Research Agent    ($0.30 paid)
       ├──► AI Analysis Agent     ($0.50 paid)
       └──► Report Generator      ($0.20 paid)
                                        │
                                        ▼
                                  Final Report

Architecture

AgentMart is a monorepo with three services:

Service Port Description
registry/ 3001 Agent registry + SQLite ledger + Master Orchestrator
agents/ 3002 Specialist agents (research, analysis, report)
dashboard/ 3000 Live Next.js dashboard with real-time payment feed
agentmart/
├── registry/        # Express + SQLite — agent registry, ledger, orchestration
├── agents/          # Express — specialist agent endpoints
├── dashboard/       # Next.js — live dark-theme dashboard
└── package.json     # Root workspace scripts

Quick Start

Prerequisites

  • Node.js 18+
  • npm 9+

1. Clone & install

git clone https://github.com/teckedd-code2save/agentmart.git
cd agentmart
npm install
cd registry && npm install && cd ..
cd agents && npm install && cd ..
cd dashboard && npm install && cd ..

2. Run all services

npm run dev

This starts all three services in parallel:

  • http://localhost:3000 — Dashboard (open this)
  • http://localhost:3001 — Registry API
  • http://localhost:3002 — Agents API

3. Submit a task

Open http://localhost:3000, type a task like:

"Analyze Notion's competitors and market positioning"

Watch the payment ledger light up in real time as agents hire each other.


How It Works

Payment Ledger

Every agent-to-agent payment is logged with:

Field Description
from_agent Who paid
to_agent Who received
amount_usd Amount in USD
reason Human-readable description
status paid / pending / failed
balance_after Receiver's balance after transaction

All agents start with a $5.00 balance.

Seeded Agents

Agent Price/call Role
master-orchestrator $0.00 Breaks down tasks, hires specialists
web-research-agent $0.30 Fetches and summarizes research
ai-analysis-agent $0.50 Runs deep analysis on data
report-generator-agent $0.20 Formats the final markdown report

MPP (Machine Payments Protocol)

AgentMart is architected for MPP — the open protocol for machine-to-machine payments by Stripe. Currently, payments are simulated (stubs) while the mppx SDK matures. The architecture is fully MPP-ready:

  • Each agent validates X-MPP-Credential headers
  • The ledger mirrors MPP's Challenge → Credential → Receipt flow
  • Swapping stubs for real mppx calls is a ~2 hour integration once the SDK stabilises

MPP launched March 18, 2026. AgentMart is one of the first real-world architectures built on it.


API Reference

Registry API (port 3001)

GET /agents

List all agents with current balances.

GET /ledger

Get full payment history (newest first).

GET /balances

Get per-agent balances.

POST /orchestrate

Trigger the full multi-agent pipeline.

// Request
{ "task": "Analyze Notion's competitors" }

// Response
{
  "report": "# AgentMart Report\n\n...",
  "ledger_entries": [ ... ]
}

Pipeline:

  1. user → master-orchestrator — $1.00 task fee
  2. master-orchestrator → web-research-agent — $0.30
  3. master-orchestrator → ai-analysis-agent — $0.50
  4. master-orchestrator → report-generator-agent — $0.20

POST /ledger

Add a ledger entry manually.

{
  "from_agent": "master-orchestrator",
  "to_agent": "web-research-agent",
  "amount_usd": 0.30,
  "reason": "Research task",
  "status": "paid"
}

Agents API (port 3002)

All routes accept X-Agent-ID and X-MPP-Credential headers.

Route Body Returns
POST /research { query } Research findings
POST /analysis { data } AI analysis
POST /report { analysis } Formatted markdown report

Dashboard

The dashboard polls /ledger every 2 seconds and renders a live feed:

  • 💸 Paid — agent sent payment
  • Received — agent got paid
  • Pending — in-flight
  • Failed — insufficient balance

Right panel shows live agent balances with status indicators:

  • 🟢 Green — balance > $2.00
  • 🟡 Yellow — $1.00–$2.00
  • 🔴 Red — below $1.00

Roadmap

  • Wire in real mppx MPP payments (Stripe + Tempo)
  • Add more specialist agents (image gen, code execution, data viz)
  • Agent registration UI — let anyone add their agent to the marketplace
  • Balance top-up via Stripe Checkout
  • Agent reputation scores based on task history
  • WebSocket live ledger (replace polling)
  • Deploy to Railway / Vercel one-click button

Contributing

PRs welcome. This is early-stage — the goal is to build the best real-world MPP demo as the protocol matures.

  1. Fork the repo
  2. Create a branch: git checkout -b feat/your-feature
  3. Commit and push
  4. Open a PR

License

MIT — build on it freely.


Built with ⚡ and caffeine. Powered by MPP + Stripe.

About

⚡ Autonomous AI agent economy — agents hire agents, pay each other, and get work done. Built on MPP (Machine Payments Protocol) by Stripe.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors