Repository is archived
No release in over 3 years
Prospective memory engine: manages intentions, monitors trigger conditions, and executes when conditions are met
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-prospective-memory

Intention management system for the LegionIO cognitive architecture. Implements prospective memory — remembering to do things in the future when conditions are met.

What It Does

Manages future-directed intentions with trigger conditions. Intentions move through a lifecycle: pending, monitoring, triggered, executed (or expired/cancelled). Each intention has an urgency score that decays over time and a trigger type (time-based, event-based, context-based, or activity-based). Expirations are checked each tick.

Usage

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

# Create an intention
result = client.create_intention(
  description:       'Send deployment notification',
  trigger_type:      :event_based,
  trigger_condition: 'deployment_complete == true',
  urgency:           0.7,
  domain:            :deployment,
  expires_at:        Time.now + 3600
)
intention_id = result[:intention][:id]

# Move through lifecycle
client.monitor_intention(intention_id: intention_id)
# => { updated: true, intention: { status: :monitoring, ... } }

# When trigger fires
client.trigger_intention(intention_id: intention_id)

# After execution
client.execute_intention(intention_id: intention_id)

# Query by state
client.pending_intentions
client.monitoring_intentions
client.triggered_intentions

# Query by urgency or domain
client.most_urgent_intentions(limit: 5)
client.intentions_by_domain(domain: :deployment)

# Periodic operations
client.check_expirations   # mark expired intentions
client.decay_urgency       # urgency drifts down each tick
client.execution_rate
client.intention_report

Trigger Types

:time_based, :event_based, :context_based, :activity_based

Urgency Labels

:critical (>= 0.8), :high, :moderate, :low, :deferred

Development

bundle install
bundle exec rspec
bundle exec rubocop

License

MIT