COMPOSITION-EPISODIC COGNITIVE MEMORY

Memory that knows
who did what to whom

VSA as a link-coprocessor beside the model: plan with one model, execute with another, remember what it learns.

THE PROBLEM

Flat retrieval cannot see direction.

Alice killed Bob. Later the agent is asked: "Who killed Alice?"
"Bob killed Alice in retaliation..." (RAG Hallucination)
THE SOLUTION

Role binding in high-dimensional space

Facts are stored as Subject ⊗ Relation ⊗ Object.
The system can answer role-sensitive questions without hallucinating.
EMPIRICAL MEASUREMENTS & EVIDENCE

Rigorous Benchmarks

Measured live on real API endpoints. Fully reproducible via scripts in the repository.

COST SAVINGS
x2.6 → x6.0

Hybrid context-first cuts costs by x2.6, while distilled procedures achieve up to x6.0 savings.

TOKEN REDUCTION
x3.1 → x16.5

Reduces input context bloat by bypassing loop iterations, saving up to x16.5 fewer tokens.

AUTO-DISTILL EFFICIENCY
x7.7 → x9.7

Repeated tasks compile into deterministic scripts, lowering overheads by x9.7 on light workloads.

Benchmark 1: Raidho vs Pure Opus 4.8

Real-API measurement (2026-06-11) auditing a codebase package for docstrings, TODOs, and functions. Same model, same task, executed three ways.

Metric Pure Tool-Loop (B) Hybrid Context-First (C) Procedure + 1 Call (A)
LLM Calls 8 1 1
Tokens (In+Out) 45,288 14,484 2,744
Cost ($) $0.3010 $0.1156 $0.0501
Time (seconds) 55.9 s 32.6 s 22.7 s
Report Quality Deep ≥ B (Found B's findings + 3 new issues) Metrics OK, generic advice
COST & TOKENS VS PURE LOOP
Cost and Tokens Comparison
FOUR METRICS AT A GLANCE
Four Metrics at a Glance

Execution Architecture Flow

flowchart TD subgraph Pure_Loop ["Pure LLM tool-loop (B)"] direction TB L1[Iteration 1: ~41k context] --> L2[Iteration 2: ~41k context] L2 --> L3[...] L3 --> L8[Iteration 8: ~41k context] L8 -.-> Waste[Waste: re-paying context 8×] style Waste fill:#c17d5f,color:#fff end subgraph Hybrid ["Hybrid context-first (C)"] direction TB H1[Deterministic collect: $0] --> H2[One synthesis call: ~14k ctx] H2 -.-> HW[Quality matched, ×2.6 cheaper] style HW fill:#5f8a7f,color:#fff end subgraph Procedure ["Distilled procedure (A)"] direction TB P1[Deterministic collect: $0] --> P2[One synthesis call: ~2k ctx] P2 -.-> PW[Mechanics executed, ×6 cheaper] style PW fill:#8a7f5f,color:#fff end Pure_Loop ~~~ Hybrid ~~~ Procedure
* Opus 4.8 pricing verified against Anthropic docs 2026-06-11: $5.00/M input tokens, $25.00/M output tokens. Multipliers: ×2.6 less cost (Hybrid vs Pure Loop), ×3.1 fewer tokens (Hybrid vs Pure Loop), ×6 cheaper cost (Procedure vs Pure Loop), ×16.5 fewer tokens (Procedure vs Pure Loop).

Benchmark 2: Auto-Distillation Curve

Real-API measurement (2026-06-12) under live `deepseek-chat` demonstrating cost reductions over repeated tasks.

Profile Base Cost Distilled (Only) Context-First Combined
Light (Little Data) $0.00034 $0.00004 (×9.7)
Heavy (Audit Task) $0.00100 $0.00046 (×2.2) $0.00059 (×1.7) $0.00013 (×7.7)
LEVERS AGAINST THE LOOP
Levers against the Loop
SAVINGS SCALE WITH OVERHEAD
Savings Scale
* DeepSeek-Chat pricing verified 2026-06-11: $0.14/M input cache-miss, $0.0028/M cache-hit, $0.28/M output. Combined is the integration of context-first and distill, achieving the maximum ×7.7 efficiency.
100% CLIENT-SIDE VSA ENGINE

Interactive VSA Terminal

Vector Symbolic Architecture generating D=10,000 hypervectors in your browser.
Try entering facts (e.g. "Alice loves Bob") and asking questions ("Alice loves ?").

> Astrum Verum VSA Core Initialized. Dimension: 10,000. > Groq Semantic Router & Llama-3.1 Active.
$
THE COGNITIVE ARCHITECTURE FRAMEWORK

Raidho ᚱ

A framework that splits thinking from doing, remembers what it learns, and runs locally.

Reasoning ≠ Execution

Plan on a smart model, execute on a cheap one. Decouple high-level strategies (Claude) from repetitive tool iterations (DeepSeek) to cut context costs.

Durable VSA Memory

Facts are stored as (Subject, Relation, Object) algebraic hypervectors. Persists on disk, reloads instantly, and is recalled only when relevant across languages.

Council Mode

Engage two independent LLM models to debate a technical choice. A third neutral model distills the consensus, automatically updating the VSA memory.

Auto-Distillation

Repeated read-only tool-loops are automatically compiled into deterministic Python procedures, stripping LLM overhead by up to ×9.7 on subsequent runs.

Bring Your Own Key

Provider-agnostic and client-owned. Run on Anthropic Claude, DeepSeek, OpenAI, or any OpenAI-compatible API endpoints.

Open & Lightweight

The core relies only on NumPy. Easy to hack, customize, and plug into other frameworks. Released under AGPL-3.0 for open research.

REAL TALK FROM MISSION CONTROL

THE ARCHITECT & THE GRIND

Vitaliy Fedotov

It all started in December 2025 just for fun — wanted to mess around with voice AI and personal knowledge graphs. Thought I'd laugh, code a bit in the evenings. But the project sucked me in completely: I quit my regular job because I couldn't stop.

Now Astrum is no longer a hobby — it's a full-on thing: a hyper-advanced voice assistant running on your private knowledge graph, with 3D orbits, embeddings, spatial UI. I coded everything with Anthropic Claude — tried every coding agent out there (Gemini, Grok, o1, the rest), but only Claude has the memory and understanding to keep the whole complex project in its head without losing the thread. And yeah, it ate up every last dollar I had on API credits. Sitting in Calgary with zero savings, no investors, no corporate backing.

If the AI community and anyone who vibes with this doesn't throw some voluntary support my way — the project will just stall out. No moon promises, just a real indie dev trying to finish what he started.

EXPERIMENTS & PROOFS

Mathematical Foundations

Experimental Polygon Synthesis: Honest Boundaries

VSA is not a replacement for the semantic intelligence of language models. It is an extremely lightweight, local, private, and deterministic coprocessor for symbolic links and states.

Where VSA Fails

  • Loses at semantic reasoning: raw linear embedding offsets (3CosAdd) represent language meanings better.
  • Loses to exact classical sparse structures (SciPy CSR) when symbols are enumerable, being slower (×5) and heavier (×200).
  • Cannot derive text meaning autonomously; it only recalls pre-mapped structural relations.

Where VSA Wins

  • Perfect for variable-role binding on abstract symbols, beating neural networks zero-shot.
  • Holds multiple dense relations inside a single fixed-size vector (ideal for state snapshots and neural network inputs).
  • The Headline Metric: tag-overlap links computed via LLM take 36 s ($1.7–2.7 / 1k queries) vs 169 μs locally ($0 cost).
EXP 01 OOD REFUTED

MVP Analogy & Held-out Entities

Question: Can a freely learnable VSA codebook learn algebraic relations and generalize to unseen/held-out entities (OOD)?
Finding: Train Acc: 0.99 / OOD Acc: 0.10 (chance baseline 0.04). Optimization collapses on new entities because their vectors remain random.

EXP 02 OOD COLLAPSE

Analogy with Pair-Split Combinations

Question: Does OOD generalization improve when all entities are trained but specific relation-entity combinations are held out?
Finding: Train Acc: 1.00 / OOD Acc: 0.02. Free codebook optimization destroys the systematic permutation-algebra structure.

EXP 02B THEORY VERIFIED

Diagnosis of Attractor Collapse

Question: Is OOD collapse caused by "train-attractor collapse" pulling new vectors to trained primitives?
Finding: Theory Refuted. OOD errors are random (0.68 vs 0.625 baseline). The collapse in Exp 02 is noise from a small sample size.

EXP 03 ALGEBRA WINS

Fixed Permutation Algebra Control

Question: Does systematic analogy generalization stem from fixed algebraic structures rather than learning?
Finding: OOD Acc: 1.00. Non-learned permutation algebra yields 100% OOD accuracy without any training, proving structure > optimization.

EXP 04 GROUNDING SUCCESS

Learnable Grounding with Fixed Algebra

Question: Can we learn a mapping (grounding) from raw features into a frozen VSA codebook while preserving OOD systematicity?
Finding: Train Acc: 1.00 / OOD Acc: 1.00. Freezing the algebra and training only the mapping preserves 100% OOD systematicity.

EXP 05 NARROW NICHE

Grounding Gate on Semantic Relations

Question: Does a fixed, random projection of sentence embeddings + VSA algebra preserve semantic structure without training?
Finding: VSA: 0.75±0.07 vs 3CosAdd: 0.99±0.03 (baseline 0.025). VSA projection loses semantic structure; learning window is narrow.

EXP 06 VSA BYPASSED

Zero-Shot Relation Composition

Question: Does VSA binding out-perform raw linear embeddings in zero-shot composition (e.g. Person → Country → Capital)?
Finding: VSA: 0.24 vs Linear Offset: 0.45 (leakage 0.36). Linear offsets win because embeddings are fundamentally linear, not algebraic.

EXP 07 PARITY ONLY

Learnable Grounding for Composition

Question: Can training a grounding encoder (embedding-to-hypervector) improve VSA composition to beat linear offsets?
Finding: VSA composition reached 0.40±0.06, showing parity with the linear offset ceiling of 0.45, but failed to exceed it.

EXP 08 VSA DOMINATES

Variable Binding (Abstract Symbols)

Question: How does VSA perform in its native niche—role-filler binding with abstract symbols without semantic interference?
Finding: VSA: 1.00 vs NN OOD: 0.014 (baseline 0.08, bag-of-values 0.33). VSA achieves 100% accuracy with zero training.

EXP 09 CAPACITY DEMONSTRATED

Variable Binding Capacity Curve

Question: Does VSA's advantage hold as load (bound roles in a state) increases in D=2048 space?
Finding: VSA holds 1.00 up to 64 roles, 0.995 at 96 roles, while the neural network collapses to floor starting at 16 roles.

EXP 10 CLASSIC WINS

VSA Coprocessor on Real Memory Graph

Question: Can VSA speed up tag-overlap calculations in a real graph compared to exact sparse structures?
Finding: SciPy CSR: 260 μs, 0.4 MB vs VSA: 1200 μs, 78 MB. VSA loses because graph links are highly sparse (2-8 tags/node), which CSR processes by nnz.

EXP 11 LIMITS FOUND

StateMemory Capacity & Load

Question: What is the capacity limit of Astrum's StateMemory, and how does VSA match up to exact structures under noise?
Finding: D=2048 holds ~128 facts, D=10k holds ~512. Under noise, exact pairs beat VSA by 20x in speed (606 μs vs 13.2 ms) and 6x in memory.

EXP 12 COPROCESSOR THESIS VALIDATED

LLM vs Local Structural Linking

Question: What is the latency and cost difference between asking an LLM to compute links vs local computing?
Finding: LLM: 36 s, $1.7–$2.7 vs Local: 169 μs, $0. Local calculation is over 200,000x faster and free. Model needs token budget to compute.

EXP 13 RECALL ONLY

Polysemy Disambiguation in Quran

Question: Can VSA derive semantic meaning to resolve polysemous words (words with ~10 meanings) in context?
Finding: VSA algebra alone cannot derive semantic meaning (Acc ≈ baseline 1/N). It only recalls pre-mapped structural relations.

EXP 14 ANALYSIS ONLY

LLM Classical Arabic Reliability

Question: How self-consistent are frontier models on highly controversial or ambiguous classical Arabic terms?
Finding: Frontier models show overconfident self-contradiction under minor phrasing changes and struggle to acknowledge scholarly uncertainty.

EXP 15 PROTOTYPE SHIPPED

Tafsir Angle Generator Prototype

Question: Can a VSA-seeded generation pipeline help human scholars identify novel interpretations of verses like 24:35?
Finding: Developed a prototype where VSA seeds relational targets and the LLM formulates angles, using self-flagging honesty checks.

EXP 16 NEGATIVE

VSA as a Metadata Cipher

Question: Can a VSA-bundle act as a standalone metadata obfuscator?
Finding: Negative. Without a secret, the link graph is recoverable by membership query (separation σ=7–20). With a key, strength lives in the key, not VSA. VSA is just a wrapper, not a cryptosystem.

EXP 17 MIXED

Encrypted Archive Indexing

Question: Can VSA index an encrypted archive better than classical baselines?
Finding: Mixed. Only matches a plain embedding+filter baseline on composition. Superposition destroys recall (G=2→0.80, G=4→0.35). Squeeze and lose, don't and it's worse than FAISS. Crypto & retrieval are not VSA's territory.

EXP 18 POSITIVE

Real Link Candidates Recall

Question: Do VSA neighbors surface real link candidates on a real text corpus?
Finding: Positive. Overlap@5 with raw embeddings = 0.93 using SimHash grounding. Confirms VSA's real niche: associative recall with one atom per record.

EXP 19 CORRECTED

Graph Decay by Degree

Question: Is a graph's decay signal (weighted by degree) a valid measure of importance?
Finding: Negative. Degree protects frequent, self-similar noise. The earlier framing that "decay protects junk by degree" was over-claimed. Measurement repointed the hypothesis.

EXP 20 PROVEN

Reflex Chain Scaling

Question: Can one human judgment about a pattern scale automatically across a memory graph?
Finding: Positive. It can auto-apply with a confidence gradient, provenance tags, and an audit trail for rollback. Reflex applies only to stable *nature*, never fluid *significance*.

EXP 21 MEASURED

Isolation Scale of Pattern Cleanup

Question: How much bloat does pattern-cleanup actually remove from a memory graph?
Finding: A handful of pattern-judgments isolate a measurable but small fraction of the bloat. Point-cleanup is hygiene, not the cure.

EXP 22 DIRECTION

The Ephemeral Dead-Zone

Question: Where does the real noise and bloat accumulate in the knowledge graph?
Finding: Bloat lives in an ephemeral dead-zone: items decay skips but consolidation misses. Structural signals alone cannot separate valid from noise; a human validity signal is required.

Synthesis: 16–17 close the door on VSA-as-crypto. 18 confirms VSA's real niche (associative recall). 19–22 turn to the harder problem — telling valid memory from accumulated noise — and find that structure alone can't; a human validity signal is the missing piece. Hypotheses were killed on measurement, not on prose.

HIGH-DIMENSIONAL RETRIEVAL BOUNDS

Memory Capacity

Empirical capacity thresholds measured across 30 random seeds, representing the worst-case retrieval accuracy.

Experiment 1: Facts Structural Recall vs N (Superposition Capacity)

Measures the accuracy of role-binding retrieval under increasing superposition load (from 1,000 to 16,000 independent facts) in a D=10,000 bipolar space.

N (facts) Mean Acc Std Min (Worst-Case) Max Seeds
1,000 0.9333 0.0167 0.8900 0.9600 30
2,000 0.9225 0.0165 0.8900 0.9500 30
4,000 0.8825 0.0221 0.8250 0.9450 30
8,000 0.8420 0.0226 0.8050 0.9050 30
16,000 0.7468 0.0321 0.6950 0.8050 30

Experiment 2: Episode Order-Recall vs Length

Measures structural order recall precision for full sequential episodes vs. a bounded working window (W=150).

Full Episode (No Window)

L (length) Mean Acc Min Max
50 1.0000 1.0000 1.0000
100 0.9900 0.9900 0.9900
200 0.9507 0.9350 0.9650
500 0.5567 0.4720 0.6060
1,000 0.2365 0.1910 0.2710

Bounded Window (W=150)

L (length) Mean Acc Min Max
50 1.0000 1.0000 1.0000
100 0.9900 0.9900 0.9900
200 0.9780 0.9733 0.9800
500 0.9649 0.9533 0.9667
1,000 0.9649 0.9533 0.9667

* Note: Sequential order recall drops as the superposition increases. By introducing a bounded working window W=150 (ephemeral active memory), recall accuracy remains stable at ~0.965 even at L=1000 length.

Experiment 3: SimHash Grounding Fidelity

Measures structural embedding similarity fidelity (preserving original geometry of transformer embeddings projected to hypervectors).

Metric Mean Correlation Std Min (Worst-Case) Max Seeds
Pearson 0.992122 0.000176 0.991792 0.992492 30
Spearman 0.990727 0.000225 0.990383 0.991217 30
RIGOROUS SOFTWARE QUALITY

The Test Suite

A comprehensive suite of 83 unit tests across 9 modules validating memory, distillation, and safety.

TEST COVERAGE BY SUBSYSTEM
Test coverage by subsystem
TEST SUITE MINDMAP
mindmap root((Test suite
83 tests)) Distillation & safety (42) test_distill: 13 test_feedback: 14 test_procedure_execution: 15 Memory / VSA core (17) test_bitpack: 5 test_state_memory: 7 test_persistence: 5 External-review regressions (11) test_review_fixes: 11 Context-first (7) test_context_first: 7 Council to memory (6) test_council_memory: 6

Functional Subsystem Verification

test_distill.py (13)

Validates compile-time capture of command histories as deterministic procedures, ensuring only read-only pipelines are learned.

test_feedback.py (14)

Verifies state-quarantining, fitness feedback loops, and procedure validation/lint checks to filter out buggy codeblocks.

test_procedure_execution.py (15)

Asserts execution correctness of compiled procedures, matching inputs/outputs, and handling sandbox file reads.

test_state_memory.py (7)

Tests VSA register state memory bindings, unbinding operations, bundled memory, and cleanups in browser engines.

test_bitpack.py (5)

Tests the performance and accuracy of compact VSA bit-packing, converting floating-point vectors into binary elements.

test_persistence.py (5)

Ensures VSA memory is safely stored to disk and reloaded intact across subsequent session instances.

test_review_fixes.py (11)

Checks regression fixes and code corrections identified during codebase review cycles, preserving critical logic.

test_context_first.py (7)

Validates workspace collection strategies, context budget allocation, and the initial inject sequence.

test_council_memory.py (6)

Verifies the extraction of consensus debate statements into memory triples, making verdicts durable.

SCIENTIFIC INTEGRITY

Scientific Honesty

We do not polish our numbers or hide failure modes. Our methodology rests on radical transparency and fail-fast refutation.

30 RANDOM SEEDS

Every capacity benchmark represents the average and worst-case bounds measured across 30 separate random initializations. We report the minimum retrieval accuracy bounds to guarantee real-world performance, not cherry-picked best runs.

NO STRAWMAN BASELINES

We compare VSA and our distillation loop against state-of-the-art implementations (like full Opus 4.8 prompts and native exact matrix calculations), rather than using weak or un-optimized baselines to artificially inflate our speedups.

RAPID REFUTATION

We document negative findings (such as VSA semantic limitations or failure under D=10,000 without windows). Failure is not a setback, but a boundary condition that clarifies when VSA is a coprocessor versus when traditional databases or LLMs must take over.

SYSTEM TECHNOLOGY
Python 3.11 Kotlin Jetpack Compose Android SDK NumPy Vector Symbolic Architecture (VSA) Kanerva SDM SentenceTransformers Anthropic Claude Anthropic Claude Google Gemini Google Gemini DeepSeek DeepSeek V4 Llama 3.1 Whisper STT Cartesia TTS
pip install -e ".[dev]" PYTHONPATH=. python experiments/vsa_sdm/phase2_pipeline.py
DEVELOPMENT LOG

Development Log

2026-07-03 measured

Experiments 25–28: the physics of the memory horizon

Mapped the capacity limit. Memory can override a weak model (26) — but only for facts it already stores; on conflicts or unseen queries the override confidently fails. Retrieval, not reasoning. The collapse obeys an exact law: Hopfield capacity α_c ≈ 0.14·N — a sharp retrieval→spin-glass transition, not gradual fade (27; measured 0.152 vs theory 0.138). Geometrically the overload is spaghettification: an anisotropic collapse into a thread — the shared gist survives along one axis while per-item detail thins to the noise floor (28). Unlike a black hole, the thread has a bottom: it thins only to the resolution limit √D, never to a singularity.

Experiment 25: event horizon
25 · event horizon — coherent gist holds, detail dies
Experiment 27: Hopfield capacity
27 · Hopfield capacity — retrieval→spin-glass at α_c≈0.14
Experiment 28: spaghettification
28 · spaghettification — thread stretches, floors at √D
Experiment 26: memory vs model
26 · memory vs model — override helps only when memory is right
2026-06-23 negative + positive

Experiments 16–22: VSA's edges, mapped

Closed VSA-as-crypto (16–17). Confirmed associative-recall niche (18, overlap@5=0.93). Opened the valid-vs-noise problem (19–22): structure alone can't tell them apart — a human validity signal is required. Direction set for a human-validated link layer.

2026-06-17 milestone

Research landing published

Research landing published (experiments 01–15, benchmarks, 83 tests).