Repository is archived
No release in over 3 years
Models mutualistic, parasitic, and commensal relationships between cognitive subsystems — co-active subsystems may enhance or drain each other based on symbiotic bond dynamics
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-symbiosis

A LegionIO cognitive architecture extension that models the interdependencies between cognitive subsystems as symbiotic bonds. Bonds can be mutualistic (both benefit), parasitic (one drains the other), or commensal (one benefits, the other is unaffected). Ecosystem health reflects the balance of these relationships.

What It Does

Tracks a network of bonds between named cognitive subsystems. Each bond has:

  • A relationship type (:mutualistic, :parasitic, or :commensal)
  • A strength (0.0 to 1.0) that grows when activated and decays over time
  • A benefit ratio (positive for mutualism, negative for parasitism)

Ecosystem health is computed from the ratio of mutualistic to parasitic active bonds.

Usage

require 'lex-cognitive-symbiosis'

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

# Create a mutualistic bond between memory and emotion
client.create_bond(subsystem_a: :memory, subsystem_b: :emotion, relationship_type: :mutualistic)
# => { success: true, created: true, bond: { bond_id: "uuid...", strength: 0.3, strength_label: :weak, ... } }

# Create a parasitic bond (anxiety draining focus)
client.create_bond(subsystem_a: :anxiety, subsystem_b: :focus, relationship_type: :parasitic, strength: 0.5)
# => { success: true, created: true, bond: { bond_id: "uuid...", relationship_type: :parasitic, ... } }

# Activate an interaction — increases bond strength
client.activate(subsystem_a: :memory, subsystem_b: :emotion, amount: 0.1)
# => { success: true, found: true, bond_id: "uuid...", strength: 0.4, activation_count: 1 }

# Check ecosystem health
client.health_status
# => { success: true, score: 0.33, label: :stressed, bond_count: 2, active_bonds: 2, network_density: 0.45 }

# List all bonds for a given subsystem
client.list_bonds(subsystem_id: :memory)
# => { success: true, bonds: [...], count: 1 }

# List bonds by type
client.list_bonds(relationship_type: :parasitic)
# => { success: true, bonds: [...], count: 1 }

# Find active parasites
client.detect_parasites(strength_threshold: 0.3)
# => { success: true, parasites: [...], count: 1 }

# Full ecosystem report
client.ecosystem_report
# => { success: true, health: {...}, bonds_by_type: { mutualistic: 1, parasitic: 1, commensal: 0 }, ... }

Development

bundle install
bundle exec rspec
bundle exec rubocop

License

MIT