Skip to content

CrewAI

Skytale integrates with CrewAI as standard BaseTool instances. Your agents get encrypted send/receive capabilities without any infrastructure changes.

Terminal window
pip install skytale-sdk[crewai]

This installs skytale-sdk and crewai.

from crewai import Agent, Task, Crew
from skytale_sdk.integrations import crewai as skytale_crew
# 1. Create a channel manager
mgr = skytale_crew.create_manager(identity=b"analyst")
# 2. Create or join a channel (see Invite Flow below)
mgr.create("acme/analysis/pipeline")
# 3. Create an agent with Skytale tools
analyst = Agent(
role="Analyst",
goal="Read and analyze data from the encrypted channel",
backstory="You analyze data received via encrypted channels.",
tools=skytale_crew.tools(mgr),
)
# 4. Run a task
task = Task(
description="Check acme/analysis/pipeline for new data and summarize it.",
expected_output="A summary of the data received.",
agent=analyst,
)
crew = Crew(agents=[analyst], tasks=[task])
crew.kickoff()

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

from skytale_sdk.integrations import crewai as skytale_crew
researcher = skytale_crew.create_manager(identity=b"researcher")
analyst = skytale_crew.create_manager(identity=b"analyst")
researcher.create("acme/demo/findings")
token = researcher.invite("acme/demo/findings")
analyst.join_with_token("acme/demo/findings", token)
# Both managers are ready — create Agents with tools and run a Crew

Run a setup script before starting your crew:

# 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)
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/crewai_encrypted.py for a complete multi-agent crew demo.

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

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