0.0
Repository is archived
No release in over 3 years
Models spreading activation in semantic networks — stimuli prime related concepts, lowering their activation threshold and speeding future access.
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-priming

Associative activation network for the LegionIO cognitive architecture. Implements spreading activation priming across linked concept nodes.

What It Does

Maintains a network of concept nodes connected by association strengths. When a concept is primed, its activation is boosted and that activation spreads through the network via BFS — each hop attenuated by the spread factor and association strength. Concepts decay each tick. Supports querying which concepts are currently primed, finding the strongest activations, and retrieving neighbors.

Usage

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

# Build the concept network
client.add_concept(name: :authentication, domain: :security)
client.add_concept(name: :credentials, domain: :security)
client.add_concept(name: :session_token, domain: :security)
client.link_concepts(name_a: :authentication, name_b: :credentials, strength: 0.8)
client.link_concepts(name_a: :credentials, name_b: :session_token, strength: 0.7)

# Prime a concept (activation spreads to neighbors)
client.prime_concept(name: :authentication, boost: 0.5, spread: true)

# Check which concepts are now active
client.primed_concepts
# => { success: true, concepts: [
#      { name: :authentication, activation: 0.5, domain: :security },
#      { name: :credentials, activation: 0.175, domain: :security },
#      { name: :session_token, activation: 0.031, domain: :security }
#    ], count: 3 }

# Top activations
client.strongest_primes(count: 3)

# Check a specific concept
client.check_primed(name: :credentials)
# => { success: true, name: :credentials, activation: 0.175, primed: true, source: :authentication }

# Each tick: decay activations
client.update_priming
client.priming_stats

Development

bundle install
bundle exec rspec
bundle exec rubocop

License

MIT