# AI Engineering Handbook

A practical book on building with large language models. LLMs, prompting, tools, embeddings, RAG, agents, reasoning, memory, safety, evaluation, MCP and production, each linked to working AgenticMind nodes.

Source: https://glamorous-boar.cloudvent.net/learn/

---

This handbook teaches **AI engineering**: the craft of building reliable software systems around large language models. It assumes you can program a little and know nothing about machine learning. Each chapter explains the ideas from first principles, shows the trade-offs, and ends with **Try it in AgenticMind**: the nodes and templates that implement the idea, so you can run it within minutes.

## What AI engineering is

Machine learning engineering trains models. **AI engineering builds products on top of models someone else trained.** The model is a powerful but unreliable component: it is non-deterministic, it can be wrong with confidence, it knows nothing after its training cut-off, it cannot see your data unless you give it, and it costs money and time per call. AI engineering is the set of techniques that turn that component into a system people can trust:

- **Context**: give the model the right information (prompting, retrieval, memory).
- **Action**: let it do things (tools, function calling, agents).
- **Thinking**: help it reason better (reasoning strategies, reflection, multiple agents).
- **Control**: keep it safe and bounded (guardrails, limits, human approval, sandboxes).
- **Measurement**: know whether it works (evaluation, tracing, observability).
- **Operation**: run it in production (durability, streaming, cost, latency, deployment).

## Chapters

| # | Chapter | You will learn |
|---|---|---|
| 1 | [LLM fundamentals](/learn/llm-fundamentals/) | Tokens, context windows, sampling, temperature, reasoning models, cost and latency |
| 2 | [Prompt engineering](/learn/prompt-engineering/) | System prompts, few-shot examples, delimiters, output formats, prompt templates |
| 3 | [Tools and structured output](/learn/structured-output-and-tools/) | Function calling, JSON Schema, structured outputs, forced tool calls |
| 4 | [Embeddings and vector search](/learn/embeddings-and-vector-search/) | Embeddings, cosine similarity, vector databases, ANN and HNSW |
| 5 | [Retrieval-augmented generation](/learn/rag/) | The RAG pipeline, chunking, context building, citations, hallucination |
| 6 | [Advanced retrieval](/learn/advanced-retrieval/) | BM25, hybrid search, RRF, reranking, query rewriting, compression, parent-child |
| 7 | [Agents](/learn/agents/) | The agent loop, ReAct, plan-and-execute, tool design, limits |
| 8 | [Multi-agent systems](/learn/multi-agent-systems/) | Supervisors, handoffs, orchestrator-workers, critics, debate |
| 9 | [Reasoning strategies](/learn/reasoning-strategies/) | CoT, self-consistency, ToT, GoT, MCTS, Reflexion, self-refine and more |
| 10 | [Memory](/learn/memory/) | Short-term vs long-term memory, recall, consent and privacy |
| 11 | [Guardrails and safety](/learn/guardrails-and-safety/) | Prompt injection, jailbreaks, PII, output validation, defence in depth |
| 12 | [Evaluating AI systems](/learn/evaluation/) | Test sets, retrieval and generation metrics, LLM-as-judge, regression testing |
| 13 | [The Model Context Protocol](/learn/mcp/) | Why MCP exists, clients, servers, transports, security |
| 14 | [Production AI systems](/learn/production-ai-systems/) | Workflows vs agents, durability, HITL, streaming, observability, cost, deployment |
| — | [Glossary](/learn/glossary/) | Every term, A to Z |

## Reading paths

- **Two-hour crash course:** chapters 1, 2, 5, 7, 12 and the glossary.
- **Building a RAG product:** 1 → 4 → 5 → 6 → 12 → 14.
- **Building agents:** 1 → 3 → 7 → 8 → 9 → 11 → 14.
- **Preparing a talk or interview:** the glossary, then the *Key takeaways* box at the end of each chapter, then the [Presentation FAQ](/faq/).

## How the chapters map to AgenticMind

<Diagram caption="Each layer of an AI system and where it lives in AgenticMind.">

```
flowchart TB
  A[Inputs & triggers] --> B[Guardrails: Input Guard]
  B --> C[Context: Retrieval, Memory, Prompt templates]
  C --> D[Model: LLM, Model Router, Reasoning]
  D <--> E[Action: Agent, Tools, MCP, Code sandbox]
  D --> F[Guardrails: Output Guard]
  F --> G[Human Approval]
  G --> H[Outputs, Export, Deploy]
  D -.-> I[Traces, Evaluation, Observability]
  E -.-> I
```

</Diagram>

Every concept in this book has a node or a feature you can poke at. That is the point: AI engineering is learned by building, breaking and measuring.
