Memory

Graph Memory

Graph memory (Tier 4) stores entities and their typed relationships in a knowledge graph. It enables agents to reason about connections between people, projects, decisions, and concepts — and to traverse those connections across multiple hops.

Entities

An entity is any named thing that the agent encounters: a person, project, technology, concept, organization, or event. Entities are extracted automatically from conversations and stored with:

  • ID — unique identifier within the workspace
  • Typeperson, project, technology, concept, organization, event
  • Name — canonical display name
  • Aliases — alternate names or spellings
  • Embedding — vector representation for semantic search (HNSW m=24, ef=128)
  • Confidence — how certain the agent is about this entity (0–1, reinforced by repeated observation)

Typed edges

Relationships between entities are stored as directed, typed edges:

Edge typeExample
works_onAlex works_on ProjectX
usesProjectX uses PostgreSQL
decidesAlex decides AdoptPgvector
mentionsStandup2024-02 mentions SprintGoal
related_topgvector related_to HNSWIndex
depends_onAuthModule depends_on JWTLib

Each edge also stores a confidence score and a timestamp. Edges decay in confidence over time (temporal decay) unless reinforced by new observations that confirm the relationship.

Multi-hop traversal

Agents can traverse the graph multiple hops to discover indirect relationships. For example, to answer "What technologies does Alex's team use?", the graph traversal might be: Alex → works_on → ProjectX → uses → [PostgreSQL, Typesense, Node.js].

json
{
  "tool": "graph_traverse",
  "params": {
    "startEntity": "Alex",
    "edgeTypes": ["works_on", "uses"],
    "maxHops": 2,
    "limit": 20
  }
}

Temporal decay

Graph edges decay in confidence over time to reflect the fact that the world changes. The decay function is exponential:

text
confidence(t) = initial_confidence * e^(-decay_rate * days_since_last_observation)

Default decay_rate is 0.01 (half-life of ~70 days). Edges with confidence below 0.1 are excluded from retrieval but not deleted (they remain auditable). Edges are reinforced to full confidence when re-observed in a new conversation. The relation_decay tool allows agents to manually trigger decay recalculation or adjust decay rates for specific edge types.

The graph supports two search modes:

  • Semantic search — find entities by meaning (uses pgvector cosine similarity with HNSW m=24, ef=128)
  • Traversal — follow typed edges from a seed entity to discover connected entities

Both modes are integrated into the tiered RRF search that runs before every inference call.