The Core Idea

Most AI systems store knowledge as either model weights (billions of parameters baked in at training time) or text chunks (vector databases, RAG pipelines). SAGE does neither. It encodes knowledge into a 256Γ—256 Neural Cellular Automata grid β€” a living, self-organizing structure where information exists as emergent patterns in cellular dynamics.

This isn't a metaphor. The grid is literally a 2D array of cells, each containing 32 channels of floating-point values. Cells perceive their neighbors and update through tiny neural networks. Knowledge encoding means writing patterns into this grid such that they can be retrieved later through query-driven readout.

Key numbers: 256 Γ— 256 cells Γ— 32 channels = 2,097,152 values. Quantized to half-precision, the entire knowledge store fits in ~128KB. For context, a single page of a vector database index is typically larger than SAGE's entire knowledge grid.

Step 1: Text β†’ Tokens

The encoding pipeline starts with standard BPE (Byte Pair Encoding) tokenization. Current experiments use a 1,024-token vocabulary, though this scales to larger vocabularies as grid size increases.

Input: "Coral reefs are threatened by rising ocean temperatures" Tokens: [coral, reefs, are, threatened, by, rising, ocean, temperatures] IDs: [ 247, 891, 102, 673, 54, 445, 312, 798]

The tokenizer is deliberately small compared to LLM tokenizers (50K–100K tokens). This is intentional β€” the NCA grid doesn't need to distinguish between "can't" and "cannot" at the token level. The grid's spatial dynamics handle semantic nuance through pattern interaction, not vocabulary size.

Step 2: Spatial Projection (Semantic Hashing)

Each token is mapped to a 2D coordinate on the grid via a learned semantic hash function. This is a small neural network (2 layers, ~500 parameters) that maps token IDs to (x, y) coordinates:

Semantic Hash: token_id β†’ (x, y) ∈ [0, 255] Γ— [0, 255] "coral" β†’ (42, 87) ─┐ "reefs" β†’ (44, 89) β”œβ”€β”€ Semantically related tokens "marine" β†’ (40, 85) β”€β”˜ land NEAR each other "ocean" β†’ (50, 91) ─┐ "temperature" β†’ (52, 93) β”œβ”€β”€ Related concepts "acidification"β†’ (48, 95) β”€β”˜ cluster spatially "politics" β†’ (180, 23) ─── Unrelated tokens land "database" β†’ (210, 156) ─── FAR away

The semantic hash is trained end-to-end with the rest of the system. It learns to place related concepts near each other on the grid β€” not because we told it to, but because proximity enables the NCA dynamics to form useful associative connections between related knowledge.

This is fundamentally different from vector embeddings. In a vector DB, similarity is measured by cosine distance in a high-dimensional space. In SAGE, similarity is literal spatial proximity on a 2D grid β€” and the NCA dynamics create emergent connections between nearby concepts.

Step 3: Gaussian-Weighted Write

Once a token has a grid coordinate, knowledge is written as a Gaussian activation centered on that coordinate. The write isn't a single-cell operation β€” it's a smooth, overlapping activation pattern:

For token at position (cx, cy): activation(x, y) = A Γ— exp(-((x-cx)Β² + (y-cy)Β²) / (2σ²)) where: A = amplitude (derived from token embedding) Οƒ = 2.0 (spread β€” each token affects ~25 cells) cx, cy = projected coordinates Written to channels 4–17 (semantic + association channels)

The Gaussian spread is critical. It means each token's knowledge overlaps with nearby tokens' knowledge. When "coral" writes at (42, 87) and "reefs" writes at (44, 89), their Gaussian activations overlap β€” and the NCA dynamics in the overlap region create associative patterns that encode the relationship between the concepts.

Confidence Gating

Writes are gated by existing confidence values (channel 18). If a cell already contains high-confidence knowledge, the new write is attenuated:

effective_write = new_activation Γ— (1 - existing_confidence Γ— gate_strength) gate_strength = 0.7 (tunable β€” higher = more conservative)

This prevents new information from overwriting well-established knowledge, while still allowing gradual updates as evidence accumulates.

Step 4: NCA Integration

After writing raw activations to the grid, SAGE runs 10–20 NCA update steps. This is where the magic happens. Each cell:

  1. Perceives neighbors via 3Γ—3 Sobel filters (detecting gradients and patterns in nearby cells)
  2. Processes perception through a tiny MLP (2 layers, ~50 parameters per cell)
  3. Updates state with a stochastic mask (not every cell updates every step β€” this prevents synchronization artifacts)

