Skip to main content

Module blackboard

Module blackboard 

Source
Expand description

Shared AI knowledge base — the Blackboard pattern.

A Blackboard is a typed key-value store where each entry has an optional time-to-live (TTL). Multiple agents can share a single SharedBlackboard (Arc<RwLock<Blackboard>>). BlackboardCondition integrates with behavior trees to guard transitions on blackboard values.

§Example

use proof_engine::ai::blackboard::{Blackboard, BlackboardValue, BlackboardCondition};

let mut bb = Blackboard::new();
bb.set("enemy_health", BlackboardValue::Float(45.0));
bb.set_with_ttl("target_pos", BlackboardValue::Vec2(glam::Vec2::new(3.0, 4.0)), 5.0);

// Check a condition
let cond = BlackboardCondition::KeyLessThan("enemy_health".into(), 50.0);
assert!(cond.evaluate(&bb));

bb.update(6.0); // expire the target_pos entry
assert!(!bb.contains("target_pos"));

Structs§

Blackboard
A typed, expiring key-value knowledge base for AI agents.
BlackboardEntry
A single entry on the blackboard, with optional expiry.
BlackboardObserver
A simple change-notification system for the blackboard.
SharedBlackboard
A thread-safe, reference-counted blackboard for cross-agent sharing.

Enums§

BlackboardCondition
A condition that can be evaluated against a Blackboard. Primarily for use in behavior tree guard nodes.
BlackboardValue
All value types that can be stored on a blackboard.