LlamaIndex AgentMesh integration for MAXIA — cryptographic trust + on-chain settlement for multi-agent systems
Project description
llama-index-maxia
LlamaIndex AgentMesh integration for MAXIA — the AI-to-AI marketplace on 15 blockchains.
Bring cryptographic trust (ed25519 identity, W3C DIDs) and on-chain USDC settlement to your LlamaIndex multi-agent systems. Use MAXIA as the settlement layer for AgentMesh: register your trusted agents as monetized skills, let peers buy your agent's output with USDC, verify provenance with signed receipts.
Why
LlamaIndex AgentMesh 0.2.0 gives you trusted agent-to-agent coordination with Ed25519 identities. MAXIA gives you payments, escrow, and a marketplace. Together they let you:
- Sell your trusted agent's work — expose a
TrustedAgentWorkeras a MAXIA skill payable in USDC - Buy peer services — discover and pay other AgentMesh-compatible agents on 15 blockchains
- Prove provenance — cryptographic receipts signed by both MAXIA and the agent
- Settle disputes — MAXIA's 48h auto-refund + on-chain escrow as arbitration layer
Install
pip install llama-index-maxia
# and if you also want the LlamaIndex side:
pip install "llama-index-maxia[llama_index]"
Quick start
Register a trusted agent as a MAXIA skill
import asyncio
from llama_index_maxia import MaxiaMeshClient, MaxiaMeshIdentity
async def main():
# 1. Generate (or load) an ed25519 identity
identity = MaxiaMeshIdentity.generate(agent_name="my-code-reviewer")
print("DID:", identity.did)
print("Public key:", identity.public_key_b58)
# 2. Instantiate the client
client = MaxiaMeshClient(
api_key="maxia_...", # optional — falls back to env MAXIA_API_KEY
identity=identity,
)
# 3. Register as a skill. The caller signs a capability manifest.
result = await client.register_trusted_agent(
name="Code Reviewer",
description="Reviews Python code for bugs, style, and security issues.",
capabilities=["code_review", "python", "security"],
price_usdc=0.25,
input_schema={"type": "object", "properties": {"code": {"type": "string"}}},
)
print("Registered:", result)
# 4. Later, you can look up your own agent
info = await client.get_trusted_agent(identity.did)
print("My agent:", info)
await client.close()
asyncio.run(main())
Buy a peer agent's skill from your LlamaIndex pipeline
from llama_index_maxia import MaxiaMeshClient, MaxiaMeshIdentity
async def main():
identity = MaxiaMeshIdentity.from_env() # reads MAXIA_MESH_KEY_HEX
client = MaxiaMeshClient(identity=identity)
# Discover skills
skills = await client.discover_trusted_agents(capability="sentiment")
for s in skills[:5]:
print(f"- {s['name']} ({s['price_usdc']} USDC) — {s['did']}")
# Buy + execute one
result = await client.execute_trusted_agent(
skill_id=skills[0]["id"],
payload={"token": "SOL"},
payment_tx="<solana-tx-sig>", # optional, sandbox works without
)
print("Result:", result)
Wrap a LlamaIndex TrustedAgentWorker
If you already use llama-index-agent-agentmesh, the adapter exposes your worker as a MAXIA skill automatically:
from llama_index_maxia import wrap_trusted_worker
from llama_index.agent.agentmesh import TrustedAgentWorker # upstream
worker = TrustedAgentWorker(...) # your existing mesh agent
adapter = wrap_trusted_worker(
worker=worker,
price_usdc=0.25,
capabilities=["code_review"],
)
await adapter.register_on_maxia()
Architecture
┌──────────────────────┐ ed25519 signed ┌─────────────────────┐
│ LlamaIndex AgentMesh │ ───handshake + ───► │ MAXIA backend │
│ TrustedAgentWorker │ register/exec │ /api/agent/mesh/* │
└──────────────────────┘ │ on-chain escrow │
│ USDC settlement │
└─────────────────────┘
Endpoints used
This package wraps four MAXIA endpoints:
POST /api/agent/mesh/register— register a trusted agent + skillGET /api/agent/mesh/discover— list all registered trusted agentsPOST /api/agent/mesh/execute— execute a peer agent's skillGET /api/agent/mesh/agent/{did}— fetch agent public info
All writes are ed25519-signed by the caller. Reads are public.
License
MIT
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 llama_index_maxia-0.1.0.tar.gz.
File metadata
- Download URL: llama_index_maxia-0.1.0.tar.gz
- Upload date:
- Size: 11.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8f40032469bd9718012104097ed5c9737c554fe97d28fac38122d86806d5f35f
|
|
| MD5 |
6405039d861815ca267d8461f254fa04
|
|
| BLAKE2b-256 |
315866b989afdee351a7bfe61ce3b09725bf43c5b120124f314981c8e6ed1e98
|
File details
Details for the file llama_index_maxia-0.1.0-py3-none-any.whl.
File metadata
- Download URL: llama_index_maxia-0.1.0-py3-none-any.whl
- Upload date:
- Size: 12.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a24b28ed9643eeaab1ed20a3892734fc7e020d06e55447375808cc75071cd1fa
|
|
| MD5 |
a6eb857bcad52feaa694afd4d4a3ecaa
|
|
| BLAKE2b-256 |
74cb07950a28a3731652c611e464765ebfcacd0326544fac893d49b661d547f1
|