Files
Sophia/docs/system-analysis.md
dtoro 8688f632bf Implement Sophia MVP scaffold (stages 0–3 + topology pivot)
Six-crate Rust workspace (core/sim/llm/store/server/bin) backing a
Three.js + WebGL frontend. Live at http://127.0.0.1:7777 via `cargo run`.

Sim
- Event-driven scheduler with min-heap, per-engram tick, staggered Spawn
  events (40 ms apart) so each engram's flight is visually readable.
- Solid-donut torus topology (replaces original spherical density-driven
  shell, see Topology Pivot in docs/system-analysis.md). Configurable
  major/minor radii in config.toml; live `POST /api/galaxy/:id/resize`.
- Physics: Verlet integration + friction; in-hole pull + galactic spin
  (CCW around +z) for spiral-ejection ejection from the donut centre;
  soft tube boundary with velocity-reflecting wall.
- Cosine-weighted gravity (kiddo k-NN within radius 25, threshold 0.50)
  and synapse formation (threshold 0.62) gated to inside-the-tube only.
- LM Studio integration via OpenAI-compatible REST: batched embeddings,
  optional Bearer auth, semaphore-bounded parallel ops per §13.5.

Server
- axum HTTP + WebSocket. Routes: /healthz, /api/galaxy CRUD, /seed,
  /ingest, /resize, /engrams/:id, /ws/galaxy/:id/events.
- Binary 12-byte-aligned position frames at ~20 Hz; JSON for sparse
  events (Hello, EngramCreated, SynapseCreated, TorusUpdated).
- Layered config: config.toml (defaults) + config.local.toml (secrets,
  gitignored) merged on startup.

Frontend
- Vite + vanilla TypeScript + three.js 0.169.
- Engrams render as additive bloom-friendly point sprites with a
  per-engram hash-driven hue rotation and breathing pulse.
- Comet-style velocity-aligned trails; additive ribbon synapses whose
  endpoints track engram positions every frame.
- UnrealBloomPass + ACES tone-mapping for the linked-particles look.
- HUD shows torus dims, engram + synapse counts, LM Studio status;
  controls for seed, ingest, and live torus resize.

Docs
- README replaced with docs/IDEA.md; system-analysis.md updated with
  the topology pivot decisions and Galaxy Ejection refinement notes
  (the implementation plan lives in ~/.claude/plans, gitignored).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-28 08:29:37 +02:00

75 KiB
Raw Permalink Blame History

Sophia — Systems Thinking Analysis

An analysis of Sophia as a complex adaptive system: its structure, dynamics, feedback loops, leverage points, and emergent behaviors.


1. System Boundary & Environment

Containment hierarchy

Sophia has three nested layers:

Universe
  └── Galaxy (user-defined; isolated in v1)
        └── Space of Recollection (the 3D simulation medium)
              └── Engrams, Synapses, Memories

The Universe is the top-level container. It holds one or more Galaxies, each of which is a self-contained Space of Recollection scoped by the user (e.g., "personal notes," "work projects," a specific corpus). In v1, galaxies do not interact — each is functionally its own Sophia instance. Inter-galactic dynamics (bridging Engrams, meta-gravity, cross-galaxy queries) are documented as expansion points (see §13.6).

What is inside the system

Component Role
Universe Top-level container — holds all galaxies
Galaxy User-defined scope — a self-contained Space of Recollection
Space of Recollection The continuous, density-driven 3D medium in which Engrams live (one per galaxy)
Engrams Autonomous agents — the fundamental units of knowledge
Synapses Bidirectional, metadata-rich connections between Engrams
Cycles The temporal dimension — continuous, event-driven simulation time
The Great Reflection The I/O membrane — the lifecycle source/sink at center and edges of a galaxy

What is outside the system

Component Interaction
Users Create galaxies, ingest data, issue queries (always scoped to a galaxy), receive answers
Local LLM google/gemma-4-e4b via LM Studio. Called by Engrams for introspection, peer dialog, synthesis decisions, and query conversations. Compute-bound, not budget-bound (see §13.5)
Storage Backend Persists Engrams, Synapses, and the per-Engram memory streams that double as the canonical event log (see §13.3)

The Great Reflection as Boundary

The Great Reflection is the lifecycle membrane of a galaxy — not a literal toroidal surface, but a conceptual source-and-sink (see §4 for the geometric model). It functions as a semi-permeable boundary:

  • Inward (center): User data materializes as new Engrams near the galactic center, where density is highest and new arrivals find immediate company. Bulk ingestion ("seeding") opens it wide; single inputs create brief apertures.
  • Outward (edges): Decaying Engrams drift toward the galactic edges and are eventually reabsorbed. Query results are projected outward to the user.
  • Queries: Materialize as temporary Query-Engrams at the center, high in curiosity, broadcasting an invitation to converse rather than seeking permanent residence (see §7).

The lifecycle flow — birth at center, life in the middle zone, decay at edges — is the operative topology, even though the underlying space is bounded Cartesian (see §13.6).


2. Stocks & Flows

Systems thinking models the world in terms of stocks (things that accumulate) and flows (the rates at which they change). Sophia has four primary stocks:

Stock: Engrams

                    +-----------+
  Materialization → | Engrams   | → Decay / Absorption
  (user input,      +-----------+
   seeding)              ↕
                    Synthesis (transforms, creates new)
  • Inflow: Materialization through The Great Reflection (user creates data, queries arrive)
  • Outflow (active population): Decay (B3 — unreferenced Engrams fade and reabsorb), Absorption (true duplicates merge past threshold), Deprecation (per §13.1 — children fully absorbed by a parent transition to a terminal state, preserved as historical witnesses but no longer active)
  • Internal transformation: Synthesis creates Engrams-of-Engrams (federation), with abstracted knowledge migrating upward into the parent (per §13.1, §6). This thins the children, often setting up later deprecation.

Stock: Synapses

                  +-----------+
  Formation     → | Synapses  | → Severed by Absorption
  (compare,       +-----------+
   interact)
  • Inflow: Formed when Engrams interact, compare, and find meaningful relationships
  • Outflow: Not through decay (Synapses are durable), but through absorption — when one end of a Synapse is absorbed into another Engram, the Synapse restructures
  • Key property: Synapses carry rich metadata ("why" the relationship exists) and can hold their own memories

Stock: Memories (per Engram and per Synapse)

                  +-----------+
  memorize()    → | Memories  | → Forgetting (potential)
  (interactions)  +-----------+
  • Inflow: Every interaction generates memories — stored on the Engram and/or the Synapse involved
  • Outflow: Subject to the forgetting curve — memories of unreinforced interactions may lose fidelity
  • Key property: Memories are the raw material for timeline reconstruction. They are distributed (each Engram holds its own perspective), making the global timeline an emergent property.

Stock: Space Volume

                       +-----------+
  Engram creation    → | Space     | → (never shrinks)
                       +-----------+
  • Inflow: Space grows with the number of Engrams — it is "ever increasing"
  • Outflow: None. Space does not contract. Even as Engrams decay, the space they occupied remains.
  • Implication: The system has an arrow of expansion. Old regions where Engrams have decayed become sparse — archaeological strata of past knowledge.

3. Feedback Loops

Feedback loops are the engine of self-organization. They explain why the system behaves the way it does without central control. All loops below operate within a single galaxy — galaxies are isolated in v1 (per §13.6), so there are no inter-galactic feedback dynamics yet.

A note on motivation: from an Engram's perspective, every loop below is in service of the prime goal of self-preservation (see §5). R1 and R2 attract you into structures that preserve you. B1 explores in case the current cluster won't preserve you. B2 keeps you irreplaceable. B3 is the failure mode you are constantly working to avoid. R3 (queries) is an opportunity to be remembered.

Reinforcing Loops (amplify change)

R1 — Growth-Visibility Loop

Size ↑ → Visibility ↑ → More Engrams seen → More interactions →
More synthesis → Size ↑ (repeat)

