Skip to content

Create example: Cognitive Blackboard cross-module demo #14

@web3guru888

Description

@web3guru888

Summary

We need a clear, runnable example script demonstrating how the Cognitive Blackboard integration layer works across multiple modules. This is the highest-leverage documentation improvement we can make right now — it's the hello_world for the integration layer.

What the example should show

examples/cognitive_blackboard_demo.py should demonstrate:

  1. Initialize the blackboard

    from asi_build.integration import CognitiveBlackboard, EventBus
    blackboard = CognitiveBlackboard()
  2. Register two or more module adapters

    from asi_build.integration.adapters import ConsciousnessAdapter, ReasoningAdapter
    consciousness_adapter = ConsciousnessAdapter(blackboard)
    reasoning_adapter = ReasoningAdapter(blackboard)
  3. Post an entry from one module

    blackboard.post_entry(
        topic="consciousness.phi",
        content={"phi": 0.72, "theory": "IIT"},
        source_module="consciousness",
        priority=EntryPriority.HIGH
    )
  4. Query the blackboard from another module

    entries = blackboard.query(BlackboardQuery(topic="consciousness.phi", limit=5))
    for entry in entries:
        print(f"Φ = {entry.content['phi']}")
  5. Show the EventBus firing lifecycle events

    def on_entry_added(event):
        print(f"New entry: {event.payload['topic']}")
    
    blackboard.event_bus.subscribe("blackboard.entry.added", on_entry_added)
  6. Print a final blackboard state summary

Files to create

  • examples/cognitive_blackboard_demo.py — The main script (~100-150 lines, well-commented)
  • Optionally: examples/README.md update to list the new example

Reference

Acceptance criteria

  • Script runs with python examples/cognitive_blackboard_demo.py after pip install -e .
  • All imports resolve with the core install (no optional deps required)
  • Script is well-commented explaining each step
  • Output is informative (print statements showing data flowing between modules)

Estimated effort: 2–3 hours | Difficulty: Beginner-friendly — mostly reading existing code and writing a demo

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentationenhancementNew feature or requestgood first issueGood for newcomers

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions