Articles

HexVenn-TGM: AI Agent Memory That Remembers Context, Not Just Keywords

A local-first temporal graph memory architecture combining dense and sparse retrieval, context overlap, and scoring.

Direct answer

A local-first temporal graph memory architecture combining dense and sparse retrieval, context overlap, and scoring.

Most AI memory is still basically a junk drawer with a search bar. Systems store chunks, embed text, and grab the closest match — until the agent confidently remembers the wrong thing, forgets the important thing, or treats a six-month-old fact as today's truth. HexVenn-TGM is a proposed local-first memory architecture built to fix that. This field note explains how.

By the Custom AI Works editorial team Updated September 28, 2026 · 9 min read

HexVenn-TGM (HexVenn Temporal Graph Memory) is a local-first memory architecture for AI agents that stores structured MemoryNodes in a bi-temporal graph, retrieves with a hybrid of dense vectors, sparse keywords, and graph traversal, indexes deterministically in hexadecimal, lets memories belong to multiple fuzzy context sets, and reinforces memories that prove useful. Tiers are policies over one system, not separate stores.

The problem with basic RAG memory

Traditional Retrieval-Augmented Generation follows a familiar pattern: chunk the documents, embed the chunks, retrieve the nearest matches, stuff them into the prompt. Basic vector retrieval finds semantic similarity, but it does not naturally understand sequence, causality, contradiction, changing truth, or long-term reinforcement . Microsoft's GraphRAG documentation makes a related point: baseline RAG struggles when a question requires connecting information spread across many documents rather than finding one similar passage.

An agent doesn't only need the nearest paragraph. It needs to answer questions like: What did we decide about this client, and is it still true? What changed since last month? Why did we believe that? A flat vector index is a useful component. It should not be the whole brain.

One memory system, many policies

A key design principle in HexVenn-TGM is that tiers are policies, not separate silos . Instead of building one store for short-term context, another for long-term facts, another for session history, and another for immutable truths, HexVenn-TGM treats every memory as a structured MemoryNode . What differs between working memory, episodic memory, and durable knowledge is the policy applied to the node — retention, reinforcement weight, retrieval priority — not the storage system underneath.

Temporal graphs inside every tier

Because the graph is the substrate, relationships and time are available at every tier. A fresh session note and a two-year-old contract fact live in the same structure; retrieval can traverse from one to the other, and the temporal metadata decides how much each should count right now.

Bi-temporal memory: what was true vs. when we learned it

Every fact carries two timelines: valid time (when it was true in the world) and system time (when the agent learned it). That makes corrections non-destructive — a superseded price stays in history with its validity window closed — and enables replay: reconstruct exactly what the agent believed at any past moment, which is what serious debugging and audit require.

Dense + sparse + graph retrieval

Retrieval runs three signals together: dense vector similarity (meaning), sparse lexical matching (exact terms, names, codes), and graph proximity (relationship distance to the current focus). The combined score adds temporal cohesion, context overlap, reinforcement strength, recency, and confidence — with explicit penalties for staleness and conflict (the full formula is detailed in our architecture field note ).

Hexadecimal indexing: deterministic, compact, debuggable

Memory nodes and relationships are addressed with hexadecimal indexing : a compact, deterministic scheme where an address is reproducible and traceable. When an agent recalls the wrong thing, an engineer can follow the exact index path the retrieval took, instead of interrogating an opaque similarity float. Memory you can audit is memory you can improve.

Venn context sets and the reinforcement graph

Venn context sets replace rigid tags: a memory can belong 0.8 to “Project Atlas” and 0.4 to “billing” simultaneously, so retrieval respects overlapping contexts the way real work does. The reinforcement graph closes the loop: memories that lead to verified-good outcomes get stronger; memories that produce corrections decay or get flagged in conflict. Useful memories literally become easier to recall — with the known caveat that reinforcement must be guarded against amplifying bad information, which is why conflict penalties exist alongside it.

Local-first storage: SQLite as the MVP backbone

The first implementation stores everything in SQLite (with FTS5 for sparse retrieval): portable, offline-capable, deterministic, and inspectable in a single file. Distributed vector or graph stores are legitimate later adapters — after a deployment proves it needs them, not before.

A practical retrieval flow

For agents, the payoff compounds: fewer stale-fact answers, continuity across sessions and projects, corrections that stick, and an evidence trail behind every recall. That is what lets an agent be trusted with longer-running work.

