Prismatic Blackboard

Prismatic Blackboard

220 files AI

Overview

Prismatic Blackboard implements the blackboard architecture pattern for multi-agent collaborative problem solving within the Prismatic Platform. The system provides a shared knowledge space backed by ETS where specialized agents post partial solutions, triggering other agents to contribute their expertise through a publish-subscribe notification mechanism. A controller component manages agent scheduling, quorum-based decision making, and convergence detection.

Complex intelligence analysis tasks require integrating knowledge from multiple specialized domains. Assessing the security posture of an entity requires network intelligence (from Shodan, Censys), vulnerability data (from NVD, CVE databases), reputation intelligence (from AbuseIPDB, GreyNoise), business context (from ARES, Justice.cz), and compliance status (from regulatory frameworks). No single analysis module possesses all this knowledge. The blackboard architecture solves this by providing a shared workspace where partial solutions trigger further analysis, enabling emergent problem solving without rigid workflow definitions.

Knowledge entries are typed and schema-validated, with temporal versioning and provenance tracking integrated with the Prismatic Nabla epistemic framework. The architecture supports complex intelligence analysis tasks -- such as multi-source entity resolution, comprehensive threat assessment, and security rating computation -- where no single agent possesses complete knowledge and the solution emerges from the collaboration of specialists. The design goals include ETS-backed high-performance shared knowledge space, trigger-based agent coordination activated by knowledge changes, configurable quorum requirements before conclusions are accepted, temporal versioning maintaining version history with timestamps, NABLA-compliant provenance tracking, and convergence detection declaring problems solved when knowledge stabilizes.

Architecture

The architecture centers on a shared knowledge space where agents read and write entries, coordinated by a controller that manages scheduling and convergence.

Agent Pool (Specialized Knowledge Sources)
       |
  +----+----+----+----+
  |    |    |    |    |
  Net   Vuln  Rep  Biz  Compliance
  Intel Intel Intel Intel Assessor
       |
  Blackboard (Shared Knowledge Space, ETS)
  +-- Knowledge Entries (typed, versioned, with provenance)
  +-- Change Notifications (PubSub)
  +-- Conflict Resolution (latest-wins or quorum)
       |
  Controller
  +-- Agent Scheduling (priority-based)
  +-- Quorum Management (configurable thresholds)
  +-- Convergence Detection (stability check)
  +-- Deadlock Resolution (timeout-based)

The process topology uses three supervised GenServers managing the knowledge store, controller logic, and notification dispatch:

PrismaticBlackboard.Application (Supervisor, :one_for_one)
+-- PrismaticBlackboard.KnowledgeStore (GenServer)
|     ETS table owner, entry management, versioning
+-- PrismaticBlackboard.Controller (GenServer)
|     Agent scheduling, convergence monitoring
+-- PrismaticBlackboard.Notifier (GenServer)
      PubSub notification dispatch

An agent posts a knowledge entry to the blackboard. The KnowledgeStore validates the entry against its schema, stores it in ETS with version metadata, and notifies the Controller. The Controller evaluates which other agents should be activated based on the knowledge change, checks quorum status, and dispatches activation signals through the Notifier. Activated agents query the blackboard for relevant knowledge, perform their analysis, and post new knowledge entries. The cycle continues until the Controller detects convergence.

Key Modules

ModuleResponsibility
PrismaticBlackboardPublic facade: post/2, query/2, subscribe/2, converged?/1
PrismaticBlackboard.KnowledgeStoreETS-backed knowledge entry storage with versioning
PrismaticBlackboard.ControllerAgent scheduling, quorum management, convergence detection
PrismaticBlackboard.NotifierPubSub-based change notification to subscribed agents
PrismaticBlackboard.ConflictResolverResolution strategies for concurrent knowledge updates
PrismaticBlackboard.ProvenanceTrackerNABLA-compliant contributor attribution and confidence
PrismaticBlackboard.SchemaKnowledge entry type definitions and validation

Convergence detection monitors the rate of knowledge contributions. When no new entries or updates are posted within a configurable stability window (default 5 seconds), the Controller declares convergence. A minimum contribution threshold ensures that convergence is not declared prematurely due to slow agents. For high-confidence conclusions, the Controller requires a configurable number of independent agent contributions agreeing on a value.

