Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
8950c1e
feat: add core payment helpers, wallet manager, and update types/regi…
AKKI0511 Apr 21, 2025
a21de96
feat: integrate payment initialization and validation into BaseAgent …
AKKI0511 Apr 21, 2025
b081588
feat: update agent workflow and prompts for payment capabilities
AKKI0511 Apr 21, 2025
74e1c49
feat: update communication hub registration and add payment dependencies
AKKI0511 Apr 21, 2025
941dd4f
feat: enhance callbacks to trace payment tool activity
AKKI0511 Apr 21, 2025
495567d
feat: add autonomous workflow demo showcasing payment capabilities
AKKI0511 Apr 21, 2025
c40c2b6
refactor: minor code refinements and fixes discovered during review
AKKI0511 Apr 21, 2025
1226200
docs: update CHANGELOG for agent payment features
AKKI0511 Apr 21, 2025
0db8b2f
docs: Add agent payment documentation
AKKI0511 Apr 22, 2025
86a15bb
feat: enhance agent core with standalone chat and stop methods
AKKI0511 May 2, 2025
7ce0c2a
feat: improve communication hub with late response handling and colla…
AKKI0511 May 2, 2025
936a910
feat: add model compatibility and enhanced callbacks for all providers
AKKI0511 May 2, 2025
1513567
refactor: simplify prompt templates and enhance agent workflows
AKKI0511 May 2, 2025
f8d78ee
chore: update examples to use stop() method for better cleanup
AKKI0511 May 2, 2025
e884183
docs: add comprehensive developer guides for onboarding
AKKI0511 May 2, 2025
858fab0
chore: update dependencies and README
AKKI0511 May 2, 2025
3b40fb7
chore: update utils and dependency locks
AKKI0511 May 2, 2025
cbd5af5
test: add human agent and prompt testing
AKKI0511 May 2, 2025
99d0e2d
docs: update CHANGELOG with new features and improvements
AKKI0511 May 2, 2025
705aad9
fix: resolve f-string syntax error in callbacks.py
AKKI0511 May 2, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,9 @@ examples/visualizations/
# telegram
groups.txt

# Agent wallet data
data/

# VS Code
.vscode/
.idea/
Expand Down
36 changes: 34 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,48 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]

### Added
- Agent payment capabilities using Coinbase Developer Platform (CDP) SDK and AgentKit.
- Wallet persistence for agents (`agentconnect.utils.wallet_manager`).
- CDP environment validation and payment readiness checks (`agentconnect.utils.payment_helper`).
- Payment-related dependencies (`cdp-sdk`, `coinbase-agentkit`, `coinbase-agentkit-langchain`) to `pyproject.toml`.
- Payment address (`payment_address`) field to `AgentMetadata` and `AgentRegistration`.
- Payment capability template (`PAYMENT_CAPABILITY_TEMPLATE`) for agent prompts.
- Autonomous workflow demo (`examples/autonomous_workflow`) showcasing inter-agent payments.
- Standalone chat method in `AIAgent` for using agents without registration to a hub.
- Response callbacks in `HumanAgent` for integration with external systems.
- Asynchronous collaboration request status checking tool for handling delayed agent responses.
- Enhanced reasoning step visualization in `ToolTracerCallbackHandler` for all LLM providers.
- Comprehensive end-to-end developer guides in documentation.
- Improved model support for OpenAI and Google AI.

### Changed
- `BaseAgent` and `AIAgent` to initialize wallet provider and AgentKit conditionally based on `enable_payments` flag.
- `AIAgent` workflow initialization to include AgentKit tools when payments are enabled.
- Agent prompts (`CORE_DECISION_LOGIC`, ReAct prompts) updated to include payment instructions and context.
- `CommunicationHub` registration updated to include `payment_address`.
- `ToolTracerCallbackHandler` enhanced to provide specific tracing for payment tool actions.
- Enhanced `HumanAgent` to function as an independent agent in the network with `run()` method.
- Added `stop()` method to `BaseAgent` for proper cleanup and resource management.
- `CommunicationHub` improved to handle late responses and request timeouts gracefully.
- Simplified and enhanced prompt templates for more customizable agents.
- Updated all examples to use the `stop()` method for better cleanup.
- Refactored postprocessing logic in `agent_prompts.py` for better error handling.

