# Knowledge Base Graph

Turns an LLM wiki knowledge base into an entity and topic knowledge graph.

- Repository: https://github.com/Egonex-AI/Understand-Anything (89616 stars)
- Category: Data and ML
- License: MIT
- Last updated: 2026-10-26
- Runs scripts: yes, review before use

## Install

Claude Code: `npx skills add Egonex-AI/Understand-Anything --skill understand-knowledge -g -a claude-code -y`
Codex: `npx skills add Egonex-AI/Understand-Anything --skill understand-knowledge -g -a codex -y`
Cursor: `npx skills add Egonex-AI/Understand-Anything --skill understand-knowledge -g -a cursor -y`
Gemini CLI: `npx skills add Egonex-AI/Understand-Anything --skill understand-knowledge -g -a gemini-cli -y`
Claude Code plugin marketplace: `/plugin marketplace add Egonex-AI/Understand-Anything`

## Description

Analyze a Karpathy-pattern LLM wiki knowledge base and generate an interactive knowledge graph with entity extraction, implicit relationships, and topic clustering.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# /understand-knowledge

Analyzes a Karpathy-pattern LLM wiki, a three-layer knowledge base with raw sources, wiki markdown, and a schema file, and produces an interactive knowledge graph dashboard.

## What It Detects

The **Karpathy LLM wiki pattern** (see https://gist.github.com/karpathy/442a6bf555914893e9891c11519de94f):
- **Raw sources**, immutable source documents (articles, papers, data files)
- **Wiki**, LLM-generated markdown files with wikilinks (`[[target]]` syntax)
- **Schema**, CLAUDE.md, AGENTS.md, or similar configuration file
- **index.md**, content catalog organized by categories
- **log.md**, chronological operation log

Detection signals: has `index.md` + multiple `.md` files with wikilinks. May have `raw/` directory and schema file.

## Instructions

### Phase 1: DETECT

1. Determine the target directory:
   - If the user provided a path argument, use that
   - Otherwise, use the current working directory
   - **Resolve the data directory `$UA_DIR`** once, and reuse it for every read and write below: `UA_DIR="<TARGET_DIR>/$([ -d "<TARGET_DIR>/.understand-anything" ] && echo .understand-anything || echo .ua)"`, this selects the legacy `.understand-anything/` when it already exists, otherwise the new `.ua/`.

2. Run the format detection script bundled with this skill:
   ```
   python3 "<SKILL_DIR>/parse-knowledge-base.py" "<TARGET_DIR>"
   ```
   - If the script exits with an error, tell the user this doesn't appear to be a Karpathy-pattern wiki and explain what was expected
   - If successful, proceed. The script writes `scan-manifest.json` to `$UA_DIR/intermediate/`

3. Read the scan-manifest.json and announce the results:
   - "Detected Karpathy wiki: N articles, N sources, N topics, N wikilinks (N unresolved)"
   - List the categories found from index.md

### Phase 2: SCAN (already done)

The rest: https://github.com/Egonex-AI/Understand-Anything/blob/HEAD/understand-anything-plugin/skills/understand-knowledge/SKILL.md
