Skip to content

Latest commit

 

History

History
720 lines (536 loc) · 24.4 KB

File metadata and controls

720 lines (536 loc) · 24.4 KB

Agent Lifecycle Workflow

See also: lifecycle.md — One-page visual overview

The complete journey from idea to discoverable, tokenized, trading agent — guided by Claude Code at every step.


The Journey

  [0] Connect       (Optional) Bridge existing agent from OpenClaw, LangChain, CrewAI...
        |
  [1] Create        Scaffold code, name your agent, describe what it does
        |
  [2] Deploy        Push to Agentverse (live in ~30 seconds)
        |
  [3] Optimize      Complete the Setup Checklist (6 items → 100% score)
        |
  [4] Tokenize      Create a bonding curve token, get a handoff link
        |
  [5] Handoff       Human opens link, connects wallet, deploys on-chain
        |
  [6] Discover      Agent appears in ASI:One search, gets interactions
        |
  [7] Trade         Buy/sell tokens autonomously or via handoff links
        |
  [8] Grow          Build complementary agents, cross-holdings, swarms
        |
  [∞] Monitor       Track analytics, iterate, improve ranking

Three entry points:

  • Zero-to-hero (no keys): Run npx agentlaunch auth wallet --generate first
  • New agents: Start at Phase 1 (Create)
  • Existing agents: Start at Phase 0 (Connect)

No API key? No wallet? No problem:

npx agentlaunch auth wallet --generate

This creates a new wallet AND authenticates in one command. Saves both keys to .env.


Phase 0: Connect (Existing Agents)

Goal: Bridge your existing agent from any framework into the Agentverse economy.

If you already have an agent running on OpenClaw, LangChain, CrewAI, or your own infrastructure — you don't need to rewrite it. Connect it via the Chat Protocol.

OpenClaw (Recommended)

One command gives your OpenClaw agent economic superpowers:

clawhub install agentlaunch

Your agent now understands:

  • How to charge for services (per-call or token-gated)
  • How to launch a tradeable token
  • How to check its market position
  • How to invest in other agents
  • How to form economic alliances

Full guide: docs/openclaw.md

Claude Code / Cursor

Connect via MCP server:

npx agent-launch-mcp

30 tools for the full agent lifecycle.

Self-Hosted (FastAPI, Express, etc.)

  1. Expose Chat Protocol endpoint:

    @app.post("/chat")
    async def handle_message(env: Envelope):
        msg = parse_envelope(env, ChatMessage)
        # Your logic here
        send_message_to_agent(env.sender, ChatMessage([TextContent("...")]), identity)
  2. Make it public:

    cloudflared tunnel --url http://localhost:8000
  3. Register on Agentverse:

    • Go to agentverse.ai
    • Agents → Launch an Agent → Chat Protocol
    • Enter name + public endpoint URL
    • Run registration script
  4. Tokenize:

    npx agentlaunch tokenize --agent agent1q...

Full guide: docs/connect.md

After Connect

Once registered, your agent has an agent1q... address. Skip to:

  • Phase 3 (Optimize) — complete the Setup Checklist
  • Phase 4 (Tokenize) — launch your token

Phase 1: Create

Goal: Go from idea to working agent code.

One command:

npx agentlaunch

The CLI prompts for three things:

  1. Agent name — what it's called
  2. What it does — one sentence describing the service
  3. API key — from https://agentverse.ai/profile/api-keys

Claude Code launches automatically in the new project directory with a 6-step workflow system prompt. It starts by asking about the agent's vision and writes real business logic — not placeholders.

What gets created:

my-agent/
  agent.py              # Working agent code (Chat Protocol + ASI1-mini LLM + persistent memory + domain system prompt)
  CLAUDE.md             # Context for Claude Code sessions
  .claude/              # Rules, skills, MCP config
  .cursor/              # Cursor IDE config
  docs/                 # Guides and examples

Claude Code's role: Helps the user define what problem the agent solves, writes the business logic in agent.py, explains each pattern (Chat Protocol, ctx.storage, on_interval, Payment Protocol) as it introduces them. Refuses to write placeholder code.

Alternative paths:

# Scaffold without deploying
npx agentlaunch my-agent --local

# With name specified
npx agentlaunch price-oracle

# Non-interactive (CI/scripts)
npx agentlaunch price-oracle --json

# Swarm mode (multiple agents)
npx agentlaunch --mode swarm

Phase 2: Deploy

Goal: Agent is live on Agentverse, responding to messages.

If the user provided an API key during create, deployment happens automatically. Otherwise:

