Skip to content
Back to skills

Exploring Knowledge Graph

ASecurity

Guidance for deep knowledge graph traversal across memories, entities, and relationships. Use when needing comprehensive context before planning, investigating connections between concepts, or answering "what do you know about X" questions.

  • 47 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added February 8, 2026
ai-agentsjavascriptgojavanode

Security analysis

A100/100

Scanned February 12, 2026

npx -y skills add rjmurillo/ai-agents --skill exploring-knowledge-graph --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Exploring Knowledge Graph?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Exploring Knowledge Graph
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/rjmurillo-exploring-knowledge-graph/badge)](https://www.skillsdirectory.com/skills/rjmurillo-exploring-knowledge-graph)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: exploring-knowledge-graph
description: Guidance for deep knowledge graph traversal across memories, entities, and relationships. Use when needing comprehensive context before planning, investigating connections between concepts, or answering "what do you know about X" questions.
license: MIT
metadata:
version: 1.0.0
model: claude-sonnet-4-5
---

# Exploring the Knowledge Graph

Forgetful stores knowledge as an interconnected graph: memories link to other memories, entities link to memories, and entities relate to each other. Deep exploration reveals context that simple queries miss.

## Triggers

| Trigger Phrase | Operation |
|----------------|-----------|
| `what do you know about X` | Full knowledge graph traversal |
| `how do I explore the knowledge graph` | Graph exploration workflow |
| `how are these concepts connected` | Entity relationship traversal |
| `give me comprehensive context on X` | Deep multi-phase exploration |
| `map out related knowledge for X` | Entity discovery and memory linking |

---

## When to Explore

Explore the knowledge graph when:

- Starting complex work that spans multiple topics
- User asks "what do you know about X"
- Planning requires understanding existing decisions/patterns
- Investigating how concepts connect across projects
- Need comprehensive context, not just top search results

## Exploration Phases

Track visited IDs to prevent cycles. Execute phases sequentially.

### Phase 1: Semantic Entry Point

```javascript
execute_forgetful_tool("query_memory", {
  "query": "<topic>",
  "query_context": "Exploring knowledge graph for comprehensive context",
  "k": 5,
  "include_links": true,
  "max_links_per_primary": 5
})
```

Collect: `primary_memories` + `linked_memories` (1-hop connections).

### Phase 2: Expand Memory Details

For key memories, get full details:

```javascript
execute_forgetful_tool("get_memory", {"memory_id": <id>})
```

Extract: `document_ids`, `code_artifact_ids`, `project_ids`, additional `linked_memory_ids`.

### Phase 3: Entity Discovery

Find entities in discovered projects:

```javascript
execute_forgetful_tool("list_entities", {
  "project_ids": [<discovered project ids>]
})
```

### Phase 4: Entity Relationships

For relevant entities, map relationship graph:

```javascript
execute_forgetful_tool("get_entity_relationships", {
  "entity_id": <id>,
  "direction": "both"
})
```

Relationship types: works_for, owns, manages, collaborates_with, etc.

### Phase 5: Entity-Linked Memories

For each entity, find all linked memories:

```javascript
execute_forgetful_tool("get_entity_memories", {
  "entity_id": <id>
})
```

Returns `{"memory_ids": [...], "count": N}`. Fetch any new memories not already visited.

## Presenting Results

Group findings by type:

**Memories**: Primary (direct matches) → Linked (1-hop) → Entity-linked (via entities)

**Entities**: Name, type, relationship count, linked memory count

**Artifacts**: Documents and code snippets found via memory links

**Graph Summary**: Total nodes, key themes, suggested follow-up queries

## Depth Control

- **Shallow** (phases 1-2): Quick context, ~5-15 memories
- **Medium** (phases 1-4): Include entities and relationships
- **Deep** (all phases): Full graph traversal, comprehensive context

Match depth to task complexity. Start shallow, go deeper if context insufficient.

## When to Use

Use this skill when:

- Starting complex work spanning multiple topics
- User asks "what do you know about X"
- Planning requires understanding existing decisions and patterns
- Investigating how concepts connect across projects

Use [using-forgetful-memory](../using-forgetful-memory/SKILL.md) instead when:

- Creating or querying individual memories
- Simple semantic search is sufficient

Use [curating-memories](../curating-memories/SKILL.md) instead when:

- Updating, obsoleting, or linking specific memories
- Cleaning up duplicate or stale content

---

## Anti-Patterns

| Avoid | Why | Instead |
|-------|-----|---------|
| Running all 5 phases for simple queries | Wastes tokens on unnecessary traversal | Start shallow (phases 1-2), go deeper only if needed |
| Not tracking visited IDs | Causes infinite cycles in graph traversal | Maintain a visited set, skip already-seen nodes |
| Expanding every linked memory | Exponential blowup on dense graphs | Focus on high-importance memories (7+) |
| Skipping entity phases when entities exist | Misses cross-project connections | Check for entities in Phase 3 before skipping |
| Presenting raw results without grouping | Overwhelming and unstructured | Group by type: memories, entities, artifacts |

---

## Verification

After graph exploration:

- [ ] Entry point query returned relevant results
- [ ] No cycles encountered (visited IDs tracked)
- [ ] Depth matched task complexity (shallow/medium/deep)
- [ ] Results grouped by type for readability
- [ ] Follow-up queries identified if context was insufficient

---

## Efficiency Tips

- Check `truncated` flag from query_memory (8000 token budget)
- Skip Phase 3-5 if no entities exist in discovered projects
- Use `project_ids` filter to scope exploration
- Stop expanding when hitting diminishing returns

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…