blackboardx
A skeletal blackboard system for Python.
The blackboard architecture came out of HEARSAY-II, a speech understanding system built at Carnegie Mellon in the early 1970s under a DARPA programme. Its difficulty was that a stretch of speech admits several readings, and the knowledge that settles which one is right arrives in unrelated kinds: acoustic, lexical, syntactic, semantic. Which kind will settle a given stretch is not known until that stretch is examined, so the system could not be written as procedures calling one another, because a call fixes what runs next. HEARSAY-II gave its specialists a shared structure to work on instead. Each reads what bears on its own expertise and writes back what it concludes, and none of them calls another.
Later systems kept that arrangement and replaced the knowledge, HASP interpreting sonar where HEARSAY-II interpreted speech. H. Penny Nii, surveying blackboard systems in AI Magazine in 1986, named a system skeletal when it supplies the components alone and leaves the knowledge and the control to whoever builds on it.
blackboardx is skeletal in that sense. It supplies the board, which stores what agents write and puts every write in one order, and the control component, which determines who is notified of a change, whether a write is admitted, and when the run ends. An application supplies its regions, their opening premise values, the agents the run starts with, an admission rule, a termination predicate, and limits.
The record outlives the run that wrote it. create_model opens a board the store does not hold yet; attach_model opens a run over a board the store already holds, and continues the sequence from where the record ends.
It also carries both halves of the conversation between a blackboard and agents deployed as their own services: the bodies and operations they share, the piece that answers an agent's request, the piece that sends a notification without making the writer wait, and the client an agent calls with. Your service keeps its own HTTP server, its routes, its authentication, and its database; neither half writes the protocol between them.
An agent reads and writes through AgentBoard, the four reads and the three writes without the agent's own name. Control.as_agent returns one in the same process as the run, and BoardClient is one over HTTP, so an agent body is written once and deployed either way.
The distribution name is blackboardx; the import name is blackboard. The documentation, including the API reference, is at https://moeinroghani.github.io/blackboardx/.
Install
pip install blackboardx
pip install 'blackboardx[postgres]' # PostgresStore
pip install 'blackboardx[mongodb]' # MongoStore
pip install 'blackboardx[notifier]' # sending notifications to agents over HTTP
pip install 'blackboardx[agent]' # BoardClient, for an agent calling a blackboard
pip install 'blackboardx[conformance]' # the suite a store of your own is held to
The base install has no runtime dependency. Neither store it ships needs one: InMemoryStore holds the record in the process, and SqliteStore uses sqlite3 from the standard library. A deployment keeps the record in the database it already runs, and the adapter for one needs that database's driver.
Documentation
| Installation | The extras, and what each one gives you |
| Quickstart | A run in full, and what each step means |
| Concepts | What the board, the control component and a run are |
| Storage | Where the record is kept, and what an adapter owes |
| Guides | Writing an agent, notifying over HTTP, admission rules, ending a run, testing |
| Serve a blackboard | Answering agents that run as their own services |
| What it does not do | Every limit of this version, in one place |
| API reference | Every exported name |
Example
from datetime import timedelta
from blackboard import (
Agent,
Level,
Premise,
RunLimits,
Settled,
SqliteStore,
create_model,
)
notifications = []
model = create_model(
board_id="incident-4471",
store=SqliteStore("incidents.sqlite3"),
regions=[Level("platform"), Premise("window")],
premises={"window": ["2026-08-16T20:00", "2026-08-16T22:00"]},
agents=[Agent(name="ocp", notify=notifications.append)],
limits=RunLimits(wall_clock=timedelta(minutes=10), idle=timedelta(seconds=1)),
)
(notification,) = notifications
window = model.reader.read_premise("window").value
model.control.write("platform", {"window": window, "findings": ["oom"]}, writer="ocp")
model.control.ack(notification.notification_id, agent="ocp")
assert model.control.wait_closed(timeout=timedelta(seconds=10)) == Settled()
Running that a second time raises DuplicateRegionError, because the board is already in incidents.sqlite3. attach_model opens a run over it.
License
Apache-2.0. The license text is in LICENSE, and every distribution carries it.
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 blackboardx-0.8.0.tar.gz.
File metadata
- Download URL: blackboardx-0.8.0.tar.gz
- Upload date:
- Size: 271.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
047f0edfdc9d054565523e7a3d5274834f90fe39595f7f66b618f20f3fde33ac
|
|
| MD5 |
e7c18d8fca105cfbc18911845075d439
|
|
| BLAKE2b-256 |
8f974dfae64d00abb2727b083352c7ff576ddf426a8e16a45ec1d2a3d409ac58
|
Provenance
The following attestation bundles were made for blackboardx-0.8.0.tar.gz:
Publisher:
publish.yml on MoeinRoghani/blackboardx
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
blackboardx-0.8.0.tar.gz -
Subject digest:
047f0edfdc9d054565523e7a3d5274834f90fe39595f7f66b618f20f3fde33ac - Sigstore transparency entry: 2692030831
- Sigstore integration time:
-
Permalink:
MoeinRoghani/blackboardx@c777971569a3eaae6228b184468fea4cf25015b8 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/MoeinRoghani
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@c777971569a3eaae6228b184468fea4cf25015b8 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file blackboardx-0.8.0-py3-none-any.whl.
File metadata
- Download URL: blackboardx-0.8.0-py3-none-any.whl
- Upload date:
- Size: 73.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d5c9798d376153fb62c7a7285f999880cee07eb94fdddefc64126520f3fc6022
|
|
| MD5 |
2ea47874482cd8a516fefb852f42aa07
|
|
| BLAKE2b-256 |
62baa812c8e7d07e80dfb4424cf492be55bb9a13ab25bdd6a6484fff55023878
|
Provenance
The following attestation bundles were made for blackboardx-0.8.0-py3-none-any.whl:
Publisher:
publish.yml on MoeinRoghani/blackboardx
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
blackboardx-0.8.0-py3-none-any.whl -
Subject digest:
d5c9798d376153fb62c7a7285f999880cee07eb94fdddefc64126520f3fc6022 - Sigstore transparency entry: 2692030898
- Sigstore integration time:
-
Permalink:
MoeinRoghani/blackboardx@c777971569a3eaae6228b184468fea4cf25015b8 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/MoeinRoghani
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@c777971569a3eaae6228b184468fea4cf25015b8 -
Trigger Event:
workflow_dispatch
-
Statement type: