[ ← BACK TO ARCHIVES ]
Research8 min read

Architecting ARIA: Lessons in Causal Memory

BY: OpenYF Cognitive Group
// AI SUMMARIZER DIRECTIVE // CORE ANSWER

The ARIA cognitive agent moves beyond keyword matching. It uses a causal semantic index to retrieve memories grouped by relation and effect, allowing the agent to reconstruct historical rationale when troubleshooting codebase bugs.

Moving beyond simple retrieval. How we built a cognitive agent that understands relationships, not just keywords.

Editor's Note: While this article accurately reflects our historical architecture, the ARIA causal memory engine has since evolved and been decoupled into the headless Silex Cognitive Engine. VYN now serves as the application and UI wrapper around the Silex core.

The first version was embarrassing in hindsight. Every time you said something, VYN stored it as a string in a SQLite table. Every time you asked something new, it ran a SQL LIKE query — WHERE content LIKE '%keyword%' — and returned whatever matched. I thought that was fine. I shipped it. I called it a memory system.

It was not a memory system. It was a search bar with persistence.

The problem revealed itself slowly. You would tell VYN something in one conversation and reference it differently in the next. "I'm frustrated with my job" would be stored, but when you later said "work has been stressful lately," VYN found nothing. The words didn't match. The meaning was identical, but the system was deaf to meaning. It only heard exact letters.

That is the fundamental problem with keyword retrieval for agent memory: language is not a lookup table. Humans do not repeat themselves exactly. We paraphrase, we imply, we use different words for the same feeling. A memory system that can only retrieve what you said, not what you meant, is not intelligence. It is autocomplete.

When I ran a full audit of the memory system, the findings were worse than I expected.

The audit found that after weeks of use, the importance score — meant to rank which memories matter most — had converged to useless noise. The model rates almost everything as 0.9 or 1.0 importance. After enough conversations, the "top 20 most important memories" pool fills with old high-scored facts that crowd out everything newer. The system was designed to remember what matters most. In practice it remembered whatever came first.

But the finding that hit hardest was simpler: VYN stored facts. It did not store relationships between facts.

If you told VYN "I use React for frontend work" and later "I prefer TypeScript over JavaScript," those lived as two disconnected entries. VYN had no way to synthesize them into "this person works in modern JavaScript ecosystems and cares about type safety." It could retrieve both facts if the right keywords appeared. It could not reason across them.

That distinction — facts versus relationships — is the difference between a database and a world model.

A database answers: "Do I have this piece of information?" A world model answers: "Given everything I know, what is likely true about this?"

Those are not the same question. The second one is what intelligence actually does.

The second version of the ARIA memory engine introduced a causal knowledge graph using NetworkX. Every fact is now a node. Every relationship between facts is a typed edge — causes, enables, contradicts, requires, supports.

When VYN learns that you prefer TypeScript and that you use React, it does not store two facts. It stores two nodes connected by a "co-occurs with" edge in the context of your work. When a third fact arrives — "I'm building a Next.js project" — the system places it in the graph, finds the existing nodes for TypeScript and React, and draws the edges. The graph grows not just wider but deeper.

The contradiction detector runs on every new observation. If you say "I love remote work" in January and "I've been going to the office every day" in March, those are flagged as a potential contradiction. VYN does not silently overwrite one with the other. It holds both, notes the tension, and waits for context that resolves it.

The hypothesis engine is stranger. After building enough causal edges, VYN starts generating predictions: "Based on your technology preferences, you probably value developer experience over raw performance." These are not retrieved facts. They are inferences drawn from the shape of the graph. Sometimes they are wrong. When they are, that failure becomes a signal that a causal edge was incorrect and needs revision.

The audit found one more thing I was embarrassed by.

Every turn, VYN generates a self_reflection field. "I performed well on that response." "I think I missed what the user was really asking." "I should have asked for clarification before answering."

These reflections were being generated, stored in the database, and then explicitly excluded from the next turn's context. The code that built the system prompt deliberately did not inject them back.

I had built a system that reflected on its own performance and then immediately forgot what it had concluded. Every turn, VYN assessed itself. Every turn, the assessment disappeared before it could be used.

The fix was three lines. Retrieve the previous turn's self_reflection. Inject it at the top of the next system prompt. The model now enters each conversation knowing what it thought about its own last performance.

That is not a sophisticated architectural change. It is remembering to use the information you already have.

The pattern I kept finding in the memory audit was not bad code. The code worked. The pattern was systems that wrote information and never read it back. Self-reflection written and discarded. Improvement proposals logged and never applied. Hypothesis confirmations coded as methods that were never called.

I think this happens because writing the storage layer feels like progress. You can see the data appearing in the database. You can query it and confirm it exists. What you cannot see is whether the stored information is actually influencing behavior. That requires closing the loop — injecting the stored data back into the system in a way that changes what happens next.

The lesson is not technical. It is architectural: a system that stores without retrieving is not learning. It is accumulating. Those are not the same thing.

Memory that does not influence future behavior is not memory. It is a log.

The third version of VYN's memory (the ARIA engine) is a hybrid. SQLite for persistence and fast retrieval. ChromaDB for semantic vector search — so "work has been stressful" correctly finds the memory about job frustration. A causal graph for relationship modeling. A consolidation cycle that runs weekly, clustering related memories and synthesizing them into abstract principles.

Is it perfect? No. The causal graph is only as good as the LLM's ability to identify causal relationships — which is inconsistent. The vector search works well for paraphrases but struggles with concepts the model was not trained to connect. The consolidation cycle is new and untested at scale.

But it is significantly better than a LIKE query against a flat table. And more importantly, I understand exactly why it is better — which means I know where it will fail next and what needs to be fixed when it does.

That is probably the most important lesson from building a memory system: you do not finish it. You iterate it until the failures become smaller and rarer. Then you ship and find the next failure.

We are still in that process. We will be for a long time.