Documentation

LLM & Generative AI documentation

A reference for every concept, technique, and tool you need to build with modern AI — from first principles to the LangChain, LangSmith, and LlamaIndex ecosystem.

Core concepts

The foundational topics that power every modern LLM and Gen AI application.

AI & ML Fundamentals

The building blocks: data, models, training, inference, and the relationship between AI, ML, neural networks, and deep learning.

  • Supervised, unsupervised, self-supervised, and reinforcement learning
  • Neural networks: layers, weights, activations, backpropagation
  • Training loop, loss functions, overfitting vs generalization
  • Why scale (data + compute + parameters) unlocked modern AI

Large Language Models (LLMs)

Transformer-based models trained on massive text corpora to predict the next token. The engine behind ChatGPT, Claude, Gemini, and Llama.

  • Tokens, embeddings, attention, and the transformer block
  • Pre-training, supervised fine-tuning (SFT), and RLHF
  • Context windows, temperature, top-p, and decoding strategies
  • Open vs closed models: GPT, Claude, Gemini, Llama, Mistral

Generative AI

Models that create new content — text, images, audio, video, and code — by learning the distribution of training data.

  • Text generation with LLMs
  • Image generation with diffusion models (Stable Diffusion, DALL·E, Imagen)
  • Speech and music synthesis
  • Multimodal models that combine text, vision, and audio

Prompt Engineering

The craft of writing inputs that steer LLMs toward useful, reliable outputs.

  • Zero-shot, few-shot, and chain-of-thought prompting
  • System vs user messages and role prompting
  • Structured output with JSON schemas and function calling
  • Iterating with evals instead of vibes

Retrieval-Augmented Generation (RAG)

Ground LLM responses in your own data by retrieving relevant chunks at query time and feeding them into the prompt.

  • Chunking strategies and embedding models
  • Vector databases: pgvector, Pinecone, Weaviate, Qdrant
  • Hybrid search (semantic + keyword) and re-ranking
  • Citations, evaluation, and reducing hallucinations

Agents & Tool Use

LLMs that plan, call tools, and act in loops to accomplish multi-step goals.

  • Function/tool calling and structured arguments
  • ReAct, Plan-and-Execute, and reflection patterns
  • Memory: short-term scratchpads and long-term stores
  • Multi-agent orchestration and human-in-the-loop

Evaluation & Safety

How to measure quality and ship LLM apps responsibly.

  • Offline evals: golden sets, LLM-as-judge, rubric scoring
  • Online metrics: thumbs, task completion, latency, cost
  • Guardrails: PII redaction, jailbreak defense, content filters
  • Bias, fairness, and red-teaming

Frameworks & tooling

The libraries most teams reach for when building production LLM applications.

LangChain

An open-source framework for building applications with LLMs by composing models, prompts, retrievers, tools, and agents into runnable chains.

  • LCEL (LangChain Expression Language) — pipe components with `|` into runnable graphs
  • Standard interfaces for chat models, embeddings, vector stores, retrievers, and tools
  • Built-in agents (ReAct, tool-calling) and prebuilt RAG pipelines
  • LangGraph for stateful, cyclical, multi-actor agent workflows
  • Available in Python and JavaScript/TypeScript

LangSmith

A hosted observability, evaluation, and prompt-management platform for LLM applications (works with LangChain or any framework).

  • Tracing: full inputs, outputs, token usage, latency, and cost for every LLM/tool call
  • Datasets and evals: build golden sets, run LLM-as-judge and custom evaluators
  • Prompt Hub: version, diff, and collaborate on prompts
  • Online monitoring with feedback, alerts, and regression detection
  • Drop-in: set `LANGSMITH_API_KEY` and traces flow automatically

LlamaIndex

A data framework focused on connecting LLMs to your private data — the most opinionated toolkit for production RAG and knowledge agents.

  • 150+ data loaders via LlamaHub (PDFs, Notion, Slack, SQL, S3, web, …)
  • Indexes: vector, summary, knowledge-graph, and composable sub-indices
  • Query engines with routing, sub-question decomposition, and re-ranking
  • Agents and workflows for tool use over your indexed data
  • LlamaParse for high-fidelity parsing of complex PDFs and tables

Projects

Applied ML/AI case studies that show how the concepts come together end-to-end.

Fraud Detection

An end-to-end ML project for detecting fraudulent transactions in highly imbalanced data — covering modeling approach, evaluation, and feature design.

  • Supervised learning, leakage, validation — frame fraud as a binary classification problem with labeled historical transactions; prevent target leakage by only using features available at decision time, and validate with time-based (out-of-time) splits rather than random k-fold to mimic production drift.
  • PR-AUC, resampling, cost-sensitive learning — fraud is <1% of traffic, so accuracy and ROC-AUC are misleading; optimize PR-AUC (precision-recall) and tune thresholds against business cost. Handle imbalance with SMOTE / under-sampling the majority class, or with cost-sensitive learning via class_weight='balanced' and custom loss weighting.
  • Behavioral, velocity, categorical features — engineer signals like spend deviation from a user's baseline, device/IP history, and merchant risk (behavioral); transaction counts and amounts over rolling 1m/1h/24h windows per card, user, or device (velocity); and high-cardinality categoricals (MCC, country, BIN) encoded with target/frequency encoding or embeddings.
  • Models: logistic regression baseline, gradient-boosted trees (XGBoost / LightGBM) for tabular performance, isolation forest / autoencoders for unsupervised anomaly scoring as a complementary signal.
  • Deployment: low-latency scoring (<100ms), shadow mode rollout, monitoring of score drift, precision@k, and chargeback feedback loop for continuous retraining.

Keep exploring

Dive deeper into any topic in the full curriculum, or jump to the glossary for quick definitions.

11 sections · Updated continuously