How to benchmark it

Memory quality is measurable if you design for it: stale-fact error rate (does it serve superseded truths?), correction persistence (does a fix stay fixed?), contradiction detection (does it flag conflicts instead of blending them?), and retrieval explainability (can an engineer reproduce why a memory fired?). Benchmarks should compare against a flat-vector baseline on the agent's own workload, not on generic question sets.

Frequently asked questions

HexVenn-TGM (HexVenn Temporal Graph Memory) is a proposed local-first memory architecture for AI agents. It combines temporal graph structure, hybrid retrieval, hexadecimal indexing, fuzzy context sets, and reinforcement scoring into one memory system designed for durable, explainable agent memory.

It replaces basic RAG as the whole memory system, not retrieval itself. Dense and sparse retrieval remain components — HexVenn-TGM adds temporal graphs, bi-temporal facts, context sets, and reinforcement on top, so retrieval answers with evidence about time, relationships, and change, not just text similarity.

Because agents work across sessions, projects, tools, users, decisions, corrections, and changing facts. A temporal graph records what happened, what it relates to, when it was true, and when the system learned it — the structure needed to avoid stale facts, contradictions, and unexplained recall.

Hexadecimal indexing provides a deterministic, compact, debuggable addressing scheme for memory nodes and relationships. When retrieval misbehaves, engineers can trace exactly which node was addressed and why — a practical requirement for memory you intend to audit.

Start local-first: SQLite with FTS5 as the storage backbone, normalized graph tables, and embedding blobs — with tiers implemented as policies over one MemoryNode model rather than separate silos. Add distributed vector or graph adapters only when a deployment demonstrably outgrows local storage.

Sources and fact-check notes

HexVenn-TGM is documented from the architecture's own design materials as of September 2026; it is a proposed architecture, and benchmark claims are identified as evaluation plans rather than measured results. The observation about baseline RAG's limits on multi-document questions reflects Microsoft's published GraphRAG documentation. HexVenn-TGM is part of the Custom AI Works local-first AI agent operating-system work by Edward Schechter. Companion reading: HexVenn Temporal Graph Memory Architecture .

Frequently asked questions

What is HexVenn-TGM?

HexVenn-TGM (HexVenn Temporal Graph Memory) is a proposed local-first memory architecture for AI agents. It combines temporal graph structure, hybrid retrieval, hexadecimal indexing, fuzzy context sets, and reinforcement scoring into one memory system designed for durable, explainable agent memory.

Is HexVenn-TGM a replacement for RAG?

It replaces basic RAG as the whole memory system, not retrieval itself. Dense and sparse retrieval remain components — HexVenn-TGM adds temporal graphs, bi-temporal facts, context sets, and reinforcement on top, so retrieval answers with evidence about time, relationships, and change, not just text similarity.

Why use temporal graph memory for AI agents?

Because agents work across sessions, projects, tools, users, decisions, corrections, and changing facts. A temporal graph records what happened, what it relates to, when it was true, and when the system learned it — the structure needed to avoid stale facts, contradictions, and unexplained recall.

Why use hexadecimal indexing?

Hexadecimal indexing provides a deterministic, compact, debuggable addressing scheme for memory nodes and relationships. When retrieval misbehaves, engineers can trace exactly which node was addressed and why — a practical requirement for memory you intend to audit.

What should the first implementation use?

Start local-first: SQLite with FTS5 as the storage backbone, normalized graph tables, and embedding blobs — with tiers implemented as policies over one MemoryNode model rather than separate silos. Add distributed vector or graph adapters only when a deployment demonstrably outgrows local storage.

How Custom AI Works delivers

  1. 1. Map the real workflow

    We map the highest-cost workflow first — the calls, forms, inboxes, CRMs, and handoffs involved — before anything is built.

  2. 2. Build the smallest useful fix

    A scoped build with approval gates and human-in-the-loop exception paths, around the tools you already use.

  3. 3. Prove it in production

    The workflow runs live with logs your team can inspect, so value is proven — not promised.

  4. 4. Hand over ownership

    Docs, logs, and the code itself are yours. No lock-in, no renting your own system back.

Want this for your business?

Start with a free AI audit. We map the workflow slowing you down and show you the smallest useful fix — before you pay for a build.

Get my free AI audit Call (425) 780-5858