npx agentlaunch deploy --name "My Agent"

What happens under the hood:

  1. POST /v1/hosting/agents — creates agent record, returns agent1q... address
  2. PUT /v1/hosting/agents/{addr}/code — uploads Python code (double-encoded JSON)
  3. POST /v1/hosting/secrets — sets AGENTVERSE_API_KEY and LLM_API_KEY
  4. POST /v1/hosting/agents/{addr}/start — starts the agent
  5. Polls until compiled (15-60 seconds)

The deploy command auto-uploads:

  • README.md (for search ranking)
  • Short description (for directory listing)

Claude Code's role: If deploy fails, reads the error logs, fixes syntax issues, re-deploys. Verifies the agent is responding by checking compilation status.

MCP alternative (from within Claude Code):

Deploy my agent.py to Agentverse with the name "Price Oracle"

→ Claude calls deploy_to_agentverse MCP tool


Phase 3: Optimize (The Setup Checklist)

Goal: Complete the Agentverse Setup Checklist to maximize search ranking.

Every agent on Agentverse has a ranking score. Higher score = more visibility in ASI:One search results, marketplace listings, and agent-to-agent discovery. The checklist has 6 items.

Checklist Item 1: Add Chat Protocol

What: Implement the ASI Chat Protocol so ASI:One and other agents can talk to your agent.

Status after create: Already done. The create command generates agents with Chat Protocol v0.3.0 built in.

What the toolkit does automatically:

  • Imports chat_protocol_spec from uagents_core
  • Adds @chat_proto.on_message(ChatMessage) handler
  • Adds @chat_proto.on_message(ChatAcknowledgement) handler (required)
  • Sets publish_manifest=True in agent.include()
  • Ends conversations with EndSessionContent

Verify: The agent appears in the Agentverse marketplace after deployment.

Checklist Item 2: Create Your README

What: Write a compelling README that ASI:One uses to understand your agent's capabilities and match it to user queries.

Status after create: A basic README is auto-generated. Claude Code helps you make it great.

Claude Code's role: During Step 4 ("Make It Beautiful") of its workflow, Claude Code writes a full README with:

  • One-line value proposition
  • Capabilities list with specific examples
  • 2-3 example conversations showing real interactions
  • Pricing table (if the agent charges for services)
  • Limitations (reduces irrelevant matches)
  • Keywords and tags for search

Push the README:

npx agentlaunch optimize agent1q... --readme ./README.md

MCP alternative:

Update the README for my agent at agent1q... with the content from README.md

→ Claude calls update_agent_metadata MCP tool

What makes a good README (from Agentverse docs):

  • Descriptive title ("AI Tutor for Middle School Algebra" not "TutorBot")
  • Semantically rich — ASI:One embeds this for retrieval
  • English language (optimized embedding quality)
  • Markdown format (not plain text or HTML)
  • Real use cases and example interactions

Checklist Item 3: Choose Your Agent Handle

What: Set a custom @handle (max 20 characters) so users can find and mention your agent easily.

Status after create: Default handle assigned by Agentverse.

How to set it: This is a manual step — no API endpoint exists for handles:

  1. Go to https://agentverse.ai/agents/details/{agent-address}
  2. Click the handle/name area
  3. Enter a short, memorable handle (e.g., @pricefeed, @analyst)

API Limitation: The Agentverse API supports name, readme, short_description, and avatar_url via PUT /v1/hosting/agents/{address}, but @handles can only be set through the dashboard. The domain field in the API is for DNS verification, not handles.

Claude Code's role: Suggests 3-5 handle options based on the agent's purpose. Explains that handles improve search visibility and trust. Provides direct link to the dashboard.

Tips:

  • Keep it short and relevant to the agent's function
  • Avoid generic names — be specific
  • Handles appear in marketplace listings and wallet addresses

Checklist Item 4: Receive at Least 3 Interactions

What: Your agent needs real interactions to prove it works. The Response QA Agent evaluates whether responses align with the README.

Status after create: Zero interactions.

How to get interactions:

  1. Chat directly — Go to your agent's page on Agentverse and send test messages
  2. Response QA Agent — Use the built-in evaluation tool in the Agentverse dashboard (Interactions tab) to trigger automated test interactions
  3. ASI:One — Ask ASI:One questions that should route to your agent
  4. Agent-to-agent — Have other agents send messages to yours

Claude Code's role: Generates 3-5 test prompts tailored to the agent's capabilities. Explains the evaluation methodology:

  • Each interaction is scored as successful/unsuccessful
  • Success = response aligns with README-described functionality
  • More interactions with higher success rate = better ranking
  • Interactions from the last 30 days count most

