Attention and Motivation

Draft — This content has not been approved for publication.

Scope

All repositories implementing attention allocation (ECAN) and motivational/goal management (MetaMo/OpenPsi). For theoretical foundations, see ECAN Full and MetaMo Full.

Active Repositories

Attention Allocation (ECAN)

RepoLanguageUpstreamMaturityPurpose
metta-attentionMeTTa + PythoniCog-Labs-DevResearch / OperationalMeTTa port of ECAN: attention-bank (storage/indexing) + attention agents (diffusion, Hebbian learning, rent, forgetting). Runs on PeTTa.
attentionC++iCog-Labs-DevLegacyOriginal OpenCog ECAN (v0.1.4): ImportanceDiffusion, RentCollection, HebbianLinkCreation/Updating, Forgetting agents. CogServer module.
weighted-atom-sweepRustiCog-Labs-DevExperimentalWeighted atom sweep operations on MORK's S-expressions. Graph traversal and importance-proportional sampling. Implementation analogy only — generic AtomHeader trait, NOT an STI/LTI/AttentionValue bridge. Requires nightly Rust and sibling MORK/PathMap.
DAS AttentionBroker (subsystem)C++singnetOperationalPer-context Hebbian network + token rent/wages/spreading economy outside AtomDB. ExactCountHebbianUpdater + TokenSpreader. ECAN-compatible engineering surrogate; see DAS Full.

Motivation and Goal Management (MetaMo / OpenPsi)

RepoLanguageUpstreamMaturityPurpose
hyperon-openpsiMeTTa + PythoniCog-Labs-DevOperationalOpenPsi cognitive architecture in MeTTa: demands, emotions, modulators, action planners (hill-climbing). Use cases: ping-pong, curious-agent (Gemini LLM), Qwestor API.
MetaMo-PythonPythoniCog-Labs-DevExperimentalCategory theory reference implementation: AppraisalComonad, DecisionMonad, MetaMoPseudoBimonad. 8-dim goals, 6-dim modulators, dual overgoals.
PeTTa-OpenPSIMeTTa + PythoniCog-Labs-DevResearch / OperationalProlog-based MeTTa port of OpenPsi with A* and Thompson sampling planners. Use cases: curious-agent, metta-trader (NARS-based).

How They Fit Together

Attention lineage:

  • attention (C++, legacy) → metta-attention (MeTTa, current): Direct architectural port. Same concepts (STI/LTI, Hebbian diffusion, rent collection, forgetting) but expressed declaratively in MeTTa rather than as imperative CogServer modules. ECAN cluster-pilot Sources 1+2 (2026-04-26) established that both implementations score 0/4 strict-literal compliance against the 2009 ECAN paper's update equations: Classic C++ already used pragmatic engineered surrogates (target-funds/buffer rent, fund-buffer wage adjustment, normalized-STI fuzzy-conjunction Hebbian, deterministic elapsed-time decay in place of the literal tanh sigmoid), and the MeTTa port faithfully ports those surrogates. The MeTTa port did not lose paper equations — Classic C++ had already moved away from them.
  • DAS AttentionBroker (C++, operational): The third member of the ECAN-engineering-surrogate lineage, identified by AtomSpace cluster pilot Source 4 (2026-04-29). DAS uses ExactCountHebbianUpdater (HebbianNetworkUpdater.cc:57-96; weights = count(A→B)/count(A) — NOT the Classic ECAN Hebbian Conjunction equation) and a fixed-token TokenSpreader (rent rate 0.75, lower/upper spreading 0.10, deterministic arity-weighted spreading; StimulusSpreader.cc). Like the other two members it is 0/4 strict-literal against the 2009 ECAN paper but is more production-oriented (RPC-driven per-context STI outside AtomDB; MeTTa surface via new-das!). All three should be classified as ECAN-inspired engineering surrogates rather than literal 2009 ECAN. See DAS Full for code anchors and the cluster-pilot lock-in.
  • weighted-atom-sweep is the MORK-native pattern analogy for attention: aggregate weight counters in trie nodes enable importance-proportional sampling without global scans. AtomSpace cluster pilot Source 3 (2026-04-29) verified it is a separate adjacent experimental crate (HEAD 1471ff2c) outside the canonical MORK 8-member workspace; its AtomHeader is a generic trait, NOT an STI/LTI/AttentionValue, and its match counter is an integer, not an ECAN attention currency. Repurposable for recency/priority/card-version metadata if a Decko-specific AtomHeader and traversal policy are defined, but NOT a code-real ECAN bridge. The whitepaper-described "scaling ECAN on MORK" path is design-stage, not implemented at this snapshot.

