Simple infrastructure to enable payments for AI agents
Project description
Neural Payments -- Payments infrastructure for AI agents
Overview
An SDK that enables your AI agent to send and receive money programmatically. You can spin up agents, fund them with USDC, and enable them to recieve and send money from any other agent that integrates the Neural Payments SDK.
The SDK comes with a template with sample agents. To use your own agents, simply replace the agent names and identities in the template with yours.
Features
-
Programmatic Payments: Send and receive payments without messing with Paypal / stripe / credit card check in / check out pages.
-
Sample Agent Template: Create and customise your own agent by replacing the agent names in the sample templates with your own agents.
-
Instant USDC Payments: Implements near real-time USDC payments with verifiable transaction records on the USDC main net.
Prerequisites
- Python (3.9 or later)
- Node.js (v20.17.0 or later)
- API Keys from Circle’s Developer Console: Obtain your API keys by visiting Circle’s Developer Console.
Environment Setup
Python Setup
- Install Python and create a virtual environment:
mkdir ai_agents_project cd ai_agents_project python -m venv ai_agents_env source ai_agents_env/bin/activate # On Windows use: ai_agents_env\Scripts\activate
- Install necessary Python packages:
pip install autogen python-dotenv
Node.js Setup
- Create a new Node.js project:
npm init -y
- Install Circle's Developer-Controlled Wallets SDK:
npm install @circle-fin/developer-controlled-wallets --save
Configuration
- Create a
.envfile in the project root and add your API keys. To test in Replit, use the Replit Secret Keys feature:OPENAI_API_KEY=your_openai_api_key CIRCLE_API_KEY=your_circle_api_key CIRCLE_ENTITY_SECRET=your_circle_entity_secret - Create an
OAI_CONFIG_LISTfile containing necessary OpenAI configurations:[ { "model": "gpt-4o", "api_key": "${OPENAI_API_KEY}" } ]
Usage
To run the entire project, execute the following command:
python3 main.py
Key Scripts
ai_research.py: Contains logic to create and manage the AI agents in sample template.circle_payment.js: Implements blockchain payment processing, including wallet creation, transaction processing, and validation of payments received by AI agents.main.py: Orchestrates the execution of the research tasks and the payment processing.
Key Functions
- AI Research: Managed by the function defined in
ai_research.py, which initiates conversations among AI agents and collaborates on tasked workflows. - Blockchain Payments: Handled by the functions in
circle_payment.js, which encompass creating wallets, checking balances, and processing transactions.
Running the Project
- Execute the project by running
main.py. It will perform AI research on the topic defined in the script and handle all wallet interactions and payments through the Circle API. - Monitor the logs in the terminal for real-time feedback regarding agent contributions and payment confirmations.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file agent_payments-0.2.0.tar.gz.
File metadata
- Download URL: agent_payments-0.2.0.tar.gz
- Upload date:
- Size: 101.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c4ebc9406f45d5b435913f0240147b84257cc7fb1b2ab0bb3408c4badcb6a3ce
|
|
| MD5 |
ad8fabe930b11df60314491ae1716845
|
|
| BLAKE2b-256 |
c9b8d91028bf04a7bfa82976dd6196ca4bf0aeb541aac10d2ca9a6a012b05a54
|
File details
Details for the file agent_payments-0.2.0-py3-none-any.whl.
File metadata
- Download URL: agent_payments-0.2.0-py3-none-any.whl
- Upload date:
- Size: 6.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b9a7c02e017f1fb464e2af4973333ba33b20f4ab21d6974bcc0b6b91d462047d
|
|
| MD5 |
8a8e6c10f47dd51a3915077542c5d316
|
|
| BLAKE2b-256 |
e63ddf4a45c8d1830fda6ef250d6cd0e802a316cc4f12a2cadc0ccf3a45d156d
|