SPADE Bokeh

Advanced web-based visualization platform for multi-agent systems with real-time data streaming, interactive dashboards, and enterprise-grade performance

What is SPADE Bokeh?

SPADE Bokeh Server Plugin is a powerful integration that brings Bokeh's advanced web-based interactive visualization capabilities directly into your SPADE multi-agent systems. This plugin leverages Bokeh's HTML5 Canvas and WebGL rendering to create high-performance, real-time visualizations that update dynamically as your agents operate.

Built on Bokeh's server architecture, the plugin provides seamless integration with SPADE 3+ web controller and Jinja2 template system. It transforms your multi-agent systems into visually rich, interactive monitoring and analysis platforms where complex agent behaviors, communication patterns, and system metrics are rendered as publication-quality charts accessible from any web browser.

Technical Foundation: Uses Bokeh's ColumnDataSource for efficient data streaming, periodic callbacks for real-time updates, and BokehServerMixin for seamless SPADE integration.

Advanced Bokeh Visualization Features

Real-Time Data Streaming

Leverage Bokeh's ColumnDataSource and periodic callbacks for efficient real-time agent data visualization. Stream new data points without full plot redraws, supporting high-frequency agent updates with minimal performance impact.

Interactive Chart Library

Access Bokeh's comprehensive plotting toolkit: scatter plots with customizable markers, multi-line time series, bar charts, histograms, box plots, contour plots, heatmaps, and specialized geographic visualizations for spatial agent data.

Agent Monitoring Dashboards

Build comprehensive multi-panel dashboards with interactive widgets (sliders, dropdowns, checkboxes) that trigger Python callbacks. Monitor agent states, performance metrics, message queues, and system health in real-time.

HTML5 Web Rendering

Deploy browser-based visualizations using HTML5 Canvas and WebGL rendering. No client-side installation required - serve interactive dashboards through SPADE's web interface with automatic plot synchronization.

Technical Architecture & Integration

Performance Optimized
  • Efficient Data Streaming: ColumnDataSource streams only new data points, not entire datasets
  • WebGL Acceleration: Hardware-accelerated rendering for large datasets and smooth interactions
  • Selective Updates: Only modified plot elements are re-rendered, maintaining 60fps performance
Developer Experience
  • BokehServerMixin: Simple mixin class for seamless SPADE integration
  • Template Integration: Direct embedding in Jinja2 templates with {{ script | safe }}
  • Multiple Servers: Run independent Bokeh servers on different ports per agent
Quick Integration Example
from spade_bokeh import BokehServerMixin
from spade.agent import Agent
from bokeh.plotting import figure
from bokeh.models import ColumnDataSource

class MyVisualizationAgent(BokehServerMixin, Agent):
    async def setup(self):
        # Start Bokeh server
        self.bokeh_server.start()
        
        # Add real-time plot endpoint
        self.bokeh_server.add_plot("/live_data", self.create_live_plot)
        
        # Start data streaming
        self.add_behaviour(self.DataStreamBehaviour())
    
    def create_live_plot(self, doc):
        # Create data source for streaming
        source = ColumnDataSource(data=dict(x=[], y=[]))
        
        # Create interactive plot
        plot = figure(title="Agent Performance", 
                     x_axis_label="Time", y_axis_label="Value")
        plot.line('x', 'y', source=source, line_width=2)
        
        # Add periodic callback for real-time updates
        def update_data():
            new_data = self.get_latest_metrics()
            source.stream(new_data, rollover=1000)
        
        doc.add_periodic_callback(update_data, 100)  # Update every 100ms
        doc.add_root(plot)
Why Choose SPADE Bokeh?
  • Enterprise-Grade Scaling: Handle thousands of agents with efficient data streaming and WebGL rendering
  • Rich Interaction Toolkit: Built-in zoom, pan, select, hover tools plus custom JavaScript callback support
  • Cross-Platform Compatibility: HTML5/JavaScript rendering works across all modern browsers and devices
  • Scientific Computing Integration: Native support for NumPy arrays, Pandas DataFrames, and SciPy data structures
  • Extensible Widget System: Custom controls, parameter sliders, data selection tools, and real-time configuration panels
Installation
pip install spade_bokeh

Requires Python 3.7+, SPADE 3+ framework, and Bokeh 2.0+

Transform Your Multi-Agent Systems