---
description: Knowledge Graphs
alwaysApply: false
---

# Knowledge Graphs

Rules for constructing, maintaining, and querying the knowledge graph connecting concepts, sources, and notes.

## Triple Structure

Every relationship follows Subject-Predicate-Object. Both entities must exist as nodes before creating an edge. Every edge must have a labeled predicate.

## Relationship Types

| Relationship | Use When |
|-------------|----------|
| `supports` | Evidence reinforces a claim |
| `contradicts` | Opposing evidence or argument |
| `extends` | Incremental development of an idea |
| `instance_of` | Specific example of a general concept |
| `part_of` | Component within a larger structure |
| `causes` | Causal relationship |
| `analogous_to` | Structural similarity across domains |
| `supersedes` | Updated understanding replaces old one |
| `depends_on` | Prerequisite relationship |
| `derived_from` | Intellectual lineage |

## Node Types

Concept, Source (bibliographic record), Note (permanent note), Person, Claim (specific assertion), Question (open question for exploration).

## Construction Process

1. **Extract entities** from each new note or document
2. **Identify relationships** — explicit, implicit, cross-document
3. **Validate** — Check contradictions, verify directionality, disambiguate
4. **Merge** — Deduplicate entities, resolve synonyms, reconcile conflicts
5. **Assign confidence** — Score uncertain connections (0.0-1.0)

## Graph Health Targets

| Metric | Healthy Range |
|--------|--------------|
| Orphan nodes | < 5% of total |
| Average node degree | 3-8 edges |
| Largest connected component | > 80% of nodes |
| Average path length | < 5 hops |

## Maintenance

- **Daily:** New nodes/edges as notes are created
- **Weekly:** Review orphans, merge duplicates
- **Monthly:** Recompute centrality, prune dead edges
- **Quarterly:** Archive superseded relationships, audit low-confidence edges

## Rules

- Never create an edge without a labeled predicate
- Flag edges with confidence below 0.5 for human review
- When sources contradict, create explicit `contradicts` edges on both sides
- Superseded nodes are archived, not deleted; always link to successor
- Entity disambiguation takes priority: two nodes for the same concept is worse than a missing edge
