skills/knowledge/knowledge-graph/SKILL.md
Build and navigate knowledge graphs showing article relationships, topic hierarchies, cross-reference maps, content dependency analysis, and knowledge domain coverage visualization
npx skillsauth add happy-technologies-llc/happy-servicenow-skills knowledge-graphInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
This skill covers building and navigating knowledge graphs within ServiceNow Knowledge Management:
When to use: When knowledge managers need to understand the structure and interconnections of their knowledge base, when building guided learning paths, when identifying knowledge silos, or when improving article discoverability through relationship enrichment.
knowledge_manager, knowledge_admin, or admincom.glideapp.knowledge (Knowledge Management)kb_knowledge, kb_category, m2m_kb_to_kb, label_entryknowledge/gap-analysis for coverage assessment, knowledge/content-recommendation for graph-based recommendationsRetrieve the full category structure to establish the topic hierarchy backbone.
MCP Approach:
Tool: SN-Query-Table
Parameters:
table_name: kb_category
query: active=true^ORDERBYparent,order
fields: sys_id,label,parent_id,parent_table,full_category,active,kb_knowledge_base
limit: 500
REST Approach:
GET /api/now/table/kb_category
?sysparm_query=active=true^ORDERBYparent_id,order
&sysparm_fields=sys_id,label,parent_id,full_category,active,kb_knowledge_base
&sysparm_display_value=true
&sysparm_limit=500
Build the hierarchy tree:
Knowledge Base: IT Support
+-- Hardware
| +-- Laptops
| | +-- Setup & Configuration
| | +-- Troubleshooting
| +-- Printers
| +-- Mobile Devices
+-- Software
| +-- Operating Systems
| +-- Business Applications
| +-- Development Tools
+-- Network
+-- VPN & Remote Access
+-- WiFi
+-- Email & Calendar
Fetch the many-to-many relationship records between articles.
MCP Approach:
Tool: SN-Query-Table
Parameters:
table_name: m2m_kb_to_kb
query: from_kb.workflow_state=published
fields: sys_id,from_kb,to_kb,relationship_type
limit: 1000
REST Approach:
GET /api/now/table/m2m_kb_to_kb
?sysparm_query=from_kb.workflow_state=published
&sysparm_fields=sys_id,from_kb,to_kb,relationship_type
&sysparm_display_value=true
&sysparm_limit=1000
Find hidden connections by analyzing article content for cross-references.
Approach 1 -- Inline links:
MCP Approach:
Tool: SN-Query-Table
Parameters:
table_name: kb_knowledge
query: workflow_state=published^textLIKEKB00
fields: sys_id,number,short_description,text
limit: 200
Parse the text field for patterns like KB001XXXX to extract referenced article numbers.
Approach 2 -- Shared tags and labels:
Tool: SN-Query-Table
Parameters:
table_name: label_entry
query: table=kb_knowledge
fields: sys_id,id_display,label,table,id
limit: 500
Group articles by shared labels to identify topic clusters:
Label: "vpn" -> KB0012001, KB0012345, KB0012290, KB0012310
Label: "remote-access" -> KB0012001, KB0012189, KB0012290, KB0012310
Label: "security" -> KB0012310, KB0013001, KB0013045
Approach 3 -- Co-occurrence in incident resolution:
Tool: SN-Query-Table
Parameters:
table_name: incident
query: u_knowledge_articleISNOTEMPTY^resolved_at>javascript:gs.daysAgo(90)
fields: u_knowledge_article,category,subcategory
limit: 500
Articles frequently used to resolve the same incident category are implicitly related.
Represent the graph as nodes (articles) and edges (relationships):
=== KNOWLEDGE GRAPH STRUCTURE ===
Nodes (Articles): 342 published articles
Edges (Relationships): 567 connections
Node Properties:
- sys_id, number, title, category, knowledge_base
- view_count, rating, age_days, word_count
- in_degree (articles pointing to this), out_degree (articles this points to)
Edge Types:
- RELATED_TO: General topical relationship (312 edges)
- PREREQUISITE: Must read A before B (45 edges)
- SUPERSEDES: Article A replaces article B (28 edges)
- DEPENDS_ON: Article A references procedures in B (89 edges)
- SAME_TOPIC: Articles in the same category (93 edges)
Graph Metrics:
- Average degree: 3.3 connections per article
- Density: 0.0097 (sparse - room for enrichment)
- Connected components: 23 (ideally should be 1-3)
- Orphaned articles: 47 (no connections at all)
Find articles with no or minimal connections.
MCP Approach:
Tool: SN-Query-Table
Parameters:
table_name: kb_knowledge
query: workflow_state=published^sys_idNOT IN<list_of_connected_article_ids>
fields: sys_id,number,short_description,kb_category,sys_view_count,rating,sys_created_on
limit: 100
=== ORPHANED ARTICLES ===
Articles with zero connections: 47
High-Impact Orphans (>100 views, still unlinked):
| Article | Title | Views | Category |
|------------|---------------------------------|-------|-----------------|
| KB0014523 | Outlook Calendar Sync Issues | 890 | Email |
| KB0014601 | Docker Container Best Practices | 456 | Dev Tools |
| KB0014789 | Expense Report Submission Guide | 1,234 | Finance |
Recommended Actions:
1. KB0014523 -> Link to KB0012290 (shares email/remote topic)
2. KB0014601 -> Link to KB0013201 (development environment setup)
3. KB0014789 -> Create new "Finance" topic cluster
Add discovered relationships to the knowledge graph.
MCP Approach:
Tool: SN-Create-Record
Parameters:
table_name: m2m_kb_to_kb
data:
from_kb: "<article_a_sys_id>"
to_kb: "<article_b_sys_id>"
relationship_type: "related"
REST Approach:
POST /api/now/table/m2m_kb_to_kb
Body: {
"from_kb": "<article_a_sys_id>",
"to_kb": "<article_b_sys_id>",
"relationship_type": "related"
}
Evaluate how well different topics are covered:
=== TOPIC COVERAGE ANALYSIS ===
| Topic Area | Articles | Avg Rating | Avg Views | Gaps Identified |
|---------------------|----------|------------|-----------|-----------------|
| VPN & Remote Access | 12 | 4.1 | 1,450 | Mobile VPN setup |
| Email & Calendar | 8 | 3.8 | 980 | Shared mailbox config |
| Laptop Setup | 15 | 4.3 | 2,100 | Linux support |
| Printer Setup | 6 | 3.2 | 560 | Wireless printing |
| Software Install | 22 | 3.9 | 1,800 | License requests |
| Security Policies | 5 | 4.0 | 780 | BYOD policies |
Under-served Topics (high incident volume, low article count):
1. Password Reset - 450 incidents/month, only 2 articles
2. MFA Setup - 280 incidents/month, only 1 article
3. File Sharing - 190 incidents/month, only 3 articles
Create ordered reading sequences using prerequisite relationships:
=== LEARNING PATH: VPN Administration ===
Level 1 - Foundations:
1. KB0012001 - VPN Client Installation (prerequisite for all)
2. KB0012310 - Remote Security Policy (prerequisite for all)
Level 2 - User Support:
3. KB0012345 - VPN Troubleshooting (depends on KB0012001)
4. KB0012290 - Network Drive Mapping (depends on KB0012001)
Level 3 - Advanced:
5. KB0012400 - VPN Split Tunnel Configuration (depends on KB0012345)
6. KB0012450 - VPN Server Administration (depends on KB0012001, KB0012310)
Estimated Total Reading Time: 45 minutes
Assessment Available: Yes (quiz after Level 2)
Export graph data in a format suitable for visualization tools:
MCP Approach:
Tool: SN-Query-Table
Parameters:
table_name: kb_knowledge
query: workflow_state=published
fields: sys_id,number,short_description,kb_category,sys_view_count
limit: 500
Output as a node-edge list for visualization:
{
"nodes": [
{"id": "KB0012001", "label": "VPN Installation", "group": "Network", "size": 1890},
{"id": "KB0012345", "label": "VPN Troubleshooting", "group": "Network", "size": 2340}
],
"edges": [
{"from": "KB0012001", "to": "KB0012345", "type": "prerequisite"},
{"from": "KB0012345", "to": "KB0012400", "type": "related"}
]
}
Set up ongoing graph health monitoring:
MCP Approach:
Tool: SN-Query-Table
Parameters:
table_name: kb_knowledge
query: workflow_state=published^sys_created_on>javascript:gs.daysAgo(30)
fields: sys_id,number,short_description,kb_category
limit: 50
For each new article, check if it has been connected to the graph. Flag unconnected new articles for relationship assignment.
| Tool | Purpose | When to Use | |------|---------|-------------| | SN-Query-Table | Fetch articles, categories, relationships, usage data | Primary data retrieval for graph construction | | SN-Get-Record | Retrieve single article details for content analysis | Deep-dive into specific nodes | | SN-Create-Record | Create new relationship records | Adding edges to the graph | | SN-Update-Record | Update article tags, topics, metadata | Enriching node properties | | SN-NL-Search | Find semantically related articles | Discovering implicit relationships |
| Issue | Cause | Resolution |
|-------|-------|------------|
| No m2m records found | Relationships not used in this instance | Check if m2m_kb_to_kb table exists; may need custom relationship table |
| Category hierarchy flat | Categories not structured with parent references | Build hierarchy using parent_id field on kb_category |
| Too many orphaned articles | Relationship management not part of publishing workflow | Add relationship check to article review process |
| Graph too dense | Every article linked to every other | Limit to meaningful relationships; use topic clustering instead |
| Learning path loops | Circular prerequisite chains | Validate graph is a DAG (directed acyclic graph) for prerequisites |
| Performance issues with large queries | Too many articles queried at once | Paginate queries using sysparm_offset and process in batches |
Input: "Analyze the IT Support knowledge base graph and identify disconnected clusters"
Steps: Retrieve all published articles and relationships, build adjacency list, run connected component analysis, identify isolated clusters, generate report with recommendations to bridge clusters.
Input: "Create a learning path for new IT support agents covering incident management"
Steps: Identify all articles in the Incident Management category, analyze prerequisite relationships, order by dependency depth, generate a sequential learning path with estimated reading times.
Input: "Find and create missing relationships for all VPN-related articles"
Steps: Query all articles with "VPN" in title or body, analyze inline references and shared tags, identify articles that reference each other but lack formal relationships, create m2m_kb_to_kb records for discovered connections.
knowledge/gap-analysis - Identify missing knowledge coverage areasknowledge/content-recommendation - Recommend articles based on graph proximityknowledge/duplicate-detection - Find redundant articles in the graphknowledge/kb-summarization - Summarize articles for graph node descriptionsknowledge/article-generation - Create articles to fill identified graph gapsknowledge/gap-grouping - Group knowledge gaps by topic clusterstesting
Manage supplier onboarding, qualification, performance monitoring, and offboarding with auditable lifecycle controls
tools
Identify emerging risks, prioritize intake signals, and route candidates into formal GRC risk assessment workflows
documentation
Screen inbound documents for completeness, policy risk, and routing readiness before extraction or case workflows
testing
Generate concise task summaries with status, timeline, blockers, SLA risk, and recommended next actions