These integration steps allow the new knowledge to interact with and merge into existing patterns. The NCA dynamics create associations, resolve conflicts, and build the emergent spatial structure that makes retrieval possible.

Before integration: After 10 NCA steps: Β·Β·Β· Β·Β·Β· Β·Β·Β· Β·Β·Β· Β·Β·Β· Β·Β·Β· Β·Β·Β· coral Β·Β·Β· Β·Β·Β· coral Β·Β·Β· Β·Β·Β· Β·Β·Β· Β·Β·Β· Β·Β·β‰ˆ β‰ˆβ‰ˆβ‰ˆ β‰ˆΒ·Β· ← new association Β·Β·Β· Β·Β·Β· Β·Β·Β· Β·β‰ˆΒ· Β·Β·Β· Β·β‰ˆΒ· patterns emerge Β·Β·Β· reefs Β·Β·Β· Β·Β·Β· reefs Β·Β·Β· between related Β·Β·Β· Β·Β·Β· Β·Β·Β· Β·Β·Β· Β·Β·Β· Β·Β·Β· concepts (β‰ˆ = emergent association pattern from NCA dynamics)

Channel Allocation: 24 Shared + 8 Private

Each cell's 32 channels serve specialized roles. This isn't arbitrary β€” it's a carefully designed allocation that separates concerns:

ChannelsNameShared?What They Store
0–3 Structural βœ“ Yes Cell alive/dead state, health metric, connectivity to neighbors, structural role (hub vs leaf)
4–11 Semantic βœ“ Yes Token embedding projections β€” the core "meaning" of what's stored at this location. 8 dimensions capture the primary semantic axes
12–17 Association βœ“ Yes Cross-cell relationship patterns β€” co-occurrence signals, causal links, hierarchical relationships. These emerge primarily from NCA dynamics, not direct writes
18–21 Temporal βœ“ Yes When knowledge was written (recency), how many sources confirmed it (confidence), decay rate, update frequency
22–23 Provenance βœ“ Yes Hashed source identity, reputation score of the contributing node. Used for trust-weighted retrieval
24–31 Private βœ— No Local-only knowledge β€” personal preferences, PII-adjacent patterns, user-specific context. Never transmitted over the network

The shared/private split is enforced at the protocol level. When generating diffs for network transmission, channels 24–31 are zeroed out before signing. There is no configuration that allows private channels to leak β€” it's a hard architectural boundary.

Why 24 + 8?

The ratio is empirically determined. 24 shared channels provide enough representational capacity for rich knowledge encoding while keeping diff sizes small (~1KB). 8 private channels give each node room for personalization without affecting the shared knowledge layer. In experiments, reducing shared channels below 20 degraded retrieval quality; increasing private channels beyond 8 didn't improve personalization measurably.

Retrieval: Query β†’ Grid β†’ Context

When SAGE needs to answer a question, it reverses the encoding process β€” but with important differences:

Step 1: Query Projection

The question is tokenized and each token is projected to grid coordinates using the same semantic hash. This identifies regions of interest on the grid.

Query: "What threatens coral reefs?" Tokens: [what, threatens, coral, reefs] Grid regions of interest: "coral" β†’ neighborhood around (42, 87) "reefs" β†’ neighborhood around (44, 89) "threatens" β†’ neighborhood around (61, 72) Search radius: Οƒ Γ— 3 = 6 cells around each coordinate

Step 2: Attention Readout

For each region of interest, an attention mechanism reads from the grid cells in the neighborhood. The attention weights consider:

This last point is crucial. The attention readout doesn't just find exact matches β€” it follows association patterns to pull in contextually relevant knowledge. When you query "coral reefs" and "threatens," the association channels may activate patterns related to "ocean acidification" and "temperature rise" even though those terms weren't in the query.

Step 3: Context Vector β†’ Text Prefix

The attention readout produces a context vector that is decoded into a natural language prefix. This prefix is prepended to the transformer's input, giving it factual grounding:

Readout context vector β†’ decoder β†’ "[Knowledge context: Coral reefs are biological structures built by marine organisms. Ocean acidification and rising temperatures threaten reef ecosystems. Confidence: 0.82]" This prefix feeds into the transformer for fluent response generation.

Step 4: Confidence Gating

If the readout confidence is below a threshold (default: 0.3), the context is suppressed entirely. The system returns "I don't know" rather than generating a response from low-confidence knowledge. This is SAGE's defense against hallucination β€” if the grid doesn't have reliable knowledge, it says so.

Why This Isn't a Vector Database

