Architecture · Graph TheoryMarch 2026

Beyond the Bucket:
The Four Layers of the
MAGMA Architecture

The biggest mistake in AI memory design is treating all data as equal. A chat log is not a project rule. A timestamp is not a causal link. If you dump everything into one vector bucket, you lose the topology of thought.

9 min readMAGMA FrameworkGraph ArchitectureAssociative Pathfinding

Standard vector databases are one-dimensional: they measure similarity. Point A is close to Point B. That's all they know. This is useful for search, but it's insufficient for reasoning. When your agent needs to answer "What caused the deployment failure last Tuesday?" — a similarity search returns snippets about deployments and failures. It does not return the causal chain that connects them.

VEKTOR implements the MAGMA framework (Multi-level Attributed Graph Memory Architecture) — organizing your agent's memory into four orthogonal layers that each capture a different dimension of knowledge. Together, they enable what we call Associative Pathfinding: the ability to traverse a logical path through history rather than just retrieve similar fragments.

Based on the MAGMA research (arXiv:2601.03236), which demonstrated that multi-layer graph memory reduces multi-hop reasoning errors by 62% compared to single-layer vector retrieval in long-horizon agent tasks. Read the paper →
The Four Layers
Each layer captures a different dimension of knowledge
ENTITY CAUSAL TEMPORAL SEMANTIC before after caused sarah proj-x
Layer 01
Semantic
The foundation — similarity in high-dimensional space
Standard vector embeddings. Measures relatedness between memories. This is the baseline that every vector database provides. In VEKTOR, it's the starting point — not the ceiling. Every node exists in semantic space, but semantic similarity alone can't answer "why" or "when."
Layer 02
Temporal
The chronological spine — before and after
Tracks the sequence of events. Edges in the temporal layer encode "before" and "after" relationships, allowing your agent to reason about the order of a 3-month project without confusing last week's decision with last quarter's. Critical for agents that need to understand how state evolved over time.
Layer 03
Causal
The "why" engine — cause and effect
Maps directed edges between actions and their outcomes. If "Command A" led to "System Crash B", VEKTOR draws a causal edge so the agent learns from that failure and never repeats it. This layer is what separates an agent that knows facts from an agent that understands consequences.
Layer 04
Entity
The permanent index — actors and assets
A persistent registry of the named entities in your agent's world: users, projects, servers, constraints, external services. Entity nodes are high-importance by default and form the anchors through which all other layers are navigated. Think of it as the agent's address book — always current, never forgotten.
Associative Pathfinding
How multi-layer traversal solves the multi-hop problem

Standard RAG fails at multi-hop questions. "What language does the developer who likes dark mode use?" returns snippets about "Sarah likes dark mode" and "Project X uses Rust" — but unless they appear in the same paragraph, RAG can't connect them. The answer requires three hops: Sarah → dark mode preference → Project X → Rust.

VEKTOR's graph traversal solves this. The entity layer has a node for "Sarah." From Sarah, semantic edges connect to her preferences. From Sarah, causal edges connect to her project contributions. From the project node, temporal edges lead to the current tech stack. The answer assembles itself through pathfinding — not keyword proximity.

// Multi-hop retrieval using cross-layer pathfinding
const result = await memory.recall(
  "What language does the dark mode developer use?",
  {
    layers: ["semantic", "entity", "causal"],
    hops: 3,
    topK: 5
  }
);
// Traversal: dark mode → Sarah (entity) → Project X (causal) → Rust (semantic)
// Returns: ["Sarah uses Rust", "Sarah prefers dark mode", "Project X stack: Rust"]
MAGMA in One Sentence

Stop giving your agents a pile of paper. Give them a map of their own history.

  • Semantic: what things are related
  • Temporal: what happened before and after
  • Causal: what caused what
  • Entity: who and what exists in the world
  • Together: a traversable map — not a searchable pile