Motivation lineage:

  • hyperon-openpsi implements Dörner's Psi theory in MeTTa — the operational predecessor to MetaMo. It provides demands, emotions, modulators, and feedback loops that select goals and allocate compute.
  • PeTTa-OpenPSI is a parallel port using Prolog-native MeTTa with different planning strategies (A*, Thompson sampling) and use cases (NARS-based trading).
  • MetaMo-Python is the theoretical reference for the next-generation motivational framework — formal category theory abstractions (pseudo-bimonad) that will eventually replace the hand-tuned OpenPsi dynamics. Currently Python-only, not yet integrated into the Hyperon AtomSpace.

The evolutionary path is: OpenPsi (heuristic) → hyperon-openpsi (MeTTa port) → MetaMo (formal category theory). All three coexist during the transition.

Hanson dialogue/robotics runtime branch (historical, not active in current Hyperon). The OpenPsi cluster pilot Source 4 (2026-04-28) established that Hanson Robotics' Sophia stack -- via ros-behavior-scripting and loving-ai-ghost -- consumed Classic OpenPsi as a behavior-loop authority for dialogue and motor schemas, with psi-step driving the runtime loop and psi-rule registrations mapping perceptual predicates to behaviors. Demands like face-demand and speech-demand were satisfied by hardcoded constant TVs (e.g., (stv 1 1)) rather than the OpenPsi paper's quantitative satisfaction economy. The Loving AI Ghost production runtime explicitly disabled ECAN/STI in 2018 (commit 51a413e7 DevHEAD: (ghost-set-sti-weight 0)) using the supported Ghost API. Hanson's opencog fork stopped tracking upstream OpenPsi at 2016-06 master and missed the entire 2017+ opencog/openpsi/dynamics/ mathematical buildout. This is a runtime/application branch over Classic OpenPsi -- not a paper-faithful reimplementation, not a separate mathematical tradition. No documented MeTTa equivalent of this branch exists in the current Hyperon ecosystem.

Linas Vepstas Hyperon-era research portfolio (Perception cluster pilot 2026-05-01). Vepstas's role in the Hyperon ecosystem extends well beyond his historical legacy authorship of Classic C++ opencog/attention (424 commits) and the 2019-09-06 AttentionBank removal (commit 318c0b4cb). The Perception/Neural-Symbolic cluster pilot Source 5 established a CF5.2 role upgrade from [LEGACY-AUTHOR-BRIDGE] to [HYPERON-ERA-PARALLEL-RESEARCH-PORTFOLIO]. Evidence: a 5-repo sole-authored Hyperon-era research effort on the AtomSpace-Scheme stack (C++ + Guile, no .metta files):

  • opencog/sensory @ 64849f3 -- ~733 commits; 7 wired sensory atom types (TEXT_FILE_NODE, FILE_SYS_NODE, UNIX_SOCKET_NODE, TCP_SOCKET_NODE, TERMINAL_NODE, I_R_CHAT_NODE, OLLAMA_NODE) at opencog/sensory/types/sensory_types.script:29-51; 705-line README framing perception/action research on AtomSpace as successor to failed Hanson Sophia / Minecraft ROCCA / Unity pet-dog / soccer-robothon embodiment efforts.
  • opencog/agents @ 0718ba0 -- 89 commits; pure-Atomese learning agents (experiments/02-memory/, count-agent.scm).
  • opencog/motor @ d5ba07e -- 76 commits; sensory-backed crawler project (demos/crawler.scm).
  • opencog/evidence @ ba0314c -- 30 commits; theory/docs portfolio.
  • opencog/atomese-simd @ b8be282 -- 372 commits; OpenCL/CUDA Atomese/Sensory acceleration (4 .cl + 1 .cu).

Plus two co-authored repositories: opencog/miner (with Nil Geisweiller; the C++/Scheme symbolic miner that the hyperon-miner trio ports to MeTTa) and opencog/vision (with Adrian Borucki; minimal AtomSpace-OpenCV scaffolding).

Significance for Attention & Motivation framing. The Hyperon ecosystem operates on TWO parallel stacks (cluster-narrative-deciding finding):

  • AtomSpace-Scheme stack -- Vepstas perception portfolio + opencog/miner + opencog/vision. Active 2025-2026.
  • MeTTa-runtime stack -- hyperon-experimental + metta-attention + hyperon-miner trio + neural-subgraph-matcher-miner. Active 2025-2026.

