← Knowledge Trees · Nestor G Pestelos Jr
LLM System Design Knowledge Tree
Prerequisite curriculum: token mechanics, context pipelines, RAG graphs, gateways, resilience, and evaluation.
Target Capability
Architect production-grade LLM applications: select models along the 4-tier capability spectrum, construct deterministic context pipelines, integrate hybrid vector/graph RAG retrieval, deploy resilient reverse-proxy gateways with tiered fallbacks, and validate systems with automated LLM-as-a-judge evals.
Phase 1 — Fundamental Units & Model Selection 3 / 3 Mastered
Tokens & Dense Vector Embeddings
Test: Explain subword tokenization; demonstrate why embeddings cluster by conceptual meaning rather than string equality using cosine distance.
Inspect Evidence & Links
The Four-Tier Model Selection Spectrum
Test: Route four distinct production workloads (planning, coding, triage, local privacy) to Frontier, Workhorse, Flash, and SLM tiers with cost-latency justification.
Inspect Evidence & Links
Multimodal Processing Tiers
Test: Classify text, vision, audio, and structured data pipelines into token cost and latency implications.
Inspect Evidence
Phase 2 — Context Engineering & Prompts 3 / 3 Mastered
Four-Part Structured Prompt Framework
Test: Construct a deterministic system prompt partitioned into Identity/Role, Task/Context, Safety/Constraints, and Output Schema.
Inspect Evidence
Context Overflow & Memory Hierarchy
Test: Design a memory hierarchy (Working Turn Buffer → Episodic Logs → Semantic Notes) that prevents "Lost in the Middle" degradation.
Inspect Evidence
Context Engineering as a Data Pipeline
Test: Implement prompt compression, token-budget enforcement, and dynamic data packing before model invocation.
Inspect Evidence
Phase 3 — Code Understanding & Hybrid RAG 3 Mastered, 1 Frontier
AST Chunk Boundaries
Test: Contrast fixed-character chunking with Abstract Syntax Tree (AST) class/function chunk boundaries for codebases.
Inspect Evidence & Links
Vector Retrieval vs. Redundant Similarity
Test: Explain why naive top-K cosine similarity returns redundant chunks, and implement Maximal Marginal Relevance (MMR).
Inspect Evidence
GraphRAG & Relational Queries
Test: Combine knowledge-graph entity traversal with vector similarity to resolve multi-hop dependency questions.
Inspect Evidence & Links
RAG Ingestion Pipelines
Test: Design an end-to-end document parsing, deduplicating, embedding, and tenant-isolated ingestion pipeline.
Phase 4 — Production Architectural Patterns Locked
The LLM Gateway Pattern
Test: Build a reverse-proxy gateway abstracting vendor SDKs, normalizing schemas, and injecting tracing headers.
Circuit Breakers & Tiered Fallbacks
Test: Wire automated failover from primary to secondary LLM endpoints when error rates exceed threshold.
Three-Level LLM Caching
Test: Implement exact-match hash cache and semantic embedding cache with collision prevention.
Phase 5 — Evaluation, Security & Safety Locked
LLM-as-a-Judge Golden Set Benchmarking
Test: Construct a golden dataset and automated evaluation harness scored by a rubric-constrained judge model.
Firewall LLM & Plan-Approve-Execute Gating
Test: Implement pre-call intent filtering and separate execution policy from generation logic.