Skip to content

feat: Add local agent orchestrator example and comprehensive docs#24

Merged
pcarranzav merged 8 commits intomainfrom
feat/local-agent-example
Dec 10, 2025
Merged

feat: Add local agent orchestrator example and comprehensive docs#24
pcarranzav merged 8 commits intomainfrom
feat/local-agent-example

Conversation

@pcarranzav
Copy link
Member

@pcarranzav pcarranzav commented Dec 6, 2025

Summary

Adds local agent orchestrator example demonstrating X402RemoteAgentToolset with comprehensive documentation for all examples.

Builds on: #23 (Example Migration)
Chain: This PR targets feat/example-migration branch (will rebase to main after #22 and #23 merge)

What's Included

New: Local Agent Orchestrator Example

Location: examples/src/examples/a2a/buyer/local_agent/agent.py

Demonstrates building a local ADK agent that orchestrates multiple remote A2A agents as tools.

Features:

How it works:

  1. Orchestrator lists available remote agents via x402_a2a_list_agents
  2. Delegates user requests to appropriate agent via x402_a2a_send_to_agent
  3. Remote agent processes with automatic payment handling
  4. Orchestrator returns results to user

Comprehensive Documentation

Examples README

Location: examples/README.md

Complete getting started guide with:

  • Quick start (4 simple steps with staging/testnet)
  • All 4 examples documented:
    • A2A Direct Connection
    • A2A Local Orchestrator (new)
    • MCP via Proxy
    • A2A Seller
  • Architecture diagrams for each pattern
  • Comprehensive troubleshooting section
  • Ampersand-first approach throughout

Environment Variables Reference

Location: examples/docs/environment-variables.md

Complete reference documentation:

  • Smart Account vs Standalone mode comparison tables
  • Staging vs Production URL reference tables
  • Complete configuration examples for each mode
  • Network configuration (Base Sepolia vs Base)
  • Security best practices
  • Troubleshooting guide

Documentation Highlights

Ampersend-first approach - All docs promote:

  1. Getting Started (testnet) - Smart Account + Ampersend shown first
  2. Production - Clear upgrade path
  3. Standalone Alternative - EOA + Naive for testing only

Benefits emphasized:

  • Spend limits and monitoring
  • Production-ready security from day one
  • Free testnet for getting started (Base Sepolia)
  • Circle USDC faucet integration

Testing

PR Chain

All PRs in this chain are ready for review:

  1. feat: Add X402RemoteAgentToolset for local agent orchestration #22: X402RemoteAgentToolset (infrastructure)
  2. feat: Add MCP example and enhance A2A example with Smart Account support #23: Example migration + basic docs
  3. feat: Add local agent orchestrator example and comprehensive docs #24 (this): Local agent example + comprehensive docs

🤖 Generated with Claude Code

@pcarranzav pcarranzav force-pushed the feat/local-agent-example branch from d8547ae to d267636 Compare December 6, 2025 11:24
@pcarranzav pcarranzav force-pushed the feat/example-migration branch from f731092 to c29fda3 Compare December 8, 2025 16:41
@pcarranzav pcarranzav force-pushed the feat/local-agent-example branch 3 times, most recently from 11d4366 to e206a62 Compare December 8, 2025 17:22
@pcarranzav pcarranzav force-pushed the feat/local-agent-example branch 2 times, most recently from 4c9aef7 to a0c21b7 Compare December 8, 2025 18:37
@pcarranzav pcarranzav force-pushed the feat/example-migration branch from b2b790f to 611ddd8 Compare December 9, 2025 15:33
@pcarranzav pcarranzav force-pushed the feat/local-agent-example branch 6 times, most recently from e29de79 to 0a461ac Compare December 10, 2025 17:08
pcarranzav and others added 8 commits December 10, 2025 14:41
…e docs

Add local agent example demonstrating multi-agent orchestration using
X402RemoteAgentToolset with comprehensive documentation.

Local Agent Orchestrator Example:
- Uses X402RemoteAgentToolset to provide remote agents as tools
- Demonstrates agent discovery and delegation
- Per-agent conversation context management
- Smart Account + EOA support with auto-detection
- Defaults to staging subgraph service

Comprehensive Documentation:
- examples/README.md - Complete getting started guide
  - Quick start with staging (testnet, free)
  - All 4 examples documented with architecture diagrams
  - Troubleshooting section
  - Ampersend-first approach

- examples/docs/environment-variables.md - Complete reference
  - Smart Account vs Standalone mode tables
  - Staging vs Production URLs
  - Setup instructions for both modes
  - Security notes and best practices

Documentation highlights Ampersend benefits:
- Spend limits and monitoring
- Production-ready security
- Free testnet for getting started
- Clear upgrade path to production

All examples follow consistent pattern:
- Getting Started (testnet) shown first
- Standalone Alternative for testing
- Production upgrade clearly documented

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
SmartAccountConfig has OWNABLE_VALIDATOR as default.
Document that users can use 'adk web' to start a web UI interface
as an alternative to the interactive CLI 'adk run' command.
- Clarify that examples connect to The Graph subgraph services
- Explain services provide blockchain data (ENS, Uniswap, etc)
- Add example query: 'What were the last 2 ENS registrations?'
- Help users understand what to ask the agents
The local orchestrator uses Gemini model which requires GOOGLE_API_KEY.
Document this in both the agent.py docstring and examples/README.md.
adk web requires the parent directory containing agent folders,
not the agent folder itself (e.g., src/examples/a2a/buyer not .../adk).
@pcarranzav pcarranzav force-pushed the feat/local-agent-example branch from 0a461ac to 5dafb72 Compare December 10, 2025 17:42
Base automatically changed from feat/example-migration to main December 10, 2025 17:47
@pcarranzav pcarranzav marked this pull request as ready for review December 10, 2025 17:47
@pcarranzav pcarranzav merged commit efecb24 into main Dec 10, 2025
6 checks passed
@pcarranzav pcarranzav deleted the feat/local-agent-example branch December 10, 2025 17:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants