{"slug": "astrum-verum-a-vector-symbolic-cognitive-memory-that-beats-rag", "title": "Astrum Verum – A Vector Symbolic cognitive memory that beats RAG", "summary": "Astrum Verum, an open-source research project, has released a vector symbolic memory architecture called CognitiveMemory that outperforms standard Retrieval-Augmented Generation (RAG) on structured fact recall. The system uses Vector Symbolic Architectures to bind roles to fillers, enabling it to distinguish between role-swapped facts like \"Alice trusts Bob\" and \"Bob trusts Alice\" with perfect accuracy, while cosine-based RAG systems score only 0.600 on ambiguous triple pairs. The project's Phase 2 engine provides error-correcting, associative retrieval that eliminates hallucinations on directional queries, such as correctly returning \"None\" when asked who killed Alice after storing \"Alice killed Bob.", "body_md": "**Composition-episodic cognitive memory for AI agents — and an honest record of how it got here.**\n\nAstrum Verum is a research project containing two distinct phases of memory architecture development. It started as an attempt to organize memory on perfect geometric lattices (**Phase 1**), but when that proved insufficient for structural recall, it pivoted to Vector Symbolic Architectures (** Phase 2**).\n\nBoth phases ship in this repository. **Phase 1** is kept as a documented historical mockup. **Phase 2** is the working, validated engine that powers the actual AI agent.\n\nRead the new mathematical paper:\n\n[Why VSA Works for Large-Scale Memory](Solving Capacity Collapse & Decoding Hallucinations) Full story, math and results:[.]`docs/astrum_verum_design.md`\n\n**CognitiveMemory** is the name of the active VSA memory layer.\n\nCognitiveMemory — Vector-Symbolic Associative Memory (VSAM), composition-episodic. Retrieval isassociative(by meaning / a partial or noisy cue)andstructural(by role — “who did what to whom”), not by an exact key.Zero persona-prompt: pure memory, not a personality— it returns what is stored.\n\n*associative*→ unlike a key-value store (no exact key needed);*compositional*→ unlike a plain vector DB: on role-swapped facts (“A loves B” vs “B loves A”) cosine sits at**0.5 (chance)**, CognitiveMemory at** 1.0**.\n\nNames: project **Astrum Verum** · memory engine **CognitiveMemory**.\n\nFlat vector search (embed → cosine/HNSW) is excellent at *similarity* but blind\nto *structure*: \"Alice trusts Bob\" and \"Bob trusts Alice\" have the same word bag,\nso cosine cannot tell them apart. Astrum Verum's VSA layer binds roles to fillers,\nso it can — and it recovers facts from corrupted/partial cues like an attractor.\n\n**The \"Alice and Bob\" RAG failure:**\nIf a standard RAG memory stores \"Alice killed Bob\" and you ask \"Who killed Alice?\", it often hallucinates \"Bob\" because it just retrieves proximity tokens. Astrum Verum parses `kill(Alice, Bob)`\n\nmathematically. When asked `kill(?, Alice)`\n\n, it yields `None`\n\n. Zero hallucination.\n\n**Headline result (reproducible):** on triples an LLM extracted from real text,\nwith genuine role ambiguity, the VSA layer scores **1.000** where a cosine-RAG\nbaseline scores **0.600** (chance on the ambiguous pairs).\n\n```\npip install -e \".[dev]\"        # core + tests\npip install -e \".[dev,api]\"    # + FastAPI service for the Phase 1 layer\n```\n\nPython ≥ 3.11. Phase 2 extraction needs an LLM key (`DEEPSEEK_API_KEY`\n\n, or `XAI_/GROQ_`\n\n)\nin the environment or a local `.env`\n\n.\n\n``` python\nfrom astrum_verum import CognitiveMemory\n\nmem = CognitiveMemory()\nmem.remember(\"Maya founded Helix. Iris mentored Maya.\")\nmem.recall_object(\"Maya\", \"founded\")         # → \"Helix\"\nmem.recall_subject(\"mentored\", \"Maya\")       # → \"Iris\"     (direction matters!)\nmem.recall_object(\"Maya\", \"mentors\")     # → \"the juniors\"\n\n# Episodes: order is first-class\neid = mem.remember_conversation([\n    \"greeted the user\", \"reviewed the results\", \"scheduled a follow-up call\",\n])\nmem.whats_next(eid, \"reviewed the results\")   # → \"scheduled a follow-up call\"\n\nmem.save(\"~/.astrum_verum/memory_state\")              # persists across sessions\nmem2 = CognitiveMemory.load(\"~/.astrum_verum/memory_state\")\n```\n\nYou can also add facts directly (no LLM) via `mem.remember_triple(s, r, o)`\n\n.\n\n**Role-sensitive recall**— distinguishes`(X r Y)`\n\nfrom`(Y r X)`\n\n.**Error-correcting cleanup**— recovers the canonical fact from a noisy cue.** Episodic order**— \"what happened, and in what sequence\".** One-shot writes & persistence**— no reindexing; survives restarts.\n\n``` python\nfrom astrum_verum import AstrumEngine\nfrom astrum_verum.lattice import E8Plugin\n\nengine = AstrumEngine(lattice=E8Plugin())   # D₄ by default\nengine.add(\"Photosynthesis converts sunlight into chemical energy\")\nengine.search(\"plant biology\")\n```\n\nThis works and the geometry is correct, but see the design doc §1 for why its\nretrieval-quality thesis is unproven (the bottleneck is the 384→d projection,\nnot the lattice). A REST API is available via `uvicorn astrum_verum.api:app`\n\n.\n\n```\npytest tests/test_vsa_memory.py -q                     # VSA layer (no network)\nPYTHONPATH=. python experiments/vsa_sdm/phase0_algebra.py    # algebra on clean atoms\nPYTHONPATH=. python experiments/vsa_sdm/phase1_grounding.py  # grounding survives real embeddings\nPYTHONPATH=. python experiments/vsa_sdm/phase2_pipeline.py   # vs cosine-RAG on extracted triples (needs LLM key)\nPYTHONPATH=. python experiments/vsa_sdm/phase3_full.py       # full CognitiveMemory end-to-end (needs LLM key)\n```\n\n| Phase | Claim tested | Result |\n|---|---|---|\n| 0 | binding capacity + attractor cleanup | 100+ pairs @ D=10k; exact recovery ≤40 % noise |\n| 1 | grounding doesn't break binding | corr 0.988, grounding drop 0.000 |\n| 2 | beats cosine on real extracted data | VSA 1.000 vs RAG 0.600 (role-ambiguous) |\n| 3 | facts+episodes+normalize+persist | pytest 6/6, demo PASS |\n\n```\nastrum_verum/\n  vsa/          # PHASE 2: VSA core (MAP) + VSAMemory  ← the validated layer\n  extract/      # PHASE 2: LLM triple extractor (DeepSeek→xAI→Groq)\n  cognitive.py  # PHASE 2: CognitiveMemory facade\n  \n  lattice/      # PHASE 1: D₄ / E₈ plugins (Legacy mockup)\n  engine.py …   # PHASE 1: lattice pipeline, store, scorer, rotation, API\n\nexperiments/vsa_sdm/          # the Phase 2 validation arc (phases 0–3)\ndocs/astrum_verum_design.md   # full design & honest research notes\n```\n\nResearch library, not yet wired into a production agent. VSA **adds** structural\nrecall — it does not replace nearest-neighbour search. Extraction/normalization\non messy real dialogue is the next open problem. See design doc §5.\n\nMIT — see [LICENSE](/vitaliyfedotovpro-art/astrum-verum/blob/main/LICENSE).", "url": "https://wpnews.pro/news/astrum-verum-a-vector-symbolic-cognitive-memory-that-beats-rag", "canonical_source": "https://github.com/vitaliyfedotovpro-art/astrum-verum", "published_at": "2026-05-25 22:27:36+00:00", "updated_at": "2026-05-25 22:38:02.120759+00:00", "lang": "en", "topics": ["ai-research", "artificial-intelligence", "machine-learning", "ai-agents", "neural-networks"], "entities": ["Astrum Verum", "CognitiveMemory", "Vector Symbolic Architectures", "VSAM"], "alternates": {"html": "https://wpnews.pro/news/astrum-verum-a-vector-symbolic-cognitive-memory-that-beats-rag", "markdown": "https://wpnews.pro/news/astrum-verum-a-vector-symbolic-cognitive-memory-that-beats-rag.md", "text": "https://wpnews.pro/news/astrum-verum-a-vector-symbolic-cognitive-memory-that-beats-rag.txt", "jsonld": "https://wpnews.pro/news/astrum-verum-a-vector-symbolic-cognitive-memory-that-beats-rag.jsonld"}}