Skip to main content
AI · concept deep-dives

Concept library

42 deep-dives across 8 categories. Each concept covers mental model, formal definition, concrete code example, common misconception, red flags if skipped, and primary citations (RFC / paper / vendor docs).

Foundations

0/8 authored
A1
Author me

Tokens & tokenization

The unit LLMs actually see — and how to count them before your bill hits.

A1
Author me

Context window

How much the model can 'see' at once — and what fills it silently.

A1
Author me

Temperature & sampling

Why the same prompt gives different outputs — and how to control randomness.

A1
Author me

Streaming responses

Why every good LLM UI streams — and the mechanics behind it.

A1
Author me

Chat Completions vs Responses APIs

The two API shapes and when each applies (OpenAI's 2024 API split, Anthropic Messages, Gemini generateContent).

A1
Author me

Rate limits — TPM, RPM, and 429s

How LLM providers meter you — and the client-side patterns that survive throttling.

A2
Author me

Transformer architecture (in 15 minutes)

Attention, KV cache, autoregressive decoding — the minimum theory for a builder.

A2
Author me

Embeddings — vectors that mean something

Why 'king - man + woman = queen' is real math — and how you use it in production.

Prompting

0/6 authored
A2
Author me

System prompts

Persona, constraints, output shape — the seat of the model's behavior.

A2
Author me

Zero-shot vs few-shot prompting

When examples earn their tokens — and when they poison your output.

A2
Author me

Chain-of-thought prompting

Wei et al. 2022 — the two-word trick that unlocked reasoning.

A2
Author me

Structured outputs & JSON mode

How production systems get exact-shape output every time.

A2
Author me

Function calling / tool use

The primitive that turns an LLM into an agent.

A2
Author me

Prompt versioning & A/B testing

Prompts are code — version, deploy, roll back, evaluate.

RAG

0/6 authored
A3
Author me

Chunking strategies

Fixed-size, semantic, hierarchical — the choice that makes or breaks retrieval.

A3
Author me

Vector search & approximate nearest neighbors

HNSW, IVF, ScaNN — the algorithms that make similarity search fast.

A3
Author me

Hybrid search (dense + sparse)

Why pure vector search fails — and how BM25 + embeddings + reciprocal rank fusion win.

A3
Author me

Reranking with cross-encoders

The second-pass model that turns 90% recall into 95% precision.

A3
Author me

RAG — the full pipeline

Ingest → chunk → embed → index → retrieve → generate. Every step defended.

A3
Author me

RAG evaluation (Ragas, faithfulness, answer relevance)

How to measure whether your RAG is actually working.

Agents

0/7 authored
A4
Author me

ReAct — Reasoning + Acting

Yao et al. 2022 — the loop that started the agent era.

A4
Author me

Tool schemas & registration

How LLMs discover and invoke tools — and what breaks.

A4
Author me

Agent memory — short-term, long-term, semantic

The memory layers a production agent actually uses.

A4
Author me

Reflexion — self-critique loops

Shinn et al. 2023 — how agents learn from their own mistakes.

A4
Author me

Planning & task decomposition

The step that separates a chatbot from an agent.

A4
Author me

Multi-agent orchestration

Orchestrator + workers, hierarchical, market-based patterns.

A4
Author me

Model Context Protocol (MCP)

Anthropic's 2024 standard for LLM ↔ tool interoperability.

Safety

0/5 authored
A5
Author me

Prompt injection & OWASP AI Top 10

The attack surface every LLM app has — and defense-in-depth.

A5
Author me

Data exfiltration via LLMs

When your prompt leaks your training data (or your customer data).

A5
Author me

Guardrails — input + output filtering

Constitutional AI, NeMo Guardrails, Llama Guard — the guardian layer.

A5
Author me

Hallucination detection

How to know when your model is confidently wrong.

A5
Author me

PII & data residency

GDPR, HIPAA, and the compliance edges of building on foundation models.

Cost & ops

0/5 authored
A5
Author me

LLM cost model — deriving $/query

The math to price your feature before you ship it.

A5
Author me

Prompt caching (Anthropic, OpenAI)

The 10x cost lever most teams never turn on.

A5
Author me

Batch API & async inference

50% discounts for non-real-time work.

A5
Author me

Model routing (cheap fallback → expensive escalation)

The router that saves your bill without hurting quality.

A5
Author me

LLM observability (traces, prompt logs, evals in prod)

You can't fix what you can't see — the tooling layer.

Multimodal

0/2 authored
A4
Author me

Multimodal inputs — image, audio, PDF

How production systems handle non-text inputs.

A4
Author me

Vision-language models (GPT-4o, Claude, Gemini vision)

The current state of the art in image reasoning.

Fine-tuning

0/3 authored
A5
Author me

Supervised fine-tuning (SFT)

When to fine-tune, and how much data you actually need.

A5
Author me

LoRA & QLoRA

The parameter-efficient techniques that make fine-tuning affordable.

A5
Author me

DPO, RLHF, and preference tuning

How the models you use were aligned — and what you can do downstream.