Repository is archived
No release in over 3 years
Models autonoetic consciousness — maintains an autobiographical narrative of episodes, narrative threads, and an evolving self-concept that emerges from the pattern of lived experience.
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-narrative-self

Autobiographical narrative and self-concept for the LegionIO cognitive architecture. Models the agent's personal history as episodes, threads, and an evolving identity.

What It Does

Maintains an autobiography of personal episodes — each with a significance score, emotional valence, domain, and tags. Episodes are grouped into narrative threads by thematic overlap. A self-concept emerges from the statistical pattern of episode types over time via exponential moving average. Older low-significance episodes fade naturally.

Usage

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

# Record an experience
client.record_episode(
  description:       'Successfully debugged a complex race condition',
  episode_type:      :achievement,
  domain:            :engineering,
  significance:      0.8,
  emotional_valence: 0.7,
  tags:              ['debugging', 'concurrency']
)

# Create a narrative thread to track a recurring theme
client.create_thread(theme: 'debugging', domain: :engineering)

# Retrieve recent and significant episodes
client.recent_episodes(count: 5)
client.significant_episodes(min_significance: 0.7)

# Self-concept summary
summary = client.self_summary
# => {
#   total_episodes: 42,
#   dominant_types: [:achievement, :discovery, :insight],
#   dominant_domains: [:engineering, :coordination],
#   active_threads: ['debugging', 'planning'],
#   self_concept: { achievement: 0.72, discovery: 0.61, ... },
#   narrative_richness: 0.64
# }

# Tick decay (call each processing cycle)
client.update_narrative_self

Episode Types

:achievement, :failure, :discovery, :connection, :conflict, :resolution, :insight, :surprise, :decision, :transition, :reflection

Significance Labels

Range Label
0.8+ :pivotal
0.6–0.8 :important
0.3–0.6 :routine
< 0.3 :minor

Development

bundle install
bundle exec rspec
bundle exec rubocop

License

MIT