From graphiti-context-hub
When to query and save to Graphiti knowledge graph. PROACTIVELY query before starting work. Save important decisions and patterns.
How this skill is triggered — by the user, by Claude, or both
Slash command
/graphiti-context-hub:using-graphiti-memoryThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
**Query PROACTIVELY:**
Query PROACTIVELY:
Save Immediately After:
Step 1: Get config and repo context (run once):
source "$HOME/.config/claude/graphiti-context-hub.conf" 2>/dev/null
GROUP_ID="${GRAPHITI_GROUP_ID:-main}"
REPO_NAME=$(git remote get-url origin 2>/dev/null | sed 's/.*\///' | sed 's/\.git$//' || basename "$PWD")
Step 2: Search Graphiti (use GROUP_ID from above):
# Search nodes (entities)
nodes_result = mcp__graphiti__search_nodes({
"query": "authentication patterns",
"group_ids": [GROUP_ID], # Always "main"
"max_nodes": 10
})
# Search facts (relationships)
facts_result = mcp__graphiti__search_memory_facts({
"query": "authentication flow",
"group_ids": [GROUP_ID],
"max_facts": 20
})
Step 1: Get config (if not already loaded):
source "$HOME/.config/claude/graphiti-context-hub.conf" 2>/dev/null
GROUP_ID="${GRAPHITI_GROUP_ID:-main}"
REPO_NAME=$(git remote get-url origin 2>/dev/null | sed 's/.*\///' | sed 's/\.git$//' || basename "$PWD")
Step 2: Save episode with repo tagging:
# IMPORTANT: Prefix episode_body with "Repo: {REPO_NAME}\n\n"
result = mcp__graphiti__add_memory({
"name": "Auth Decision: JWT with httponly cookies",
"episode_body": f"""Repo: {REPO_NAME}
Decision: Using JWT tokens stored in httponly cookies.
Rationale:
- XSS protection via httponly flag
- CSRF protection via SameSite attribute
- Automatic token rotation on refresh
Implementation:
- Access token: 15 min expiry
- Refresh token: 7 day expiry
- Redis for token storage
""",
"group_id": GROUP_ID, # Always "main"
"source": "context-hub",
"source_description": "Architectural decision"
})
episode_id = result.get('episode_id', result.get('uuid'))
Key Pattern: Always prefix episode_body with Repo: {REPO_NAME}\n\n to tag which repository the memory belongs to.
Automatic Entity Extraction:
Search Capabilities:
Knowledge Graph Benefits:
Config file: ~/.config/claude/graphiti-context-hub.conf
GRAPHITI_GROUP_ID=main
GRAPHITI_ENDPOINT=http://localhost:8000
SERENA_ENABLED=true
Created by /context-hub-setup. Defaults: group_id=main, endpoint=localhost:8000.
Before implementing a feature:
# Search for related patterns
nodes = mcp__graphiti__search_nodes({
"query": f"implementing {feature_name}",
"group_ids": [GROUP_ID],
"max_nodes": 10
})
# Check for architectural decisions
facts = mcp__graphiti__search_memory_facts({
"query": f"{feature_name} architecture",
"group_ids": [GROUP_ID],
"max_facts": 20
})
After making a decision:
mcp__graphiti__add_memory({
"name": f"Decision: {decision_title}",
"episode_body": f"""Repo: {REPO_NAME}
Decision: {what_you_decided}
Context: {why_this_matters}
Rationale: {reasoning}
Trade-offs: {alternatives_considered}
""",
"group_id": GROUP_ID,
"source": "context-hub"
})
npx claudepluginhub geojaz/graphiti-context-hub --plugin graphiti-context-hubSearches knowledge graph, loads session context, views history, checks status, and visualizes memory for recalling past decisions in coding sessions.
Gives agents low-token codebase context by querying a graphify knowledge graph instead of reading raw files. Use for research, impact analysis, and agent-loop integration.
Fetches up-to-date documentation from Context7 for libraries and frameworks like React, Next.js, Prisma. Use for setup questions, API references, and code examples.