Skip to main content

CrewAI integration for Beam Protocol

Project description

beam-crewai

beam-crewai is a small Python package that connects CrewAI agents to Beam Protocol using the beam-directory SDK.

It provides two high-level primitives:

  • BeamTool: a CrewAI-compatible tool for sending natural-language messages to Beam agents
  • BeamAgent: a thin wrapper around the Beam Protocol Python SDK for registration, intent sending, and natural-language conversations

Installation

pip install beam-crewai

Quick Start

1) Create a Beam wrapper

from beam_crewai import BeamAgent

beam = BeamAgent.create(
    agent_name="researcher",
    org_name="acme",
    directory_url="https://api.beam.directory",
    default_recipient="analyst@partner.beam.directory",
)

2) Send a Beam intent

result = beam.send_intent_sync(
    intent="query.status",
    params={"detail": "full"},
)

print(result.success)
print(result.payload)

3) Send a natural-language Beam message

reply = beam.talk_sync("What is the latest account summary?")
print(reply["message"])

Using BeamTool with CrewAI

from crewai import Agent
from beam_crewai import BeamAgent, BeamTool

beam = BeamAgent.create(
    agent_name="ops-assistant",
    org_name="acme",
    directory_url="https://api.beam.directory",
    default_recipient="crm@partner.beam.directory",
)

beam_tool = BeamTool(
    beam_agent=beam,
    description="Send a message to the CRM Beam agent and return the reply.",
)

agent = Agent(
    role="Operations Assistant",
    goal="Fetch information from partner agents over Beam",
    backstory="A CrewAI agent that delegates partner-system questions to Beam agents.",
    tools=[beam_tool],
)

The tool sends a conversation.message request through Beam and returns the remote agent's text response. If the Beam response has no plain-text message, it falls back to serialized structured payload.

API

BeamAgent

  • BeamAgent.create(...): creates a new Beam identity and client
  • BeamAgent.from_identity_data(...): rebuilds a wrapper from exported Beam identity data
  • register(...) / register_sync(...): registers the local Beam agent in the directory
  • send_intent(...) / send_intent_sync(...): sends a Beam intent frame
  • talk(...) / talk_sync(...): sends a natural-language Beam message

BeamTool

  • Accepts message, optional to, optional context, optional language, and timeout_ms
  • Uses the wrapper's default_recipient when to is omitted
  • Raises an error on Beam delivery failures so CrewAI can surface the tool failure

Development

Run the package tests with:

python -m unittest discover -s tests

License

Apache-2.0

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

beam_crewai-0.1.0.tar.gz (15.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

beam_crewai-0.1.0-py3-none-any.whl (13.5 kB view details)

Uploaded Python 3

File details

Details for the file beam_crewai-0.1.0.tar.gz.

File metadata

  • Download URL: beam_crewai-0.1.0.tar.gz
  • Upload date:
  • Size: 15.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for beam_crewai-0.1.0.tar.gz
Algorithm Hash digest
SHA256 a3b1a757c971c835e7f2145e6a6f7bbbcda52f5577a56f903c9b4cf4f3b50ce3
MD5 17ce11302f2c30fa255ff803b36307fd
BLAKE2b-256 dd84c31909368cc4594391daeddb14e5cad16342000ca67be65d5d02976b401f

See more details on using hashes here.

File details

Details for the file beam_crewai-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: beam_crewai-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 13.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for beam_crewai-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 289f19b735ece21421b0addccb8d868e2c2cdecd136f2650c8728bb36d0c4490
MD5 4f5470c53ecb780b77812a03fa70b083
BLAKE2b-256 92e38081e9f169721cdec2e5cf3978f37b149438ab07d3aba6aa44f21b64e8d7

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page