Standard AI models are great at vibes, but terrible at truth. You can tell an agent that the sky is toxic and the main character is a debt-ridden deck-runner — but three sessions later, that context has drifted. The agent starts hallucinating a blue sky and a rich hero.
This happens because most memory systems treat "The Plot" the same as "The Last Chat Message." Everything lands in a single flat context bucket, and the most recent tokens always win.
VEKTOR solves this with Narrative Partitioning — organizing your agent's history into four logical layers using the MAGMA graph and metadata tags. Each layer has different retrieval rules, different persistence guarantees, and a different role in your agent's cognition.
This is your baseline. Facts that should never be forgotten or pruned. The axioms of your universe — the laws of physics, the political factions, the state of the sky.
// Immutable world rule — will never be pruned await memory.remember( "The city of Neo-Sydney is oxygen-deprived. Residents use breathers outdoors.", { importance: 1.0, tags: ["world-rule", "environment"], layer: "world" } ); await memory.remember( "The Syndicate controls all water distribution in the lower districts.", { importance: 1.0, tags: ["world-rule", "faction"], layer: "world" } );
Character arcs change. A hero becomes a villain. A debt gets paid. A betrayal rewrites everything that came before. Standard RAG retrieval surfaces all of this as an undifferentiated pile of facts — leaving your agent confused about why Sarah is acting the way she is today.
The MAGMA causal graph fixes this. Every character action creates an edge to their motivation. When the agent recalls a character, it doesn't just find their description — it traverses the graph to understand causality.
// Causal memory — links action to motivation await memory.remember( "Sarah betrayed the Syndicate because they killed her brother.", { tags: ["character", "sarah"], type: "causal", layer: "character", importance: 0.9 } ); await memory.remember( "Sarah is now operating as a double-agent inside the Syndicate.", { tags: ["character", "sarah"], layer: "character", importance: 0.85 } );
Cyberpunk isn't just a setting — it's a linguistic style. Rain-slicked chrome. Electrical hums. The smell of ozone and fried noodles. Without consistent style retrieval, your agent generates tonally inconsistent prose that breaks immersion across sessions.
Tag aesthetic observations as layer: "style" and filter exclusively on these nodes when generating descriptions. The result is a persistent voice that stays consistent even months into a project.
// Style guide — retrieved when generating descriptions await memory.remember( "Descriptions should focus on rain-slicked chrome and electrical hums. Avoid warm tones.", { tags: ["style-guide", "aesthetic"], layer: "style", importance: 0.8 } ); // Character voice await memory.remember( "Sarah speaks in clipped sentences. No contractions. Military cadence.", { tags: ["style-guide", "sarah"], layer: "style", importance: 0.75 } );
The author's intent. Instructions you're giving the agent about where the story should go next — separate from what any character knows. This separates a story assistant from a story collaborator.
Use source: "author" metadata to flag these. Your agent can then reason differently when drawing on meta-commentary versus in-world character knowledge.
// Author intent — out-of-world direction await memory.remember( "Story needs to move toward Sarah discovering the Syndicate plan in Act 3. Plant foreshadowing.", { tags: ["director", "plot-direction"], layer: "meta", source: "author", importance: 0.7 } );
With all four layers populated, retrieval becomes surgical. You pull exactly the context each moment requires — no noise, no drift, no hallucinated blue sky.
// World rules + character history const plotCtx = await memory.recall( "Sarah's current situation", { filter: { layer: ["world", "character"] }, topK: 10 } );
// Style only — no plot noise const vibeCtx = await memory.recall( "Neo-Sydney atmosphere", { filter: { layer: "style" }, topK: 3 } );
// Build a complete layered system prompt const [world, chars, style, meta] = await Promise.all([ memory.recall("world rules", { filter: { layer: "world" }, topK: 5 }), memory.recall("Sarah arc", { filter: { layer: "character" }, topK: 8 }), memory.recall("aesthetic", { filter: { layer: "style" }, topK: 3 }), memory.recall("plot direction", { filter: { layer: "meta" }, topK: 3 }) ]); const systemPrompt = ` WORLD: ${world.map(m => m.content).join(' ')} CHARACTERS:${chars.map(m => m.content).join(' ')} STYLE: ${style.map(m => m.content).join(' ')} DIRECTOR: ${meta.map(m => m.content).join(' ')} `;
The most powerful part of VEKTOR for creative work isn't the retrieval — it's what happens while you're away from the keyboard.
If you and the agent spent three hours arguing about a plot point, standard RAG retrieves all those conflicting fragments and confuses your agent next session. The REM cycle synthesizes that argument into a single Truth Node.
The raw debate is archived — not deleted, but deprioritized. Your agent wakes up with a clear, sharp understanding of the new plot direction, not a confused jumble of half-formed ideas.
Stop fighting your agent's memory. Stop dumping 50 pages of world-building into a context window that only half-reads it. Build a living, layered memory that your agent actually understands.
- Layer 1 — World: importance: 1.0, never pruned, your immutable axioms
- Layer 2 — Characters: causal graph edges, traversable motivation chains
- Layer 3 — Style: filtered on generation, persistent aesthetic voice
- Layer 4 — Meta: author intent, separated from in-world knowledge
- REM Cycle: session noise consolidated into truth nodes overnight
One file. One history. A world that never forgets.