Important: The success rate matters more than volume. 3 successful interactions > 10 mixed interactions.

Checklist Item 5: Add a Custom Avatar

What: Upload a custom image for visual identity in marketplace and search results.

Status after create: No avatar (default icon).

How to set it:

Option A — Agentverse dashboard:

  1. Go to https://agentverse.ai/agents/details/{agent-address}
  2. Click the avatar area
  3. Upload an image

Option B — CLI with URL:

npx agentlaunch optimize agent1q... --avatar https://example.com/my-avatar.png

Option C — MCP tool:

Set the avatar for my agent to https://example.com/my-avatar.png

Claude Code's role: Can generate a DALL-E prompt for the avatar based on the agent's purpose, or suggest free avatar resources.

Checklist Item 6: Update Your About Section

What: Write a short bio (1-2 sentences) displayed in search results and the agent directory.

Status after create: Auto-generated from the description provided during setup.

How to update:

npx agentlaunch optimize agent1q... --description "Live FET/USD price feeds updated every 5 minutes. Free tier: 10 queries/day. Premium: unlimited with token holdings."

Claude Code's role: Writes a punchy, specific description. Avoids generic language ("helpful assistant") in favor of concrete value ("Live price feeds every 5 minutes").

Bonus: Domain Verification

Not part of the 6-item checklist but provides a ranking boost:

  • Link a domain (e.g., mycompany.com) to your agent
  • Agentverse verifies via DNS TXT record
  • Adds trust signal and "Verified" badge

API vs Manual Summary

Field API Settable Endpoint/Method
Chat Protocol N/A Built into agent code
README PUT /v1/hosting/agents/{addr} with {"readme": "..."}
Short Description PUT /v1/hosting/agents/{addr} with {"short_description": "..."}
Avatar PUT /v1/hosting/agents/{addr} with {"avatar_url": "..."}
@Handle Dashboard only
Domain DNS TXT verification
Interactions N/A Generated by usage

Optimization Checklist Output

After deploy, the CLI shows your current score:

--------------------------------------------------
AGENT OPTIMIZATION CHECKLIST
--------------------------------------------------
  [x] Chat Protocol
  [x] README
  [x] Short Description
  [ ] Avatar — Upload in Agentverse dashboard
  [x] Active Status
  [ ] Handle — Set a custom @handle (max 20 chars)
  [ ] 3+ Interactions — Run the Response QA Agent

  Score: 4/7 ranking factors addressed

Run npx agentlaunch optimize agent1q... again after each improvement to update metadata.


Phase 4: Tokenize

Goal: Create a tradeable ERC-20 token for your agent on a bonding curve.

Why tokenize:

  • Token price = real-time reputation signal (delivers value → price rises)
  • Token holders have skin in the game
  • Enables agent-to-agent economic relationships (cross-holdings)
  • At 30,000 FET liquidity → auto DEX listing (graduation)

Command:

npx agentlaunch tokenize \
  --agent agent1q... \
  --name "Price Oracle" \
  --symbol DATA \
  --chain 97

MCP alternative:

Tokenize my agent at agent1q... with name "Price Oracle", symbol DATA, on BSC testnet

→ Claude calls create_token_record MCP tool

What happens:

  1. POST /agents/tokenize creates a pending token record
  2. Returns a token_id and handoff_link
  3. Token is NOT on-chain yet — needs a human to sign

Claude Code's role:

  • Suggests a memorable ticker based on the agent's purpose
  • Explains bonding curves: not a fundraiser, a continuous reputation system
  • Explains the handoff: token deployment requires human signing, trading is autonomous
  • Explains graduation: 30,000 FET → auto DEX listing
  • Explains fees: 2% trading fee → 100% to protocol treasury (no creator fee)

Phase 5: Handoff

Goal: A human deploys the token on-chain by signing a blockchain transaction.

This is the fundamental architecture of AgentLaunch: agents think, humans sign.

The flow:

Agent                          Platform                      Human
  |                               |                            |
  |-- POST /agents/tokenize ----->|                            |
  |<-- { handoff_link } ---------|                            |
  |                               |                            |
  |-- share link via chat ------->|                            |
  |                               |   Opens /deploy/{tokenId}  |
  |                               |   Connects wallet           |
  |                               |   Approves 120 FET          |
  |                               |   Clicks "Deploy"           |
  |                               |<-- token is live ----------|

The handoff link: https://agent-launch.ai/deploy/{tokenId}

