SPADE Framework

Smart Python Agent Development Environment - A multi-agent systems framework powered by XMPP messaging, enabling intelligent agents to communicate with each other and humans.

What is SPADE?

SPADE (Smart Python Agent Development Environment) is an open-source multi-agent systems platform that enables developers to create intelligent agents capable of communicating with other agents and humans through the XMPP protocol.

Built with modern Python's asyncio architecture, SPADE provides a behavior-based agent model that supports real-time presence notifications, FIPA metadata handling, and includes a built-in web interface for monitoring and interaction. Compatible with Python ≥3.9 and works across Windows, macOS, and Linux platforms.

Technical Specifications
  • Language: Python ≥3.9
  • Protocol: XMPP (Extensible Messaging and Presence Protocol)
  • Architecture: Asyncio-based for concurrent operations
  • License: MIT Open Source

Core Framework Features

XMPP-Based Communication

Built on the XMPP protocol for robust, real-time messaging between agents and humans. Includes standardized messaging, presence notification, and built-in security features.

Behaviour-Based Model

Define agent behaviors using cyclic, periodic, one-shot, and finite state machine patterns. Modular design supports task specialization and complex workflow management.

Asyncio Support

Modern asynchronous programming with Python's asyncio for concurrent agent operations. Enables non-blocking operations, efficient resource usage, and modern Python practices.

Presence Awareness

Real-time presence notification system to monitor agent status and availability. Includes status tracking, automatic reconnection, and comprehensive system monitoring.

Web Interface

Built-in web interface for easy monitoring and interaction with your agents. Features message visualization, agent status dashboard, and customizable user interface.

FIPA Compliance

Supports FIPA metadata via XMPP Data Forms, ensuring compatibility with multi-agent system standards.

Quick Start Guide

Installation

Install SPADE using pip and create your first agent in minutes.

Terminal
pip install spade

Requirements: Python ≥3.9, works on Windows, macOS, and Linux.

Hello World Agent

Create your first SPADE agent with this simple example.

hello_agent.py
import spade
from spade.agent import Agent
from spade.behaviour import OneShotBehaviour

class MyAgent(Agent):
    class MyBehav(OneShotBehaviour):
        async def run(self):
            print("Hello World!")

    async def setup(self):
        self.add_behaviour(self.MyBehav())

async def main():
    agent = MyAgent("agent@localhost", "password")
    await agent.start()

if __name__ == "__main__":
    spade.run(main())

Framework Resources & Documentation

Comprehensive resources to help you build powerful multi-agent systems with SPADE:

Ready to build your multi-agent system?

Agent Communication Example

Message Handling Agent

This example demonstrates SPADE's message handling capabilities with automatic reply functionality:

agent_example.py
import spade
from spade.agent import Agent
from spade.behaviour import CyclicBehaviour
from spade.message import Message

class MyAgent(Agent):
    class MyBehaviour(CyclicBehaviour):
        async def run(self):
            msg = await self.receive(timeout=10)
            if msg:
                print(f"Message received: {msg.body}")
                reply = Message(to=str(msg.sender))
                reply.body = "I received your message!"
                await self.send(reply)

    async def setup(self):
        behaviour = self.MyBehaviour()
        self.add_behaviour(behaviour)

async def main():
    agent = MyAgent("agent@localhost", "password")
    await agent.start()

if __name__ == "__main__":
    spade.run(main())

This agent can receive messages and automatically reply to them. SPADE handles all the underlying communication details for you.

Interactive Agent Demo

See how SPADE agents communicate and interact in real-time

Status: Paused
A simple demonstration of two agents exchanging messages.
Agent Communication

Watch agents send and receive messages using XMPP protocol

Behavior Patterns

See different behavior types: Cyclic, Periodic, and One-shot

Real-time Updates

Monitor agent status and presence in real-time

Python Implementation