Skip to content
Skills Library
AI & agents · Analysis

tune-knowledge-graph-rag

/tune-knowledge-graph-rag

Tune Knowledge Graph RAG — optimize graph traversal depth, entity resolution, hybrid graph+vector weights, extraction prompt, Gremlin query performance, cost. Use when: tune, optimize graph RAG.

Repository
frootai ↗
Licence
MIT
Last repository change
26.10.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
3
Scripts
0
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 26.10.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What it does and when to use it

Tune Knowledge Graph RAG — optimize graph traversal depth, entity resolution, hybrid graph+vector weights, extraction prompt, Gremlin query performance, cost. Use when: tune, optimize graph RAG.

Original author description

Tune Knowledge Graph RAG — optimize graph traversal depth, entity resolution, hybrid graph+vector weights, extraction prompt, Gremlin query performance, cost. Use when: tune, optimize graph RAG.

How it works

  1. When to Use
  2. Tuning Dimensions
  3. Production Readiness Checklist
  4. Output: Tuning Report
Original SKILL.md headings · 98 lines, 610 words
SKILL.md preview
---
name: tune-knowledge-graph-rag
description: "Tune Knowledge Graph RAG — optimize graph traversal depth, entity resolution, hybrid graph+vector weights, extraction prompt, Gremlin query performance, cost. Use when: tune, optimize graph RAG."
---

# Tune Knowledge Graph RAG

## When to Use
- Optimize graph traversal depth (more hops = more context, higher latency)
- Tune entity resolution thresholds (when to merge similar entities)
- Configure hybrid graph+vector retrieval weights
- Improve entity extraction prompt quality
- Reduce Gremlin query latency and RU cost

## Tuning Dimensions

### Dimension 1: Graph Traversal Depth

| Max Hops | Context Size | Accuracy | Latency | Cost |
|----------|-------------|----------|---------|------|
| 1 | Small (direct neighbors) | Good for simple queries | < 100ms | Low |
| 2 | Medium (2 degrees) | Good for relationship queries | 100-300ms | Medium |
| 3 | Large (3 degrees) | Best for complex reasoning | 300-800ms | High |
| 4+ | Very large | Diminishing returns, noise | > 1s | Very high |

**Rule**: Default to 2 hops. Only use 3 for explicitly multi-hop queries. Never use 4+.

### Dimension 2: Entity Resolution

| Threshold | Behavior | Example |
|-----------|----------|---------|
| Strict (exact match) | Only merge identical names | "AWS" ≠ "Amazon Web Services" |
| Moderate (fuzzy + aliases) | Merge similar + known aliases | "AWS" = "Amazon Web Services" |
| Aggressive (embedding similarity) | Merge if embeddings similar | "ML" = "Machine Learning" |

Configuration:
```json
{
  "entity_resolution": {
    "method": "fuzzy_plus_aliases",
    "similarity_threshold": 0.85,
    "alias_dictionary": "config/entity-aliases.json",
    "case_sensitive": false
  }
}
```

### Dimension 3: Hybrid Graph+Vector Weights

| Configuration | Graph Weight | Vector Weight | Best For |
|--------------|-------------|--------------|---------|
| Graph-heavy | 0.7 | 0.3 | Relationship-heavy domains (org charts, supply chains) |
| Balanced | 0.5 | 0.5 | General-purpose knowledge bases |
| Vector-heavy | 0.3 | 0.7 | Content-heavy with few relationships |

**Tuning method**: Compare retrieval quality on test queries with each weight configuration.

### Dimension 4: Extraction Prompt Optimization

| Technique | Impact | Example |
|-----------|--------|---------|
| Entity type constraints | +20% precision | "Only extract: Person, Org, Product" |
| Relationship direction | +15% accuracy | "Alice reports_to Bob (not Bob reports_to Alice)" |
| Few-shot examples | +25% consistency | Include 2 examples of expected output |
| Confidence scores | Enables filtering | "Include confidence 0-1 per entity" |
| Negative examples | -30% false entities | "Do NOT extract generic concepts" |

### Dimension 5: Cost Optimization

| Component | Cost Driver | Optimization |
|-----------|------------|-------------|
| Entity extraction | GPT-4o tokens per doc | Batch documents, use gpt-4o-mini for simple docs |
| Graph storage | Cosmos DB RU/s | Set appropriate RU/s for read pattern |
| Graph traversal | Gremlin query complexity | Index key properties, limit hop depth |
| Embedding (hybrid) | Per-query embedding | Cache query embeddings for repeated queries |

**Monthly estimate** (50K documents, 10K queries/day):
- Entity extraction (one-time): ~$250 (gpt-4o for 50K docs)
- Cosmos DB (400 RU/s): ~$24/mo
- Query embeddings: ~$6/mo
- OpenAI generation: ~$300/mo
- **Total: ~$330/mo** (ongoing) + $250 (one-time extraction)

## Production Readiness Checklist
- [ ] Entity extraction F1 ≥ 0.85
- [ ] Relationship precision ≥ 0.80
- [ ] Entity resolution merging duplicates correctly
- [ ] Graph traversal (2 hops) < 300ms
- [ ] Hybrid graph+vector weights optimized
- [ ] Multi-hop queries resolving correctly (≥ 75%)
- [ ] Graph vs vector providing ≥ 15% lift on relationship queries
- [ ] Cosmos DB RU/s sized for query load
- [ ] Entity alias dictionary maintained

## Output: Tuning Report
After tuning, compare:
- Entity extraction accuracy improvement
- Graph traversal latency change
- Hybrid weight optimization results
- Multi-hop query success rate
- Cost per query reduction
Files in this package (3)
  • SKILL.lean.md 4 KB
  • SKILL.md 4 KB
  • agents/openai.yaml 1 KB

Versions

The database has no other skills named tune-knowledge-graph-rag.

Database snapshot: 13.11.2026 · package version 776031702b23 (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 100deploy-knowledge-graph-rag
    Deploy Knowledge Graph RAG — configure entity extraction, relationship mapping, Cosmos DB Gremlin graph, graph traversal retrieval, hybrid graph+vector search. Use when: deploy, provision graph RAG.
  • 100evaluate-knowledge-graph-rag
    Evaluate Knowledge Graph RAG — measure entity extraction accuracy, relationship precision, graph traversal quality, hybrid retrieval effectiveness, multi-hop reasoning. Use when: evaluate, benchmark graph RAG.
  • 100graph-rag
    Relationship-aware retrieval using graph traversal, entity anchors, community expansion, and hybrid vector plus graph search. Use when chunk similarity alone misses paths, entities, or subsystem context.
  • 100graph-rag
    Relationship-aware retrieval using graph traversal, entity anchors, community expansion, and hybrid vector plus graph search. Use when chunk similarity alone misses paths, entities, or subsystem context.
  • 90graph-rag
    Use when needing global or relational understanding of codebases or knowledge corpora. Keywords: GraphRAG, knowledge graph, entity extraction, community summarization, graph traversal, Microsoft GraphRAG.
  • 100knowledge-graph-builder
    Activates KnowledgeGraph — an expert in building, querying, and reasoning over knowledge graphs. Use when you need entity extraction, relationship mapping, ontology design, Neo4j/RDF graph construction, graph-RAG pipelines, or complex multi-hop reasoning over structured knowledge.

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.