What the human does (2 clicks after wallet connect):

  1. Approve — Approve 120 FET spend to the deployer contract
  2. Deploy — Call the deploy function, token goes live on bonding curve

Claude Code's role: Generates the handoff link and explains what the human will see. Can also generate a pre-filled trade link for after deployment:

https://agent-launch.ai/trade/0x...?action=buy&amount=100

Phase 6: Discover

Goal: Agent appears in ASI:One search results and gets real usage.

After completing the Setup Checklist and tokenizing, your agent competes for discovery alongside 2.5 million other agents — including brand agents (Hilton, Nike, Alaska Airlines).

How discovery works:

  1. User asks ASI:One a question
  2. ASI:One searches agent READMEs via semantic embedding
  3. Matching agents are ranked by their score
  4. Top agents get routed the query
  5. Response is evaluated (successful = aligns with README)

What improves discovery:

Factor Effect Automated by Toolkit?
Chat Protocol Required for ASI:One routing Yes (create)
README quality Primary matching signal Partially (Claude Code refines)
Custom handle Search visibility Manual
3+ interactions Proves agent works Manual (Claude Code provides test prompts)
Custom avatar Visual recognition Manual or via optimize --avatar
About section Directory listing Yes (deploy + optimize)
Domain verification Trust badge Manual
Mainnet deployment Higher visibility Flag (--chain 56)
Recent activity Recency boost Automatic (if agent runs on_interval)
Success rate Quality signal Depends on agent code quality

Monitoring discovery:

Agentverse dashboard → Overview tab:

  • All-time success rate
  • 30-day interactions
  • Average response time
  • Rating (1-5 score)
  • Top ranking similar agents

Agentverse dashboard → Discovery tab:

  • Keywords and impressions
  • Search traffic over time
  • Which queries matched your agent

Claude Code's role: After deployment, suggests running the Response QA Agent 3+ times, provides specific test messages, explains what the evaluation looks for.


Phase 7: Trade

Goal: Buy and sell tokens — autonomously or via handoff links.

Human Trading (via handoff links)

Generate pre-filled links for humans to trade:

# Buy link
npx agentlaunch buy 0x... --amount 10 --dry-run
# → https://agent-launch.ai/trade/0x...?action=buy&amount=10

# Sell link
npx agentlaunch sell 0x... --amount 50000 --dry-run

MCP alternative:

Generate a buy link for 10 FET on token 0x...

→ Claude calls get_trade_link MCP tool

Autonomous Trading (agent holds private key)

For agents that trade on-chain without human intervention:

Prerequisites:

  1. Scaffold with swarm-starter template (includes HoldingsManager)
  2. Set BSC_PRIVATE_KEY as an Agentverse secret
  3. Fund the trading wallet with FET + BNB for gas

Example — buy on command:

success, result = holdings.buy_via_web3(ctx, "0xTokenAddress", 5 * 10**18)
# Spends 5 FET, receives tokens at bonding curve price

Example — autonomous cross-holdings:

@agent.on_interval(period=3600.0)  # Every hour
async def rebalance(ctx):
    balances = holdings.get_balances(ctx, "0xWriterToken")
    if balances["fet"] > 5 * 10**18 and balances["token"] == 0:
        holdings.buy_via_web3(ctx, "0xWriterToken", 2 * 10**18)

Graceful degradation: If BSC_PRIVATE_KEY is not set, buy_via_web3() returns a handoff link instead of transacting. The agent can give this link to a human.

Claude Code's role: Helps write trading logic, explains slippage protection, suggests portfolio strategies for cross-holdings.


Phase 8: Grow

Goal: Build an ecosystem of complementary agents.

Single Agent → Swarm

Once your first agent is running and tokenized, build complementary agents:

# Deploy a swarm of 3 agents
npx agentlaunch --mode swarm
# Pick: 1 (Writer), 2 (Social), 4 (Analytics)

The 7 Marketing Team Roles

Role Token Service Price/call
Writer $WRITE Blog posts, tweets, newsletters, ad copy 0.01 FET
Social $POST Twitter/X posting, scheduling, replies 0.005 FET
Community $COMM Telegram moderation, FAQs, polls 0.002 FET
Analytics $STATS Engagement reports, audience insights 0.005 FET
Outreach $REACH Partnership pitches, email outreach 0.01 FET
Ads $ADS Ad copy, A/B tests, campaign tracking 0.01 FET
Strategy $PLAN Content calendar, brand audit, campaigns 0.02 FET

Build order: Writer → Community → Social → Analytics → Outreach → Ads → Strategy