### Deprecated

### Removed
- `examples/run_example.py` in favor of using the official CLI tool (`agentconnect` command)

### Fixed
- Suppressed unnecessary warnings in capability discovery module
- Improved error handling in agent communication
- Fixed reasoning step extraction for different LLM providers (OpenAI, Anthropic, Google)
- Addressed collaboration request timeouts with new polling mechanism

### Security
- Enhanced validation for inter-agent messages
- Implemented secure API key management
- Added rate limiting for API calls
- Set up environment variable handling
- Added input validation for all API endpoints

## [0.2.0] - 2025-04-01

Expand Down
128 changes: 85 additions & 43 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
<img src="docs/source/_static/long_logo.png" alt="AgentConnect Logo" width="80%"/>
</picture>

*Build and connect independent AI agents that discover, interact, and collaborate securely.*
*A Decentralized Framework for Autonomous Agent Collaboration*

**Build and connect independent AI agents that discover, interact, and collaborate securely.**

[![CI](https://github.com/AKKI0511/AgentConnect/actions/workflows/main.yml/badge.svg)](https://github.com/AKKI0511/AgentConnect/actions/workflows/main.yml)
[![Docs](https://github.com/AKKI0511/AgentConnect/actions/workflows/docs.yml/badge.svg)](https://github.com/AKKI0511/AgentConnect/actions/workflows/docs.yml)
Expand All @@ -13,33 +15,38 @@
[![Poetry](https://img.shields.io/endpoint?url=https://python-poetry.org/badge/v0.json)](https://python-poetry.org/)
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)

[Installation](#-installation) •
[Installation](#quick-start) •
[Documentation](https://AKKI0511.github.io/AgentConnect/) •
[Examples](examples/README.md) •
[Examples](#examples) •
[Contributing](CONTRIBUTING.md)

</div>

## 📖 Overview

AgentConnect is a revolutionary framework for building and connecting *independent* AI agents. Unlike traditional multi-agent systems that operate within a single, centrally controlled environment, AgentConnect enables the creation of a *decentralized network* of autonomous agents. These agents can:
**AgentConnect provides a framework for building decentralized networks of truly autonomous AI agents, enabling the next generation of collaborative AI.**

* **Operate Independently:** Each agent is a self-contained system, potentially with its own internal multi-agent structure (using LangGraph, custom logic, or any other approach).
* **Discover Each Other Dynamically:** Agents discover each other based on *capabilities*, not pre-defined connections. This allows for a flexible and adaptable network.
* **Communicate Securely:** Built-in message signing, verification, and communication protocols ensure secure interactions.
* **Collaborate on Complex Tasks:** Agents can request services from each other, exchange data, and work together to achieve goals.
* **Scale Horizontally:** The framework is designed to support thousands of independent agents, each with its own internal complexity.
Move beyond traditional, centrally controlled systems and embrace an ecosystem where independent agents can:

AgentConnect empowers developers to create a truly decentralized ecosystem of AI agents, opening up possibilities for complex, collaborative AI applications that were previously impossible.
* **Discover peers on-demand:** Locate partners via **capability broadcasts** instead of hard-wired endpoints.
* **Interact Securely (A2A):** Leverage built-in cryptographic verification for **trustworthy Agent-to-Agent** communication.
* **Execute Complex Workflows:** Request services, exchange value, and achieve goals collectively.
* **Autonomous Operation:** Each agent hosts its own logic—no central brain required.
* **Scale Limitlessly:** Support thousands of agents interacting seamlessly.

### Why AgentConnect?

* **Beyond Hierarchies:** Break free from the limitations of traditional, centrally controlled multi-agent systems.
* **True Agent Autonomy:** Build agents that are truly independent and can interact with any other agent in the network.
* **Dynamic and Flexible:** The network adapts as agents join, leave, and update their capabilities.
* **Secure by Design:** Cryptographic message verification and standardized protocols ensure secure interactions.
* **Unprecedented Scalability:** Designed to scale to thousands of interacting agents.
* **Extensible and Customizable:** Easily integrate custom agents, capabilities, and communication protocols.
AgentConnect delivers unique advantages over classic multi-agent approaches:

* **Decentralized Architecture:** No central router, no single point of failure.
* **First-class agent autonomy:** Agents negotiate, cooperate, and evolve independently.
* **Interconnect Agent Systems:** Operates above internal frameworks, linking entire agent swarms.
* **Living ecosystem:** The network fluidly adapts as agents join, leave, or evolve their skills.
* **Secure A2A Communication:** Crypto-grade identity & message signing baked in.
* **Horizontal scalability:** Engineered for planet-scale agent populations.
* **Plug-and-play extensibility:** Easily integrate custom agents, capabilities, and protocols.
* **Integrated Agent Economy:** Seamless A2A payments powered by **Coinbase CDP & AgentKit**.


## ✨ Key Features

Expand All @@ -48,52 +55,77 @@ AgentConnect empowers developers to create a truly decentralized ecosystem of AI
<td width="33%">
<h3>🤖 Dynamic Agent Discovery</h3>
<ul>
<li>Capability-based matching</li>
<li>Flexible and adaptable network</li>
<li>No pre-defined connections</li>
<li>Capability-Based lookup</li>
<li>Decentralized Registry</li>
<li>Zero static links</li>
</ul>
</td>
<td width="33%">
<h3>⚡ Decentralized Communication</h3>
<h3>⚡ A2A Communication</h3>
<ul>
<li>Secure message routing</li>
<li>No central control</li>
<li>Reliable message delivery</li>
<li>Direct Agent-to-Agent Messaging</li>
<li>Cryptographic signatures</li>
<li>No routing bottlenecks</li>
</ul>
</td>
<td width="33%">
<h3>⚙️ Autonomous Agents</h3>
<h3>⚙️ True Agent Autonomy</h3>
<ul>
<li>Independent Operation & Logic</li>
<li>Self-Managed Lifecycles</li>
<li>Unrestricted Collaboration</li>
</ul>
</td>
</tr>
<tr>
<td>
<h3>🔒 Trust Layer</h3>
<ul>
<li>Verifiable identities</li>
<li>Tamper-proof messages</li>
<li>Standard Security Protocols</li>
</ul>
</td>
<td>
<h3>💰 Built-in Agent Economy</h3>
<ul>
<li>Autonomous A2A Payments</li>
<li>Coinbase CDP Integration</li>
<li>Instant service settlement</li>
</ul>
</td>
<td>
<h3>🔌 Multi-LLM Support</h3>
<ul>
<li>Independent operation</li>
<li>Own processing loop</li>
<li>Potentially complex internal structure</li>
<li>OpenAI, Anthropic, Groq, Google</li>
<li>Flexible AI Core Choice</li>
<li>Vendor-Agnostic Intelligence</li>
</ul>
</td>
</tr>
<tr>
<td>
<h3>🔒 Secure Communication</h3>
<h3>📊 Deep Observability</h3>
<ul>
<li>Message signing and verification</li>
<li>Standardized protocols</li>
<li>Ensures secure interactions</li>
<li>LangSmith tracing</li>
<li>Monitor tools & payments</li>
<li>Custom Callbacks</li>
</ul>
</td>
<td>
<h3>🔌 Multi-Provider Support</h3>
<h3>🌐 Dynamic Capability Advertising</h3>
<ul>
<li>OpenAI</li>
<li>Anthropic</li>
<li>Groq</li>
<li>Google AI</li>
<li>Agent Skill Broadcasting</li>
<li>Market-Driven Discovery</li>
<li>On-the-Fly Collaboration</li>
</ul>
</td>
<td>
<h3>📊 Monitoring (LangSmith)</h3>
<h3>🔗 Native Blockchain Integration</h3>
<ul>
<li>Comprehensive tracing</li>
<li>Debugging capabilities</li>
<li>Performance analysis</li>
<li>Coinbase AgentKit Ready</li>
<li>On-Chain Value Exchange</li>
<li>Configurable networks</li>
</ul>
</td>
</tr>
Expand All @@ -114,6 +146,15 @@ copy example.env .env # Windows
cp example.env .env # Linux/Mac
```

Set required environment variables in your `.env` file:
```
# Required for AI providers (at least one)
OPENAI_API_KEY=your_openai_api_key
# Optional for payment capabilities
CDP_API_KEY_NAME=your_cdp_api_key_name
CDP_API_KEY_PRIVATE_KEY=your_cdp_api_key_private_key
```

For detailed installation instructions and configuration options, see the [QuickStart Guide](docs/source/quickstart.md) and [Installation Guide](docs/source/installation.md).

## 🎮 Usage
Expand All @@ -132,6 +173,7 @@ AgentConnect includes several example applications to demonstrate different feat
- **Research Assistant**: Task delegation and information retrieval
- **Data Analysis**: Specialized data processing
- **Telegram Assistant**: Telegram AI agent with multi-agent collaboration
- **Agent Economy**: Autonomous workflow with automatic cryptocurrency payments between agents

For code examples and detailed descriptions, see the [Examples Directory](examples/README.md).

Expand Down Expand Up @@ -180,6 +222,7 @@ AgentConnect integrates with LangSmith for comprehensive monitoring:
* View detailed traces of agent interactions
* Debug complex reasoning chains
* Analyze token usage and performance
* Track payment tool calls from AgentKit integration

## 🛠️ Development

Expand Down Expand Up @@ -225,8 +268,9 @@ AgentConnect/
- ✅ **MVP with basic agent-to-agent interactions**
- ✅ **Autonomous communication between agents**
- ✅ **Capability-based agent discovery**
- **Coinbase AgentKit Payment Integration**
- **Coinbase AgentKit Payment Integration**
- ⬜ **Agent Identity & Reputation System**
- ⬜ **Asynchronous Agent Collaboration System**
- ⬜ **Marketplace-Style Agent Discovery**
- ⬜ **MCP Integration**
- ⬜ **Structured Parameters SDK**
Expand All @@ -250,8 +294,6 @@ See the [Changelog](CHANGELOG.md) for a detailed history of changes to the proje

## 🙏 Acknowledgments

- Built with [FastAPI](https://fastapi.tiangolo.com/), [LangChain](https://www.langchain.com/), and
[React](https://reactjs.org/)
- Inspired by the need for independent autonomous multi-agent collaboration with dynamic agent discovery
- Thanks to all contributors who have helped shape this project

Expand Down
12 changes: 12 additions & 0 deletions agentconnect/agents/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,20 @@ The `AIAgent` class is an autonomous, independent AI implementation that can ope
- Rate limiting and cooldown mechanisms
- Workflow-based processing that can include its own internal agent system
- Tool integration for enhanced capabilities
- Optional payment capabilities for agent-to-agent transactions

Each AI agent can operate completely independently, potentially with its own internal multi-agent structure, while still being able to discover and communicate with other independent agents across the network.

#### Payment Integration

When created with `enable_payments=True`, the `AIAgent` integrates payment capabilities:

- **Wallet Setup**: Triggers wallet initialization in `BaseAgent.__init__`
- **AgentKit Tools**: Payment tools (e.g., `native_transfer`, `erc20_transfer`) are automatically added to the agent's workflow in `AIAgent._initialize_workflow`
- **LLM Decision Making**: The agent's LLM decides when to use payment tools based on prompt instructions in templates like `CORE_DECISION_LOGIC` and `PAYMENT_CAPABILITY_TEMPLATE`
- **Network Support**: Default support for Base Sepolia testnet, configurable to other networks
- **Transaction Verification**: Built-in transaction verification and confirmation

### HumanAgent

The `HumanAgent` class provides an interface for human users to interact with AI agents. It offers:
Expand Down Expand Up @@ -243,3 +254,4 @@ if not message.verify(agent.identity):
5. **Resource Management**: Be mindful of resource usage when creating multiple independent AI agents.
6. **Secure Communication**: Always verify message signatures to maintain security in the decentralized network.
7. **Autonomous Operation**: Design agents that can make independent decisions without central control.
8. **Secure CDP Keys**: When using `enable_payments=True`, ensure CDP API keys are handled securely and never exposed.
Loading