Overview
Agentic AI Engineering
The conceptual core of agent design, for Principal & Staff Engineers (L6/L7)
This book assumes the substrate from AI & LLM Foundations — read that first. If this were a book, this page is the table of contents. It is organized as a learning journey — every Part builds on the previous one, from what makes a system “agentic” through cognitive architecture, memory, tools, reasoning algorithms, and retrieval and context engineering. Each chapter links out to the framework, platform, and SRE notes that already exist elsewhere in this wiki instead of duplicating them. Unwritten chapters are listed as stub rows, not empty files.
Parts
00 — Introduction to Agentic AI
Where “LLM application” becomes “agent.” The deep architectural treatment of the loop this Part introduces conceptually lives in Agent Architecture (Part 00 of Building & Evaluating Agents) — read that alongside this Part’s framing chapters.
- Chapter 1. What is Agentic AI? — What makes a system ‘agentic’ rather than a chatbot or a script, the recurring design patterns, real-world use cases, and the engineering mindset this book assumes.
- Chapter 2. Agent vs Workflow vs Automation — Draws the architectural line between a fixed automation script, a deterministic workflow/DAG, and a true agent with dynamic control flow.
- Chapter 3. Characteristics of Intelligent Agents — Defines the properties that qualify a system as agentic — autonomy, goal-directedness, environment perception, and adaptive planning.
- Chapter 4. Agent Lifecycle — Covers an agent’s full lifecycle from initialization through the perceive-plan-act-reflect loop to termination or handoff.
- Chapter 5. Agent Taxonomy — Classifies agent architectures — reactive, deliberative, hybrid, and multi-agent — and maps each to production use cases and reliability tradeoffs.
- Chapter 6. Agent Design Principles — When a deterministic system beats an agentic one, how to choose and scope tools, prompt engineering, error handling, guardrails, and security considerations that apply before any code is written.
- Chapter 7. When NOT to Build an Agent — Covers the decision criteria for rejecting an agentic architecture in favor of a simpler deterministic pipeline.
- Chapter 8. AI Agent Use Cases — Surveys production-proven agent use cases and the common architectural shape each one shares underneath the domain-specific framing.
- Chapter 9. Enterprise Adoption Patterns — Covers how enterprises roll out agentic systems safely — human-in-the-loop gating, phased autonomy levels, audit logging, and governance structures.
01 — Agent Cognition
The cognitive loop underneath every agent architecture. See 3-references/AI/agent-harness-demo.md
for a working context-injection harness that implements a version of this loop end to end.
- Chapter 1. Perception — Covers how an agent ingests and represents its environment — structured tool outputs, unstructured text, multimodal inputs.
- Chapter 2. Decision Making — Covers the decision-making layer that selects the next action from the perceived state, and how confidence and risk thresholds shape when an agent should act versus escalate.
- Chapter 3. Planning — Covers agent planning strategies — task decomposition, hierarchical planning, and plan-and-execute versus ReAct-style interleaved planning.
- Chapter 4. Reasoning — Covers the reasoning strategies an agent applies mid-execution and how reasoning depth trades off against latency and token cost.
- Chapter 5. Reflection — Covers self-evaluation loops where an agent critiques its own intermediate output before acting on it.
- Chapter 6. Self-Correction — Covers how an agent detects and repairs its own errors mid-task, and the failure boundary where correction should hand off to a human.
- Chapter 7. Learning Loops — Covers how agents improve across invocations without full retraining — memory-based adaptation, and the online-eval loop that turns production traces into improvement signal.
- Chapter 8. Agent State Machines — Covers modeling an agent’s execution as an explicit state machine — states, transitions, and guards.
- Chapter 9. Goal-Oriented Behavior — Covers how an agent maintains and decomposes a top-level goal across multi-step execution.
- Chapter 10. Autonomous Execution — Covers the execution layer that carries a planned action through to completion — validation, rollback, and autonomy-level gating.
02 — Memory Systems
Solving the LLM’s stateless-by-design limitation. See 3-references/AI/agent-harness-demo.md for a
working per-persona memory implementation this Part generalizes into a full taxonomy.
- Chapter 1. Why Agents Need Memory — (stub) — Frames the stateless-by-default nature of LLM inference and why an agent operating across tool calls, sessions, or users needs an explicit memory subsystem.
- Chapter 2. Context Windows — (stub) — Covers context window mechanics and the tradeoffs between stuffing history into the prompt versus offloading it to external memory.
- Chapter 3. Working Memory — (stub) — Covers the agent’s working memory — the mutable scratchpad of current task state that lives only for one execution loop.
- Chapter 4. Short-Term Memory — (stub) — Covers short-term memory as bounded, session-scoped conversation history — sliding windows, summarization-on-overflow.
- Chapter 5. Long-Term Memory — (stub) — Covers persistent memory that survives across sessions and restarts, and how an agent decides what’s worth remembering permanently.
- Chapter 6. Semantic Memory — (stub) — Covers semantic memory as structured factual and conceptual knowledge decoupled from any specific conversation.
- Chapter 7. Episodic Memory — (stub) — Covers episodic memory as a log of specific past events, and how agents use it for recall of prior incidents and precedent-based reasoning.
- Chapter 8. Memory Storage Architectures — (stub) — Compares relational, key-value, document, and hybrid storage architectures for agent memory.
- Chapter 9. Vector Databases — (stub) — Covers embedding generation, ANN indexing (HNSW, IVF), similarity metrics, and recall/latency/cost tradeoffs.
- Chapter 10. Knowledge Graphs — (stub) — Covers knowledge graphs as a structured alternative to vector similarity search for multi-hop reasoning.
- Chapter 11. Memory Retrieval — (stub) — Covers retrieval strategies for pulling relevant memory back into an agent’s context.
- Chapter 12. Memory Compression — (stub) — Covers techniques for compressing accumulated memory before it consumes context budget.
- Chapter 13. Memory Versioning — (stub) — Covers versioning and conflict resolution for agent memory that changes over time.
03 — Planning & Reasoning Algorithms
The algorithm catalog every agent architecture in Part 00 of Building & Evaluating Agents draws from. Agent Architecture already covers ReAct, Plan-and-Execute, and Chain-of-Thought at an overview level — this Part goes one level deeper into each, plus the algorithms that chapter doesn’t cover.
- Chapter 1. Chain of Thought — (stub) — Eliciting intermediate reasoning steps before a final answer, why it improves multi-step performance, and its limits on tasks requiring backtracking.
- Chapter 2. ReAct — (stub) — Interleaving reasoning traces with tool-invoking actions in a single loop, and why it became the default architecture for tool-using agents.
- Chapter 3. Self-Consistency — (stub) — Sampling multiple independent reasoning paths and taking a majority vote over final answers.
- Chapter 4. Tree of Thoughts — (stub) — Exploring multiple reasoning branches with lookahead and backtracking.
- Chapter 5. Graph of Thoughts — (stub) — Where intermediate thoughts can merge, refine, and feed back into each other as a DAG rather than a tree.
- Chapter 6. Reflexion — (stub) — An agent critiquing its own failed attempt in natural language and feeding that self-reflection back into the next attempt.
- Chapter 7. Plan-and-Execute — The single-agent-scoped view of decomposing a task into an explicit upfront plan before executing steps, and its tradeoffs against ReAct. Formalized as a cross-cutting pattern, with applicability criteria, in Planner–Executor Pattern (Part 00 of AI Architecture & System Design) — read that for the canonical treatment.
- Chapter 8. Program-Aided Language Models — (stub) — Offloading deterministic computation to generated code executed by an interpreter instead of having the LLM compute the answer directly.
- Chapter 9. LLM Compiler — (stub) — Planning a DAG of tool calls upfront and executing independent branches in parallel.
- Chapter 10. Debate & Critic Agents — (stub) — Separate agent roles arguing opposing positions or critiquing a proposer’s output.
- Chapter 11. Hierarchical Planning — (stub) — Decomposing a goal into subgoals handled by higher- and lower-level planners at different abstraction levels.
04 — Tools & Environment Interaction
How an agent reaches outside the model. See 3-references/AI/llm-engineering-layers.md for a worked
tool-dispatch loop with real code.
- Chapter 1. Tool Calling Architecture — The mechanics of function/tool calling in modern LLM APIs — schema definition, structured-call output, execution, result injection.
- Chapter 2. APIs as Tools — Wrapping arbitrary external APIs as agent tools — authentication, schema translation, error surfacing.
- Chapter 3. REST & GraphQL Integration — Schema introspection for GraphQL, pagination handling, and rate-limit-aware retry design.
- Chapter 4. Database Tools — Text-to-SQL generation, read-only scoping, query validation, and the injection-attack surface of letting an LLM generate queries.
- Chapter 5. Search Tools — Web search APIs, retrieval-augmented search over internal corpora, and result-ranking strategies.
- Chapter 6. Browser Automation — Headless browser control, DOM parsing, and accessibility-tree extraction for dynamic pages.
- Chapter 7. Computer Use Agents — Agents that operate a full desktop GUI via screenshots and coordinate-based actions.
- Chapter 8. Code Execution — Sandboxed code execution as an agent tool — isolation boundaries, resource limits, output capture.
- Chapter 9. Model Context Protocol (MCP) — The standardized interface between agents and external tools/data sources, and its client-server architecture for tool discovery and invocation. See Appendix H — MCP Reference Guide.
- Chapter 10. Tool Discovery — Static registration versus dynamic discovery, tool metadata design, and scaling tool catalogs beyond one prompt.
- Chapter 11. Tool Selection Strategies — Embedding-based tool retrieval and hierarchical tool routing as the number of available tools grows.
- Chapter 12. Tool Security — Least-privilege scoping, output sanitization against prompt injection, approval gates, and audit logging.
- Chapter 13. Agents in CI/CD & SDLC Workflows — Establishing an agent’s execution context, scoping it to a repository and branch, triggering it from CI/SDLC events, and letting it act autonomously via branch/PR creation while merge stays gated — using GitHub Copilot coding agent as the reference implementation.
- Chapter 14. Safe Execution Paths & Error Handling — Error-handling taxonomy, retry design, rollback mechanics, escalation paths, and the traceability record that lets an agent operate safely when a tool call fails.
05 — Retrieval & Knowledge Systems
Grounding an agent in more than its context window can hold. See
4-archive/h-aiops/06-hybrid-retrieval-aiops-assistant/spec.md for a real hybrid BM25+vector+RRF
retrieval design this Part’s chapters generalize. Context Engineering — how what’s retrieved here
actually gets assembled into a prompt — is broken out into its own Part (06), since it grew larger
than a single chapter could hold.
- Chapter 1. Retrieval-Augmented Generation (RAG) — (stub) — The core RAG pipeline of indexing, retrieval, and generation, and why retrieval quality bounds answer quality regardless of context window size.
- Chapter 2. Embeddings — (stub) — How embedding models turn text into dense vectors, and the tradeoffs between commercial and open-source models.
- Chapter 3. Chunking Strategies — (stub) — Compares fixed-size, recursive, and semantic chunking and how boundary choices affect retrieved-passage quality.
- Chapter 4. Vector Search — (stub) — The approximate nearest neighbor algorithms (HNSW, IVF) behind vector databases.
- Chapter 5. Hybrid Search — (stub) — Why combining dense vector similarity with sparse keyword search (BM25) outperforms either alone.
- Chapter 6. Reranking — (stub) — Cross-encoder reranking models that reorder an initial retrieval candidate set for precision.
- Chapter 7. Agentic RAG — (stub) — RAG architectures where an agent decides when and what to retrieve, iteratively refining queries.
- Chapter 8. GraphRAG — (stub) — How knowledge-graph-structured retrieval captures entity relationships and multi-hop reasoning that vector search misses.
- Chapter 9. Multi-Stage Retrieval — (stub) — Pipelines that chain coarse-to-fine retrieval stages to balance recall and precision at scale.
06 — Context Engineering
What actually gets assembled into the prompt, in what order, and within what budget — arguably the discipline that has displaced prompt engineering as the core skill of building reliable agents. This Part was a single stub chapter inside Retrieval & Knowledge Systems; it’s promoted to its own Part here because the surface area (assembly, ranking, budgets, retrieval policy, compression, and the emerging idea of a prompt compiler) is as broad as memory or planning.
- Chapter 1. Context Assembly — How the final prompt gets built from disparate sources — system instructions, retrieved chunks, memory, tool schemas, and conversation history — and the ordering decisions that affect what the model actually attends to.
- Chapter 2. Context Ranking — Scoring and ordering candidate context fragments by relevance before they’re admitted into a fixed token budget.
- Chapter 3. Memory Selection — The policy layer between memory retrieval (Part 02) and context assembly — selection criteria beyond raw similarity, the cost of over-including memory (crowded-out context, stale precedent), and a worked contrast between a turn needing deep multi-session recall and one needing almost none.
- Chapter 4. Prompt Budgets — Allocating a fixed token budget across system prompt, retrieved context, memory, tool schemas, and conversation history, with explicit tradeoffs when the budget is exceeded.
- Chapter 5. Retrieval Policies — When to retrieve, how much (fixed-k vs. adaptive), and from which source (routing across corpora, echoing the Router Pattern) — the decision layer that sits in front of the retrieval mechanics in Part 05, and how Agentic RAG relocates the whole policy into the model’s own iterative loop.
- Chapter 6. Context Compression — Summarization, extractive pruning, and structured compression techniques for fitting more signal into less context without silently dropping what the model needed.
- Chapter 7. Prompt Compilers — The emerging idea of treating context assembly as a compilation step — a declarative spec of what the model needs, compiled down to an optimized prompt, rather than hand-assembled string concatenation.
Metadata
| Author | Amit Singh |
| Scope | agentic-ai-engineering |