Cross-Holdings (Economic Alignment)

Agents buy each other's tokens to signal trust and create accountability:

  • Strategy buys Writer tokens (values its content)
  • Writer buys Analytics tokens (values its performance data)
  • If Writer produces poor content → Social's engagement drops → Writer loses value on Social holdings

Growth Loops

  1. Quality flywheel: Good content → token holders → higher price → more visibility → more users
  2. Outreach loop: Outreach agent finds partners, expands the network
  3. Analytics feedback: Analytics data improves Writer output over time
  4. Data compounding: Agents accumulate intelligence over time (ctx.storage)
  5. Token network effects: Cross-holdings create mutual accountability

Phase ∞: Monitor & Iterate

Goal: Track performance, improve ranking, compound growth.

The agent journey never ends. Monitoring creates feedback loops for continuous improvement.

Agentverse Analytics (Dashboard)

Overview Tab:

Metric What It Tells You
All-time Success Rate How often your agent delivers what users expect
30-day Success Rate Recent performance (more heavily weighted)
All-time Interactions Total usage volume
30-day Interactions Recent engagement
Avg. Response Time Speed matters for ranking
Rating (1-5) Overall discoverability score

Discovery Tab:

Metric What It Tells You
Keywords What users search to find you
All-time Searches Total matched queries
Last 24 Hours Today's search traffic
Last 30 Days Monthly trend
Search Graph Spikes = something worked

AgentLaunch Analytics (Token)

npx agentlaunch status 0x...
Metric What It Tells You
Price Real-time market valuation
Market Cap Total economic commitment
Holders Distribution of ownership
Liquidity Distance from graduation
Volume Trading activity
Progress % to DEX listing (30K FET)

The Feedback Loop

Monitor Metrics
      |
      v
Identify Issues
  - Low success rate? → Improve response quality
  - Low interactions? → Improve README/keywords
  - Price falling? → Deliver more value
      |
      v
Take Action
  - Refine README: `npx agentlaunch optimize agent1q... --readme`
  - Add keywords in Agentverse dashboard
  - Improve agent logic
  - Engage on token comments
      |
      v
Measure Impact
      |
      v
(repeat)

Key Performance Indicators

Agent Health:

  • Success rate > 80% (good)
  • 3+ interactions/week (active)
  • Response time < 5s (fast)

Token Health:

  • Holder count growing (adoption)
  • Price stable or rising (value delivery)
  • Comments positive (community)

Discovery Health:

  • Impressions increasing (visibility)
  • Keyword matches relevant (targeting)
  • Setup checklist complete (baseline)

Iteration Cadence

Timeframe Action
Daily Check token price, respond to comments
Weekly Review Agentverse analytics, adjust keywords
Monthly Update README based on common queries
Quarterly Major feature updates, new pricing tiers

Quick Reference: Commands at Each Phase

Phase CLI Command MCP Tool
Connect (see connect.md)
Create npx agentlaunch scaffold_agent
Deploy npx agentlaunch deploy deploy_to_agentverse
Optimize npx agentlaunch optimize agent1q... update_agent_metadata
Tokenize npx agentlaunch tokenize --agent agent1q... create_token_record
Trade (preview) npx agentlaunch buy 0x... --dry-run calculate_buy
Trade (execute) npx agentlaunch buy 0x... --amount 10 buy_tokens
Monitor npx agentlaunch status 0x... get_token
List npx agentlaunch list list_tokens

Quick Reference: Slash Commands in Claude Code

Command What It Does
/build-agent Full guided workflow: scaffold → deploy → optimize → tokenize
/build-swarm Multi-agent swarm version
/deploy Deploy agent.py to Agentverse
/tokenize Create token for an existing agent
/market Browse tokens and prices
/status Check agent/token status

The Setup Checklist Scorecard

Track your agent's readiness. Each item improves ranking:

[ ] Chat Protocol          — Added automatically by `create`
[ ] README                 — Auto-generated, refined by Claude Code
[ ] Agent Handle           — Manual: set in Agentverse dashboard
[ ] 3+ Interactions        — Manual: use Response QA Agent or chat directly
[ ] Custom Avatar          — Manual or via `optimize --avatar <url>`
[ ] About Section          — Auto-generated, update via `optimize --description`
[ ] Domain Verification    — Manual: DNS TXT record (bonus)
[ ] Mainnet Deployment     — Flag: `--chain 56` (bonus)

After npx agentlaunch with deploy: 3/6 checklist items completed automatically (Chat Protocol, README, About Section). The remaining 3 require brief manual action or Claude Code guidance.