limbic_system

Limbic System package initialization.

Exposes all public interfaces as well as legacy internal functions and constants to ensure complete backward compatibility with downstream modules, reset tools, and tests.

class limbic_system.LimbicSystem(redis_client=None, openrouter_api_key=None, openrouter_client=None, cache_redis_client=None)[source]

Bases: object

Shard-based limbic respiration backed by Redis DB12.

Parameters:

openrouter_api_key (Optional[str])

async inhale(channel_id)[source]

RESPIRATION PHASE 1: INHALE

Fetches local shard + global heart, mixes via osmosis, runs homeostatic regulation, returns the effective state.

Return type:

Dict[str, Any]

Parameters:

channel_id (str)

async exhale(channel_id, stimulus_delta, apply_decay=True, user_message='', star_reply='', user_id='', appraisal_dimensions=None, config=None, platform='')[source]

RESPIRATION PHASE 2: EXHALE

Updates local shard with new delta, applies metabolic decay, and pulses global heart.

Return type:

Dict[str, Any]

Parameters:
async scan_triggers(text, query_embedding=None)[source]

Scan text for emotional triggers using semantic matching.

Return type:

List[tuple]

Parameters:
classmethod classify_dominant_emotions(vector, top_n=3)[source]
Return type:

List[Dict[str, Any]]

Parameters:
static metabolic_decay(vector, tau=0.92, baseline=None)[source]
Return type:

Dict[str, float]

Parameters:
static format_context_injection(vector, cues, dominant, cascade_cues=None, rdf_output=None, user_read='', self_reflection=None, high_ticks=None, prev_dominant_names=None, route_flags=None, appraisal_dimensions=None, local_vector=None)[source]
Return type:

Dict[str, Any]

Parameters:
class limbic_system.DecoupledRespirationEngine(limbic_system, heartbeat_interval=300.0)[source]

Bases: object

Runs psychological respiration cycles in the background, out-of-path from message loops.

Parameters:
  • limbic_system (Any)

  • heartbeat_interval (float)

async start()[source]
Return type:

None

async stop()[source]
Return type:

None

limbic_system.warm_ncm_caches()[source]

Pre-load all lazily-cached YAML files so first-touch doesn’t block.

Return type:

None