What is SpadeLLM?

SpadeLLM is a production-ready extension for SPADE that integrates Large Language Models into multi-agent systems, enabling intelligent communication, reasoning, and decision-making capabilities across distributed agent networks.

Built with enterprise requirements in mind, SpadeLLM supports multiple LLM providers (OpenAI, Ollama, LM Studio), Model Context Protocol (MCP) integration for both local and HTTP streaming servers, advanced memory management, human-in-the-loop workflows, and comprehensive guardrails for safe AI deployment. Compatible with Python 3.10-3.12 and SPADE 3.3.0+.

Advanced LLM Integration Features

Multi-Provider Architecture

Seamlessly integrate with OpenAI GPT-4, Ollama local models, and LM Studio. Switch providers dynamically or use multiple models simultaneously for different agent roles.

Advanced Tool & MCP Integration

Agents can execute custom tools and functions asynchronously with JSON schema validation. Full Model Context Protocol (MCP) support for local servers (stdout/stdin) and HTTP streaming servers. Includes LangChain tool integration and custom tool creation.

Dual Memory System

Agent-based memory for shared knowledge across the system and thread-level memory for isolated conversation contexts. Smart context window management with configurable size limits and automatic cleanup.

Human-in-the-Loop

Web-based interface for expert consultation and oversight. Configurable timeout mechanisms for human intervention in critical decisions, ensuring responsible AI deployment.

Learn SpadeLLM - Step by Step

Follow our comprehensive tutorials to master SpadeLLM, from your first agent to advanced multi-agent systems.

🤖

Your First LLM Agent

Beginner 30-45 min

Learn how to create a basic SPADE-LLM agent step by step, starting with a simple setup and gradually adding features to understand core concepts.

Basic Agent Setup LLM Provider Config Interactive Chat
Start Tutorial →
🛡️

Guardrails System Tutorial

Intermediate 1-2 hours

Learn how to implement safety and content filtering in SPADE-LLM agents using comprehensive guardrail mechanisms.

Input/Output Guardrails Keyword Filtering LLM Safety Validation
Learn Guardrails →
🔧

Custom Tools Tutorial

Intermediate 1-2 hours

Learn how to create and use custom tools with SPADE-LLM agents to perform actions beyond text generation.

Tool Creation Schema Definition Multi-Tool Agents
Build Tools →
🏗️

Advanced Multi-Feature Agent

Advanced 2-3 hours

Create sophisticated multi-agent systems with advanced features like MCP integration, human-in-the-loop workflows, and complex routing.

Multi-Agent Systems MCP Integration Human-in-the-Loop
Build Advanced System →
Ready to become a SpadeLLM expert?

Explore all tutorials and guides in our comprehensive documentation.

Start with Your First Agent

LLM Provider Architecture

Production-ready integration with leading AI providers and local serving frameworks:

OpenAI GPT-4.1, GPT-4.1-mini
GPT-4o, GPT-4-turbo
Ollama Llama 3.3, Qwen3, Gemma 3
DeepSeek-R1, Phi-4
LM Studio Local inference
Custom models

Memory Management & Guardrails

Agent-Based Memory

Shared knowledge store across all agent instances. Perfect for maintaining global context, learned behaviors, and system-wide knowledge that persists across restarts and conversations.

Thread-Level Memory

Isolated conversation contexts for individual user sessions. Maintains conversation history, user preferences, and context-specific information without cross-contamination between threads.

Content Guardrails

Keyword-based filtering system for input and output validation. Configurable blocking policies prevent inappropriate content, protect sensitive information, and ensure compliance with content policies.

Context Window Management

Smart and fixed window sizing with automatic cleanup. Optimizes token usage while maintaining conversation coherence. Configurable limits prevent context overflow and manage costs effectively.

Technical Architecture & Benefits

  • Asynchronous Design: Built on SPADE's async architecture with non-blocking LLM calls and parallel tool execution
  • Context Management: Smart and fixed window sizing with automatic context cleanup and conversation threading
  • Memory Persistence: Agent-based memory for shared knowledge and thread-level memory for isolated conversations
  • Safety Guardrails: Keyword-based content filtering, input/output validation, and configurable security policies
  • Provider Flexibility: Dynamic provider switching with unified API across OpenAI, Ollama, and LM Studio
  • Tool & MCP Integration: JSON schema-validated tool calling with full Model Context Protocol support (local stdout/stdin and HTTP streaming), LangChain compatibility and custom function support
Quick Start Example
from spade_llm import LLMAgent, LLMProvider

async def main():
    # Configure provider
    provider = LLMProvider.create_openai(
        api_key="your-api-key",
        model="gpt-4.1-mini"
    )
    
    # Create intelligent agent
    agent = LLMAgent(
        jid="assistant@example.com",
        password="password",
        provider=provider,
        system_prompt="You are a helpful assistant"
    )
    
    await agent.start()
Ready to build intelligent multi-agent systems?