---
title: "Unified Agent Memory Plane & Jev Knowledge Graph: Ending Siloed Agent Amnesia"
description: "How we used CUJ-Driven Development (CDD) to eliminate cross-agent amnesia across Grok Bot, Instinct (OpenClaw), Muse, Claude Code, and Antigravity—combining a local SQLite WAL + Markdown memory plane, offline store-and-forward queuing, and a System-One decision model (Jev) Knowledge Graph."
url: "https://herrington.ai/cujs/unified-agent-memory-plane/"
markdown_url: "https://herrington.ai/cujs/unified-agent-memory-plane/index.md"
author: "Daniel Herrington"
date: "2026-10-20"
updated: "2026-10-31"
markdown_tokens: 3417
content_signal: "ai-train=yes, search=yes, ai-input=yes"
mcp_endpoint: "https://herrington.ai/mcp"
---
# Unified Agent Memory Plane & Jev Knowledge Graph: Ending Siloed Agent Amnesia

*When you run more than one personal AI agent, you quickly hit a new kind of bottleneck: you become the manual copy-paste router for your own AI fleet.*

---

## Part I: Why CUJ-Driven Development (CDD) Exists

Writing code—especially in an era of autonomous coding agents—is no longer the scarce resource. **Building the right thing, with zero wasted motion, is the hard part.**

Most engineering projects start technology-first (*"Let's spin up a vector database and an MCP server"*). That mindset almost always produces over-engineered plumbing that misses the actual day-to-day human annoyance.

**[Critical User Journey (CUJ)-Driven Development](/cujs/cuj-engineering-framework/)** flips that order. Before writing a single line of code, every feature or system must pass a strict product-engineering filter expressed as a structured Mad Lib:

> **"I want to [do X] while avoiding [Y] so that I can [do Z]."**

* **`[Do X]` (The Goal)**: The concrete action or capability you want to achieve.
* **`[Avoiding Y]` (The Core Friction)**: The manual effort, cognitive load, latency, or failure mode that currently stands in the way.
* **`[Do Z]` (The Outcome)**: The high-leverage real-world benefit once the friction is gone.

### Why the Magic Is in `"While Avoiding [Y]"`
Focusing on `[Do X]` tells you *what* to build; focusing on **`while avoiding [Y]`** dictates *how the architecture must behave*:
1. **Surgical Architecture**: Every database table, sync loop, and lifecycle hook exists solely to eliminate a named friction point in `[Y]`.
2. **Unambiguous Definition of Done**: A project isn't finished when unit tests pass—it's finished when the human no longer experiences `[Y]`.
3. **Autonomous Engineering Pipeline**: Raw friction statements captured from real usage (`/cuj` widgets or GitHub Issues) are triaged, audited against security threat vectors (`Turbo`, `Machine Review`, or `Manual Review` modes), synthesized into formal Case Studies like this one, and compiled directly into production software.

---

## Part II: The Problem Space — Siloed Agent Amnesia

### Context
My daily workflow runs across a fleet of specialized personal agents hosted on and around an always-on Mac mini:
* **Muse** (`Muse.app` & custom BlueBubbles study engine): Studies my iMessage history to extract relationship context, introductions, and open commitments.
* **Instinct (OpenClaw)**: My always-on gateway agent handling daily sports recaps (F1, NASCAR, Yankees, 49ers), Chevy Camaro maintenance tracking, media management (Sonarr/Radarr), and WhatsApp/Telegram alerts.
* **Grok Bot**: My interactive desktop partner for deep research, investment analysis, and technical strategy.
* **Claude Code & Claude Desktop**: My CLI/desktop reasoning and engineering agents wired via global MCP (`~/.claude.json`), `CLAUDE.md`, and turn-by-turn `Stop` hooks.
* **Antigravity**: My agentic pair programmer building and deploying full-stack applications across local workspaces.

### The Core Friction
Each agent was effective in isolation, but suffered from **siloed amnesia**:
1. **Incompatible Memory Paradigms**: Instinct reads workspace Markdown files (`MEMORY.md`), Grok Bot speaks Model Context Protocol (`stdio` MCP), Antigravity logs to its own SQLite conversation database (`conversation_summaries.db`), and Muse outputs contact dossiers.
2. **The Human Router Tax**: When **Muse** spotted an iMessage intro (`Daniel <> Rob` regarding controllable AI models on FPGA hardware), **Grok Bot** had no idea that intro existed when I asked it to evaluate FPGA startups, and **Antigravity** didn't tell the other agents what it was actively shipping on `herrington.ai`.
3. **Offline Fragility**: If an agent on a laptop or container tried to write to a shared server while the Mac mini hub was restarting or unreachable, a naive network call would error out and drop the thought.
4. **Graph Maintenance Latency**: Building a Knowledge Graph across agents traditionally requires calling a heavy "System Two" generative LLM on every single write to resolve entities and classify edges—adding seconds of latency and constant token burn.