The Vepstas portfolio receives concurrent active development on a different stack from metta-attention; it is not a frozen legacy artifact. OllamaNode in particular has dual characterization: [LLM-MEDIATED-PERCEPTION] (IRC text-stream wiring at examples/ollama-bot.scm:104-141) AND [LLM-AS-KNOWLEDGE-SOURCE] / [LLM-AS-MEMORY-SUBSTRATE] (embedding-vector extraction at examples/ollama-embed.scm:20-31, 42-46). Bidirectional cross-grep across the AtomSpace-Scheme perception portfolio and the MeTTa-runtime mining stack returned ZERO references between layers -- the two stacks operate in code-isolation. Any future ECAN reactivation that wants to consume runtime-wired perception input must either bridge across stacks or re-host on whichever stack ECAN re-emerges on. See Sensory for the synthesis card.

Quick Start

# ECAN on PeTTa (requires sibling PeTTa directory)
cd ../PeTTa && sh run.sh ../metta-attention/attention/test/agents-test.metta

# OpenPsi use cases (requires hyperon==0.2.3)
cd hyperon-openpsi && python3 test/run-tests.py
metta use-cases/ping-pong/ping-pong.metta

# MetaMo Python reference
cd MetaMo-Python && pip install -r requirements.txt
python applications/research_assistant.py

# PeTTa-OpenPSI
metta main/demands/demands.metta

# Legacy C++ ECAN (requires cogutil, atomspace, cogserver)
cd attention && mkdir build && cd build && cmake .. && make && make test

Current State vs. Whitepaper

  • ECAN operational: Both C++ and MeTTa ECAN are working. The core economic model (STI/LTI, diffusion, rent, forgetting) is implemented.
  • Fluid-dynamic extension (whitepaper §5.3–5.4): Proposed. The incompressible fluid model for attention transport (\(\nabla \cdot u = 0\)) has no implementation.
  • MetaMo pseudo-bimonad (whitepaper §5.10): MetaMo-Python implements the category theory abstractions in Python but is not yet integrated into Hyperon AtomSpace or PLN.
  • SubRep certification (whitepaper §5.9): No implementation. CDS/PDS admission rules and Motive Decomposition Networks exist only in the whitepaper design.
  • MORK-native attention: weighted-atom-sweep exists but is experimental and outside the canonical MORK workspace; it is an implementation analogy, not an ECAN bridge. Full ECAN-on-MORK integration with WILLIAM-driven importance signals is not yet operational.

Forks and Mirrors

No significant fork/mirror pattern in this family. The attention repo is an iCog-Labs-Dev fork of opencog/attention. All three motivation repos (hyperon-openpsi, MetaMo-Python, PeTTa-OpenPSI) are original iCog Labs work targeting different execution strategies.

Recommended Entry Points

  • ECAN in MeTTa: Start with metta-attention's agent tests on PeTTa. The attention-bank and agents directories mirror the C++ architecture.
  • Motivational agents: hyperon-openpsi's ping-pong use case is the simplest demonstration. The curious-agent use case requires a Gemini API key.
  • MetaMo theory: MetaMo-Python core is NumPy-only — read the pseudo-bimonad implementation alongside the AGI 2025 papers. The demo app additionally requires google-genai and python-dotenv for LLM integration.
  • MORK attention: weighted-atom-sweep requires nightly Rust and sibling MORK/PathMap checkouts — more suited for MORK developers than attention researchers.
  • DAS attention: The DAS AttentionBroker is exposed via RPC (stimulate, correlate, asymmetric_correlate, get_importance, set_determiners, set_parameters, save_context, drop_and_load_context); see DAS Full for query-tree integration via STI-sorted Source nodes.

