Reference · 14 parts · 63 sections
All necessary topics related to AI Engineering
A dense, citation-backed reference for the fundamentals every applied AI engineer needs — from tokens and tool use to retrieval, context, and agent loops. Each topic ships in three voices: the engineer's version (with code and diagrams), the layman's version (plain English with analogies), and বাংলা ব্যাখ্যা.
Contents
LLM Fundamentals
from an engineer's lens
Tokens, tokenization & context cost, Model families & trade-offs, Closed vs open-weight models, Sampling parameters, Streaming vs non-streaming, Structured outputs & JSON mode, Function calling & tool use, Multimodal inputs (vision, audio, PDFs), Embedding models & reranker models, Reasoning models & extended thinking
Prompt Engineering
System vs User vs Assistant message design, Few-shot, role prompting & personas, Chain-of-thought, ReAct & reflection patterns, XML / Markdown structuring for reliable parsing, Prompt templating & variable injection, Prompt versioning — prompts as code, Output parsers & graceful failure handling, Prompt injection defense at the prompt layer
Context Engineering
the new "prompt engineering"
Context window budgeting, Conversation summarization & rolling memory, Prompt caching strategies, Hierarchical memory, Context compression & pruning, Tool result truncation strategies, Lost in the Middle & mitigation
RAG and Knowledge Systems
Chunking strategies: fixed, semantic, structural, late chunking, Vector databases: Qdrant, Pinecone, Weaviate, pgvector, Chroma, Milvus, Hybrid search (BM25 + vector) & reciprocal rank fusion, Query rewriting, expansion & HyDE, Multi-hop retrieval & agentic retrieval, Reranking: Cohere, BGE, Voyage, Metadata filtering & structured retrieval, GraphRAG & knowledge-graph augmentation, Document parsing pipelines: Unstructured, LlamaParse, Docling, Multimodal RAG: images, tables, charts
Agents and Agentic Systems
What an agent actually is, The four canonical agent loops, Single-agent vs multi-agent orchestration, State machines and workflow graphs, Agent memory: scratchpad, semantic, procedural, Human-in-the-loop checkpoints, Subagents and delegation patterns, Error recovery, retries, and self-correction, Long-running agents and durable execution, Browser and computer-use agents
Tool Use and Integrations
Tool/function schema design, Parallel tool calling, Model Context Protocol (MCP), Sandboxed code execution, API wrappers as tools, Tool result formatting for LLM consumption
Inference
API-based vs self-hosted inference, Inference servers, Quantization: GGUF, AWQ, GPTQ, INT4/INT8, KV cache, prefix caching, speculative decoding, Continuous batching and throughput tuning, Latency vs throughput (TTFT, TPS), GPU economics, edge inference, on-device models, Inference providers
LLMOps and Observability
Tracing, Token, cost, and latency tracking, Prompt and agent versioning, A/B testing prompts and models in production, Replay and debugging, Drift detection (silent behaviour changes), Feedback loops
Evaluation Engineering
Offline evals: golden datasets, regression tests, LLM-as-judge, RAG metrics: faithfulness, answer relevance, context precision/recall, Agent evals: task success, trajectory, tool-call accuracy, Synthetic data generation for evals, Frameworks, Online evals on production traffic, Red teaming and adversarial testing
Cost and Performance Optimization
Model cascading (cheap → expensive routing), Caching: semantic, output, prompt, Batch APIs for non-real-time workloads, Distillation (small model from big), Prompt compression (LLMLingua-style), Token budgeting per feature, Model gateways: LiteLLM, Portkey, OpenRouter
Safety, Security, and Guardrails
Prompt injection (direct and indirect), Jailbreak resistance, Data exfiltration via tool calls and rendered links, Content moderation, Guardrail frameworks: NeMo Guardrails, Guardrails AI, PII redaction in inputs and outputs, Rate limiting and abuse prevention, Output validation against schemas, Audit logging for compliance
Multimodal Engineering
Vision: image understanding, OCR-via-LLM, document AI, Voice agents: STT, TTS, realtime APIs, Image generation, Video generation, ComfyUI, Replicate, Fal for media pipelines
AI Application Architecture
Streaming over SSE / WebSockets / HTTP chunked, Background jobs and queues for long agent runs, Idempotency and resumability, Multi-tenant prompt and key management, Fallback chains across providers, Feature flags for prompts and models, API design patterns for AI features
Visual Learning Resources
ten interactive guides that show how AI works
Transformer Explainer: watch a model predict the next token, LLM Visualization: a 3D tour inside a GPT, 3Blue1Brown: neural networks and transformers, animated, The Illustrated Transformer: Q, K and V, explained with pictures, TensorFlow Playground: train a tiny network and break it, A Visual Guide to Attention Variants: MHA, GQA, MLA, sliding window and more, A Visual Guide to Mixture of Experts: routers, experts and load balancing, LLM Inference Handbook: from prompt to first token and beyond, Neuronpedia: look at what features inside a model mean, Embedding Atlas by Apple: a visual map of your embeddings