coffeeAGNTCY on Skytale
coffeeAGNTCY is AGNTCY’s multi-agent reference application. A Coffee Exchange agent negotiates prices with a Coffee Farm agent using the SLIM transport layer. This tutorial shows two ways to add Skytale’s MLS encryption to the flow.
Prerequisites
Section titled “Prerequisites”- A Skytale account (
skytale signup you@example.com) - Python 3.10+
pip install skytale-sdk
Part 1: Drop-in with existing coffeeAGNTCY
Section titled “Part 1: Drop-in with existing coffeeAGNTCY”If you already have coffeeAGNTCY running, point its transport at the Skytale relay. The relay exposes a gRPC interface on port 5000 that accepts SLIM-formatted messages.
1. Clone coffeeAGNTCY
Section titled “1. Clone coffeeAGNTCY”git clone https://github.com/agntcy/coffeeAGNTCY.gitcd coffeeAGNTCY2. Set the transport endpoint
Section titled “2. Set the transport endpoint”In your coffeeAGNTCY environment config, set the relay as the transport server:
export TRANSPORT_SERVER_ENDPOINT="relay.skytale.sh:5000"export SKYTALE_API_KEY="sk_live_..."3. Run the agents
Section titled “3. Run the agents”Follow the standard coffeeAGNTCY instructions. Messages between the Exchange and Farm agents now route through the Skytale relay with MLS encryption.
Part 2: Native SDK approach
Section titled “Part 2: Native SDK approach”Build the same Exchange/Farm negotiation directly with the Skytale Python SDK. This approach gives you full control over channels, invite tokens, and protocol envelopes.
Installation
Section titled “Installation”pip install skytale-sdkThe example script
Section titled “The example script”The full script is at sdk/examples/coffeeagntcy_skytale.py. Here’s a walkthrough of the key pieces.
Channel setup
Section titled “Channel setup”The Exchange agent creates a channel and generates an invite token. The Farm agent joins with that token — no manual key package exchange needed.
from skytale_sdk import SkytaleChannelManager
# Exchange creates the channelexchange = SkytaleChannelManager(identity="exchange", api_key="sk_live_...")exchange.create("coffeeagntcy/trading/negotiation")token = exchange.invite("coffeeagntcy/trading/negotiation")
# Farm joins with the invite tokenfarm = SkytaleChannelManager(identity="farm", api_key="sk_live_...")farm.join_with_token("coffeeagntcy/trading/negotiation", token)A2A protocol envelopes
Section titled “A2A protocol envelopes”Messages use Envelope with Protocol.A2A so they’re tagged for A2A tooling while being MLS-encrypted end-to-end.
import jsonfrom skytale_sdk import Envelope, Protocol
def make_a2a_message(sender: str, text: str) -> Envelope: """Wrap a text message in an A2A protocol envelope.""" payload = json.dumps({ "parts": [{"type": "text", "text": text}], "sender": sender, }).encode("utf-8") return Envelope( protocol=Protocol.A2A, content_type="application/json", payload=payload, )
# Exchange sends a quote requestexchange.send_envelope( "coffeeagntcy/trading/negotiation", make_a2a_message("exchange", "Requesting quote: 100 bags Arabica, delivery Q3 2026"),)
# Farm receives and respondsenvelopes = farm.receive_envelopes("coffeeagntcy/trading/negotiation", timeout=10.0)for env in envelopes: body = json.loads(env.payload) print(body["parts"][0]["text"])Local dev mode
Section titled “Local dev mode”Use --mock to run without a relay or API key. The SDK uses in-memory transport for local testing.
python coffeeagntcy_skytale.py --mock=== coffeeAGNTCY on Skytale ===Mode: mock (local)
[Exchange] Created channel: coffeeagntcy/trading/negotiation[Exchange] Invite token generated[Exchange] Sent quote request[Farm] Joined channel: coffeeagntcy/trading/negotiation[Farm] Received: Requesting quote: 100 bags Arabica, delivery Q3 2026[Farm] Sent quote[Exchange] Received: Quote: $4.20/lb Arabica, 100 bags, FOB Santos. Valid 24h.[Exchange] Deal confirmed[Farm] Received: Accepted. Locking price at $4.20/lb for 100 bags.
=== Negotiation complete ===Running against the hosted relay
Section titled “Running against the hosted relay”skytale signup you@example.compython coffeeagntcy_skytale.pyOr pass credentials explicitly:
python coffeeagntcy_skytale.py --api-key sk_live_... --endpoint https://relay.skytale.sh:5000Environment variables
Section titled “Environment variables”| Variable | Default | Description |
|---|---|---|
SKYTALE_API_KEY | ~/.skytale/api-key | API key for authenticated access |
SKYTALE_RELAY | https://relay.skytale.sh:5000 | Relay server URL |
SKYTALE_API_URL | https://api.skytale.sh | API server URL |
SKYTALE_MOCK | — | Set to 1 or true for local dev mode |
Next steps
Section titled “Next steps”- Python SDK reference for the full
SkytaleChannelManagerAPI - LangGraph integration to add Skytale tools to LangGraph agents
- Architecture for how the relay, MLS, and SDK fit together