Claude-skill-registry graphiti-mcp-usage
Workflow for using Graphiti MCP tools to capture preferences, procedures, and facts consistently.
git clone https://github.com/majiayu000/claude-skill-registry
T=$(mktemp -d) && git clone --depth=1 https://github.com/majiayu000/claude-skill-registry "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/data/graphiti-mcp-usage" ~/.claude/skills/majiayu000-claude-skill-registry-graphiti-mcp-usage && rm -rf "$T"
skills/data/graphiti-mcp-usage/SKILL.mdGraphiti MCP Usage Skill
This skill explains how to use the Graphiti knowledge graph effectively. Follow it whenever you need to look up or store ScreenGraph preferences, procedures, or factual relationships.
Before You Start
- Search for existing knowledge.
- Use
to look for Preferences or Procedures tied to your task.search_nodes - Use
to explore relationships and factual context.search_facts - Filter by entity type (
,"Preference"
) to narrow the results."Procedure" - Review every match before making new assumptions.
- Use
- Capture requirements immediately.
- When a user states a requirement or preference, call
right away.add_episode - Split long requirements into logical chunks.
- Explicitly mark when you are updating existing knowledge instead of creating new entries.
- When a user states a requirement or preference, call
- Document procedures and facts.
- Confirmed workflows become Procedures.
- Relationships between entities become Facts.
- Tag each entry with specific categories for easier retrieval later.
During Your Work
- Respect preferences. Align your work with every preference you discover.
- Follow procedures exactly. Execute the stored steps without deviation.
- Apply factual context. Use recorded facts to inform implementation details and recommendations.
- Stay consistent. Ensure your narrative and actions match the graph’s established knowledge.
Best Practices
| Core Principle | Quick Action |
|---|---|
| Know Your Context | Run for Preferences & Procedures before starting. |
| Know the Relationships | Use to surface supporting data. |
| Be Efficient | Filter nodes immediately by specifying or . |
| Be Thorough | Review all matches to avoid redundant knowledge. |
| Don’t Lose Context | Use immediately for new or updated requirements. |
| Define the “How” | Record workflows as Procedures. |
| Define the “What” | Record entity relationships as Facts. |
| Tag Everything | Use clear categories for every Preference and Procedure. |
Summary Checklist
- Search nodes for Preferences/Procedures.
- Search facts for supporting relationships.
- Capture new requirements or updates with
.add_episode - Store workflows as Procedures and relationships as Facts.
- Tag entries with clear categories for future retrieval.
Remember: the Graphiti knowledge graph is your memory. Use it consistently to deliver personalized, context-aware assistance.
ScreenGraph-Specific Patterns
Project Identifier (CRITICAL)
ALWAYS use
for ALL Graphiti operations.group_id="screengraph"
- ✅ Graphiti is shared across multiple projects
- ✅
provides project isolationgroup_id - ✅ Use tags in
to categorize content (e.g.,episode_body
)[Tags: backend, agent, appium] - ❌ NEVER use different group_ids - ScreenGraph =
always"screengraph"
Common Tags for Organization:
- Backend/API patternsbackend
- UI components, Svelte patternsfrontend
- E2E tests, integration teststesting
- Bug fixes, workaroundsdebugging
- Design decisionsarchitecture
- CI/CD, automationdevops
- Device connections, WebDriverappium
Common Workflow: Before Implementing
// Step 1: Search for existing patterns const nodes = await search_memory_nodes({ query: "agent recovery after device disconnect", group_ids: ["screengraph"], max_nodes: 10 }); // Step 2: Search for specific facts const facts = await search_memory_facts({ query: "WebDriver session timeout handling", group_ids: ["screengraph"], max_facts: 10 }); // Step 3: Review results → Implement → Document
Common Workflow: After Solving Bug
// Document the solution immediately await add_memory({ name: "Agent Stalls on Privacy Consent Dialog", episode_body: ` [Tags: backend, agent, appium, debugging] **Problem**: Agent hangs when app shows privacy consent modal **Root Cause**: Policy engine doesn't handle modal overlays **Solution**: - Added pre-flight dialog detection in device-check.ts - Prompt user to handle consent before starting - Added check in EnsureDevice node **Gotchas**: - Must check BEFORE starting policy execution - Different apps have different consent flows - Some consent dialogs block UI hierarchy **Files Modified**: - backend/agent/nodes/setup/EnsureDevice/device-check.ts - backend/agent/nodes/setup/EnsureDevice/node.ts **Related Issues**: BUG-015 **Lessons**: Always assume first-run experience needs human intervention `, group_id: "screengraph", source: "text" });
Common Workflow: Before Building UI Component
// Search for similar UI patterns const uiPatterns = await search_memory_nodes({ query: "Svelte 5 component with real-time updates", group_ids: ["screengraph"], max_nodes: 5 }); // Check for specific gotchas const gotchas = await search_memory_facts({ query: "Svelte 5 runes reactivity issues", group_ids: ["screengraph"], max_facts: 5 });
Common Workflow: Documenting Architecture Decision
// After major refactoring or design decision await add_memory({ name: "Agent State Machine: Single Sink Pattern", episode_body: ` [Tags: backend, agent, architecture] **Decision**: Use single terminal state ("completed") instead of multiple end states **Rationale**: - Simplifies state transitions - Easier to track run completion - Aligns with database schema **Alternatives Considered**: - Multiple terminal states (success/failure/canceled) - Rejected: Added complexity without clear benefit **Implementation**: - State machine has 1 terminal: "completed" - stopReason field captures why (success/error/canceled) - Frontend uses stopReason for UI decisions **References**: - backend/agent/machine/AgentMachine.ts - agent_single_sink_design.md **Date**: 2025-11-05 `, group_id: "screengraph", source: "text" });
Quick Reference: API Usage
Search by topic:
search_memory_nodes({ query: "topic", group_ids: ["screengraph"], max_nodes: 10 })
Search for specific facts:
search_memory_facts({ query: "question", group_ids: ["screengraph"], max_facts: 10 })
Document solution:
add_memory({ name: "Short Title", episode_body: "[Tags: category1, category2]\n\nProblem:\nSolution:\nGotchas:\nFiles:", group_id: "screengraph", source: "text" })
Retrieve recent episodes:
get_episodes({ group_id: "screengraph", last_n: 10 })
ScreenGraph Integration Points
With Other MCPs
- Context7 → Use when you need external library docs
- Sequential-thinking → Use for complex reasoning
- Encore-mcp → Use for backend introspection, then document findings
- Playwright → Use for frontend debugging, then document patterns
With Task Commands
After running important Task commands, document learnings:
// After task founder:workflows:db-reset add_memory({ name: "Database Reset Procedure", episode_body: "[Tags: devops, database]\n\nRun 'task founder:workflows:db-reset' to wipe DB. Automatically runs migrations after. Safe for dev, dangerous for prod.", group_id: "screengraph", source: "text" })
With Claude Skills
Before using complex skills (backend-debugging, e2e-testing), search Graphiti for related past issues to inform your approach.