Repository is archived
No release in over 3 years
Detects the overall mood and trending concerns across all cognitive subsystems. Captures what the agent mind is collectively focused on via signal ingestion, trend windows, convergence scoring, and divergence alerts.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Development

 Project Readme

lex-cognitive-zeitgeist

A LegionIO cognitive architecture extension that captures the aggregate cognitive atmosphere across subsystems. Named after the German "spirit of the age" — surfaces dominant themes, collective mood, convergence, and momentum from the stream of signals flowing through the cognitive system.

What It Does

Ingests cognitive signals from multiple subsystems and computes cross-cutting metrics:

  • Collective mood: intensity-weighted mean valence across all signals (-1.0 to +1.0)
  • Cognitive convergence: ratio of subsystems focused on the same dominant domain; low convergence triggers a divergence alert
  • Momentum: whether signal intensity is accelerating or fading in the recent window
  • Dominant themes: domains with highest total intensity weight
  • Rising/falling domains: comparing recent activity to historical baseline

Usage

require 'lex-cognitive-zeitgeist'

client = Legion::Extensions::CognitiveZeitgeist::Client.new

# Ingest signals from different subsystems
client.ingest_signal(source_subsystem: :emotion, domain: :anxiety, intensity: 0.7, valence: -0.6)
client.ingest_signal(source_subsystem: :prediction, domain: :threat, intensity: 0.8, valence: -0.4)
client.ingest_signal(source_subsystem: :memory, domain: :curiosity, intensity: 0.5, valence: 0.3)

# Get collective mood
client.collective_mood
# => { success: true, mood: -0.4, mood_label: :subdued }

# Check whether subsystems are aligned
client.cognitive_convergence
# => { success: true, convergence: 0.67, convergence_label: :aligned, divergence_alert: false }

# Dominant themes (by intensity weight)
client.dominant_themes(limit: 3)
# => { success: true, themes: [{ domain: :threat, weight: 0.8 }, ...], count: 3 }

# Rising and falling domains
client.rising_domains
# => { success: true, domains: [{ domain: :threat, delta: 0.3 }], count: 1 }

# Trend window status
client.trend_window_status
# => { success: true, trend_window: { size: 3, dominant_domain: :threat, momentum: 0.1, ... }, momentum_label: :steady }

# Full zeitgeist report
client.zeitgeist_report
# => { success: true, signal_count: 3, dominant_themes: [...], collective_mood: -0.4,
#      mood_label: :subdued, convergence: 0.67, convergence_label: :aligned,
#      momentum: 0.1, momentum_label: :steady, divergence_alert: false, ... }

Development

bundle install
bundle exec rspec
bundle exec rubocop

License

MIT