memory-fabric by yonatangross/orchestkit
npx skills add https://github.com/yonatangross/orchestkit --skill memory-fabric通过 mcp__memory__* 实现知识图谱编排,用于实体提取、查询解析、去重和交叉引用增强。
┌─────────────────────────────────────────────────────────────┐
│ Memory Fabric Layer │
├─────────────────────────────────────────────────────────────┤
│ │
│ ┌─────────────┐ ┌─────────────┐ │
│ │ Query │ │ Query │ │
│ │ Parser │ │ Executor │ │
│ └──────┬──────┘ └──────┬──────┘ │
│ │ │ │
│ ▼ ▼ │
│ ┌──────────────────────────────────────────────┐ │
│ │ Graph Query Dispatch │ │
│ └──────────────────────┬───────────────────────┘ │
│ │ │
│ ┌─────────▼──────────┐ │
│ │ mcp__memory__* │ │
│ │ (Knowledge Graph) │ │
│ └─────────┬──────────┘ │
│ │ │
│ ▼ │
│ ┌─────────────────────────────────────────┐ │
│ │ Result Normalizer │ │
│ └─────────────────────┬───────────────────┘ │
│ │ │
│ ▼ │
│ ┌─────────────────────────────────────────┐ │
│ │ Deduplication Engine (>85% sim) │ │
│ └─────────────────────┬───────────────────┘ │
│ │ │
│ ▼ │
│ ┌─────────────────────────────────────────┐ │
│ │ Cross-Reference Booster │ │
│ └─────────────────────┬───────────────────┘ │
│ │ │
│ ▼ │
│ ┌─────────────────────────────────────────┐ │
│ │ Final Ranking: recency × relevance │ │
│ │ × source_authority │ │
│ └─────────────────────────────────────────┘ │
│ │
└─────────────────────────────────────────────────────────────┘
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
从自然语言中提取搜索意图和实体提示:
Input: "What pagination approach did database-engineer recommend?"
Parsed:
- query: "pagination approach recommend"
- entity_hints: ["database-engineer", "pagination"]
- intent: "decision" or "pattern"
查询图(实体搜索):
mcp__memory__search_nodes({
query: "pagination database-engineer"
})
将结果转换为通用格式:
{
"id": "graph:original_id",
"text": "content text",
"source": "graph",
"timestamp": "ISO8601",
"relevance": 0.0-1.0,
"entities": ["entity1", "entity2"],
"metadata": {}
}
当两个结果的文本相似度 >85% 时:
如果一个结果提到了图中其他地方存在的实体:
分数 = recency_factor × relevance × source_authority
| 因子 | 权重 | 描述 |
|---|---|---|
| recency | 0.3 | 较新的记忆排名更高 |
| relevance | 0.5 | 语义匹配质量 |
| source_authority | 0.2 | 图实体增强,交叉验证增强 |
{
"query": "original query",
"total_results": 4,
"sources": {
"graph": 4
},
"results": [
{
"id": "graph:cursor-pagination",
"text": "Use cursor-based pagination for scalability",
"score": 0.92,
"source": "graph",
"timestamp": "2026-01-15T10:00:00Z",
"entities": ["cursor-pagination", "database-engineer"],
"graph_relations": [
{ "from": "database-engineer", "relation": "recommends", "to": "cursor-pagination" }
]
}
]
}
Memory Fabric 从自然语言中提取实体以进行图存储:
Input: "database-engineer uses pgvector for RAG applications"
Extracted:
- Entities:
- { name: "database-engineer", type: "agent" }
- { name: "pgvector", type: "technology" }
- { name: "RAG", type: "pattern" }
- Relations:
- { from: "database-engineer", relation: "uses", to: "pgvector" }
- { from: "pgvector", relation: "used_for", to: "RAG" }
加载 Read("${CLAUDE_SKILL_DIR}/references/entity-extraction.md") 以获取详细的提取模式。
Memory Fabric 支持多跳图遍历,用于复杂的关系查询。
Query: "What did database-engineer recommend about pagination?"
1. Search for "database-engineer pagination"
→ Find entity: "database-engineer recommends cursor-pagination"
2. Traverse related entities (depth 2)
→ Traverse: database-engineer → recommends → cursor-pagination
→ Find: "cursor-pagination uses offset-based approach"
3. Return results with relationship context
Memory Fabric 使用知识图谱处理实体关系:
mcp__memory__search_nodes 查找匹配的实体当 memory 搜索运行时,可以选择性地使用 Memory Fabric 来获取统一结果。
prompt/memory-fabric-context.sh - 在会话开始时注入统一上下文stop/memory-fabric-sync.sh - 在会话结束时将实体同步到图# Environment variables
MEMORY_FABRIC_DEDUP_THRESHOLD=0.85 # Similarity threshold for merging
MEMORY_FABRIC_BOOST_FACTOR=1.2 # Cross-reference boost multiplier
MEMORY_FABRIC_MAX_RESULTS=20 # Max results per source
必需: 知识图谱 MCP 服务器:
{
"mcpServers": {
"memory": {
"command": "npx",
"args": ["-y", "@anthropic/memory-mcp-server"]
}
}
}
| 场景 | 行为 |
|---|---|
| graph unavailable | Error - graph is required |
| Query empty | Return recent memories from graph |
ork:memory - 面向用户的记忆操作(搜索、加载、同步、可视化)ork:remember - 面向用户的记忆存储caching - 可以使用 fabric 的缓存层| 决策 | 选择 | 理由 |
|---|---|---|
| Dedup threshold | 85% | 平衡捕获重复项与保留细微差别 |
| Parallel queries | Always | 减少延迟,两个来源是独立的 |
| Cross-ref boost | 1.2x | 已验证的信息更可信,但不占主导地位 |
| Ranking weights | 0.3/0.5/0.2 | 相关性最重要,时效性次之 |
每周安装量
94
仓库
GitHub 星标数
132
首次出现
Jan 22, 2026
安全审计
安装于
gemini-cli87
opencode86
codex85
github-copilot84
cursor83
amp78
Knowledge graph orchestration via mcp__memory__* for entity extraction, query parsing, deduplication, and cross-reference boosting.
┌─────────────────────────────────────────────────────────────┐
│ Memory Fabric Layer │
├─────────────────────────────────────────────────────────────┤
│ │
│ ┌─────────────┐ ┌─────────────┐ │
│ │ Query │ │ Query │ │
│ │ Parser │ │ Executor │ │
│ └──────┬──────┘ └──────┬──────┘ │
│ │ │ │
│ ▼ ▼ │
│ ┌──────────────────────────────────────────────┐ │
│ │ Graph Query Dispatch │ │
│ └──────────────────────┬───────────────────────┘ │
│ │ │
│ ┌─────────▼──────────┐ │
│ │ mcp__memory__* │ │
│ │ (Knowledge Graph) │ │
│ └─────────┬──────────┘ │
│ │ │
│ ▼ │
│ ┌─────────────────────────────────────────┐ │
│ │ Result Normalizer │ │
│ └─────────────────────┬───────────────────┘ │
│ │ │
│ ▼ │
│ ┌─────────────────────────────────────────┐ │
│ │ Deduplication Engine (>85% sim) │ │
│ └─────────────────────┬───────────────────┘ │
│ │ │
│ ▼ │
│ ┌─────────────────────────────────────────┐ │
│ │ Cross-Reference Booster │ │
│ └─────────────────────┬───────────────────┘ │
│ │ │
│ ▼ │
│ ┌─────────────────────────────────────────┐ │
│ │ Final Ranking: recency × relevance │ │
│ │ × source_authority │ │
│ └─────────────────────────────────────────┘ │
│ │
└─────────────────────────────────────────────────────────────┘
Extract search intent and entity hints from natural language:
Input: "What pagination approach did database-engineer recommend?"
Parsed:
- query: "pagination approach recommend"
- entity_hints: ["database-engineer", "pagination"]
- intent: "decision" or "pattern"
Query Graph (entity search):
mcp__memory__search_nodes({
query: "pagination database-engineer"
})
Transform results to common format:
{
"id": "graph:original_id",
"text": "content text",
"source": "graph",
"timestamp": "ISO8601",
"relevance": 0.0-1.0,
"entities": ["entity1", "entity2"],
"metadata": {}
}
When two results have >85% text similarity:
If a result mentions an entity that exists elsewhere in the graph:
Score = recency_factor × relevance × source_authority
| Factor | Weight | Description |
|---|---|---|
| recency | 0.3 | Newer memories rank higher |
| relevance | 0.5 | Semantic match quality |
| source_authority | 0.2 | Graph entities boost, cross-validated boost |
{
"query": "original query",
"total_results": 4,
"sources": {
"graph": 4
},
"results": [
{
"id": "graph:cursor-pagination",
"text": "Use cursor-based pagination for scalability",
"score": 0.92,
"source": "graph",
"timestamp": "2026-01-15T10:00:00Z",
"entities": ["cursor-pagination", "database-engineer"],
"graph_relations": [
{ "from": "database-engineer", "relation": "recommends", "to": "cursor-pagination" }
]
}
]
}
Memory Fabric extracts entities from natural language for graph storage:
Input: "database-engineer uses pgvector for RAG applications"
Extracted:
- Entities:
- { name: "database-engineer", type: "agent" }
- { name: "pgvector", type: "technology" }
- { name: "RAG", type: "pattern" }
- Relations:
- { from: "database-engineer", relation: "uses", to: "pgvector" }
- { from: "pgvector", relation: "used_for", to: "RAG" }
Load Read("${CLAUDE_SKILL_DIR}/references/entity-extraction.md") for detailed extraction patterns.
Memory Fabric supports multi-hop graph traversal for complex relationship queries.
Query: "What did database-engineer recommend about pagination?"
1. Search for "database-engineer pagination"
→ Find entity: "database-engineer recommends cursor-pagination"
2. Traverse related entities (depth 2)
→ Traverse: database-engineer → recommends → cursor-pagination
→ Find: "cursor-pagination uses offset-based approach"
3. Return results with relationship context
Memory Fabric uses the knowledge graph for entity relationships:
mcp__memory__search_nodes finds matching entitiesWhen memory search runs, it can optionally use Memory Fabric for unified results.
prompt/memory-fabric-context.sh - Inject unified context at session startstop/memory-fabric-sync.sh - Sync entities to graph at session end# Environment variables
MEMORY_FABRIC_DEDUP_THRESHOLD=0.85 # Similarity threshold for merging
MEMORY_FABRIC_BOOST_FACTOR=1.2 # Cross-reference boost multiplier
MEMORY_FABRIC_MAX_RESULTS=20 # Max results per source
Required: Knowledge graph MCP server:
{
"mcpServers": {
"memory": {
"command": "npx",
"args": ["-y", "@anthropic/memory-mcp-server"]
}
}
}
| Scenario | Behavior |
|---|---|
| graph unavailable | Error - graph is required |
| Query empty | Return recent memories from graph |
ork:memory - User-facing memory operations (search, load, sync, viz)ork:remember - User-facing memory storagecaching - Caching layer that can use fabric| Decision | Choice | Rationale |
|---|---|---|
| Dedup threshold | 85% | Balances catching duplicates vs. preserving nuance |
| Parallel queries | Always | Reduces latency, both sources are independent |
| Cross-ref boost | 1.2x | Validated info more trustworthy but not dominant |
| Ranking weights | 0.3/0.5/0.2 | Relevance most important, recency secondary |
Weekly Installs
94
Repository
GitHub Stars
132
First Seen
Jan 22, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykWarn
Installed on
gemini-cli87
opencode86
codex85
github-copilot84
cursor83
amp78
签证文件自动翻译工具 - 支持OCR识别、专业翻译、PDF生成,一站式处理签证申请材料
1,400 周安装
WebSocket 安全最佳实践:预防 CSWSH 攻击与连接管理指南
126 周安装
macOS原生开发技能 - 提升Claude在macOS平台的集成与自动化能力
134 周安装
小说结局诊断指南:如何写出既必然又惊喜的完美结局 | 写作技巧与问题解决方案
93 周安装
GitHub自动化工具:通过Rube MCP与Composio自动化管理仓库、问题、PR和CI/CD
156 周安装
Hyperliquid 机会扫描器 v5:AI 驱动的量化交易工具,低代币消耗筛选永续合约机会
128 周安装
scenario-analyzer:基于AI的新闻头条中长期投资情景分析工具 | 金融科技与投资分析
170 周安装