graphify
/graphify
Knowledge graph development for LLM applications. Graph storage selection, graph algorithms, extraction from documents/code/websites, entity extraction, Graph RAG, and visualization. Use when building knowledge graphs, graph databases, or LLM graph applications.
- Author
- v1truv1us ↗
- Repository
- ai-eng-system ↗
- Licence
- MIT
- Last repository change
- 09.08.2026
Assessment and security
- Files in this package
- 1
- Scripts
- 0
- HTML comments
- 0
- URLs in SKILL.md
- 0
No signals detected. Repository changed on 09.08.2026, without references to retired models or APIs.
MIT, open: use and modify while retaining author attribution.
What it does and when to use it
Knowledge graph development for LLM applications. Graph storage selection, graph algorithms, extraction from documents/code/websites, entity extraction, Graph RAG, and visualization. Use when building knowledge graphs, graph databases, or LLM graph applications.
Original author description
Knowledge graph development for LLM applications. Graph storage selection, graph algorithms, extraction from documents/code/websites, entity extraction, Graph RAG, and visualization. Use when building knowledge graphs, graph databases, or LLM graph applications.
How it works
- When to Use
- 1. Graph Storage Selection
- 2. Graph Algorithms
- 3. Graph Extraction Sources
- 4. LLM Graph Construction
- 5. LLM Graph Integration
- 6. Graph Visualization
- Process Summary
- Common Mistakes
- Verification
SKILL.md preview
---
name: graphify
description: Knowledge graph development for LLM applications. Graph storage selection, graph algorithms, extraction from documents/code/websites, entity extraction, Graph RAG, and visualization. Use when building knowledge graphs, graph databases, or LLM graph applications.
---
# Graphify
Build knowledge graphs for LLM applications. Knowledge graphs improve AI responses by providing structured context with relationships, enable retrieval-augmented generation with graph traversal, and support agentic workflows with graph-defined tools.
## When to Use
- Building knowledge bases with relationships (not just chunks)
- Implementing Graph RAG for better recall
- Extracting structure from unstructured documents
- Building agent memories with relationships
- Creating recommendation systems
- Analyzing code dependencies
---
## 1. Graph Storage Selection
Choose storage based on query patterns and scale requirements.
### In-Memory Graph
Use for: prototyping, small graphs (<10K nodes), single-machine apps
```typescript
// Example: GraphLib or native Map/Set
const graph = new Map<string, Set<string>>();
```
### PostgreSQL with Extensions
Use when: already using PostgreSQL, need ACID compliance, moderate scale
- **pggraph**: Native graph support via extensions
- Works with existing Postgres infrastructure
### Neo4j
Use when: complex relationship queries, Cypher proficiency, managed needed
- Best for: traversals, path finding, graph algorithms
- Avoid if: simple queries dominate
### Redis
Use when: caching, real-time, ephemeral graphs
- Best for: session graphs, rate limiting, recent activity
### AWS Neptune
Use when: managed, need Gremlin/SPARQL, AWS ecosystem
- Serverless option available
- Integration with AWS services
**Decision Matrix:**
| Scenario | Recommended |
|----------|-------------|
| Prototyping | In-memory |
| Already on Postgres | PostgreSQL |
| Complex traversals | Neo4j |
| Caching/real-time | Redis |
| Managed AWS | Neptune |
| Knowledge base | Neo4j or PostgreSQL |
---
## 2. Graph Algorithms
Select algorithm based on the question you're answering.
### Traversal (BFS/DFS)
Use for: exploration, finding any path, connectivity
- **BFS**: Shortest unweighted path, level-by-level
- **DFS**: Deep exploration, cycle detection
```typescript
// BFS for shortest path
function bfs(graph, start, goal) {
const queue = [[start]];
const visited = new Set([start]);
while (queue.length) {
const path = queue.shift();
const node = path[path.length - 1];
if (node === goal) return path;
for (const neighbor of graph.get(node) || []) {
if (!visited.has(neighbor)) {
visited.add(neighbor);
queue.push([...path, neighbor]);
}
}
}
}
```
### Shortest Path (Dijkstra, A*)
Use for: weighted routing, travel time, cost optimization
### Centrality Measures
Use for: identifying important nodes
- **PageRank**: Importance via links/votes
- **Betweenness**: Bridge identification
- **Degree**: Direct influence
### Community Detection
Use for: clustering, segmentation
- **Louvain**: Large-scale community detection
- **Label Propagation**: Fast clustering
**When to Use Each:**
| Question | Algorithm |
|----------|-----------|
| How do I get from A to B? | BFS/Dijkstra |
| What's the best order? | Topological sort |
| What's most important? | PageRank |
| Who are the bridges? | Betweenness |
| What groups exist? | Louvain |
---
## 3. Graph Extraction Sources
Extract graphs from different data sources.
### From Documents (PDF, Markdown)
Process: chunk → extract entities → extract relationships
```typescript
// Extract entities from text chunk
prompt = `Extract entities from: {chunk}
Entities as JSON: { "entities": [{"id": "...", "type": "...", "name": "..."}] }`;
```
### From Code (AST Parsing)
Extract: imports, function calls, class relationships
```typescript
// Dependency graph from imports
imports.map(file => ({
source: file.path,
targets: file.imports,
type: 'imports'
}));
```
### From Websites
Link graphs from HTML parsing
```typescript
// Extract links
links = html.querySelectorAll('a[href]')
.map(a => ({ source: pageUrl, target: a.href, type: 'links_to' }));
```
### From SQL
Schema graphs: tables, columns, foreign keys
```typescript
// Extract schema relationships
foreignKeys.map(fk => ({
source: fk.fromTable,
target: fk.toTable,
type: 'references',
via: fk.column
}));
```
### From JSON/YAML
Configuration graphs
```typescript
// Dependencies from package.json
deps.map(d => ({ source: 'package', target: d.name, type: 'depends_on' }));
```
---
## 4. LLM Graph Construction
Build graphs using LLMs for entity and relationship extraction.
### Entity Extraction Prompt
```prompt
Extract all entities from the following text.
For each entity, provide: id, type, name, description.
Text: {text}
Output as JSON array:
```
### Relationship Extraction Prompt
```prompt
Extract relationships between these entities.
For each relationship: source, target, type, confidence (0-1).
Entities: {entities}
Relationships:
```
### Relationship Confidence
- Use LLM to provide confidence scores
- Filter by threshold (e.g., confidence > 0.7)
- Allow incremental updating
### Semantic Search with Embeddings
```typescript
// Embed entities for semantic search
entities.forEach(entity => {
entity.embedding = embed(entity.name + ' ' + entity.description);
});
// Query: find similar entities
similar = vectorSearch(queryEmbedding, entities, topK: 10);
```
### Incremental Graph Building
1. Process new document
2. Extract entities (match existing → link, new → add)
3. Extract relationships (add/update)
4. Update embeddings
---
## 5. LLM Graph Integration
Use graphs with LLMs for improved retrieval.
### Graph RAG Pattern
```prompt
Context from knowledge graph:
{graph_context}
Question: {question}
Based on the graph context above, answer:
```
**Graph retrieval steps:**
1. Convert question to graph query
2. Traverse relevant subgraphs
3. Include relationship context in prompt
### Graph Tools for Agents
Define tools from graph structure:
```typescript
// Graph-defined tools
const tools = graph.nodes.map(node => ({
name: `query_${node.type}`,
description: `Query ${node.type} entities`,
parameters: { ... }
}));
```
### Subagent Orchestration via Graph
```typescript
// Route through graph
function orchestrate(query, graph) {
const relevant = graph.query(query);
const agent = selectAgent(relevant.type);
return agent.execute(query, relevant.context);
}
```
**Hybrid RAG: Vector + Graph**
| Approach | Best For |
|----------|----------|
| Vector only | Similarity search |
| Graph only | Relationship queries |
| Hybrid | Both similarity + relationships |
Execute both, combine results.
---
## 6. Graph Visualization
Choose visualization based on context.
### Mermaid
For documentation, README files:
```mermaid
graph TD
A[User] --> B[Login]
B --> C[Dashboard]
C --> D[Query Graph]
D --> E[Results]
```
### D3.js
For interactive web applications:
```typescript
// D3 force-directed graph
const simulation = d3.forceSimulation(nodes)
.force('link', d3.forceLink(links).id(d => d.id))
.force('charge', d3.forceManyBody())
.force('center', d3.forceCenter(width / 2, height / 2));
```
### Graphviz (DOT)
For static diagrams:
```
digraph {
User -> Login -> Dashboard
Dashboard -> Query
Query -> Graph
}
```
**Selection Guide:**
| Context | Recommended |
|--------|-------------|
| Documentation | Mermaid |
| Web app | D3.js |
| Static analysis | Graphviz |
| CLI output | ASCII |
---
## Process Summary
### Step 1: Choose Storage
Start simple, upgrade as needed
### Step 2: Extract Graph
- From documents → chunk + LLM extraction
- From code → AST parsing
- From existing data → schema extraction
### Step 3: Build Incrementally
- Process documents
- Deduplicate entities
- Add relationships
- Update embeddings
### Step 4: Integrate with LLM
- Graph RAG for retrieval
- Graph tools for agents
### Step 5: Visualize
As needed for debugging/documentation
---
## Common Mistakes
| Mistake | Reality |
|---------|--------|
| "Start with Neo4j" | Start in-memory, upgrade when needed |
| "Extract everything" | Focus on useful relationships |
| "Graph replaces vector" | Use hybrid approach |
| "One-time build" | Graphs need maintenance |
---
## Verification
- [ ] Graph storage selected based on query patterns
- [ ] Algorithm chosen for actual questions
- [ ] Extraction working from primary sources
- [ ] Entity/relationship extraction prompts defined
- [ ] Graph RAG pattern implemented
- [ ] Visualization working for debugging
## Anti-Rationalization Table
| Excuse | Counter |
|--------|---------|
| "Start with Neo4j" | Start in-memory, upgrade when needed. Premature infrastructure adds operational cost. |
| "Extract everything" | Focus on useful relationships. Over-extraction creates noise and slows queries. |
| "Graph replaces vector" | Use hybrid approach. Graph and vector complement each other, they do not compete. |
| "One-time build is enough" | Graphs need maintenance. Stale graphs produce stale answers. |
| "I don't need confidence scores on relationships" | Without confidence, you cannot filter low-quality edges. Scores enable quality control. |
Versions
| Repository | Score | Licence |
|---|---|---|
| This page · v1truv1us/ai-eng-system | 100 | MIT |
| vanducng/skills | 100 | MIT |
| TerminalSkills/skills | 100 | Apache-2.0 |
| 2799662352/ai-image-master | 100 | MIT |
| Metixpro/Macron-Agent | 100 | MIT |
| adeiltonpessini/kit-memoria-ia | 100 | Apache-2.0 |
| vinnie357/claude-skills | 100 | MIT |
| sammcj/agentic-coding | 95 | Apache-2.0 |
| taianh20102011/skill-for-ai | 95 | MIT |
Identical content appears in 1 other GitHub folders. We show one copy with the highest score.
Database snapshot: 13.11.2026 · package version 6fc16a764b6f (SHA-256 digest of the entire package)
Downloads in the last 30 days: 0 · ranking
Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.
Similar skills
- 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. - 100tune-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. - 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. - 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-construction
Building knowledge graphs from unstructured text. LLM-based triple extraction (subject-predicate-object), schema-guided extraction via Pydantic + structured output, REBEL model, OpenIE, entity linking to Wikidata/DBpedia, validation with LLM judges, incremental KG updates, and… - 100graphify-usage
This skill should be used when querying the graphify knowledge graph for structural codebase information, choosing between graph tools and grep, or interpreting graph query results.