At first glance, NCA knowledge encoding might seem like "just another embedding store." It's not. The differences are fundamental:

Vector DB / RAG

Storage: Text chunks stored verbatim, indexed by embedding vectors

Retrieval: Cosine similarity search β€” find the closest chunk

Associations: None β€” only exact/similar matches

Size: Grows linearly with data (GB–TB)

Learning: None β€” static after indexing

NCA Knowledge Grid

Storage: Knowledge compressed into emergent grid patterns β€” no text stored

Retrieval: Spatial attention with association following

Associations: Emergent β€” NCA dynamics create connections

Size: Fixed 128KB regardless of data volume

Learning: Continuous β€” new knowledge integrates via NCA dynamics

The Association Problem

Consider a vector database that has indexed two documents:

  1. "Climate change causes ocean acidification and temperature rise"
  2. "Coral organisms are sensitive to pH levels and temperature"

If you query "How does climate change affect coral reefs?", a RAG system retrieves both chunks by embedding similarity. But it doesn't understand the connection β€” it just dumps both chunks into the LLM's context window and hopes the LLM figures it out.

In SAGE's NCA grid, the encoding of "ocean acidification" and "sensitive to pH" creates overlapping activations in nearby grid regions. After NCA integration steps, the cellular dynamics form associative patterns that directly encode the relationship: acidification (from climate change) lowers pH (which coral is sensitive to). The grid computes the association β€” it doesn't just store the raw facts.

This is why the emergent intelligence experiment works: when Node A's "climate change" knowledge and Node B's "coral reef" knowledge merge on Node C, the NCA dynamics create associations that neither node had. The grid doesn't retrieve and concatenate β€” it integrates and associates.

The Fixed-Size Advantage

A vector database grows with data. Index 1 million documents and you need gigabytes of storage plus expensive similarity search infrastructure. The NCA grid is always 128KB. New knowledge is compressed into existing patterns β€” older, less-confirmed knowledge gradually fades as new patterns overwrite them through confidence gating.

This means SAGE nodes can sync their entire knowledge state in a few hundred milliseconds over a normal internet connection. Try that with a vector database.

Continuous Learning

Vector databases are static indexes. You add documents, you search documents. There's no learning, no integration, no emergence. The NCA grid is a living structure β€” every new piece of knowledge triggers integration steps that can create new associations, strengthen existing ones, or let outdated knowledge decay. The grid is always changing, always learning.

Concrete Example: Full Pipeline

Let's trace a complete encode-then-retrieve cycle:

═══ ENCODE ═══ User says: "The Eiffel Tower was built in 1889 for the World's Fair" 1. Tokenize: [eiffel, tower, built, 1889, world, fair] 2. Semantic hash: eiffel β†’ (128, 201) tower β†’ (130, 203) built β†’ (135, 198) 1889 β†’ (132, 195) world β†’ (140, 200) fair β†’ (142, 202) 3. Gaussian write to channels 4–17: Each token writes a Οƒ=2.0 Gaussian centered on its coords Overlapping regions: eiffel+tower, world+fair, etc. 4. Confidence update (channel 18): Cells in the write region get confidence += 0.3 5. NCA integration (10 steps): Association channels (12–17) develop patterns linking eiffel↔tower, built↔1889, world↔fair ═══ RETRIEVE (later) ═══ Query: "When was the Eiffel Tower constructed?" 1. Tokenize + hash: eiffel β†’ (128, 201) tower β†’ (130, 203) constructed β†’ (136, 199) ← near "built" (135, 198)! 2. Attention readout: Search neighborhoods around (128,201), (130,203), (136,199) Find strong activations in semantic channels Association channels pull in "1889" from nearby (132, 195) Confidence: 0.72 (above threshold) 3. Decoded context: "Eiffel Tower, built 1889, World's Fair" 4. Transformer generates: "The Eiffel Tower was constructed in 1889 for the World's Fair in Paris."

Note how "constructed" (the query term) maps near "built" (the stored term) via the semantic hash β€” even though they're different tokens. The spatial proximity lets the retrieval system find relevant knowledge without exact token matching.

Current Limitations

These are engineering challenges, not fundamental limitations. The reservoir computing experiments (100% top-5 prediction with linear readout) prove the NCA grid can encode computationally useful structure. The signal ratio experiments (238.9Γ— random) prove it scales with grid size. Everything from here is optimization.

Further Reading

🌿 SAGE is open source and free forever. Join the Discord to follow the research, or install SAGE and start exploring. Source: github.com/Caryyon/sage