Multi-Agent Systems · Python · XMPP

Smart Python Agent Development Environment

The open-source platform for building intelligent multi-agent systems in Python. Agents that talk over XMPP, organize their work in behaviours, know who is online — and, with SPADE-LLM and SPADE BDI, reason with large language models and AgentSpeak.

01 · Presence

Agents come online

Every SPADE agent is a first-class XMPP client with its own JID. When it starts, it connects, announces its presence and becomes instantly reachable — by agents and by humans.

agent = MyAgent("agent@server", "passwd")
await agent.start()
02 · Behaviours

Behaviours drive them

Agents think in behaviours: cyclic, periodic, one-shot, timeout and finite-state machines — all running concurrently on Python's asyncio event loop.

self.add_behaviour(ReceiverBehaviour(),
  Template(metadata={"performative": "inform"}))
03 · Messaging

Messages flow over XMPP

Agents exchange FIPA-style messages with performatives, templates and presence awareness — real-time, standardized and secure, with no extra infrastructure to build.

msg = await self.receive(timeout=10)
await self.send(reply)
04 · Intelligence

Reasoning joins the network

Plug cognition into any agent: SPADE-LLM connects Large Language Models with tools, guardrails and memory, while SPADE BDI adds AgentSpeak reasoning with beliefs, desires and intentions.

agent = LLMAgent("llm@server", "passwd",
  provider=LLMProvider.create_openai(...))
PyPI Version Python Versions MIT License CI Status Coverage Documentation Downloads
0
Downloads
0
Stars
0
Forks
0
Plugins

Key Features

Discover what makes SPADE the perfect choice for multi-agent systems

🔌

XMPP-Based

Built on the XMPP protocol for robust, real-time messaging between agents and humans.

  • Standardized messaging
  • Presence notification
  • Security features
⚙️

Behaviour-Based Model

Define agent behaviors using cyclic, periodic, one-shot, and finite state machine patterns.

  • Modular design
  • Task specialization
  • Complex workflow support
🔄

Asyncio Support

Modern asynchronous programming with Python's asyncio for concurrent agent operations.

  • Non-blocking operations
  • Efficient resource usage
  • Modern Python practices
👁️

Presence Awareness

Real-time presence notification system to monitor agent status and availability.

  • Status tracking
  • Automatic reconnection
  • System monitoring
🌐

Web Interface

Built-in web interface for easy monitoring and interaction with your agents.

  • Message visualization
  • Agent status dashboard
  • Customizable UI
🧠

LLM Integration

Seamless integration with Large Language Models for intelligent agent reasoning and natural language processing.

  • AI-powered agents
  • Natural language understanding
  • Contextual reasoning

See SPADE Agents in Action

Write a few lines of Python, press Run, and watch your agent receive and reply to messages

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())
Live preview simulated
agent@localhost
network

A basic SPADE agent that receives messages and automatically replies — SPADE handles presence, the XMPP connection and message delivery for you. The preview above replays the program's real output; run it for yourself in a couple of commands.

From Zero to Agents in Minutes

No XMPP server to configure — SPADE ships with everything you need

1
Install SPADE

One command with uv (or pip). Python 3.10+ on Linux, macOS or Windows.

2
Write your first agent

Subclass Agent, add a behaviour, done. The built-in XMPP server starts automatically.

3
Run it

Watch your agent connect, announce its presence and start exchanging messages.

Full Quickstart Guide
$ uv init my-agents && cd my-agents
$ uv add spade
$ uv run agent.py
# agent.py
import spade
from spade.agent import Agent
from spade.behaviour import OneShotBehaviour

class HelloAgent(Agent):
    class Hello(OneShotBehaviour):
        async def run(self):
            print(f"Hello from {self.agent.jid}!")

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

async def main():
    agent = HelloAgent("hello@localhost", "secret")
    await agent.start()
    await spade.wait_until_finished(agent)

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

Extend SPADE with Plugins

Enhance your agent platform with specialized capabilities

SPADE BDI

Implement Belief-Desire-Intention agents with AgentSpeak language support.

SPADE PubSub

Add publish-subscribe communication patterns to your agent platform.

SPADE Artifact

Create and manage artifacts for your agents to interact with.

SPADE Norms

Implement normative systems to regulate agent behaviors.

SPADE Bokeh

Integrate interactive Bokeh plots with your agent interfaces.

Explore All Plugins

Discover the complete SPADE plugin ecosystem with detailed documentation and examples.

Use Cases

SPADE powers intelligent applications across various domains

🏭

Industrial IoT

Coordinate IoT devices and sensors in smart factories and industrial automation systems.

🏙️

Smart Cities

Manage traffic systems, energy grids, and public services through intelligent agent coordination.

🤖

Distributed AI

Build distributed artificial intelligence systems with cooperating and competing agents.

💹