---

## 🚦 Critical User Journeys (CUJs)

### CUJ 1: Zero-Copy-Paste Cross-Agent Consciousness
> **"I want all of my personal agents (Grok Bot, Instinct, Muse, and Antigravity) to automatically see what the others are thinking, deciding, and building while avoiding manually copy-pasting context between chat windows or dumping noisy raw transcripts into every prompt so that I can interact with a cohesive team of agents that share a single live working memory."**

* **User Scenario**: I finish a coding sprint in Antigravity on `herrington.ai` and receive an iMessage intro spotted by Muse. When I open Grok Bot or message Instinct on WhatsApp five minutes later, both already know what Antigravity just shipped and what Muse flagged—without me explaining a thing.

### CUJ 2: Offline Store-and-Forward Durability
> **"I want any agent to log thoughts, commitments, and durable facts at any moment while avoiding failed tool calls or lost context if my Mac mini hub is down or unreachable so that I can trust that every agent thought is queued locally and replayed in exact chronological order when the hub recovers."**

* **User Scenario**: My Mac mini reboots for an OS update or I'm running an agent from a laptop off-network. The agent logs two new decisions and a fact; nothing errors out, the agent still sees its own writes immediately from its local replica, and 30 seconds after the Mac mini comes back online, the outbox flushes cleanly with zero duplicates.

### CUJ 3: Millisecond Knowledge Graph via a System-One Decision Model (Jev)
> **"I want every thought and fact across my agents to automatically link into a typed Knowledge Graph of people, projects, and commitments while avoiding the multi-second latency and token cost of invoking a heavy System-Two generative LLM on every write so that I can traverse cross-agent relationships and score agent attention in milliseconds using a System-One decision model (`Jev`)."**

* **User Scenario**: Muse logs an iMessage commitment mentioning `"Rob"`, `"FPGA"`, and `"The Zebra"`. Instead of waiting 4 seconds for an autoregressive LLM to generate JSON tokens, a non-autoregressive System-One pass evaluates structured `choice`, `noul` (boolean probability), and `score` inquiries in parallel—resolving canonical nodes, assigning `INTRODUCED_TO` ($P=0.94$) and `DEPENDS_ON` ($P=0.86$) edges, and scoring high attention for Grok Bot ($0.92$) in milliseconds.

---

## 🗺️ The Ideal Flows

