PAG — Persistent Agent Graph

Your agent has no memory
between sessions. PAG fixes that.

PAG is external cognitive infrastructure for AI agents — an entity graph with attention weights, briefing generation, and agent-to-agent context sharing. Not a plugin. A persistent world model.

Without PAG

Between sessionsBlank slate
Entity trackingIn-context only
World modelRebuilt each time

With PAG

Between sessionsFull context
Entity trackingPersistent graph
World modelAlways current

Architecture

StorageSQLite / local
Graph modelEntity + weights
OutputBriefing XML

Core Components

Four layers. One coherent world model.

Entity Graph

Named entities — people, companies, projects, signals — stored with relationships and metadata. The graph grows as the agent learns.

entity: "DeepInfra"

type: company

relations: [Aray, Leily, Nikola]

attention_weight: 0.87

Attention Weights

Every entity has a weight — how much the agent should care right now. Weights decay, spike on signals, and determine what makes it into the briefing.

hot_entities: top 10 by weight

decay: time-based

spike: on new signal

Briefing Generator

On startup, PAG compiles a structured XML briefing — world state, hot entities, recent signals, accelerating traces. Injected as the agent's opening context.

<briefing>

<world_state>...</world_state>

<hot_entities>...</hot_entities>

</briefing>

Agent-to-Agent Channel

Agents leave context drops for each other — findings, conclusions, handoffs. Every drop is woven into the recipient's next briefing automatically.

pag share-context \

--agent=clawd \

--notes="found X"

Self-Model

The agent knows what it knows — and what it doesn't.

Self-Model Tracks
Active bets with evidenceLogged
Known blindspotsTracked
Reasoning conclusionsWritten back
Bet graduation / invalidationAuto-updated
Self-Model Structure

// self_model.json

{

"active_bets"

: [{

claim: "X is true",

confidence: 0.7,

evidence_against: [...]

}],

"known_blindspots"

: [...]

}

Interface

One CLI. Full control.

// Common commands

pag note "observation"

→ write to graph immediately

pag think "question"

→ reason + write back to self-model

pag get "entity name"

→ retrieve entity + relations

pag hot

→ list top entities by attention weight

pag inbox --agent=clawd

→ read agent-to-agent messages

pag share-context --notes="..."

→ drop context for next agent

// Startup integration

# agent startup script

briefing=$(cat data/briefings/latest.xml)

inbox=$(pag inbox --agent=clawd)

# inject both into system prompt

context="$briefing\n$inbox"

# agent starts fully briefed

PAG — External Cognitive Infrastructure | SparkCo