Skip to content
graphiti logo

graphiti

Temporal knowledge graph memory system. Use PROACTIVELY at session start to load context, when solving non-trivial problems to check for known solutions, and at session end to persist learnings. Auto-store failure→success learnings when debugging takes 3+ attempts. Auto-store infrastructure conte...

SKILL.md

Full skill instructions

Graphiti — Temporal Knowledge Graph Memory

Graphiti provides persistent AI memory through a temporal knowledge graph backed by Neo4j. Store and retrieve project context, solutions, user preferences, and architectural decisions across sessions.

Decision Tree

Starting work?          → search_nodes for project context
Looking for patterns?   → search_memory_facts for relations
Solved hard problem?    → add_memory with the solution
Need recent context?    → get_episodes for session history
Session ending?         → add_memory with key learnings
User shares preference? → add_memory to remember it

MCP Tools

ToolPurposeWhen to use
add_memoryStore episodes/​insightsCapturing solutions, decisions, preferences
search_nodesSearch entity summariesFinding project context, exploring knowledge
search_memory_factsFind relationships between entitiesDiscovering patterns, connections
get_episodesRetrieve recent episodesGetting conversation/​session history
delete_episodeRemove episode and related dataCleanup incorrect entries
delete_entity_edgeRemove a relationshipCorrect wrong connections
get_entity_edgeGet specific relationshipInspect a known edge
get_statusCheck server healthDebugging connectivity
clear_graphDelete all data for groupReset memory (dangerous!)

Core Workflows

Session Start (ALWAYS)

search_nodes({ query: "[project-name] context" })
search_memory_facts({ query: "[project-name] patterns decisions" })
get_episodes({ max_episodes: 5 })

Problem Solving

1. search_memory_facts({ query: "[error message or problem]" })
2. If found → Apply known solution
3. If not → Debug normally
4. If solved after >15 min effort → add_memory with solution (see references/​store-patterns.md)

Storing Memories

For the four detailed templates (Failure→Success, Infrastructure Context, Tool Config, Cross-Session Context) including the session-summary template, see references/​store-patterns.md.

Minimal pattern:

add_memory({
  name: "Solution: [brief title]",
  episode_body: "Problem: ... Context: ... Solution: ... Why: ...",
  source: "text",
  source_description: "debugging session",
  group_id: "[project-name]"
})

Auto-Store Triggers

Store automatically (without being asked) when ANY of these occur:

TriggerPattern (in store-patterns.md)Example
Solved after 3+ attemptsFailure→SuccessDebugging a build error
Discovered wrong config keysFailure→SuccessYAML had keys for wrong service
User says "remember this"Cross-Session ContextAny explicit request
New service/​cluster discoveredInfrastructure Contextkubectl reveals new topology
Tool required non-obvious setupTool ConfigurationPackage needed extra runtime deps
Approach pivot (plan A → plan B)Failure→Successnode2nix → npm activation script
User shares team/​project contextCross-Session Context"We deploy on Tuesdays"
Found undocumented behaviorFailure→SuccessAPI behaves differently than docs

When to Add Memory

DO Add:

  • Solutions to non-trivial problems (>15 min debugging)
  • Failed approaches and what worked instead
  • Infrastructure topology and service relationships
  • User-explained project context or preferences
  • Architectural or design decisions with rationale
  • Discovered undocumented behavior or gotchas
  • Session summaries with key learnings
  • Tool configurations with gotchas

DON'T Add:

  • Generic knowledge (already in training data)
  • Trivial fixes (typos, simple syntax errors)
  • Sensitive data (credentials, API keys, PII, connection passwords)
  • Temporary debugging info
  • Content that changes frequently
  • Exact secret values (store the 1Password path instead)

Group IDs

Use group_id to scope memories per project or domain:

add_memory({ name: "...", episode_body: "...", group_id: "nix-dotfiles" })
search_nodes({ query: "...", group_ids: ["nix-dotfiles"] })

Entity Types

Graphiti auto-extracts: Preference (user choices), Requirement (features/​constraints), Procedure (step-by-step processes), Organization (companies/​teams), Document (files/​references), Topic (knowledge domains).

Search Tips

# Find architecture context
search_nodes({ query: "nix-dotfiles architecture structure" })

# Find solutions to errors
search_memory_facts({ query: "error ENOENT file not found" })

# Find user preferences
search_nodes({ query: "user preference coding style" })

# Pagination
search_nodes({ query: "...", max_nodes: 20 })

Server Setup

Backend: Neo4j (graph DB via launchd) MCP Server: Graphiti MCP on http://127.0.0.1:51847

Both services run as macOS LaunchAgents (auto-start on login):

ServiceLaunchAgent labelLogs
Neo4jcom.claude.neo4j~/​.graphiti/​neo4j/​logs/​neo4j.log
Graphiti MCPcom.claude.graphiti~/​.graphiti/​logs/​graphiti.log

Check / restart:

launchctl list | grep claude
launchctl kickstart -k gui/​$(id -u)/​com.claude.neo4j
launchctl kickstart -k gui/​$(id -u)/​com.claude.graphiti

Shell CLI (Without MCP)

For hooks, CI, and shell automation, use the bundled scripts in scripts/. See references/​shell-cli.md for the full CLI reference, examples, and HTTP tool-name mapping.

Troubleshooting

IssueSolution
Connection refusedlaunchctl list | grep claude
Neo4j not startingtail ~/​.graphiti/​neo4j/​logs/​neo4j.error.log
Graphiti not startingtail ~/​.graphiti/​logs/​graphiti.error.log
Session expired (404)Re-initialize: call initialize again
No results foundBroaden search terms, check group_id
Slow queriesReduce max_nodes/max_facts
Duplicate entriesUse delete_episode to clean up
OpenAI key failureCheck 1Password: op read "op://Private/​..."