Add systems thinking analysis and open design questions

Comprehensive systems analysis of Sophia covering stocks & flows,
feedback loops, toroidal topology, engram agent model, synthesis
mechanics, retrieval via signal waves, leverage points, and failure
modes. Includes 6 open design decisions with options and questions
for the author to answer.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-27 19:24:50 +02:00
parent 3fdf4b9d29
commit 43c4d270e6
2 changed files with 821 additions and 0 deletions

696
docs/system-analysis.md Normal file
View File

@@ -0,0 +1,696 @@
# 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
### What is inside the system
| Component | Role |
|---|---|
| **Space of Recollection** | The continuous, unbounded 3D medium in which everything exists |
| **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 — a toroidal portal at the center and edges of space |
### What is outside the system
| Component | Interaction |
|---|---|
| **Users** | Create Engrams (input), issue queries (input), receive answers (output) |
| **LLM Services** | Called by Engrams for deep introspection, comparison, and synthesis |
| **Storage Backend** | Persists the state of Space, Engrams, Synapses, and Memories |
### The Great Reflection as Boundary
The Great Reflection is not a point — it is a **toroidal surface** that exists simultaneously at the center and the edges of space. It functions as a semi-permeable membrane:
- **Inward**: User data materializes as new Engrams at the center. Bulk ingestion ("seeding") opens it wide; single inputs create brief apertures.
- **Outward**: Decaying Engrams drift toward the edges and are eventually reabsorbed. Query results are projected outward to the user.
- **Queries**: Materialize as temporary Engrams at the center, high in curiosity, seeking resonance rather than permanence.
This topology means there is no true "far away" — space curves back on itself. An Engram drifting toward the edge approaches the same boundary where new Engrams are born, creating a cycle of renewal.
---
## 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**: Decay (unreferenced Engrams fade), Absorption (true duplicates merge past threshold)
- **Internal transformation**: Synthesis creates Engrams-of-Engrams (federation), changing the population composition without necessarily changing count
### 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.
### 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 Engrams.
### 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 Toroidal Topology
The Great Reflection's donut shape has profound implications for system dynamics.
### Geometry
Imagine the Space of Recollection as the interior volume of a torus:
```
Edge (decay boundary)
╭────────────────────╮
│ ╭──────────╮ │
│ │ CENTER │ │
│ │ (birth) │ │
│ ╰──────────╯ │
╰────────────────────╯
Edge (decay boundary)
```
- **Center**: Where The Great Reflection opens to materialize new Engrams
- **Edges**: Where The Great Reflection exists as the decay boundary
- **Between**: The living space where Engrams move, cluster, and interact
### Implications
1. **No dead corners**: Because space wraps toroidally, there are no isolated edges where knowledge gets trapped. Everything is reachable.
2. **Birth-death proximity**: The birth zone (center) and the decay zone (edges) are connected through the toroidal surface. Decaying knowledge literally approaches the same membrane where new knowledge arrives — a metaphor for how old ideas inform new ones.
3. **Clustering tends toward the middle zone**: The most stable, active region is between center and edge — far enough from the chaos of new arrivals, far enough from the entropy of decay.
4. **Natural 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, continue drifting toward the edges.
---
## 5. Engram Dynamics — The Agent Model
Each Engram is an autonomous agent with internal state, perception, and decision-making.
### State Machine
```
┌──────────┐
new born → │ IDLE │ ←──────────────────┐
└────┬─────┘ │
│ perceive neighbor │
┌────▼─────┐ │
│SEARCHING │ (scanning visible │
└────┬─────┘ neighbors) │
│ found candidate │
┌────▼─────┐ │
│COMPARING │ (introspect + │
└────┬─────┘ compare) │
╲ │
match no match │
╲ │
┌──────▼───┐ ┌───▼──────┐ │
│SYNTHESIZE│ │ MEMORIZE │ │
└──────┬───┘ └───┬──────┘ │
└────────────┴───────────────────────┘
```
### 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 (Slow, deep) |
|---|---|---|
| **What** | Rule-based heuristics | LLM calls |
| **When** | Movement, proximity checks, state transitions | Introspection, deep comparison, synthesis decisions |
| **Cost** | Negligible per cycle | Expensive, batched/throttled |
| **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?"
### 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.
### Federation Model
```
Before: [A] [B] (two independent Engrams)
After: [A+B] (federated Engram)
├── [A] (child, still exists, still autonomous)
└── [B] (child, still exists, still autonomous)
```
- The parent `[A+B]` develops its **own** Manifest — its own Taxonomy, Goals, Memories, and State
- Children persist and continue to act autonomously within the federation
- The parent's self-definition emerges from (but is not simply the union of) its children
- This is recursive: `[[A+B]+C]` can form, creating hierarchical abstraction
### Absorption (Special Case)
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. Its Synapses are restructured (reconnected to A or severed). This is the system's deduplication 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 Engrams
Retrieval in Sophia is not a database lookup. It is an **activation pattern** in a living system.
### Query Lifecycle
```
1. User submits query
2. The Great Reflection materializes a Query-Engram at the center
3. Query-Engram is special:
- Temporary (will not persist after retrieval)
- Maximum curiosity (explores aggressively)
- Emits a signal wave
4. Signal wave propagates through space
5. Engrams that resonate (high similarity on Universal Slate) activate
6. Activated Engrams propagate the signal further along their Synapses
7. Activation pattern stabilizes
8. Activated Engrams + their relevant memories = the retrieval result
9. Results projected outward through The Great Reflection
10. Query-Engram dissipates
```
### Signal Wave Mechanics
The signal wave is an **activation function** that spreads through the space:
```
signal_strength(engram) = initial_resonance(query, engram)
+ sum(propagated_signal from synapse neighbors)
- attenuation(distance)
```
- **Resonance**: Computed via Universal Slate similarity between query and Engram
- **Propagation**: Activated Engrams pass the signal along Synapses, weighted by Synapse strength and relevance metadata
- **Attenuation**: Signal weakens with distance and hops — controls retrieval depth
This means retrieval naturally follows the **associative structure** of the knowledge, not just point similarity. A query about "neural networks" activates not just directly related Engrams, but also connected ones about "backpropagation", "training data", and "gradient descent" — through Synapse propagation.
### Side Effects of Queries
Queries are not read-only. They leave traces:
- Engrams that were activated `memorize()` the interaction
- Synapses traversed by signal waves may strengthen
- The system literally **learns from being queried** — frequently accessed pathways become stronger
---
## 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 |
### 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.
---
## 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.
### Computational Cost
An always-running simulation where each Engram can independently call LLMs is expensive. At scale (thousands of Engrams), the cost of System 2 operations becomes prohibitive.
**Mitigation**:
- System 1 (cheap rules) handles 95%+ of decisions
- System 2 (LLM calls) is batched, throttled, and triggered only for consequential decisions
- Idle Engrams consume near-zero compute
- Synthesis decisions can be queued and processed asynchronously
### 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 |
|---|---|
| Engrams | Spheres, radius = size, color = state (idle=blue, searching=yellow, synthesizing=green, decaying=red) |
| Synapses | Lines connecting Engrams, thickness = strength, color = relationship type |
| The Great Reflection | Translucent toroidal surface at center and edges |
| Signal Waves (queries) | Expanding wavefronts from center, Engrams glow when activated |
| Clusters | Visible as spatial groupings — no explicit drawing needed |
| Federated Engrams | Nested spheres or translucent outer shell containing children |
### 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:**
---
### 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:**
---
### 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:**
---
### 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:**
---
### 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:**
---
### 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:**