SPADE PubSub

XMPP XEP-0060 compliant publish-subscribe communication for SPADE agent frameworks

What is SPADE PubSub?

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.

Technical Foundation

Protocol: XMPP XEP-0060 (Publish-Subscribe Extension) | Language: Python (91.4% codebase) | Integration: SPADE multi-agent framework | License: MIT

XMPP XEP-0060 Implementation & Core Capabilities

Node Creation & Management

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.

Subscription & Publication System

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.

Event Notification Without Items

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.

Agent-Centric Callback System

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.

Technical Architecture & Benefits

  • XMPP XEP-0060 Compliance: Full implementation of the Publish-Subscribe Extension standard with support for all node types, access models, and subscription states
  • Agent-Framework Integration: Seamless bridging layer between SPADE agents and XMPP PubSub infrastructure with Python-native APIs
  • Event-Driven Architecture: Asynchronous callback system enables reactive agent behaviors for publications, retractions, and subscription events
  • Flexible Access Control: Support for Open, Authorize, Presence, Roster, and Whitelist access models with granular permission management
  • Hierarchical Organization: Collection nodes (XEP-0248) enable sophisticated node relationships and efficient subscription management
  • Production Ready: MIT licensed, extensively documented, and compatible with any XMPP server supporting PubSub extensions
Implementation Example

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.

Ready to implement event-driven agent communication?