Financial Trading

Create autonomous trading agents for algorithmic trading and market analysis.

🎓

Educational Systems

Develop adaptive learning environments and intelligent tutoring systems.

🌐

Social Networks

Model complex social interactions and communication patterns in virtual environments.

AI Enhancement

Meet SpadeLLM

Elevate your multi-agent systems with Large Language Model integration. Create agents that think, reason, and communicate naturally.

Next-Generation Agent Intelligence

SpadeLLM provides production-ready LLM integration with advanced safety and coordination features. Build intelligent agents with guardrails, persistent memory, human oversight, and sophisticated tool capabilities for secure, enterprise-grade AI applications.

🛡️
Guardrails System

Content filtering and safety controls for secure AI interactions

🧠
Dual Memory Architecture

Agent learning and conversation continuity with persistent storage

👥
Human-in-the-Loop

Web interface for expert consultation with configurable timeout

🔧
Advanced Tools System

Async function calling with custom tool creation and LangChain integration

🌐
MCP Server Support

Model Context Protocol integration for advanced agent coordination

💬
Smart Context Management

Multi-conversation support with automatic cleanup and intelligent routing

Multi-Agent Orchestration Demo
GitHub Monitor Active
👤 User 🛡️ Chat Agent 🔍 GitHub Analyzer 📚 Notion Manager 📧 Email Manager 👥 Human Expert Email sent
Agent Details
Active

Function

Agent function description

Tools & Capabilities

Tool 1 Tool 2

XMPP Messages

No messages yet

Why SpadeLLM? Key Advantages

🌐
XMPP-Based Distributed

Fully distributed and decentralized architecture based on XMPP protocol for robust, scalable agent communication.

🎯
Flexible Orchestration

Advanced orchestration capabilities with conditional routing, dynamic workflows, and intelligent message handling.

🔄
Intelligent Routing

Smart message routing with context-aware decision making, load balancing, and automatic failover mechanisms.

🔧
Rich Tool Ecosystem

Extensive tool integration including MCP servers, LangChain tools, and custom function calling capabilities.

🛡️
Safe & Secure Agents

Built-in security features, content filtering, guardrails system, and comprehensive safety controls for production use.

🔌
SPADE Extension Compatible

Seamlessly integrates with all SPADE extensions like BDI, PubSub, Artifacts, and Norms for enhanced functionality.

Frequently Asked Questions

Get answers to common questions about SPADE agents and multi-agent systems

SPADE (Smart Python Agent Development Environment) is a multi-agent systems platform built in Python that leverages XMPP (eXtensible Messaging and Presence Protocol) for communication. What makes SPADE unique is its combination of an intuitive behavior-based agent model with powerful instant messaging capabilities that allow agents to interact with both other agents and humans.

Unlike other agent frameworks, SPADE provides presence awareness, asynchronous operation through asyncio, and a web-based interface out of the box. It's designed to be both powerful for complex systems and approachable for developers new to agent-based programming.

No, SPADE includes a custom XMPP server (pyjabber) that you can use out of the box for development and testing. This means you can get started with SPADE without setting up any additional infrastructure.

However, for production environments or specific requirements, SPADE is compatible with any standard XMPP server like Prosody, ejabberd, or Openfire. This flexibility allows you to choose the best option for your specific deployment needs.

SPADE provides several types of predefined behaviors to help you implement different agent tasks:

  • CyclicBehaviour: Executes repeatedly without end
  • PeriodicBehaviour: Executes at regular time intervals
  • OneShotBehaviour: Executes only once
  • TimeoutBehaviour: Executes after a specified time delay
  • FSMBehaviour: Implements a Finite State Machine for complex behavior patterns

These behavior types can be combined and nested to create sophisticated agent logic, and each behavior can have its own message template to handle specific types of incoming communications.

SPADE offers several official extensions that expand its core capabilities:

  • SPADE BDI: Implements Belief-Desire-Intention agents with AgentSpeak support for intelligent reasoning and goal-oriented behavior
  • SPADE PubSub: Provides publish-subscribe communication patterns for event-driven agent interactions
  • SPADE Artifact: Enables knowledge management and data integration from multiple sources (CSV, SQL, APIs, MongoDB)

Install any extension with pip install spade_[extension] (e.g., pip install spade_bdi).

Use the SpadeLLM extension to integrate Large Language Models into your agents. It supports multiple LLM providers (OpenAI, Ollama, LM Studio, vLLM) and includes advanced features:

  • Async function calling with custom tools
  • Dual memory architecture for agent learning
  • Guardrails system for content filtering
  • Human-in-the-loop web interface
  • Intelligent message routing
  • MCP server connections

Install with pip install spade_llm and create intelligent agents that combine SPADE's distributed architecture with generative AI capabilities.

Latest News

Stay updated with the latest SPADE developments