Skip to main content

Blackboard

Blackboard coordinates independent knowledge sources that incrementally build a solution on a shared data store, with a control component choosing what runs next. It suits ill-defined problems but is non-deterministic and hard to test.

Type
Architectural
When to Use
No Deterministic Solution, Heterogeneous Knowledge Sources, Incremental Hypothesis Building

Blackboard is an architectural pattern for problems that have no deterministic solution strategy, where the path to an answer must be assembled opportunistically from partial contributions. Multiple specialized components, called knowledge sources, read from and write to a shared data structure, the blackboard, gradually building up a solution. A control component decides which knowledge source should act next based on the current state.

How It Works

The blackboard is a global, structured repository holding the problem statement and all partial solutions, or hypotheses, produced so far. Each knowledge source is an independent expert that watches the blackboard, and when the data matches its preconditions, it contributes a refinement, posting new or revised hypotheses. A control component monitors changes and chooses the next knowledge source to run, steering the system toward a solution. There is no fixed sequence; progress emerges from whichever sources can make headway given the current contents.

The loop continues until the blackboard holds an acceptable solution or no source can make further progress. This opportunistic, data-driven control is what distinguishes Blackboard from a fixed pipeline.

When to Use It

Use Blackboard when no single algorithm solves the whole problem, when diverse and partial knowledge must be combined, and when the order of applying that knowledge cannot be fixed in advance. It originated in speech recognition and remains relevant for sensor fusion, signal interpretation, planning, surveillance, and some AI and machine-learning orchestration where heterogeneous models contribute to a shared interpretation.

Trade-offs

The pattern is hard to design and test because control flow is non-deterministic and emergent, making behavior difficult to predict or reproduce. The shared blackboard is a concurrency and consistency challenge when knowledge sources run in parallel. Tuning the control strategy is largely empirical, and the system may not converge or may be slow. For well-understood, ordered problems, simpler architectures like pipelines are far easier.

Related Patterns

Mediator also centralizes coordination but among known collaborators with defined interactions, whereas Blackboard's sources are loosely coupled through shared data. Publish-Subscribe can notify knowledge sources of blackboard changes. Pipes and Filters is the deterministic alternative when the processing order is known in advance.

Example

A document-understanding system extracts structured data from scanned forms. Knowledge sources for layout analysis, OCR, field classification, and validation each post results to a shared blackboard. The control component runs OCR after layout analysis succeeds, then classification, revisiting earlier steps when validation flags inconsistencies, until a confident, consistent interpretation emerges.