# Knowledge Base Framework

General-purpose knowledge accumulation for any domain. No upfront taxonomy required — structure emerges from use.

## Quick Start

```bash
# Deploy the framework
aiwg use knowledge-base

# Ingest a source (URL, file, or freeform note)
/kb-ingest "https://example.com/article"
/kb-ingest ./my-notes.md --topic "machine learning"
/kb-ingest "Feynman Technique: explain concepts as if teaching a child"

# Check knowledge base health
/kb-health

# Check health for a specific subtree
/kb-health --path .aiwg/kb/entities/
```

## What This Is

The Knowledge Base framework is an **LLM-assisted wiki** for personal knowledge management. It handles:

- Ingesting sources (articles, books, videos, notes, conversations)
- Creating and updating entity and concept pages
- Finding gaps, orphan pages, and stale content
- Building cross-references between related topics

It differs from `research-complete` in scope and intent:

| Dimension | knowledge-base | research-complete |
|-----------|---------------|-------------------|
| Domain | Any (open-ended) | Academic / formal research |
| Citation management | Optional, informal | Required (GRADE, DOIs) |
| Structure | Emergent | Predefined taxonomy |
| Quality scoring | Not enforced | GRADE A–D mandatory |
| Primary use | Personal wikis, hobby deep-dives, competitive intel | Literature reviews, academic synthesis |

## Directory Structure

Knowledge base pages live in `.aiwg/kb/` and organize themselves as content grows:

```
.aiwg/kb/
├── entities/        # Discrete things: people, tools, companies, places
├── concepts/        # Ideas, techniques, frameworks, phenomena
├── sources/         # Summaries of articles, books, videos, podcasts
├── comparisons/     # Side-by-side analysis of multiple entities or concepts
├── syntheses/       # Cross-cutting notes that connect multiple topics
└── index.md         # Auto-maintained index (regenerated by /kb-health)
```

There is no required taxonomy — create subdirectories as needed (e.g., `entities/people/`, `concepts/ml/`). The health skill finds orphans and broken links regardless of nesting depth.

## Templates

| Template | Use for |
|----------|---------|
| `entity-page.md` | A person, company, tool, place, or other discrete thing |
| `concept-page.md` | An idea, technique, pattern, or framework |
| `source-summary.md` | An article, book, video, podcast, or document |
| `comparison-table.md` | Comparing two or more entities or concepts |
| `synthesis-note.md` | A cross-cutting insight connecting multiple topics |

## Skills

| Skill | Trigger |
|-------|---------|
| `kb-ingest` | "ingest this", "add to KB", `/kb-ingest <source>` |
| `kb-health` | "check KB health", "find orphan pages", `/kb-health` |

## Install

```bash
aiwg use knowledge-base
```
