XMPP XEP-0060 compliant publish-subscribe communication for SPADE agent frameworks
SPADE PubSub is a Python plugin that extends the SPADE 3+ (Smart Python Agent Development Environment) framework with XMPP XEP-0060 Publish-Subscribe capabilities, providing agents with standardized event-driven communication patterns for scalable multi-agent systems.
Acting as a bridging layer between SPADE's agent-oriented architecture and XMPP's publish-subscribe infrastructure, this plugin enables agents to create, manage, and interact with PubSub nodes on XMPP servers. The implementation supports the full XEP-0060 specification, including node creation and deletion, subscription management, item publication and retraction, and configurable event notifications with callback systems for reactive agent behaviors.
Protocol: XMPP XEP-0060 (Publish-Subscribe Extension) | Language: Python (91.4% codebase) | Integration: SPADE multi-agent framework | License: MIT
Comprehensive Node Operations: Create, delete, and purge PubSub nodes programmatically. Support for leaf nodes (content containers) and collection nodes (XEP-0248) for hierarchical organization. Configurable access models (Open, Authorize, Presence, Roster, Whitelist) provide granular permission control over node access and subscription management.
State-Aware Management: Handle subscription states (None, Pending, Unconfigured, Subscribed) with approval workflows. Publish items to nodes with automatic notification delivery to all subscribers. Support for item publication, retraction, and retrieval with optional payload delivery and persistent storage.
Flexible Messaging: Send notifications to all node subscribers without publishing specific items, ideal for alerts and signals. Supports metadata subscriptions for node configuration changes and extended subscription types including hierarchical notifications and linked item relationships.
Reactive Event Handling: Register custom callbacks for publication, retraction, and subscription events. Asynchronous processing enables agents to react to PubSub events in real-time. Seamless integration with SPADE agent behaviors for event-driven multi-agent system architectures.
Basic Node Operations:
# Create and manage PubSub nodes
await agent.create_node("sensor_data")
await agent.subscribe("sensor_data", callback_function)
await agent.publish("sensor_data", item_data)
Full API documentation available at the official documentation.