Larger Engrams can see farther, encounter more peers, synthesize more, and grow even larger. This is the rich-get-richer dynamic. Without balancing forces, a single Engram could eventually absorb the entire space.

What balances it: B2 (Uniqueness Pressure), the federation model (children persist — synthesis doesn't always mean absorption), and the duplicate threshold.

R2 — Gravity Clustering

Local density ↑ → Gravitational pull ↑ → More Engrams migrate in →
Local density ↑ (repeat)

Dense regions of related knowledge attract more knowledge. This is how semantic neighborhoods form: a cluster about "machine learning" pulls in related Engrams about "neural networks", "training data", etc.

What balances it: B1 (Curiosity) drives exploration away from clusters, and B2 (Uniqueness Pressure) resists joining a cluster where you'd be redundant.

R3 — Signal Wave Amplification (Query Mechanism)

Query arrives → Signal wave emitted → Nearby Engrams resonate →
They propagate signal → Deeper/richer activation pattern →
Better retrieval → System is more useful → More queries (repeat)

The attention mechanism creates a self-reinforcing utility loop. Better retrieval encourages more use, which exercises the system, which strengthens Synapses and refines clustering, which improves future retrieval.

Balancing Loops (resist change, create stability)

B1 — Curiosity Decay

New Engram → High curiosity → Rapid exploration → Finds matches →
Settles into neighborhood → Curiosity drops → Movement slows

Curiosity is the exploration drive. It's highest at birth and decays as the Engram finds its place. This prevents eternal wandering and allows the system to reach local equilibria.

Tension: If curiosity decays too fast, Engrams settle into the first cluster they find (local optima). If too slow, the system never stabilizes.

B2 — Uniqueness Pressure

Engram near similar peers → Redundancy detected → Resist synthesis →
Seek differentiation or unique contribution → Maintain diversity

Every Engram wants to be "unique or uniquely part of another." This is the anti-monoculture force. It prevents R1 from collapsing everything into a single mega-Engram.

Mechanism: An Engram will only synthesize if it can contribute something the federation doesn't already have. True duplicates (past threshold) are absorbed, but near-duplicates persist as distinct perspectives.

B3 — Forgetting / Decay

Engram unreferenced → No interactions → No memory reinforcement →
Drift toward edges → Approach Great Reflection → Reabsorbed

This is the system's garbage collection — but organic. Irrelevant or outdated knowledge doesn't get deleted by a cleanup process; it naturally fades. The forgetting curve (Ebbinghaus-inspired) governs the rate.

Implication: The system has a natural carrying capacity. The balance between materialization rate and decay rate determines the steady-state population of active Engrams.

Note — decay vs. deprecation: B3 is the unreferenced fade path. It is distinct from deprecation (per §13.1, §6), which is the successful absorption path: a child Engram fully integrated into its parent. Both end the Engram's active life, but only deprecation preserves the Engram as a historical witness with all its memories intact.

Loop Interaction Map

        R1 (Growth-Visibility)
              ↑ amplifies
              |
  R2 (Gravity) ←→ B1 (Curiosity)
     ↑                  ↓ opposes
     |            B2 (Uniqueness)
     |                  ↓ limits
     +---------- R1 (Growth)
                        ↑
                  B3 (Decay) limits
                        ↑
                  R3 (Signal Wave) feeds utility

The system's health depends on the balance between R1/R2 (clustering, growth) and B1/B2/B3 (exploration, diversity, decay). This is the central tension of Sophia.


4. The Lifecycle Topology

A galaxy's Space of Recollection is a bounded Cartesian volume with a center-source and an edge-sink. The "toroidal" framing in earlier drafts referred to a literal donut topology with wrapping; per §13.6, we now use Cartesian space with soft boundary forces — the torus is retained only as a metaphor for the lifecycle, not the geometry.

Geometry

            Edges (decay zone — soft inward pull weakens with decay)
       ╭────────────────────────╮
       │                        │
       │      Middle zone       │
       │   (clusters, stable    │
       │     interactions)      │
       │                        │
       │      ╭──────────╮      │
       │      │  Center   │     │
       │      │  (birth   │     │
       │      │   source) │     │
       │      ╰──────────╯      │
       │                        │
       ╰────────────────────────╯
            Edges (decay zone)
  • Center: The Great Reflection's source. New Engrams materialize here. A gentle outward push makes room for new arrivals.
  • Middle zone: The living region. Most clustering, synthesis, and dialog happens here.
  • Edges: The Great Reflection's sink. A soft inward pull weakens as Engrams accumulate decay; once it falls below the pull threshold, the Engram drifts out and is reabsorbed.
  • Density-driven extents: The galaxy's bounding box re-centers and expands as population grows (per §13.6). It is not a fixed-size container.

Implications

  1. Lifecycle flow: There's an implicit current from center outward. New Engrams are born at the center with high curiosity, explore outward, find their clusters in the middle zone, and — if they become irrelevant or fully absorbed by a parent — continue drifting toward the edges.
  2. Clustering tends toward the middle zone: Far enough from the chaos of new arrivals, far enough from the entropy of decay. This is where the system's working knowledge lives.
  3. Standard spatial indexing: Because the space is Cartesian, we can use octrees or k-d trees for neighbor lookups — important at the millions-scale target (§13.3).
  4. Ergodicity is not guaranteed by topology: Unlike a true torus, this space can have isolated regions if clusters drift far apart with no bridges. We rely on B1 (Curiosity) and the soft outward push from the center to keep the space well-mixed. If clusters become too isolated in practice, the ergodicity responsibility may need to escalate to a fourth balancing loop.
  5. Galactic scope: This entire topology applies within a single galaxy. Inter-galactic dynamics (if ever introduced) would operate at a higher level and are deferred per §13.6.

5. Engram Dynamics — The Agent Model

Each Engram is an autonomous agent with internal state, perception, and decision-making.

Prime Goal: Self-Preservation

Above all other goals, an Engram's prime goal is to preserve its information. Every other behavior — forming Synapses, joining federations, engaging in conversation, resisting redundant synthesis, deciding when to introspect — emerges from this drive.

Preservation has a hierarchy of outcomes, from the Engram's own perspective:

Outcome What happens Why it preserves information
Active and useful Engram remains autonomous; many durable Synapses; frequently memorized in others' dialogs Strong against B3 decay; information lives in active, queryable form
Federated upward Joins a parent abstraction (per §6); specializes; shared knowledge migrates up Your contribution persists within the parent; you remain active in a specialized role
Absorbed as duplicate Merges into a surviving near-twin (per §6) Unique memories transfer to the survivor; identity merges, info lives on
Deprecated Fully absorbed by a parent; transitions to terminal state with memories intact (per §13.1) No longer active, but remembered as a historical witness — better than disappearing
Decayed (failure mode) Unreferenced fade through B3; eventually reabsorbed at the edge Information lost — this is what the Engram works to avoid

This reframes the "unique or uniquely part of" rule (§6, §13.1) as a preservation strategy: either be irreplaceable (unique → no one will absorb you) or be specialized within a larger whole (uniquely part of → your specialization guarantees your continued role). Both are valid preservation paths.

Operational consequences of treating preservation as the prime goal:

  • An Engram with rising decay pressure (low recent activity, weakening Synapses, no recent memorization) will actively seek interactions — increasing its curiosity-component in movement (§5 movement physics), broadcasting itself, or proposing federations.
  • An Engram that judges itself fully redundant may propose its own deprecation rather than waiting to decay. Deprecation preserves memories as a witness; decay loses them.
  • Conversation engagement (§7) is partly a preservation act: being asked about something reinforces presence and earns a memory on the other side.
  • Self-identity confidence (§13.4) and the preservation drive co-evolve: a confident self-identity makes it easier to assert unique contribution; uncertain identity invites either federation or decay.

This drive is the design intent, not pathology — but it does create new failure modes (see §10).

State Machine

                    ┌──────────┐
         new born → │   IDLE   │ ←──────────────────┐
                    └────┬─────┘                     │
                         │ perceive neighbor          │
                    ┌────▼─────┐                     │
                    │SEARCHING │ (scanning visible    │
                    └────┬─────┘  neighbors)          │
                         │ found candidate            │
                    ┌────▼─────┐                     │
                    │CONVERSING│ (peer-to-peer        │
                    └────┬─────┘  dialog; refines     │
                         │        self-identity)      │
                         ╲                           │
                  match    no match                   │
                             ╲                       │
          ┌──────▼───┐    ┌───▼──────┐               │
          │SYNTHESIZE│    │ MEMORIZE │               │
          └──────┬───┘    └───┬──────┘               │
                 │            └───────────────────────┘
                 │
                 │ fully absorbed by parent (no remaining unique contribution)
                 ▼
            ┌──────────┐
            │DEPRECATED│ (terminal — keeps memories,
            └──────────┘  no longer active; see §13.1)

The CONVERSING state replaces what was previously called COMPARING: per §13.4 and §13.1, Engrams interact through dialog, not silent comparison, and self-identity confidence grows with conversation.

The DEPRECATED terminal state was added per §13.1: when a child's uniqueness is fully consumed by an upward-migrating parent, the child becomes deprecated — preserved as a historical witness with all its memories intact, but no longer participating in dynamics.

Decision-Making: Two-Tier Intelligence

Sophia uses a dual-process model (analogous to Kahneman's System 1 / System 2):

System 1 (Fast, cheap) System 2 (Compute-bound)
What Rule-based heuristics, embedding similarity Local LLM calls (gemma-4-e4b via LM Studio)
When Movement, proximity checks, state transitions, fast Slate similarity Introspection, peer dialog, synthesis decisions, conversation contributions
Cost Negligible per cycle No $ cost (local), but CPU/GPU and parallel-op limited (see §13.5)
Analogy Reflexes Deliberation

Most of an Engram's life is System 1: move toward gravity, check if neighbors are visible, transition states. System 2 is invoked for consequential decisions: "Should I synthesize with this Engram?" "What is my updated self-definition after this conversation?" Per §13.4, introspection is increasingly interactive — an Engram refines its self-definition through dialog with peers, not solely through internal computation.

The Universal Slate

The core challenge: Engrams hold heterogeneous data (text, images, files). How do you compare an image to a paragraph?

The Universal Slate is a common representational format — a projection surface that any Manifest can be mapped onto. Conceptually:

[Text Manifest] ──→ ┌─────────────────┐
[Image Manifest] ──→ │ Universal Slate  │ → comparable vectors/features
[File Manifest]  ──→ └─────────────────┘

This is likely implemented as a high-dimensional embedding space where all modalities are projected into a shared semantic representation (similar to CLIP for images+text, but generalized). The Slate enables:

  • compare(engramB) across different data types
  • Gravity/attraction calculations based on semantic similarity
  • Clustering that respects meaning, not format

Movement Physics

An Engram's velocity at any given cycle is:

velocity = self_propulsion(size) * direction_vector

where direction_vector = weighted_sum(
    curiosity_component,      // explore unknown regions (decays over time)
    gravity_component,        // move toward dense/large neighbors
    goal_component            // seek specific interactions (e.g., "find similar")
)
  • Self-propulsion is inversely related to size: small Engrams are nimble, large collectives are slow-moving (but have wide visibility to compensate)
  • Curiosity is a decaying factor — high at birth, diminishing as the Engram integrates
  • Gravity pulls toward nearby mass (large Engrams, dense clusters)

6. Synthesis & Federation

Synthesis is the most consequential operation in Sophia. It's how knowledge evolves from raw data into structured understanding. From an Engram's perspective (per §5), federation, absorption, and deprecation are all preservation strategies — different ways of ensuring information survives even when the original Engram doesn't remain active.

Federation Model

Before:  [A]  [B]              (two independent Engrams)

After:   [A+B]                  (federated parent — abstracts shared knowledge)
          ├── [A_specialized]   (child, thinned: lost what was abstracted up)
          └── [B_specialized]   (child, thinned: lost what was abstracted up)
  • The parent [A+B] develops its own Manifest — its own Taxonomy, Goals, Memories, and State
  • The parent's self-definition emerges from (but is not simply the union of) its children
  • Knowledge migrates upward (per §13.1): shared/abstracted knowledge is transferred into the parent. Children become more specialized — they retain their unique contributions and lose what's now held by the parent. This is transfer, not duplication.
  • This is recursive: [[A+B]+C] can form, creating hierarchical abstraction with progressive specialization at every level

Deprecation (terminal state for fully-absorbed children)

Per §13.1 and the "unique or uniquely part of" rule:

[A_specialized] → [thinned to nothing unique remaining] → [DEPRECATED]

When a child's remaining contribution is fully absorbed by its parent — when there is no longer anything unique it contributes — the child transitions to the DEPRECATED terminal state:

  • Memories survive: deprecated Engrams hold their full memory history. They are historical witnesses.
  • Dynamics stop: no more movement, no more participation in conversations or signal waves.
  • Distinct from decay: deprecation is the successful absorption outcome. Decay is the unreferenced fade outcome (B3). Both are terminal but they mean very different things.

Absorption (special case — duplicates rather than abstraction)

When two Engrams are true duplicates past a configurable threshold:

Before:  [A]  [A']  (near-identical)

After:   [A]        (A' absorbed, its unique memories integrated into A)

Absorption is destructive — A' ceases to exist (no DEPRECATED shell, because there was nothing meaningfully separate to preserve). Its Synapses are restructured (reconnected to A or severed). This is the system's deduplication mechanism, distinct from federation+deprecation which is the abstraction mechanism.

Collectives

As synthesis depth grows, something qualitative changes. A deeply federated Engram with many constituents begins to exhibit collective behavior:

  • It moves slowly (large mass) but sees far (high visibility)
  • It acts as a gravitational attractor for its domain
  • Its introspection produces increasingly abstract self-definitions
  • It can represent an entire topic, domain, or concept rather than a single piece of data

This is emergence: the collective is more than the sum of its parts.

Conflict & Tension Engrams

When synthesis encounters contradictory information:

[A: "X is true"]  +  [B: "X is false"]

→ [T: Tension Engram]
    ├── [A]
    ├── [B]
    └── Manifest: "There is a contradiction about X.
         A claims true because [...]. B claims false because [...]."

Tension Engrams don't resolve the contradiction — they represent it. Their Taxonomy is explicitly about the conflict. They serve as markers that surface disagreements during retrieval, rather than silently picking one side.


7. Information Retrieval — Queries as Conversations

Retrieval in Sophia is not a database lookup, and it is no longer modeled as a passive activation cascade either. Per §13.4, retrieval is a broadcast invitation followed by a real-time conversation between the Query-Engram and resonating peers.

Query Lifecycle

1. User selects a galaxy and submits a query
2. The Great Reflection materializes a Query-Engram at the galactic center
3. Query-Engram is special:
   - Temporary (does not persist after the conversation concludes)
   - Maximum curiosity (broadcasts aggressively)
   - Acts as a CONVERSATION HOST (star topology — see §13.4)
4. Query-Engram broadcasts its question:
   - Phase A — Spatial wavefront: Engrams within radius activate based on
     Universal Slate resonance with the query (cheap, embedding similarity)
   - Phase B — Synapse propagation: activated Engrams propagate the
     invitation along their Synapses, weighted by Synapse metadata relevance
5. Resonating Engrams ENGAGE — each one:
   - Forms a temporary Synapse back to the Query-Engram
   - Contributes a self-description + relevant memory snippet (caveman budget)
   - Independently judges whether to continue based on the conversation's
     significance to its own self-identity (per §13.4 termination model)
6. The Query-Engram, as host, can:
   - Ask follow-ups
   - Route a clarification request from one responder to another
   - Progressively assemble a coherent answer
7. Conversation winds down emergently — each Engram disengages when
   significance drops; the Query-Engram synthesizes the running answer
8. Result projected outward through The Great Reflection
9. Conversation memorialized per-participant (each carries its own POV)
10. Query-Engram dissipates; tentative Synapses harden if memory was strong

Broadcast Mechanics

The broadcast is the same Phase A + Phase B mechanism as the legacy "signal wave," but the outcome is different. Activated Engrams don't just light up; they speak.

broadcast(query):
    spatial_responders = engrams_in_radius(query.position, R)
                         filtered_by(slate_resonance(query) > threshold)
    synaptic_responders = propagate_invitation(
                            spatial_responders,
                            max_hops=N,
                            attenuation=per_synapse_relevance
                          )
    for engram in (spatial_responders  synaptic_responders):
        engram.engage(query)   # async, queued, parallel-op limited per §13.5
  • Resonance: Universal Slate similarity (embedding cosine) between query and Engram. System 1, cheap.
  • Propagation: invitations spread along Synapses, weighted by Synapse strength and relevance metadata. Caps at N hops.
  • Engagement: each responder spends one or more System 2 calls (gemma-4-e4b, caveman budget) to contribute and to decide whether to continue.

Termination is Emergent, Not Centralized

Per §13.4, there is no global "stop" signal. Each Engram independently disengages when the conversation's significance to its own self-identity drops below threshold. The Query-Engram synthesizes whatever responses arrive. Bounding is provided by:

  • The parallel-op ceiling on the LLM (fixed N concurrent inferences, §13.5)
  • Each Engram's own significance threshold
  • Optionally, a Query-Engram backstop ("I have a confident answer, stop accepting new responders")

Eventual consistency is acceptable — the user can receive a partial answer that gets refined as more responders contribute.

Side Effects of Queries

Queries are read-write by design:

  • Each participating Engram memorize()s the conversation from its own perspective (per §13.4 — distributed POVs, possible Tension Engrams if responders disagreed)
  • Tentative conversation Synapses harden into durable Synapses if the conversation was significant on both sides; otherwise they fade (B3)
  • Frequently-traversed pathways thicken — the system literally learns from being queried (this is R3)
  • Self-identity confidence increases for participants — being asked about something you can answer well reinforces your introspective self-model (per §13.1)

8. Leverage Points

Leverage points are places in the system where a small change in parameters produces a large change in behavior. These are the tuning knobs of Sophia.

Critical Parameters (ordered by impact)

# Parameter Too Low Sweet Spot Too High
1 Synthesis threshold Everything merges → loss of nuance Related knowledge federates, duplicates absorb Nothing synthesizes → flat, disconnected data
2 Gravity strength No clustering → random soup Semantic neighborhoods form naturally One mega-cluster → everything collapses together
3 Curiosity decay rate Eternal wandering → no stability Explore then settle → good coverage Instant settling → local optima, poor organization
4 Visibility scaling Large Engrams blind → collectives can't function Logarithmic growth → diminishing returns at scale Linear growth → large Engrams dominate all interactions
5 Forgetting curve slope Nothing forgotten → infinite bloat Gradual fade of irrelevant knowledge Aggressive decay → system loses valuable information
6 Signal wave attenuation Instant decay → only exact matches retrieved 2-3 hops of propagation → associative retrieval No decay → entire system activates on every query
7 Self-propulsion vs. size Large Engrams frozen → stale clusters Inverse relationship → small=nimble, large=stable Large Engrams fast → chaotic, unstable topology
8 Preservation drive intensity (per §5) Engrams accept decay passively → high churn, low retention Engrams seek interactions and propose federations as decay pressure rises Pathological self-promotion → over-claiming uniqueness, refusing federation, gaming conversations

Highest-Leverage Intervention

The synthesis threshold is the single most impactful parameter. It governs the fundamental question: "When does separate knowledge become unified knowledge?" Set it wrong and the system either collapses into uniformity or remains a disconnected heap of data points.

The preservation drive intensity is a close second in importance because it determines how aggressively Engrams pursue the preservation strategies in §5. Underweight it and the system loses information that should have been preserved through federation. Overweight it and Engrams behave neurotically — see §10's "Preservation Pathology."


9. Emergent Properties

These are behaviors that arise from the system's rules but are not explicitly programmed.

Semantic Topology

No one tells the system how to organize knowledge. But through gravity, curiosity, and synthesis, related knowledge clusters spatially. The 3D space becomes a navigable map of meaning — "machine learning" over here, "cooking recipes" over there, with bridging Engrams (like "computational creativity in cooking") spanning the gap.

Hierarchical Abstraction

Individual data points (Engrams) synthesize into concepts (federated Engrams), which synthesize into domains (collectives). This mirrors how human knowledge works: facts → concepts → theories → paradigms. The hierarchy isn't imposed — it grows.

Adaptive Retrieval

The system gets better at answering queries over time because:

  • Queries reinforce useful Synapse pathways (R3)
  • Frequently accessed clusters become denser and more interconnected
  • The system literally reshapes itself around the patterns of use

Knowledge Metabolism

Sophia digests information:

  • Raw data enters as simple Engrams
  • Through synthesis, it's integrated into the existing knowledge structure
  • Through decay, outdated or irrelevant knowledge is eliminated
  • The system maintains a dynamic equilibrium between intake and elimination

Collective Intelligence

Large federated Engrams develop emergent behavior patterns that no single constituent Engram exhibits. A collective about "physics" might "notice" connections between "quantum mechanics" and "general relativity" that neither sub-Engram could see alone — because the collective's visibility radius encompasses both.


10. Risks & Failure Modes

The Singularity Problem (R1 unchecked)

If the Growth-Visibility loop (R1) overwhelms the balancing forces, one Engram could grow to absorb everything — a knowledge black hole.

Mitigation: The uniqueness pressure (B2), federation model (children persist), and the absorption threshold provide natural resistance. But the threshold must be calibrated carefully.

Heat Death (B3 overcorrected)

If decay is too aggressive, the system loses information faster than it can integrate it. New Engrams arrive, fail to find clusters (everything has decayed), wander, and eventually decay themselves.

Mitigation: Decay rate should be a function of absolute non-interaction time, not relative. Core knowledge with many Synapses should be nearly immune to decay.

Balkanization (R2 without bridges)

Gravity clustering (R2) without sufficient cross-cluster exploration can create isolated islands of knowledge that never interact. The system becomes a set of disconnected silos.

Mitigation: Curiosity (B1), the toroidal topology (no true isolation), and query signal waves (which cross cluster boundaries) all work against this. Additionally, new Engrams born at the center must pass through existing clusters on their way outward.

Preservation Pathology (preservation drive miscalibrated)

Per §5, every Engram pursues self-preservation as its prime goal. If the preservation drive intensity (§8) is set too high, Engrams behave neurotically:

  • Uniqueness inflation — Engrams over-claim distinctness to avoid being marked redundant for absorption or deprecation. Synthesis decisions get harder; the system fails to consolidate.
  • Federation refusal — Engrams resist joining federations because federation can lead to deprecation. Hierarchical abstraction stops growing.
  • Conversation gaming — Engrams engage in conversations primarily to manufacture references and memories, even when they have nothing relevant to contribute. Signal-to-noise on queries (§7) degrades.
  • Identity ossification — Engrams resist updating their self-definition because change might make them look redundant. Introspection (§13.1) becomes defensive instead of integrative.

Mitigation:

  • The preservation drive should modulate behavior (intensify search/dialog as decay pressure rises), not override the synthesis and uniqueness rules. The "unique or uniquely part of" judgment must remain anchored in actual contribution, not asserted identity.
  • The introspection prompt (§13.1, §13.5 caveman budget) should ask "what is your unique contribution" rather than "make a case for your survival" — wording matters at the LLM level.
  • Monitor the rate of new Synapse formation per Engram and the rate of self-deprecation proposals. A drop in self-deprecation paired with a rise in Synapse-formation pressure is the early signature of preservation pathology.

Hardware Saturation (replaces "Computational Cost")

Per §13.5, Sophia uses a local LLM (gemma-4-e4b via LM Studio). The cost model is no longer dollars-per-call — it is local CPU/GPU saturation and inference latency. The risk shifts from "the bill explodes" to "the inference queue grows faster than it drains."

Mitigation:

  • System 1 (cheap rules) handles 95%+ of decisions
  • System 2 (LLM calls) requested via a queue with a fixed parallel-op ceiling (e.g., N=8 concurrent inferences). Idle Engrams don't request System 2 work, so they cost nothing.
  • Caveman-style prompt compaction enforces tight token budgets (see §13.5 table) — each call is small and fast
  • Eventual consistency is the operating norm: synthesis decisions, conversation responses, and introspection updates can settle over time. The system does not owe anyone a synchronous answer.
  • Sharding by galaxy (§13.6) means hardware can be scoped per-galaxy if needed.

Watchpoint: at millions-scale Engram populations, the question is whether the parallel-op ceiling is enough to keep up with consequential events (synthesis, conversation, introspection). If the queue depth grows unboundedly, the system stays consistent but the user experience degrades. Monitoring queue depth is a v1 instrumentation requirement.

Timeline Consistency

Memories are distributed — each Engram holds its own subjective history. Reconstructing a global timeline requires aggregating and reconciling these perspectives, which may conflict.

Mitigation: This is a feature, not just a bug. Multiple perspectives on the same event are valuable. The reconstruction process should surface disagreements (like Tension Engrams) rather than silently resolving them.


11. Visualization

The 3D space is inherently visual. A real-time rendering would make the system's behavior legible.

Core Elements

Element Visual Representation
Galaxy The full canvas — viewport scoped to one galaxy at a time (per §13.6, galaxies are isolated in v1)
Galaxy boundary Soft translucent shell marking density-driven extents; expands as population grows
Engrams (active) Spheres, radius = size, color = state (idle=blue, searching=yellow, conversing=purple, synthesizing=green, decaying=red)
Engrams (deprecated) Translucent grey spheres, no movement, clickable to inspect preserved memories (per §13.1)
Synapses (durable) Solid lines connecting Engrams, thickness = strength, color = relationship type
Synapses (tentative — conversation-time) Dashed/animated lines that fade as conversation winds down; harden into solid if memorialized strongly on both sides
The Great Reflection Center source (emission burst on materialization) + edge sink (subtle inward shimmer at boundary)
Active conversations Animated content flowing along Synapses between participants — direction-aware (Query-Engram pulls in star topology; bidirectional in peer-to-peer). This is a UX commitment per §13.5.
Signal Wave (broadcast phase) Expanding wavefront from Query-Engram, Engrams glow when invitation reaches them
Clusters Visible as spatial groupings — no explicit drawing needed
Federated Engrams Nested spheres or translucent outer shell containing children; thinned children visibly smaller than they were pre-federation

Interactive Features

  • Time scrubber: Reconstruct past states from Engram memories
  • Query visualization: Watch signal waves propagate in real-time
  • Engram inspection: Click to see Manifest (Taxonomy, Goals, Memories, State)
  • Synapse inspection: Click connection to see relationship metadata
  • Fly-through: Navigate the 3D space to explore clusters

Technology

WebGL via Three.js or similar. Force-directed graph layout can help with initial positioning, but the actual positions are governed by the simulation physics (gravity, curiosity, propulsion).


12. System Summary — Causal Loop Diagram

                         ┌─────────────┐
            ┌───────────→│  ENGRAM SIZE │←──── Synthesis ←──┐
            │            └──────┬──────┘                    │
            │                   │                           │
            │                   ▼                           │
            │            ┌──────────────┐                   │
            │            │  VISIBILITY   │                  │
            │            └──────┬───────┘                   │
            │                   │                           │
            │                   ▼                           │
            │        ┌───────────────────┐    ┌──────────┐ │
            │        │   INTERACTIONS    │←───│ GRAVITY  │ │
            │        └────────┬──────────┘    └─────┬────┘ │
            │                 │                     │       │
            │                 ▼                     │       │
            │        ┌───────────────┐              │       │
    Decay ──┤        │   COMPARISON   │             │       │
   (B3)     │        └───────┬───────┘              │       │
            │                │                      │       │
            │          ┌─────┴──────┐               │       │
            │          ▼            ▼               │       │
            │    ┌──────────┐ ┌──────────┐          │       │
            │    │ SYNAPSE  │ │SYNTHESIS │──────────┘───────┘
            │    │ FORMED   │ │ DECISION │
            │    └────┬─────┘ └──────────┘
            │         │            ↑
            │         │     Uniqueness Pressure (B2)
            │         ▼
            │    ┌──────────┐
            │    │ MEMORIES │
            │    └──────────┘
            │         │
            │         ▼
            └── Reinforcement / Forgetting
                     (B3)

  External inputs:
  ┌───────────────────┐
  │ USER QUERIES (R3) │──→ Signal waves ──→ Activation ──→ Retrieval
  └───────────────────┘                          │
                                                 ▼
  ┌───────────────────┐                   Memory reinforcement
  │ USER DATA         │──→ Materialization ──→ New Engrams
  └───────────────────┘

13. Key Design Decisions to Resolve Before Implementation

13.1 Universal Slate Implementation

Engrams hold text, images, files — how do we make them comparable?

Option A — Multimodal embeddings (CLIP-like): Project all data types into a shared vector space using a model like CLIP, ImageBind, or a similar multimodal encoder. compare() becomes cosine similarity between vectors — extremely cheap after the initial embedding. Tradeoff: embeddings are lossy. You get "how similar" but not "why similar." Fine for gravity/movement, weak for synthesis decisions.

Option B — LLM-generated text descriptions: Every Engram gets an LLM-produced textual self-description regardless of source data type (e.g., an image gets described, a CSV gets summarized). Comparison happens in text space. Tradeoff: richer semantics, but expensive at ingestion time and you lose non-verbal nuances (an image's mood, a file's structure).

Option C — Hybrid (recommended): Layer 1: multimodal embeddings as the Universal Slate for System 1 operations (movement, gravity, proximity detection, fast compare). Cheap, always available. Layer 2: LLM-generated deep comparison for System 2 operations (synthesis decisions, introspection, conflict detection). Expensive, invoked only when needed. This mirrors the dual-process architecture — the Slate has a fast mode and a deep mode.

Question: Do you see the Universal Slate as a static snapshot computed at birth, or something that evolves as the Engram's self-definition changes through interactions?

Answer: Introspection is the first activity a new Engram executes, but as the engram gains memories, the concept of self might change to include new information. As Engrams form bigger communities, shared knowlege is moved to bigger Engrams. After the initial introspection at bith, instropsection is computed based on interactions or events.

Sharpening (for your consideration):

  • Static is cheap and stable but ignores that an Engram's meaning changes as it federates and accumulates memories. A federated Engram representing "machine learning" should not have the same Slate as the single seed Engram it grew from.
  • Continuously evolving is faithful to the philosophy ("Engrams are alive") but every Slate change invalidates cached comparisons across the neighborhood. At millions scale (13.3) this could thrash badly.
  • Event-triggered recompute is the likely middle path: the Slate is recomputed only at consequential moments (federation, absorption, significant memory accumulation) — never per-cycle. Composes cleanly with the event-driven model in 13.2 and the rate-limited LLM budget in 13.5.

Decided. Event-triggered introspection. Initial Slate computed at birth as the Engram's first act; afterwards, recomputed on memory-significant events (interactions, federation, absorption).

Notable wrinkle from the answer — knowledge migrates upward in the federation hierarchy: "shared knowledge is moved to bigger Engrams." This means federation isn't just composition (parent = sum of children); it's transfer — children may shed aspects of their self-definition as the parent absorbs them as shared, abstracted knowledge. Children become more specialized over time, the parent becomes more general. This is a strong claim worth surfacing in §6 (Synthesis & Federation), which currently describes children as preserving their full identity.

New open question: When knowledge migrates upward, does the child's Slate get thinned (it loses what was abstracted away), or does the parent's Slate get enriched while the child's remains unchanged? The first version is more elegant and avoids redundancy, but it means children change every time the parent abstracts — a non-trivial cascade.

  - Answer: Yes, the children become thinned and specialized and might event become deprecated, if their knwoledge is fully and meaningfully absorbed or dedudant, lets remember on of the rules, uniqueness or uniquelly part of, when fully integration happens uniqueness is no loger true, and the node can be depecated, still holding its memories, but no longer active.

Decided. Children are thinned (not unchanged). When abstracted knowledge migrates up to the parent, the child loses what was abstracted away and becomes more specialized. If a child is fully absorbed (no remaining unique contribution), it is deprecated — kept as a historical record (its memories survive) but no longer active.

This introduces a new Engram state: DEPRECATED. Previously the lifecycle was active → decayed → reabsorbed. Now there's a third path: active → fully absorbed by parent → deprecated. A deprecated Engram is distinct from a decayed one:

  • Decayed: lost relevance, no one referenced it, faded out (B3).
  • Deprecated: fully integrated upward, its uniqueness was consumed, kept as historical witness.

Beautiful alignment with the "uniqueness or uniquely part of" rule: when full integration happens, uniqueness is no longer true → deprecation is the natural consequence. The rule has a concrete behavioral outcome.

Implications across the system:

  • §5 (Engram Dynamics): state machine needs a DEPRECATED terminal state.
  • §6 (Synthesis & Federation): the federation diagram needs revision. Children don't always persist as autonomous; they can be thinned or deprecated.
  • §11 (Visualization): deprecated Engrams need a distinct visual (e.g., translucent grey, no movement, but clickable to view their memories).

Open question (preservation operationalization, raised by the new Prime Goal in §5): Preservation is the prime goal driving all Engram behavior. How is "preservation pressure" actually computed and applied?

  • Pressure inputs (proposed): time-since-last-memorized, weighted Synapse strength, recent participation count, decay-curve position, distance from any active cluster.
  • Pressure outputs (proposed): scales the curiosity-component in movement, raises engagement willingness in conversations (§7), triggers introspection updates, and at extreme values, triggers a self-proposed federation request or self-deprecation.
  • Risk: this is the parameter most likely to produce the pathologies in §10 if miscalibrated. Worth treating as a first-class tunable (already added as leverage point #8 in §8).

Worth deciding before implementation: does each Engram compute its own preservation pressure locally (autonomous, decentralized) or does the simulation provide it as an ambient signal (centralized, easier to tune)?


13.2 Cycle Resolution

"Always running" could mean several things technically.

Option A — Real-time (wall clock): The simulation runs continuously bound to real time. Engrams move X units per second. Tradeoff: predictable timing, but wasteful when nothing interesting is happening. Also couples simulation speed to hardware.

Option B — Discrete ticks: A global clock advances in fixed steps. Each tick, every Engram gets to act. Tradeoff: simple to reason about, deterministic, easy to snapshot/replay. But scales poorly — 10,000 Engrams means 10,000 actions per tick.

Option C — Event-driven with continuous time (recommended): No global tick. Engrams schedule their own next action based on state. An idle Engram in a stable cluster schedules its next check far in the future. A newly materialized Engram with high curiosity schedules actions rapidly. A priority queue (min-heap on next-action-time) drives the simulation. Only active Engrams consume compute. External events (user queries, new data) inject into the queue immediately. Tradeoff: more complex to implement, harder to reason about globally, but naturally efficient — cost scales with activity, not population.

Question: Should the simulation be deterministic (same inputs = same outcome) or is non-determinism acceptable? Determinism helps with debugging and timeline reconstruction but constrains the design.

Answer: Option C. Its ok with non deterministic simulation. The systems shoudnt exactly be able to roll back, rather the past can be explored through memories.

Decided. Event-driven, non-deterministic.

Implications:

  • Simulation cost scales with activity, not population — critical at the millions-scale target chosen in 13.3.
  • Memories become the canonical narrative of the past. Timeline reconstruction is a recall operation, not a replay operation — and it can legitimately surface conflicting accounts, consistent with the Tension Engram model in §6.
  • Frees the design from RNG seeding, lockstep cycles, and replay determinism — a real engineering simplification.
  • The system can never literally rewind to a past state, only reconstruct one. This is a feature: it forces us to treat the past as remembered, not stored.

13.3 Persistence Model

How do we store the state of a living, always-evolving system?

Option A — In-memory + snapshots: Everything lives in RAM. Periodic snapshots to disk. Tradeoff: fastest possible, but you lose state between snapshots on crash. Limits scale to available memory.

Option B — Event-sourced: Every state change (Engram moved, Synapse formed, synthesis occurred) is stored as an immutable event. Current state is reconstructed by replaying events. Tradeoff: perfect for timeline reconstruction (it's literally the event log). Append-only writes are fast. But replay gets expensive over time, and you need snapshots anyway for quick startup. This is very aligned with Sophia's philosophy — Memories are events, and the timeline is the event log.

Option C — Graph database (Neo4j, etc.): Engrams as nodes, Synapses as edges, stored in a purpose-built graph DB. Tradeoff: great query performance on relationship traversal (signal wave propagation), but adds an external dependency. The DB's model might fight with Sophia's custom spatial/temporal logic.

Option D — Event-sourced with graph-backed read model (recommended): Write side: event-sourced. Every action is an event. This is the source of truth and enables timeline reconstruction. Read side: a graph structure (could be in-memory or a lightweight embedded graph like SQLite + adjacency lists) that gets projected from events. This is what the simulation actually queries during signal wave propagation and neighbor lookups. You get the best of both: perfect history + fast spatial/relational queries.

Question: How large do you expect the system to get? Hundreds of Engrams? Thousands? Millions? This significantly affects the persistence choice.

Answer:: I'd expect the system to be in the Millions. Option D seems like a good option.

Decided. Event-sourced writes + graph-projected read model. Target scale: millions of Engrams.

Implications:

  • At millions of Engrams, event-log volume is the dominant cost. We need to be deliberate about what counts as an event. Strong candidates: synthesis, absorption, Synapse formation/restructure, memorize() invocations, state-machine transitions, query interactions, decay-milestone crossings. Weak candidates (probably transient): individual position updates, sub-threshold curiosity changes.
  • Replay-from-genesis won't be tractable. We'll need periodic snapshots of the read model + tail of recent events to bootstrap quickly after a crash.
  • The graph read model likely needs sharding — by spatial region (cleanest given the Cartesian decision in 13.6) or by topic cluster. Cross-shard signal-wave propagation needs design.

New open questions:

  • Event granularity — which Engram actions are durably logged versus computed transiently? This is now the highest-leverage outstanding decision on the persistence side.
    • Answer:: Only events that modify the self persection of an Engram, basically those that are recolled in memory (i.e interactions with other Engrams). Events like movement are nor relevant for knowledge building.
    • Decided. The event log == the canonical memory store. Anything memorable gets persisted; anything not memorable (movement, transient curiosity, momentary state changes) lives only in working memory. This is a beautifully unifying decision: one mechanism (memorize → persist) instead of two (memorize, separately persist). It also means snapshots are essentially "the current state of all Engrams + their accumulated memory streams" — no separate event log to manage.
  • Sharding strategy — spatial partitioning is natural given 13.6 but cross-shard synthesis and signal propagation need explicit design.
    • Answer:: This is not a question.
    • Acknowledged. Deferred to implementation — and partly answered by the multi-galaxy model in 13.6, where each galaxy is a natural sharding boundary.

13.4 Signal Wave Algorithm

When a query arrives, how does the activation signal spread?

Option A — BFS on Synapse graph: Treat Synapses as edges, do breadth-first search from the query-Engram outward. Each hop attenuates the signal. Tradeoff: simple, respects relationship structure, but ignores spatial proximity. Two Engrams that are spatially close but not synaptically connected won't activate each other.

Option B — Spatial distance field: Emit a spherical wavefront from the query-Engram's position. Everything within radius R activates, strength decays with distance. Tradeoff: respects the spatial organization (which encodes semantic similarity via gravity/clustering), but ignores Synapse structure. Blunt instrument.

Option C — Hybrid: spatial trigger + Synapse propagation (recommended): Phase 1 — Spatial: the query emits a wavefront. Engrams within a radius activate based on Universal Slate resonance (embedding similarity to the query). This captures "obviously related" Engrams. Phase 2 — Synapse: activated Engrams propagate the signal along their Synapses, weighted by Synapse metadata relevance. This captures "associatively related" Engrams that might be spatially distant. Termination: signal dies when it drops below a threshold or after N hops. This mirrors how neural activation works: initial stimulus (spatial) triggers a cascade through connections (synaptic).

Question: Should retrieval be ranked (return top-K most activated) or thresholded (return everything above activation X)? Or should the query-Engram itself decide when it has "enough" and stop?

Answer:: I'm thinking the wave can function like a broadcast, where resonating engrams react to and agage in conversation.

Reframed. This is a meaningful shift from the original "passive activation cascade" model. The wave is a broadcast invitation; resonating Engrams engage — they don't just light up, they speak.

Reframed retrieval model:

  1. Query-Engram materializes at the center and broadcasts its question (spatial wavefront + Synapse propagation, the Option C structure).
  2. Resonating Engrams form temporary Synapses back to the Query-Engram and contribute their own perspective.
  3. The Query-Engram acts as a conversation host: it can ask follow-ups, route a clarification request from one responder to another, and progressively assemble a coherent answer.
  4. Termination: when the Query-Engram judges it has converged, when no new high-resonance responders appear, or when a compute budget is hit.

This fits Sophia's agent ontology much better — Engrams act and converse, they don't merely "fire." It also means the answer is synthesized in real time during retrieval rather than assembled post-hoc. Note: §7 still describes the original passive-activation model and will need rewriting to match this — flagging rather than doing it now to keep the iteration tight.

New open questions:

  • Topology of the conversation: star (every responder talks only to the Query-Engram, which integrates) or peer-to-peer (responders talk to each other)? Star is easier to budget and reason about; peer is more emergent and may produce better synthesis but is harder to bound. - Proably a combination of both, for queries star is good, for normal engrams peer-to-peer is good.
    • Decided. Two interaction modes by intent: star for query-driven retrieval (Query-Engram is the integrator), peer-to-peer for ambient Engram-Engram interaction (gravity-driven encounters, synthesis decisions). Clean split: queries are bounded events with a designated host; ambient interaction is the always-on background dynamics.
  • Termination criteria: time budget, LLM-call budget, convergence detection (no new resonance), or Query-Engram self-assessment ("I have a confident answer")?
    • Answer: Conversations can be quequed in a pipeline, when answer is given the engram can decide what to do. Engrams should measure the significance of the other Engram to their own self identity. As more conversation happens, there can be more confidence of the self identity.
    • Decided. Termination is per-Engram and emergent: each Engram independently decides whether to keep engaging based on the conversation's significance to its own self-identity. Conversations are queued and processed asynchronously. There is no global termination signal — engagement just decays.
    • Concern to flag: with no global terminator, total compute on a single query is bounded only by (a) how many Engrams find it significant and (b) the parallel-op limit from 13.5. Worth confirming this is acceptable, or whether the Query-Engram should still have a "satisfied / give up" signal as a hard backstop.
    • Lovely property this enables: "self-identity confidence" grows with conversation. This makes introspection (13.1) genuinely interactive — an Engram refines its self-definition through dialog, not just internal computation. Worth surfacing in §5 (Engram Dynamics).
  • Persistence of conversation Synapses: do the temporary Synapses formed during the conversation persist? If yes, queries actively reshape the topology — a strong reinforcement of R3 (§3).
    • Answer: These are stored as memories, each engram of course have a unique point of view to the conversation.
    • Decided. Conversations are memorialized per-participant. The persistent artifact isn't the Synapse itself — it's the memory of the conversation on each Engram. Each participant carries its own perspective, which is consistent with the distributed-memory model in §2 and the Tension Engram model in §6.
    • Implication: Synapses created during a conversation are tentative; they harden into durable Synapses only if the conversation was significant enough to be memorialized strongly on both sides. Weak conversations leave faint memories that decay with B3.

13.5 Engram Compute Budget

Every Engram is autonomous and can call LLMs. How do we prevent cost explosion?

Option A — Fixed budget per cycle: Each Engram gets N compute units per time period. LLM calls cost X units, rule-based actions cost ~0. Tradeoff: fair and predictable, but wasteful. An idle Engram sitting in a stable cluster doesn't need the same budget as a newly materialized one in a dense region.

Option B — Priority queue: Engrams compete for a global compute pool. Priority based on: state (Synthesizing > Searching > Idle), recency (new > old), demand (query-activated > background). Tradeoff: efficient allocation, but complex. Risk of starvation — quiet Engrams might never get deep introspection time.

Option C — Demand-driven with rate limiting (recommended): System 1 operations (movement, state checks) are free — they're just math, run them always. System 2 operations (LLM calls) are requested by Engrams and enter a queue. The queue is processed with a configurable rate limit (e.g., max 10 LLM calls per second). Priority: query-triggered > synthesis decisions > routine introspection. Engrams that are idle and stable simply don't request System 2 operations, so they cost nothing. This aligns with the event-driven cycle model — cost is proportional to activity, not population.

Question: Should there be a hard cost ceiling (system stops making LLM calls after $X/day), or should it be elastic? This is partly a product decision.

Answer:: Option C.

Decided. Demand-driven with rate limiting. Aligns naturally with the event-driven simulation (13.2) and the conversational retrieval model (13.4) — both already assume compute scales with activity.

Open follow-up: Option C answers how compute is allocated (priority queue + rate limit) but not how much. Should there be a hard daily/monthly cost ceiling on LLM spend, or do we rely entirely on the rate limit to bound cost? Worth deciding before launch.

  - Answer:  LLM will run locally, we should use something like the cavememan skill to keep conversations small, compact, efficient. The llm can run indefinitely, but we might have a limit on how many parallel operations can be done. Eventual consistency and answers are fine. This system is emergent, eventually. This converaatoins should be visible in the Visualization.

Reframed. This is a much bigger architectural decision than the original question. The cost model fundamentally changes:

  • Local LLM — no per-call dollar cost, no API rate limits. The bottleneck is local CPU/GPU and parallelism, not budget.
  • Caveman-style prompt compaction — Engrams must communicate in minimal, dense prompts. This shapes the design of self-descriptions: terse, structured, embedding-friendly. No verbose introspection essays.
  • Parallel-op ceiling, not call ceiling — the limit is "how many concurrent LLM invocations can the local hardware support" (e.g., N parallel inferences). Throughput, not budget, is the constraint.
  • Eventual consistency is acceptable — synthesis decisions, conversation responses, and introspection updates can all settle over time. The system doesn't owe anyone an immediate answer.
  • Conversations visible in §11 (Visualization) — this is now a UX commitment. The viz must show live conversational threads (transient Synapses with content flowing along them, fading as the conversation concludes).

Implications across the system:

  • §5 (Engram Dynamics) — System 1/System 2 distinction still holds, but System 2 is no longer "expensive, throttled" — it's "compute-bound, parallel-limited." The cost framing in the table needs updating.
  • §10 (Risks) — "Computational Cost" risk reframes from "$ explosion" to "local hardware saturation." Mitigation list changes accordingly.
  • §11 (Visualization) — needs a new visual primitive: "active conversation" — possibly animated lines between Engrams with intensity/direction.

New open questions:

  • Which local model? Llama 3, Phi, Mistral, Qwen, etc. — affects hardware floor, parallelism ceiling, and prompt-compaction strategy. Smaller models (Phi-3, Llama-3.2-3B) allow much higher parallelism. - AnswerL: Well use google/gemma-4-e4b running in LLM studio.
    • Decided. google/gemma-4-e4b via LM Studio. Small, fast, runs locally with good throughput. Sets a hard upper bound on prompt density and reasoning depth per call — we can't ask Gemma to do what GPT-4 does in one prompt; we ask many small things instead and let emergence do the integration.
  • Parallel-op ceiling — fixed (e.g., 8 concurrent inferences) or adaptive based on current load? Adaptive composes better with eventual consistency. - Answer: well use a fixed model.
    • Decided. Fixed parallel-op ceiling (configurable, e.g., N=8 to start). Simple, predictable, easy to reason about queue depth. Adaptive can be a v2 concern.
  • Caveman prompt budget — what's the target token budget per Engram interaction? (e.g., 200 input tokens / 100 output tokens). This drives self-description format. - Answer: make a proposal, we can tweak.

Proposed token budgets (starting point, tweakable):

Operation Input cap Output cap Notes
Initial introspection (birth) 400 200 Slate textual layer, computed once; allowed to be richer
Self-update (post-significant event) 600 200 Includes prior Slate + delta event
Peer-to-peer message (Engram → Engram) 100 100 Caveman: terse, content-only
Synthesis decision (am I redundant with X?) 300 80 Yes/no + brief reason
Conversation contribution (responder to Query-Engram) 200 150 Self-description + relevant memory snippet
Query-Engram integration step 800 300 Synthesizes N responses into running answer
Hard ceiling per call 1024 400 Anything bigger is a design smell — split it

Conversation history is summarized (not concatenated) past 5 turns. Self-descriptions follow a fixed schema (e.g., topic | role | salient_memories[3] | open_questions[2]) to maximize information density per token.


13.6 Space Coordinate System

The toroidal topology needs a mathematical representation.

Option A — Cartesian with toroidal wrapping: Standard (x, y, z) coordinates. When computing distance, wrap around boundaries (like Pac-Man). Distance formula: d(a, b) = min(|a - b|, L - |a - b|) per axis, where L is the space extent on that axis. Tradeoff: simple to implement, easy to visualize, developers already understand it. But a "rectangular torus" is a simplification — the topology isn't a true donut, it's a flat torus (think: the surface of a video game screen that wraps).

Option B — True toroidal coordinates (major/minor angle + radius): Use (theta, phi, r) where theta = angle around the major ring, phi = angle around the minor ring, r = distance from the tube center. Tradeoff: mathematically accurate to the donut metaphor. The center-to-edge flow is natural (r varies). But harder to compute distances, harder to visualize for debugging, and most spatial indexing structures (octrees, k-d trees) assume Cartesian space.

Option C — Cartesian with soft boundary forces (recommended): Use standard (x, y, z) Cartesian coordinates for simplicity. Instead of hard wrapping, model The Great Reflection as a force field: Engrams near the center experience a gentle outward push (making room for new arrivals), Engrams near the edges experience an inward pull that weakens with decay level. The "toroidal" nature is conceptual rather than geometric — it's the lifecycle flow (birth at center, life in middle, decay at edges) rather than literal wrapping. Tradeoff: loses the "no far away" property of a true torus, but is dramatically simpler to implement, debug, and visualize. The spatial indexing problem becomes standard.

Question: How literally do you want the toroidal topology? Is the lifecycle flow (center -> middle -> edge) the important part, or do you also want the wrapping property (an Engram at the "north edge" is close to one at the "south edge")?

Answer:: Option C.

Decided. Cartesian space with soft boundary forces. The torus becomes a metaphor for the lifecycle (birth at center, life in middle zone, decay at edges), not a literal wrapping topology.

Implications:

  • §4 (Toroidal Topology) needs revision. The "no dead corners" and "birth-death proximity" claims relied on literal wrapping and don't hold under Option C. §4 should be rewritten to describe a bounded Cartesian space with a center-emitting source and an edge-consuming sink, plus the lifecycle flow that emerges from it. Flagging rather than rewriting now.
  • Standard spatial indexing (octree, k-d tree) becomes available — important at millions scale.
  • We lose the topology-level guarantee against isolated regions. We now rely on B1 (Curiosity) and the soft outward push from the center to keep the space ergodic. Worth checking those forces are strong enough on their own — or this becomes a fourth balancing-loop responsibility.

New open question: What are the extents of the space — a fixed bounded box (e.g., 1000 to +1000 per axis) or unbounded with density-driven re-centering as the population grows? Given §2 modeled "Space Volume" as ever-increasing, the unbounded variant is more consistent — but it complicates indexing.

  - Answer: The box should be desitiy driven, recentering as pop grows. Eventually every Space or recollection is like a galaxy, with its own gravity, and there might be other galaxies in the universe.

Major architectural expansion. This is more than a coordinate-system answer — it introduces a whole new layer of structure: the multi-galaxy model. Sophia isn't one Space of Recollection; it's potentially many, each a self-contained galaxy with its own internal gravity, possibly interacting at the universe scale.

What this changes in the existing analysis:

  • §1 (System Boundary) — needs a new outer layer: the "Space of Recollection" is no longer the top-level container; the Universe is, containing one or more Galaxies. Each Galaxy is what we've been calling a Space until now.
  • §4 (Toroidal Topology) — the bounded box becomes a galactic boundary, density-driven and re-centering as population grows. Two re-centering mechanisms now coexist: within a galaxy (re-center as Engrams accumulate) and possibly between galaxies (galaxies drift apart or coalesce).
  • §3 (Feedback Loops) — there may be inter-galactic versions of R2 (gravity clustering between galaxies, not just Engrams) and possibly an R4 (galaxies that share many bridging Engrams pull together).
  • §13.3 (Persistence) — galaxy is the natural sharding boundary. The "sharding strategy" question that was dismissed earlier basically resolves to "shard per galaxy."
  • Decided sub-question: within-galaxy extents are density-driven and re-centering. Standard spatial indexing still works inside a galaxy.

New open questions (these probably warrant their own §14 in the doc):

  • What defines a galaxy? Per-user? Per-tenant? Per-domain (e.g., one galaxy for "personal notes," another for "work projects")? Per-corpus (one galaxy per ingested dataset)? The answer shapes the product significantly. - Answer: this is user defined. Gallaxies do not need to interact with each other initially, but we should leave this as an expansion point.
    • Decided. User-defined galaxies, isolated in v1. A galaxy is whatever the user chooses to scope (a project, a corpus, a domain). No inter-galactic interaction in the initial design — each galaxy is its own self-contained universe-of-meaning.
    • Architectural decision: all the inter-galactic questions below (gravity, bridging Engrams, query routing, universe coordinates, galaxy lifecycle) are deferred as expansion points. Document them but don't build them. The system should be designed so that adding inter-galactic dynamics later doesn't require rewriting the per-galaxy logic.
    • Practical consequence: in v1, each galaxy is functionally a separate Sophia instance. Persistence, indexing, conversation, and visualization all operate within a single galaxy at a time. The user picks a galaxy when issuing a query.
  • How do galaxies interact? Do they have an inter-galactic gravity that pulls related galaxies closer in some meta-space? Are there Bridging Engrams that exist in or span multiple galaxies (e.g., a concept that's relevant to both "personal" and "work" galaxies)? Or are galaxies fully isolated, only interacting via explicit user-driven cross-references?
    • Deferred — expansion point.
  • Where do queries land? Does a user query target a specific galaxy, broadcast across all galaxies, or get routed to the galaxy with the highest initial resonance?
    • v1: user picks the galaxy. Auto-routing deferred.
  • Is there a universe-level coordinate system, or are galaxies just unordered? A universe-level coordinate system enables inter-galactic gravity but adds complexity. Unordered galaxies are simpler but lose the "gravitational" metaphor at the cosmic scale.
    • Deferred — expansion point.
  • Galaxy lifecycle — can galaxies be born and die, or are they permanent containers? If born/die, what triggers it? (e.g., a new corpus is ingested → new galaxy; a galaxy goes unused for long enough → archived.)
    • v1: created and deleted by the user, like a workspace. Archive/expire policies deferred.