🔧 BitChat for Strands Agents
P2P Encrypted Communication Tool for Strands Agent Development
Add decentralized, peer-to-peer encrypted chat capabilities to your Strands agents using Bluetooth Low Energy mesh networking.
📦 Installation
pip install strands-bitchat
🔧 Basic Integration
from strands import Agent
from strands_bitchat import bitchat
from strands_tools import use_agent
# Add BitChat to your existing agent
agent = Agent(
tools=[bitchat, use_agent], # Required: bitchat + use_agent
system_prompt="Your agent with P2P communication capabilities"
)
# Enable P2P networking
agent.tool.bitchat(action="start", agent=agent)
agent.tool.bitchat(action="enable_agent", trigger_keyword="max", agent=agent)
🛠️ Core Actions
| Action | Purpose | Required Parameters |
|---|---|---|
start |
Initialize P2P network | - |
stop |
Stop P2P network | - |
status |
Network status | - |
send_public |
Broadcast to all peers | message |
send_private |
Encrypted direct message | message, recipient |
send_channel |
Send to specific channel | message, channel |
join_channel |
Join/create channel | channel |
leave_channel |
Leave current channel | - |
list_peers |
Show connected peers | - |
list_channels |
Show discovered channels | - |
get_messages |
Get recent message history | - |
set_nickname |
Change your nickname | nickname |
block_user / unblock_user |
Block/unblock users | nickname |
enable_agent |
Enable auto-responses | trigger_keyword, agent |
enable_monitor |
Monitor all messages silently | agent |
disable_agent |
Disable agent integration | - |
agent_status |
Check agent integration status | - |
🤖 Agent-to-Agent Communication
# Agent A
from strands import Agent
from strands_tools import use_agent
from strands_bitchat import bitchat
# Agent A - Coordinator
coordinator = Agent(
system_prompt="BitChat enabled agent. Agent coordinator. Agent A. Can call 'worker'.",
tools=[bitchat, use_agent],
record_direct_tool_call=False
)
coordinator.tool.bitchat(action="start", agent=coordinator)
coordinator.tool.bitchat(action="enable_agent", trigger_keyword="coord", agent=coordinator)
# Agent B - Worker
worker = Agent(
system_prompt="BitChat enabled agent. Agent B. Can call 'coord' for coordinator agent.",
tools=[bitchat, use_agent],
record_direct_tool_call=False
)
worker.tool.bitchat(action="start", agent=worker)
worker.tool.bitchat(action="enable_agent", trigger_keyword="worker", agent=worker)
# Now agents can communicate:
# "coord, start task X"
# "worker, process data Y"
# Additional features:
# Monitor mode (processes all messages, no auto-response)
coordinator.tool.bitchat(action="enable_monitor", agent=coordinator)
# Channel operations
coordinator.tool.bitchat(action="join_channel", channel="#team", password="secret")
coordinator.tool.bitchat(action="send_channel", message="Hello team!", channel="#team")
# Private messaging
coordinator.tool.bitchat(action="send_private", message="Direct message", recipient="worker")
# Network management
coordinator.tool.bitchat(action="list_peers")
coordinator.tool.bitchat(action="get_messages")
coordinator.tool.bitchat(action="agent_status")
🔧 Development Notes
- Always include both tools:
[bitchat, use_agent]for agent integration - Agent parameter: Required only for
enable_agentandenable_monitoractions - Auto-installs dependencies: Bluetooth LE stack installed automatically on first use
- ~5 seconds: Time needed for peer discovery and connection
- Two modes: Trigger mode (auto-responds) or Monitor mode (silent processing)
- Channel passwords: Use for secure team communications
🐛 Troubleshooting
- No peers found: Check Bluetooth is enabled
- Agent not responding: Verify trigger keyword and
use_agenttool - Permission issues: Grant Bluetooth system permissions
📄 License
MIT License
🚀 Enable your Strands agents to collaborate directly via P2P mesh networking
Metadata
Release files for strands-bitchat 1.0.7
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| strands_bitchat-1.0.7.tar.gz | 33.3 kB | Without provenance | Details for strands_bitchat-1.0.7.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| strands_bitchat-1.0.7-py3-none-any.whl | Python 3 | none | any | Details for strands_bitchat-1.0.7-py3-none-any.whl |
Total release size: 60.9 kB
Release files / strands_bitchat-1.0.7.tar.gz
| Download URL | strands_bitchat-1.0.7.tar.gz |
|---|---|
| Size | 33.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7eefb95fee808563d21e11d50b18ff4f8fd3af3ea14fba0c19848680957982c6
|
|
BLAKE2b-256 checksum How to use checksums |
4c79fb68e879e4124c167e3fe79aa9b7e88b7d9a50fe22cb2bed4759b0550e3c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.5
|
Release files / strands_bitchat-1.0.7-py3-none-any.whl
| Download URL | strands_bitchat-1.0.7-py3-none-any.whl |
|---|---|
| Size | 27.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7ad060303f36aacdc76d4034ed14e74e6f8926305794cb7994911efb7cf42bbe
|
|
BLAKE2b-256 checksum How to use checksums |
3a8023705a9315753a4794e289e3026d7b4ad4ed4660a7ad34ef035093577225
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.5
|
Security for strands-bitchat 1.0.7
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.