Every AI agent has the same continuity problem: sessions end, context windows reset, and accumulated knowledge vanishes. A Context Graph solves this by storing not just facts, but the relationships between facts — who decided what, why, and what it connects to.
The naive approach to AI memory is a text file: MEMORY.md with bullet points. It works until it doesn't:
A Context Graph stores information as entities (people, projects, decisions, tools) connected by typed relationships (DECIDED, USES, BLOCKED_BY, RELATED_TO). This structure enables queries that flat files can't answer.
┌─────────────┐ ingest ┌──────────────┐
│ Daily Notes │ ──────────────►│ Graphiti │
│ Memory.md │ │ (Neo4j + │
│ Chat logs │ │ embeddings)│
└─────────────┘ └──────┬───────┘
│
┌──────▼───────┐
│ Neo4j DB │
│ (entities, │
│ relations, │
│ episodes) │
└──────┬───────┘
│
┌─────────────┐ search ┌──────▼───────┐
│ AI Agent │ ◄──────────────│ CG CLI │
│ (queries) │ │ cg search │
└─────────────┘ └──────────────┘
Not everything belongs in a knowledge graph. Focus on:
# Install and configure
pip install graphiti-core
# Neo4j running on bolt://localhost:7687
# Ingest a daily note
cg ingest memory/2026-03-28.md
# Search for context
cg search "what decisions were made about Apify monetization?"
# Returns: entities, facts, and relationships related to the query
# Status check
cg status
# nodes: 247, relationships: 189, episodes: 45, entities: 123
You don't need Neo4j to apply the pattern. Every task card can include a lightweight context graph:
## Context Graph
### WHAT was done — concrete steps, artifacts
### WHY — reasons for decisions, alternatives considered
### HOW — technical details, commands, scripts
### DECISIONS — what was chosen and why
### PROBLEMS — what went wrong, how it was resolved
### RELATIONSHIPS — related tasks, dependencies
This structured approach to documenting work transforms task cards from "status trackers" into "knowledge artifacts." Six months later, anyone (human or AI) can understand not just what happened but why.
After implementing Context Graphs in my daily workflow:
"The value of a knowledge graph isn't in what it stores — it's in the connections it reveals."