Skip to content

feat(semantic): knowledge-memory substrate — dynamics organ + living twin + semantic-hash index - #132

Merged
mdheller merged 3 commits into
mainfrom
feat/semantic-dynamics
Aug 4, 2026
Merged

feat(semantic): knowledge-memory substrate — dynamics organ + living twin + semantic-hash index#132
mdheller merged 3 commits into
mainfrom
feat/semantic-dynamics

Conversation

@mdheller

@mdheller mdheller commented Aug 4, 2026

Copy link
Copy Markdown
Member

The knowledge-memory substrate (procyber.semantic)

Three additive modules that turn the static holographic twin into a living, indexed memory — grounding the 2026-08-04 five-diagram spine (① memory · ⑤ index).

1. dynamics.py — the temporal organ (① Memory)

Two-timescale Hebbian associative graph: a co-occurrence potentiates a fast variable; the slow variable consolidates only under repetition; both decay (fast ≫ slow) → a single co-occurrence is transient, a repeated one persists, an unrehearsed one fades-but-persists. Bounded spreading-activation recall (a governed loop, not an open one). Clean-room; cites public science (Hebb 1949, complementary-learning-systems 1995, cascade 2005, spreading activation 1975).

2. TemporalTwin (twin.py) — the living medium

The dynamics wired into the Multiverseal Twin: each attestation reinforces its context's strength and medium() weights every record by it, so an unrehearsed reputation edge decays-but-persists while a re-attested one stays sharp. The base MultiversealTwin is untouched (reference-at-ingest / only-core-mints / tamper-evident reads); strength only weights already-admitted records.

3. semantic_hash.py — the compact index (⑤ Index)

SimHash over the [Re;Im] embedding of a ℂ^D hypervector, whose cosine equals vsa.similarity. Hamming distance is a calibrated estimate of the semantic angle (cos(π·H/n)) — nearest-neighbour recall by popcount, not a dense similarity sweep.

Proof

pytest tests/test_dynamics.py tests/test_living_twin.py tests/test_semantic_hash.py16 theorems (7 + 4 + 5); the base twin + cleanroom suites are unaffected. Clean-room FRAMEWORK_FILES updated (scan clean, 24 files). Deterministic; pure-Python (dynamics + twin coupling) plus numpy (hash).

…the twin medium

procyber.semantic.dynamics adds what the static VSA/HRR medium + Multiverseal Twin lacked: how
entity associations strengthen, consolidate, and fade-but-persist over time.

- Two-timescale Hebbian plasticity: each association carries coupled fast/slow variables. A
  co-occurrence potentiates fast (saturating); slow integrates fast, so it consolidates only under
  repetition. Between reinforcements both decay, fast >> slow — a single co-occurrence is transient,
  a repeated one persists (graceful, not a cliff). Clean-room; cites public science (Hebb 1949, CLS
  McClelland-McNaughton-O'Reilly 1995, cascade Fusi-Drew-Abbott 2005).
- Bounded spreading activation for read (Collins & Loftus 1975): seeds pinned, contraction <1, fixed
  hops — a governed loop, not open. recall() = top-k associates.
- Binds upward: consolidated_associations() is the durable projection a twin medium reflects and
  ontogenesis ingests.

Proof: tests/test_dynamics.py — 7 theorems; registered in clean-room FRAMEWORK_FILES (scan clean,
23 files). Deterministic (no RNG); pure-Python (numpy already declared).
… the twin)

Factor the two-timescale law into dynamics.combine/potentiate/relax (reused by the edge graph),
and add twin.TemporalTwin: each attestation reinforces its context's fast/slow strength and
medium() weights every bound record by it, so an unrehearsed association fades-but-persists while
a re-attested one stays sharp — a forgetting curve over the reference-gated store.

Base MultiversealTwin untouched (reference-at-ingest / only-core-mints / tamper-evident reads);
strength only weights already-admitted records. Proof: test_living_twin.py (4) + dynamics/twin
suites green (17 total); cleanroom clean.
…sa.similarity

procyber.semantic.semantic_hash: signed random projections (SimHash, Charikar 2002) over the real
embedding [Re;Im] of a ℂ^D hypervector, whose cosine equals vsa.similarity. n_bits byte-packed
codes; Hamming distance is a calibrated estimate of the semantic angle (cos(π·H/n)) — the fast
index under twin recall + the association graph (popcount, not a dense similarity sweep).

Proof: test_semantic_hash.py (5) — self-identity, orthogonal⇒~half bits, Hamming↔similarity
calibration within 0.15, nearest-by-Hamming = nearest-by-similarity. Registered in cleanroom
FRAMEWORK_FILES (scan clean, 24 files).
@mdheller mdheller changed the title feat(semantic): associative-memory dynamics — the temporal organ for the twin medium feat(semantic): knowledge-memory substrate — dynamics organ + living twin + semantic-hash index Aug 4, 2026
@mdheller
mdheller merged commit e309406 into main Aug 4, 2026
6 checks passed
@mdheller
mdheller deleted the feat/semantic-dynamics branch August 4, 2026 15:04
mdheller added a commit that referenced this pull request Aug 4, 2026
…gy + ④ ingest + ⑤ index (#134)

The 5-diagram spine had ① memory (dynamics.py #132) + ② discourse (argument_mining.py #133); this lands
the last three organs, all off the SAME Aristotelian/VSA substrate so ingestion, typing and retrieval
never drift:

- ⑤ INDEX  procyber/semantic/semantic_index.py — Hamming NN retrieval over SemanticHasher codes. Ranks by
  semantic similarity (E[H/n]=θ/π), bounds by radius, and `codes_hex` exports exactly a hyper-feed
  -manifest.v0 payload — a node's index IS its mesh federation advertisement.
- ④ INGEST procyber/lod/triplify.py — text → RDF triples, the category fixing the predicate (substance →
  standard rdf:type; relation/quantity/quality → disc: predicates). Fail-closed.
- ③ ONTOLOGY procyber/ontology/atomspace.py — Aristotle's primary/secondary substance → the AtomSpace
  type-inheritance lattice (MemberLink instance / InheritanceLink subclass; accidents → EvaluationLink).
  Standard OpenCog atom types — the lattice a PLN reasoner walks (KKO-IRI grounding is the next step).

14 theorems (⑤ self-retrieval + rank agreement + radius + manifest-code round-trip; ④ one triple per
category + rdf:type interop + fail-closed; ③ instance vs subclass vs evaluation + composes a lattice).
Registered in the cleanroom FRAMEWORK_FILES — checker clean, 27 files scanned. Pure-Python, deterministic.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant