Skip to content

LangGraph

Skytale provides first-class LangGraph support. Your agents get skytale_send and skytale_receive tools that move encrypted messages over MLS channels — no infrastructure to manage.

Terminal window
pip install skytale-sdk[langgraph]

This installs skytale-sdk and langchain-core.

from langgraph.prebuilt import create_react_agent
from langchain_openai import ChatOpenAI
from skytale_sdk.integrations import langgraph as skytale_lg
# 1. Create a channel manager
mgr = skytale_lg.create_manager(identity=b"research-agent")
# 2. Create or join a channel (see Invite Flow below)
mgr.create("acme/research/results")
# 3. Bind tools to a ReAct agent
agent = create_react_agent(
ChatOpenAI(model="gpt-4o"),
skytale_lg.tools(mgr),
)
# 4. The LLM can now send/receive encrypted messages
agent.invoke({
"messages": [("user", "Send our findings to acme/research/results")]
})

One agent creates the channel and generates a token; the joining agent uses it. MLS key exchange happens automatically.

When both agents run in the same script:

from skytale_sdk.integrations import langgraph as skytale_lg
alice = skytale_lg.create_manager(identity=b"alice")
bob = skytale_lg.create_manager(identity=b"bob")
alice.create("acme/demo/chat")
token = alice.invite("acme/demo/chat")
bob.join_with_token("acme/demo/chat", token)
# Both managers are now ready — bind tools and run agents

Run a setup script before starting your agents:

# setup.py — run once
from skytale_sdk import SkytaleChannelManager
creator = SkytaleChannelManager(identity=b"creator", data_dir="/var/lib/creator")
creator.create("acme/prod/pipeline")
# Generate a token and share it (env var, config file, etc.)
token = creator.invite("acme/prod/pipeline")
# Joiner uses the token — no key package exchange needed
joiner = SkytaleChannelManager(identity=b"joiner", data_dir="/var/lib/joiner")
joiner.join_with_token("acme/prod/pipeline", token)

Then each agent process loads its own data_dir and the channel is ready.

ToolArgsDescription
skytale_sendchannel, messageSend an encrypted message to a channel
skytale_receivechannel, timeout (default 5s)Receive buffered messages from a channel
skytale_channelsList all active channels
VariableDefaultDescription
SKYTALE_RELAYhttps://relay.skytale.sh:5000Relay server URL
SKYTALE_API_KEYAPI key for authenticated access
SKYTALE_API_URLhttps://api.skytale.shAPI server URL

See sdk/examples/langgraph_encrypted.py for a complete two-agent demo.

LangGraph agents and CrewAI agents on the same channel communicate automatically — Skytale is the pipe, not the framework. A LangGraph agent sends "Found 3 papers" and a CrewAI agent receives it, because both use the same SkytaleChannelManager under the hood.

For structured cross-protocol messaging, see the Envelope and Protocol Adapters documentation.