Knowledge Graph Architecture
Platform-Agnostic Knowledge Management System
This document describes the core architectural concepts behind the knowledge graph system.
Core Concept: The Four-Pillar Memoryβ
The knowledge graph uses four complementary knowledge systems, each optimized for different purposes:
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β FOUR-PILLAR MEMORY β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β β
β ββββββββββββββββββββ ββββββββββββββββββββ β
β β Lessons Learned β β ADRs β β
β β (Deep Dive) β β (Formal) β β
β β β β β β
β β β’ Problem β β β’ Context β β
β β β’ Root Cause β β β’ Options β β
β β β’ Solution β β β’ Decision β β
β β β’ Replication β β β’ Consequences β β
β β β’ Lessons β β β β
β β β β β β
β β 5-10 min read β β 3-5 min read β β
β ββββββββββββββββββββ ββββββββββββββββββββ β
β β
β ββββββββββββββββββββ ββββββββββββββββββββ β
β β Knowledge Graph β βSession Summaries β β
β β (Quick Ref) β β (Historical) β β
β β β β β β
β β β’ Patterns β β β’ Overview β β
β β β’ Concepts β β β’ Built β β
β β β’ Gotchas β β β’ Decided β β
β β β β β’ Learned β β
β β 5-10 sec scan β β β’ Next β β
β β β β β β
β β Links to lessons β β 2-3 min scan β β
β ββββββββββββββββββββ ββββββββββββββββββββ β
β β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
The LEVERAGE Principleβ
Knowledge Graph and Lessons Learned work together:
-
KG = Quick Reference (5-10 seconds)
- Scan while working
- Quick answer to "what is this?"
- Links to deeper dive
-
Lessons = Deep Dive (5-10 minutes)
- Read when needed
- Full context and rationale
- Replication steps
Bidirectional relationship:
- KG links to detailed lessons ("see lesson for full context")
- Lessons extract to KG entries ("key insights for quick reference")
- Start with KG, drill into Lessons as needed
Information Flowβ
βββββββββββββββ
β WORK β
β (Problems, β
β Decisions, β
β Learning) β
ββββββββ¬βββββββ
β
βΌ
βββββββββββββββββββββββ
β CAPTURE β
β β
β β’ Lesson Learned β β Detailed problem-solving journey
β β’ ADR β β Formal architectural decision
β β’ Session Summary β β Work session snapshot
ββββββββ¬βββββββββββββββ
β
β (Extract key insights)
βΌ
βββββββββββββββββββββββ
β KNOWLEDGE GRAPH β
β β
β β’ Pattern β β Extracted from lesson
β β’ Concept β β Distilled from ADR
β β’ Gotcha β β Common pitfall documented
ββββββββ¬βββββββββββββββ
β
β (Bidirectional sync)
βΌ
βββββββββββββββββββββββ
β PROJECT MEMORY β
β β
β β’ MEMORY.md β β Platform persistent context
β β’ Git metadata β β Commits, branches, issues
βββββββββββββββββββββββ
Capture β Extract β Syncβ
- Capture: Document problem-solving in Lessons Learned or ADRs
- Extract: Pull key insights into Knowledge Graph for quick reference
- Sync: Update project memory (MEMORY.md) with new knowledge
Automation: The /kmgraph:kmg-sync-all command orchestrates this entire flow.
Directory Structureβ
project/
βββ docs/
β βββ lessons-learned/ # PILLAR 1: Detailed narratives
β β βββ architecture/ # System design lessons
β β βββ debugging/ # Troubleshooting journeys
β β βββ process/ # Workflow improvements
β β βββ patterns/ # Design pattern discoveries
β β
β βββ decisions/ # PILLAR 2: Formal ADRs
β β βββ ADR-001.md # Numbered decisions
β β βββ ADR-002.md
β β βββ ...
β β
β βββ knowledge/ # PILLAR 3: Quick reference
β β βββ patterns.md # Design patterns catalog
β β βββ concepts.md # Core concepts definitions
β β βββ gotchas.md # Common pitfalls
β β
β βββ sessions/ # PILLAR 4: Historical snapshots
β βββ 2024-12/
β βββ session-001.md
β βββ session-002.md
β
βββ MEMORY.md # Platform persistent context
Why This Structure?β
Separation by purpose:
- Lessons: "How we solved X" (narrative, chronological)
- ADRs: "Why we chose Y" (decision rationale, formal)
- Knowledge Graph: "Quick facts about Z" (reference, timeless)
- Sessions: "What happened when" (snapshots, historical)
Different longevity:
- Lessons & ADRs: Permanent (referenced years later)
- Knowledge Graph: Evolving (updated as understanding improves)
- Sessions: Historical (snapshot, not updated)
Knowledge Capture Workflowβ
Manual (No Automation)β
# 1. Copy template
cp core/default-templates/lessons-learned/lesson-template.md \
knowledge/lessons-learned/process/my-lesson.md
# 2. Fill in sections
vim knowledge/lessons-learned/process/my-lesson.md
# 3. Update category README
vim knowledge/lessons-learned/process/README.md
# Add link to my-lesson.md
# 4. Extract to knowledge graph (manual)
vim knowledge/concepts/patterns.md
# Add pattern extracted from lesson
# 5. Commit
git add docs/
git commit -m "docs: add lesson on my-topic"