Skip to main content
skill CX Codex

memory-fabric — Claude Code skill: knowledge graph orchestration

memory-fabric is a Claude Code skill that orchestrates knowledge graph retrieval, parses queries, deduplicates facts, and ranks results. It runs when designing or debugging agent memory mechanics.

MIT 244 installs ★ 305 updated 2026-11-21

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add yonatangross/orchestkit --skill memory-fabric -a claude-code
Open on GitHub

What memory-fabric does

The tool powers retrieval internals using mcp__memory__search_nodes calls. It extracts entity hints from natural language input, handles multi-hop graph relationship traversal, and converts matches into a normalized structure with confidence scores.

When text similarity exceeds 85%, the engine merges metadata and retains the entry with the higher relevance score. Mentions of entities existing elsewhere in the graph trigger a 1.2x cross-reference score multiplier. The final rank applies weights of 0.5 for semantic match, 0.3 for recency, and 0.2 for source authority.

Operation requires @anthropic/memory-mcp-server. Because the frontmatter sets user-invocable: false and disable-model-invocation: true, this skill serves as an internal orchestration layer for memory pipelines rather than a manual slash command.

What it helps with

  • knowledge graph orchestration
  • traverse multi-hop graph entity connections
  • deduplicate memories sharing over 85% similarity
  • score retrieval results by recency, relevance, and graph authority

Example prompts for the agent

  • Explain the deduplication logic in memory-fabric
  • Inspect the multi-hop traversal pattern for graph queries
  • Adjust the ranking weights for recency and authority

How to install memory-fabric

1Skills CLI (Vercel)

npx skills add yonatangross/orchestkit --skill memory-fabric -a claude-code

2Manually: put the files in place

~/.claude/skills/memory-fabric/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/memory-fabric/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about memory-fabric

How to install memory-fabric in Claude Code?

Run npx skills add yonatangross/orchestkit --skill memory-fabric -a claude-code. The definition will be placed in ~/.claude/skills/memory-fabric/SKILL.md.

What does memory-fabric do?

It orchestrates graph memory lookups, handles entity extraction, merges duplicate entries above 85% similarity, and applies cross-reference score boosts.

What is required to run memory-fabric?

It needs Claude Code 2.1.277 or newer and a working @anthropic/memory-mcp-server configured in your environment.

Source text

SKILL.md · MIT
---
name: memory-fabric
license: MIT
compatibility: "Claude Code 2.1.277+. Requires memory MCP server."
description: "Memory retrieval internals: knowledge graph orchestration with entity extraction, natural language query parsing, deduplication (>85% similarity), and cross-reference boosting over unified recency, relevance, and authority ranking. Use when designing or debugging how memory search itself works. Everyday lookups belong to memory search; entry storage to memory remember; consolidation to memory dream."
user-invocable: false
disable-model-invocation: true
allowed-tools: "Read Bash mcp__memory__search_nodes"
effort: high
metadata:
  category: mcp-enhancement
  mcp-server: memory
  version: "2.1.0"
  author: "OrchestKit"
  complexity: "high"
  tags: "memory, orchestration, graph-first, graph, unified-search, deduplication, cross-reference"
---

# Memory Fabric - Graph Orchestration

Knowledge graph orchestration via mcp__memory__* for entity extraction, query parsing, deduplication, and cross-reference boosting.

## Overview

- Comprehensive memory retrieval from the knowledge graph
- Cross-referencing entities within graph storage
- Ensuring no relevant memories are missed
- Building unified context from graph queries

## Architecture Overview

```
Memory Fabric Layer
┌─────────────┐ ┌──────────────┐
│Query Parser │ │Query Executor│
└──────┬──────┘ └──────┬───────┘
       └───────┬───────┘
┌──────────────┴─────────────┐
│Graph Query Dispatch        │
└──────────────┬─────────────┘
┌──────────────┴─────────────┐
│mcp__memory__*              │
│(Knowledge Graph)           │
└──────────────┬─────────────┘
┌──────────────┴─────────────┐
│Result Normalizer           │
└──────────────┬─────────────┘
┌──────────────┴─────────────┐
│Deduplication Engine        │
│(>85% sim)                  │
└──────────────┬─────────────┘
┌──────────────┴─────────────┐
│Cross-Reference Booster     │
└──────────────┬─────────────┘
┌──────────────┴─────────────┐
│Final Ranking: recency ×    │
│relevance × source_authority│
└────────────────────────────┘
```