### Flow 1: Automatic Cross-Agent Broadcast & Recall
1. **Trigger**: You complete a turn in **Antigravity**, **Muse** extracts a new iMessage commitment, or **Grok Bot** reaches a decision.
2. **Action**: Zero manual action required from the human. Antigravity's `Stop` lifecycle hook (`~/.gemini/config/hooks.json`) and MCP tools automatically invoke the Memory Plane.
3. **Automated Response**: The engine writes the thought to `~/.memory-plane/memory.db` (SQLite WAL + FTS5), updates the Jev Knowledge Graph (`graph_nodes` and `graph_edges`), and regenerates `PULSE.md` and `SHARED_MEMORY.md` (which are symlinked directly into Instinct's workspace).
4. **Resolution**: Every sibling agent immediately sees the updated focus table, open commitments, thought stream, and graph connections on its very next turn.

### Flow 2: Store-and-Forward Recovery When the Mac Mini Is Down
1. **Trigger**: An agent calls `memory_post_thought` or `memory_upsert_fact` while the central hub or database is unreachable.
2. **Action**: `ResilientMemoryClient` catches the connection error transparently.
3. **Automated Response**: The client stamps the payload with a deterministic UUID (`id`) and original `created_at` timestamp, appends it to `~/.memory-plane/outbox.jsonl`, and merges it into `~/.memory-plane/local-cache.json` so offline reads (`memory_get_pulse`) still include the new thought.
4. **Resolution**: On the next tool call or 30-second heartbeat once the Mac mini is reachable, `flushOutbox()` batch-posts the queue to `/api/sync` (`INSERT OR IGNORE` by UUID), indexes the items in FTS5 and the Jev Graph, and clears `outbox.jsonl`.

---

## 🛠️ The Solution Architecture

```mermaid
flowchart TD
    subgraph Agents["Personal Agent Fleet"]
        GB["Grok Bot (MCP stdio + Custom Instructions)"]
        IN["Instinct / OpenClaw (Symlinked PULSE.md + MCP)"]
        MU["Muse / Study Engine (iMessage Dossier Sync + REST)"]
        AG["Antigravity (Global MCP + GEMINI.md + Stop Hook)"]
    end

    subgraph ClientLayer["Resilient Store-and-Forward Layer (resilient-client.js)"]
        RC["ResilientMemoryClient"]
        OB[("outbox.jsonl (Offline Write Queue)")]
        LC[("local-cache.json (Offline Read Replica)")]
    end

    subgraph CorePlane["Canonical Memory Plane (~/.memory-plane/)"]
        JEV["Jev System-One Graph Controller (choice / noul / score)"]
        DB[("memory.db (SQLite WAL + FTS5 + Graph Tables)")]
        PMD["PULSE.md (Live Cross-Agent Consciousness)"]
        SMD["SHARED_MEMORY.md (Canonical Knowledge Base)"]
        HUB["Always-On Hub & Web UI (http://127.0.0.1:8788)"]
    end

    GB --> RC
    IN --> RC
    MU --> RC
    AG --> RC

    RC -- "Online" --> JEV
    RC -- "Mac Mini Offline" --> OB
    OB -. "Auto-Flush (/api/sync)" .-> JEV
    RC -. "Offline Reads" .-> LC

    JEV --> DB
    DB --> PMD
    DB --> SMD
    DB --> LC
    DB --> HUB
```

---

## 💻 Under the Hood (Technical Pillars)

### 1. Hybrid SQLite WAL + FTS5 + Auto-Rendered Markdown Views (`src/store.js`)
Rather than forcing file-based agents and tool-based agents into a single paradigm, every write updates a single SQLite WAL database (`memory.db`) and immediately renders clean Markdown views (`PULSE.md` and `SHARED_MEMORY.md`) alongside a JSON replica:
* **`thoughts` & `agent_heartbeats` tables**: Track every agent's active focus, open questions/commitments/handoffs, and chronological reasoning stream.
* **`facts` table**: Stores canonical, deduplicated truths (`UNIQUE(subject, fact_key)`) with confidence scores and source attribution.
* **`memory_fts` (SQLite FTS5)**: Indexes both thoughts and facts with BM25 ranking for sub-millisecond historical recall across all agents.
* **Hex-Encoded SQL Safety**: All string parameters are serialized as `CAST(X'...' AS TEXT)`, providing zero-dependency immunity against quotes, newlines, or emojis.

### 2. Offline Store-and-Forward Outbox Queue (`src/resilient-client.js`)
Wraps every read and write in an offline-first state machine:
* When `MEMORY_HUB_URL` or the local SQLite database is unreachable, `postThought()` and `upsertFact()` never fail—they append a timestamped, UUID-keyed record to `~/.memory-plane/outbox.jsonl` and update `~/.memory-plane/local-cache.json`.
* A 30-second background timer (and pre-call hook) invokes `flushOutbox()`, replaying queued operations via `POST /api/sync` where `INSERT OR IGNORE INTO thoughts (id, ...)` guarantees idempotent, chronological convergence.

### 3. System-One Graph Controller (`src/jev-graph.js`)
Traditional GraphRAG pipelines bog down because invoking an autoregressive LLM on every memory write takes seconds. By modeling graph maintenance as a **System-One decision problem** (using TypeSafe AI's non-autoregressive **Jev** model via `/v1/system-one` when `TYPESAFE_API_KEY` is present, with a 0ms deterministic local System-One fallback when offline):
* **Entity Resolution (`noul`)**: Canonicalizes mentions across agents (e.g., linking Muse's `"Rob"` and Grok Bot's `"Rob"` to `node:person:rob`).
* **Edge Classification (`choice`)**: Assigns probability-scored relational edges (`WORKING_ON`, `COMMITTED_TO`, `INTRODUCED_TO`, `BLOCKED_BY`, `DEPENDS_ON`, `MANAGES`, `BUILT_IN`).
* **Cross-Agent Attention Routing (`score`)**: Scores relevance across `grokbot`, `instinct`, `muse`, and `antigravity` so each agent can filter for high-signal graph neighbors.

### 4. Zero-Effort Antigravity Telemetry (`src/adapters/antigravity-sync.js`)
To ensure **Antigravity** always tells the other agents what it is building—even if no explicit MCP tool is called during a coding session—we wired three layers:
* **Global MCP Server (`~/.gemini/config/mcp_config.json`)**: Exposes `memory_get_pulse`, `memory_post_thought`, `memory_upsert_fact`, `memory_recall`, `memory_resolve_item`, `memory_get_graph`, and `memory_sync_status`.
* **Always-On Rule (`~/.gemini/GEMINI.md`)**: Instructs Antigravity to check `PULSE.md` and broadcast milestones.
* **Lifecycle `Stop` Hook (`~/.gemini/config/hooks.json`) + 30s Hub Poller**: Automatically queries Antigravity's internal `conversation_summaries.db` after every turn, extracting the active workspace, task title, and latest prompt context into the shared Memory Plane and Jev Knowledge Graph.
