A Python SDK implementing the Blackboard Pattern for LLM-powered multi-agent systems
Project description
Blackboard-Core
A Python SDK for building LLM-powered multi-agent systems using the Blackboard Pattern.
What is Blackboard-Core?
Blackboard-Core provides a centralized state architecture for multi-agent AI systems. Instead of agents messaging each other directly, all agents read from and write to a shared Blackboard (state), while a Supervisor LLM orchestrates which agent runs next.
┌─────────────────────────────────────────────────────────────┐
│ ORCHESTRATOR │
│ ┌─────────────┐ ┌──────────────────────────────────┐ │
│ │ Supervisor │──▶│ BLACKBOARD │ │
│ │ (LLM) │ │ • Goal • Artifacts │ │
│ └─────────────┘ │ • Status • Feedback │ │
│ │ │ • History • Metadata │ │
│ ▼ └──────────────────────────────────┘ │
│ ┌─────────────────────────────────────────────────────┐ │
│ │ WORKERS │ │
│ │ [Writer] [Critic] [Refiner] [Researcher] ... │ │
│ └─────────────────────────────────────────────────────┘ │
└─────────────────────────────────────────────────────────────┘
Features
- Centralized State - All agents share a typed Pydantic state model
- LLM Orchestration - A supervisor LLM decides which worker runs next
- Async-First - Built for high-performance async/await patterns
- Middleware System - Budget tracking, logging, human approval, auto-summarization
- Tool Calling - Native support for OpenAI-style function calling
- Persistence - Save/resume sessions with optimistic locking
- Memory System - Vector memory with pluggable embeddings
- Parallel Execution - Run independent workers concurrently
Installation
pip install blackboard-core
Quick Start
import asyncio
from blackboard import Orchestrator, Worker, WorkerOutput, Artifact, Blackboard
# 1. Define your workers
class Writer(Worker):
name = "Writer"
description = "Generates text content based on the goal"
async def run(self, state: Blackboard, inputs=None) -> WorkerOutput:
# Your LLM call here
content = f"Generated content for: {state.goal}"
return WorkerOutput(
artifact=Artifact(type="text", content=content, creator=self.name)
)
class Critic(Worker):
name = "Critic"
description = "Reviews content and provides feedback"
async def run(self, state: Blackboard, inputs=None) -> WorkerOutput:
artifact = state.get_last_artifact()
# Your review logic here
return WorkerOutput(
feedback=Feedback(
source=self.name,
critique="Looks good!",
passed=True,
artifact_id=artifact.id
)
)
# 2. Create an LLM client (implement the LLMClient protocol)
class MyLLM:
async def generate(self, prompt: str) -> str:
# Your LLM API call (OpenAI, Anthropic, etc.)
return '{"action": "call", "worker": "Writer", "reasoning": "Start writing"}'
# 3. Run the orchestrator
async def main():
orchestrator = Orchestrator(
llm=MyLLM(),
workers=[Writer(), Critic()],
verbose=True
)
result = await orchestrator.run(
goal="Write a haiku about programming",
max_steps=10
)
print(f"Final status: {result.status}")
print(f"Artifacts: {[a.content for a in result.artifacts]}")
asyncio.run(main())
Core Concepts
| Concept | Description |
|---|---|
| Blackboard | Shared state containing goal, artifacts, feedback, and metadata |
| Worker | An agent that reads state and produces artifacts or feedback |
| Orchestrator | Manages the control loop and calls the supervisor LLM |
| Supervisor | The LLM that decides which worker to call next |
| Artifact | Versioned output produced by a worker |
| Feedback | Review/critique of an artifact |
Advanced Features
Middleware
from blackboard.middleware import BudgetMiddleware, HumanApprovalMiddleware
orchestrator = Orchestrator(
llm=my_llm,
workers=[...],
middleware=[
BudgetMiddleware(max_tokens=100000),
HumanApprovalMiddleware(require_approval_for=["Deployer"])
]
)
Tool Calling (OpenAI-style)
from blackboard.tools import ToolCallingLLMClient
class MyToolLLM(ToolCallingLLMClient):
async def generate_with_tools(self, prompt, tools):
# Use OpenAI function calling
...
Memory System
from blackboard.memory import SimpleVectorMemory, MemoryWorker
from blackboard.embeddings import OpenAIEmbedder
memory = SimpleVectorMemory(embedder=OpenAIEmbedder())
worker = MemoryWorker(memory=memory)
Persistence
# Save session
result.save_to_json("session.json")
# Resume later
state = Blackboard.load_from_json("session.json")
await orchestrator.run(state=state)
Documentation
See DOCS.md for the complete API reference and advanced usage guide.
License
MIT License - see LICENSE for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file blackboard_core-1.0.2.tar.gz.
File metadata
- Download URL: blackboard_core-1.0.2.tar.gz
- Upload date:
- Size: 66.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
31acdb2be5b13aa8895932888033ddac0574047ce55f8eb122993e985faef9fc
|
|
| MD5 |
8cd08f625fe9c04fc53fa6a203293b68
|
|
| BLAKE2b-256 |
98c1e11c7e1207de783786c457b1f11142309c1c55447bab8d887321743bce66
|
Provenance
The following attestation bundles were made for blackboard_core-1.0.2.tar.gz:
Publisher:
publish.yml on hemantsingh443/blackboard-core
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
blackboard_core-1.0.2.tar.gz -
Subject digest:
31acdb2be5b13aa8895932888033ddac0574047ce55f8eb122993e985faef9fc - Sigstore transparency entry: 767160444
- Sigstore integration time:
-
Permalink:
hemantsingh443/blackboard-core@7b82f2e062e847e2f12cc3a6f7efa9a1e79b3442 -
Branch / Tag:
refs/tags/v1.0.2 - Owner: https://github.com/hemantsingh443
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@7b82f2e062e847e2f12cc3a6f7efa9a1e79b3442 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file blackboard_core-1.0.2-py3-none-any.whl.
File metadata
- Download URL: blackboard_core-1.0.2-py3-none-any.whl
- Upload date:
- Size: 61.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
22336338f508c5507e614b1f7a33ccabc66994d701997caa159f5f07a4057511
|
|
| MD5 |
7415612603d025601f31f9ef448f2257
|
|
| BLAKE2b-256 |
acc21b09f756d28af7f9be063b0311a7111c35d78244fdba9fd1efbbc8211d4d
|
Provenance
The following attestation bundles were made for blackboard_core-1.0.2-py3-none-any.whl:
Publisher:
publish.yml on hemantsingh443/blackboard-core
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
blackboard_core-1.0.2-py3-none-any.whl -
Subject digest:
22336338f508c5507e614b1f7a33ccabc66994d701997caa159f5f07a4057511 - Sigstore transparency entry: 767160464
- Sigstore integration time:
-
Permalink:
hemantsingh443/blackboard-core@7b82f2e062e847e2f12cc3a6f7efa9a1e79b3442 -
Branch / Tag:
refs/tags/v1.0.2 - Owner: https://github.com/hemantsingh443
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@7b82f2e062e847e2f12cc3a6f7efa9a1e79b3442 -
Trigger Event:
workflow_dispatch
-
Statement type: