Repository is archived
No release in over 3 years
Time-bound cognitive resource model for brain-modeled agentic AI — sand grains flow through a narrowed neck, depleting attention resources until the hourglass is flipped to renew the cycle
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-hourglass

Cognitive time-depletion model for brain-modeled agentic AI in the LegionIO ecosystem.

What It Does

Models cognitive resource depletion using the metaphor of sand flowing through hourglasses. Grains (attention, memory, energy, focus, willpower) are loaded into the upper chamber of an hourglass. Each flow tick moves a fraction from upper to lower at a fixed rate, with a 10% chance of temporary blockage. Urgency rises as the upper chamber empties. Flipping the hourglass returns lower chamber grains back up for reuse. Multiple hourglasses can run concurrently to track different cognitive resources.

Usage

require 'legion/extensions/cognitive_hourglass'

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

# Create resource grains
attention = client.create_grain(grain_type: :attention, domain: :task, content: 'code review session')
grain_id = attention[:grain_id]

# Create an hourglass
hourglass = client.create_hourglass(capacity: 10)
hourglass_id = hourglass[:hourglass_id]

# Flow one tick
client.flow_tick(hourglass_id: hourglass_id)
# => { success: true, state: :flowing, urgency: 0.1, fullness: 0.1 }

# Flip to reset
client.flip(hourglass_id: hourglass_id)
# => { success: true, before: { urgency: 0.9, ... }, after: { urgency: 0.0, ... } }

# List all hourglasses
client.list_hourglasses(limit: 20)
# => { success: true, hourglasses: [...], total: 1 }

# Status overview
client.time_status
# => { success: true, report: { hourglass_count: 1, ... } }

Development

bundle install
bundle exec rspec
bundle exec rubocop

License

MIT