| name | memory-knowledge-graph |
| description | Knowledge graph-based persistent memory for AI agents — entities, relations, and semantic retrieval. Use when working with memory knowledge graph. |
| domain | mcp |
| author | oyi77 |
| license | Apache-2.0 |
| subdomain | mcp |
| tags | ["ai-agent","graph","knowledge","mcp-server","memory","model-context-protocol","tool-integration"] |
| version | 1.0.0 |
Overview
Persistent memory system using knowledge graphs for AI agents. Stores entities, relations, and observations as a graph, enabling semantic retrieval and reasoning over accumulated knowledge.
Capabilities
- Extract entities and relations from conversations and documents
- Store knowledge as a graph (nodes + edges + observations)
- Retrieve relevant knowledge via semantic search and graph traversal
- Consolidate and deduplicate knowledge over time
- Query knowledge with natural language
When to Use
Trigger phrases:
-
"memory knowledge graph"
-
"Knowledge graph-based persistent memory for AI agents — entities, relations, and"
-
Building AI agents with long-term memory
-
Need to remember user preferences, facts, and context across sessions
-
Knowledge base that grows and improves over time
-
Cross-referencing information across multiple sources
When NOT to Use
- Task is outside your authorization scope
- You need to implement controls (use implementing-* skills)
- Task is about analysis, not action (use analyzing-* skills)
- You don't have access to target systems
- Task requires compliance expertise (consult professionals)
- Task is about defense, not offense (use defensive skills)
Pseudo Code
def execute(input_data):
if not input_data:
raise ValueError("Input data is required")
result = process(input_data)
validate_output(result)
return result
Entity Extraction
def extract_entities(text):
prompt = f"""Extract entities and relations from:
{text}
Return JSON: {{"entities": [{{"name": "...", "type": "...", "observations": [...]}}], "relations": [{{"from": "...", "to": "...", "type": "..."}}]}}"""
return llm.generate(prompt)
Knowledge Retrieval
def retrieve_relevant(query, graph, top_k=5):
semantic_results = graph.semantic_search(query, top_k=top_k)
related = []
for entity in semantic_results:
related.extend(graph.get_neighbors(entity.id, depth=2))
return rank_by_relevance(semantic_results + related, query)
Memory Consolidation
def consolidate(graph):
duplicates = find_similar_entities(graph, threshold=0.9)
for dup_group in duplicates:
merge_entities(graph, dup_group)
for entity in graph.entities:
entity.observations = [o for o in entity.observations if o.relevance > 0.3]
Common Patterns
- Extract on every interaction: Build knowledge from every conversation
- Semantic + graph traversal: Combine vector search with graph walks for better retrieval
- Consolidate periodically: Merge duplicates and prune stale knowledge
- Entity types: Person, Organization, Concept, Event, Preference
How to Use
- Invoke the skill when relevant domain keywords appear in the request
- Provide required inputs as specified in the skill definition
- Review the output for correctness before delivering to the user
- Combine with related skills for complex multi-step workflows
Verification
After completing this skill, confirm:
Process
- Analyze the task requirements
- Apply domain expertise
- Verify output quality
Anti-Rationalization Table
| Rationalization | Reality |
|---|
| "I will just use curl" | MCP handles auth, retries, streaming, and type safety. Use the SDK. |
| "One mega-server is simpler" | Single-responsibility servers are easier to debug and maintain. |
| "MCP is just a wrapper" | MCP enables cross-platform tool sharing. It is infrastructure, not overhead. |