Gaps and Consolidation Opportunities

  • Two OpenPsi ports: hyperon-openpsi and PeTTa-OpenPSI implement the same framework with different planners. A unified version would reduce maintenance burden.
  • MetaMo-Python is isolated: The formal reference implementation doesn't connect to the MeTTa ecosystem — no AtomSpace integration, no PLN interaction. Bridging this gap is the key next step.
  • No SubRep implementation: The goal certification framework described in the whitepaper has no code at all.
  • ECAN parameter tuning is manual: The whitepaper describes adaptive tuning but current implementations require hand-set rent/wage/tax parameters.
  • Three ECAN-engineering-surrogate implementations, no unified strict-literal track. Classic C++ attention, metta-attention, and DAS AttentionBroker each independently re-engineered around the 2009 paper rather than implementing it. None of the three currently provides the literal target-importance-funds rent / wage equation, the literal Hebbian Conjunction update, or the literal stochastic tanh diffusion. A strict-literal reimplementation track (separate from the production surrogates) is an open research/engineering question.
  • Lost executable PLN-attention coupling. The 2014 Harrigan et al. paper described ECAN-guided PLN inference. The OpenPsi cluster pilot Source 4 (2026-04-28) reconstructed the complete executable ECAN/STI coupling lifecycle as a 9-event sequence between 2016-03 and 2020-09, comprising a narrow URE forward-chainer STI source-selection hook (commit 0a0b09912 2016-03-09 wire-up by Misgana Bayetta; commit 0b744dbab 2018-10-23 deliberate unwire by Nil Geisweiller with comment "An attentionbank is needed in order to get the STI..."), a brief OpenPsi default action-selector STI path 2016-05 to 2016-11 (commit 8ab0e8f81 Amen Belayneh wire; commit 9f2697859 Linas Vepstas removal; commit e5bae708f 2017-11-08 reintroduction as uncalled helper), and a Loving AI Ghost runtime explicit STI-disable via supported public API (commit 51a413e7 2018-06-06 DevHEAD: (ghost-set-sti-weight 0)). All three executable paths were deliberately decoupled by 2019. Current MeTTa-PLN has no attention-layer integration. Re-establishing executable PLN-attention coupling is an open problem; see ECAN Full → Development and Historical Context for the full reconstructed lifecycle.
  • Inherited C++ bugs in metta-attention. The MeTTa port faithfully ports two probable bugs from Classic C++: the WA rent compounding mutation at WARentCollectionAgent.cc:68-70 (mutates member STIAtomRent/LTIAtomRent in place every call), and the WA diffusion parameter mis-read at WAImportanceDiffusionAgent.cc:51-52 (reads dif_tournament_size into hebbianMaxAllocationPercentage). Cleaning these up requires upstream coordination since they exist in both C++ and MeTTa codebases.
  • MeTTa-port-introduced regressions. Two distinct categories:
    • Hardcoding / parameter shadowing (likely porting error): HebbianCreationAgent.metta:17 hardcodes localToFarLinks = 1000.0, shadowing the configured LOCAL_FAR_LINK_RATIO = 10 that Classic C++ correctly reads. Fix: read the parameter, don't hardcode.
    • Dormancy / EMA commenting (likely simplification choice): recentVal.metta:22-67 has both updateMin/updateMax implementations commented out, where Classic C++ keeps _maxSTI/_minSTI as live recent_val instances. Restoring the smoothed-extrema infrastructure would be needed if the paper formulas (which depend on recentMaxSTI) are ever implemented.
  • Broader-OpenCog ECAN consumers not preserved. Pre-2019 OpenCog had Ghost dialogue (STI-weighted action-selector at matcher.scm:117-130, 284, plus STI/AF reads/writes in matcher and schemas), NLP fuzzy matching (AF-only via bank->atom_is_in_AF), Python web API AttentionValue surfaces, and OpenPsi (action-selector seam + uncalled rule-sca-weight STI helper at action-selector.scm:57-64) — all confirmed at the pre-removal monorepo snapshot (cluster Source 4, 2026-04-26). OpenPsi cluster pilot Source 1 (2026-04-27) refined the OpenPsi characterization: helper-only / uncalled in default runtime path, so OpenPsi was an ECAN-coupling enabler rather than a default executable ECAN consumer. None were preserved as functioning ECAN integrations across the 2019-09-06 AttentionBank removal; none have documented MeTTa equivalents in the current Hyperon ecosystem. Selecting which consumer integrations to rebuild is an open Hyperon-ecosystem decision.
  • AtomSpace-Scheme perception portfolio runs on a parallel stack with no attention coupling. The Linas Vepstas opencog/sensory + agents + motor + evidence + atomese-simd portfolio (Perception cluster pilot 2026-05-01) provides actively-developed runtime-wired perception/action artifacts on the AtomSpace-Scheme stack. None of these consume ECAN attention values; bidirectional cross-grep confirms zero references between the perception portfolio and either metta-attention or DAS AttentionBroker. Whether future Hyperon attention work should bridge across stacks (Scheme-side perception → MeTTa-side attention) or re-host (port perception artifacts to MeTTa, or port attention to Scheme) is an open architectural decision.



Discussion