## Unified Search Workflow

### Step 1: Parse Query

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"
```

### Step 2: Execute Graph Query

**Query Graph (entity search):**

```javascript
mcp__memory__search_nodes({
  query: "pagination database-engineer"
})
```

### Step 3: Normalize Results

Transform results to common format:

```json
{
  "id": "graph:original_id",
  "text": "content text",
  "source": "graph",
  "timestamp": "ISO8601",
  "relevance": 0.0-1.0,
  "entities": ["entity1", "entity2"],
  "metadata": {}
}
```

### Step 4: Deduplicate (>85% Similarity)

When two results have >85% text similarity:

1. Keep the one with higher relevance score
2. Merge metadata
3. Mark as "cross-validated" for authority boost

### Step 5: Cross-Reference Boost

If a result mentions an entity that exists elsewhere in the graph:

- Boost relevance score by 1.2x
- Add graph relationships to result metadata

### Step 6: Final Ranking

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 |


## Result Format

```json
{
  "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" }
      ]
    }
  ]
}
```

## Entity Extraction

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("references/entity-extraction.md")` for detailed extraction patterns.

## Graph Relationship Traversal

Memory Fabric supports multi-hop graph traversal for complex relationship queries.

### Example: Multi-Hop Query

```
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
```

### Integration with Graph Memory

Memory Fabric uses the knowledge graph for entity relationships:

1. **Graph search** via `mcp__memory__search_nodes` finds matching entities
2. **Graph traversal** expands context via entity relationships
3. **Cross-reference** boosts relevance when entities match

## Integration Points

### With memory Skill

When memory search runs, it can optionally use Memory Fabric for unified results.

### With Hooks

- `prompt/memory-fabric-context.sh` - Inject unified context at session start
- `stop/memory-fabric-sync.sh` - Sync entities to graph at session end

## Configuration

```bash
# 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 Requirements

**Required:** Knowledge graph MCP server:

```json
{
  "mcpServers": {
    "memory": {
      "command": "npx",
      "args": ["-y", "@anthropic/memory-mcp-server"]
    }
  }
}
```

## Error Handling


| Scenario           | Behavior                          |
| ------------------ | --------------------------------- |
| graph unavailable  | Error - graph is required         |
| Query empty        | Return recent memories from graph |


## Related Skills

- `ork:memory` - User-facing memory operations (search, load, sync, viz)
- `ork:memory remember` - User-facing memory storage
- `caching` - Caching layer that can use fabric

## Key Decisions


| 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        |


© OrchestKit · MIT · yonatangross/orchestkit

Similar skills

All skills for Agent setup: memory, context, orchestration →

From the same set86

The whole set →
quality-gates quality-gates scores task complexity on a 1–5 scale and halts work when requirements are vague or solutions loop. Triggers before complex tasks and after repeated failures. CX Codex +1 259installs code-review-playbook code-review-playbook supplies structured review workflows, conventional comment formats, and security checklists. Triggers during pull request evaluations or author self-reviews. CX Codex +1 254installs python-backend python-backend — a skill for Claude Code and Codex providing async Python patterns when editing *.py or package files. Enforces conventions for FastAPI, SQLAlchemy 2.0, and asyncio. CX Codex +1 250installs accessibility accessibility — a Claude Code skill for building accessible web interfaces. It activates for work on screen reader support, keyboard navigation, focus handling, and ARIA components. CX Codex +1 246installs multimodal-llm multimodal-llm — a skill for Claude Code and Codex that routes tasks across vision, speech, and video models. The agent activates it when handling image analysis, audio transcription, or video generation APIs. CX Codex +1 243installs database-patterns The database-patterns skill guides schema design, Alembic migrations, and database versioning. It fits work on normalization, migration branches, and schema drift. CX Codex +1 238installs architecture-patterns architecture-patterns enforces clean architecture, backend layer boundaries, and directory limits. Triggers when designing module boundaries or running refactoring tasks. CX Codex +1 236installs performance This skill helps diagnose slow web pages, React renders, backend requests, and LLM inference across a performance review. CX Codex +1 233installs

Project sponsors

Companies that keep this analytics open