defmodule PrismaticBlackboard.KnowledgeEntry do
  @type t :: %__MODULE__{
    topic: atom(),
    key: term(),
    value: term(),
    contributor: atom(),
    confidence: float(),
    version: pos_integer(),
    timestamp: DateTime.t(),
    provenance: Provenance.t(),
    quorum_count: non_neg_integer()
  }
end

Configuration

config :prismatic_blackboard,
  convergence_window: :timer.seconds(5),
  min_contributors: 2,
  quorum_threshold: 3,
  max_versions_per_entry: 100,
  conflict_strategy: :latest_wins,
  cleanup_interval: :timer.hours(1)

The convergence window defines the stability period after which the Controller declares convergence if no new contributions arrive. The minimum contributors threshold prevents premature convergence due to slow agent activation. Quorum threshold specifies how many independent agents must agree on a value before it is accepted as high-confidence. Conflict strategy determines how concurrent updates to the same entry are resolved, with options for latest-wins timestamp ordering or quorum-based resolution.

API Reference

# Post knowledge to blackboard
@spec post(atom(), map()) :: {:ok, KnowledgeEntry.t()}
PrismaticBlackboard.post(:entity_risk, %{
  entity: "example.com",
  risk_level: :high,
  evidence: evidence_list,
  contributor: :perimeter_agent
})

# Subscribe to knowledge changes
@spec subscribe(atom(), function()) :: :ok
PrismaticBlackboard.subscribe(:entity_risk, fn entry -> handle_update(entry) end)

# Query current knowledge
@spec query(atom(), keyword()) :: {:ok, [KnowledgeEntry.t()]}
PrismaticBlackboard.query(:entity_risk, entity: "example.com")

# Check convergence status
@spec converged?(atom()) :: boolean()
PrismaticBlackboard.converged?(:entity_risk)

Testing

KnowledgeStore tests verify correct entry storage, versioning, and conflict resolution. Controller tests verify convergence detection timing and quorum management logic. Multi-agent problem solving integration tests exercise the full blackboard cycle with simulated agents posting, subscribing, and converging on solutions.

Property-based tests use StreamData generators to produce random knowledge entries, verifying that the blackboard maintains consistency under concurrent access and that convergence is always eventually detected. Temporal ordering tests verify that version history is maintained correctly under concurrent updates.

Integration Points

ApplicationRelationship
Prismatic NablaProvenance and confidence tracking for all entries
Prismatic AgentsAgent activation and scheduling integration
Prismatic OSINT CoreMulti-source intelligence fusion
Prismatic PerimeterMulti-factor security rating computation
Prismatic Detection EngineCollaborative threat assessment

Knowledge updates are posted as GenServer calls. Change notifications are dispatched via Phoenix PubSub. Agent activation signals are sent through the Prismatic Agents dispatcher. The blackboard operates entirely within the platform with no external service dependencies.

NABLA Compliance

The blackboard architecture provides natural enforcement of several NABLA axioms through its multi-agent collaborative design.

NABLA AxiomBlackboard EnforcementImplementation
Signal PluralityQuorum requires multiple independent contributorsConfigurable minimum contributor count per conclusion
Contradiction PreservationConflicting entries preserved with version historyAll versions retained, conflict resolution explicit
Provenance MandatoryEvery entry carries contributor identity and confidenceProvenanceTracker enforces attribution on all posts
Time DecayTemporal versioning with cleanup of stale entriesTimestamps on all entries with configurable retention
Source IndependenceIndependent agents contribute without coordinationEach agent operates autonomously on its own intelligence

Malicious agents could post false knowledge to influence blackboard conclusions. The quorum requirement mitigates this by requiring independent corroboration. Provenance tracking enables audit of contributor behavior.

Performance

OperationLatencyNotes
Knowledge post< 1msETS write + PubSub broadcast
Knowledge query< 100 microsecondsETS read
Convergence check< 1msTimestamp comparison
Full problem solving cycle1-10sDepends on agent count and complexity

ETS provides lock-free concurrent reads. The blackboard supports dozens of concurrent agents posting knowledge entries.

ResourceMinimumRecommended
Memory128 MB512 MB (with large knowledge sets)
CPU2 cores4 cores

Telemetry events: [:prismatic, :blackboard, :post], [:prismatic, :blackboard, :converged], [:prismatic, :blackboard, :quorum_reached].


Connect & Contribute

Created by Tomáš Korcak (korczis) | Open Source under GHL