# ai-guru > Move from software engineer to AI engineer without starting over. Free trails with video lessons, diagrams, and code on LLMs, RAG, agents, evals, and security, with a certificate. Plus AI engineer interview prep. Every item has a page in English (/en/) and Brazilian Portuguese (/pt-br/) with the same slug. Smells link to refactorings, refactorings link to patterns, patterns link to real-world scenarios. Full text of every written page: https://ai-guru-academy.vercel.app/llms-full.txt Interactive architecture lab: https://ai-guru-academy.vercel.app/en/langgraph-lab/ ## Tracks - [LLM foundations for engineers](https://ai-guru-academy.vercel.app/en/tracks/first-steps/): Start here. What changes when a model becomes part of your system: prompts as interfaces, structured output, tools, and when a fixed workflow beats an agent. - [Evals and reliability](https://ai-guru-academy.vercel.app/en/tracks/backend/): How to know an LLM feature works before your users tell you: evals, golden datasets, structured contracts, and deterministic work moved back into code. - [RAG and context](https://ai-guru-academy.vercel.app/en/tracks/rag/): Give the model the right information at the right time: embeddings, retrieval, hybrid search, reranking, chunking, and long conversations that do not rot. - [Building agents](https://ai-guru-academy.vercel.app/en/tracks/agents/): Give the model autonomy without the classic accidents: loops with a budget, a small toolset, subagents, and multiple agents only when they pay off. - [Securing AI systems](https://ai-guru-academy.vercel.app/en/tracks/security/): For whoever answers for what the agent does with money, data, and customers: prompt injection, least privilege, human approval, and an audit trail. - [Production: cost, latency, and operations](https://ai-guru-academy.vercel.app/en/tracks/architecture/): Cheap, fast, and observable: tracing, parallel steps, caching, model cascades, a fallback when the provider goes down, and a stack without vendor lock-in. ## Fundamentals The minimum you need on tokens, context, tools, embeddings, and evals before you design any LLM system. Index: https://ai-guru-academy.vercel.app/en/fundamentals/ - [How to read this catalog](https://ai-guru-academy.vercel.app/en/fundamentals/how-to-read-this-catalog/): How to read this catalog is an AI engineering fundamental for people who work with LLMs. The five pillars, how pages connect, and where to start for your role. (pt-BR: https://ai-guru-academy.vercel.app/pt-br/fundamentos/how-to-read-this-catalog/) - [LLMs for engineers](https://ai-guru-academy.vercel.app/en/fundamentals/llm-for-engineers/): LLMs for engineers is an AI engineering fundamental for people who work with LLMs. The model as a probabilistic function: what goes in, what comes out, and what it never promises. (pt-BR: https://ai-guru-academy.vercel.app/pt-br/fundamentos/llm-for-engineers/) - [Tokens and the context window](https://ai-guru-academy.vercel.app/en/fundamentals/tokens-and-context-window/): Tokens and the context window is an AI engineering fundamental for people who work with LLMs. Why everything costs tokens, why the middle of the context fades, and how to measure it. (pt-BR: https://ai-guru-academy.vercel.app/pt-br/fundamentos/tokens-and-context-window/) - [Sampling and temperature](https://ai-guru-academy.vercel.app/en/fundamentals/sampling-and-temperature/): Sampling and temperature is an AI engineering fundamental for people who work with LLMs. Where answer variation comes from and when you want more or less of it. (pt-BR: https://ai-guru-academy.vercel.app/pt-br/fundamentos/sampling-and-temperature/) - [The prompt as an interface](https://ai-guru-academy.vercel.app/en/fundamentals/prompt-as-interface/): The prompt as an interface is an AI engineering fundamental for people who work with LLMs. Treat the prompt like an API contract: input, output, version, and test. (pt-BR: https://ai-guru-academy.vercel.app/pt-br/fundamentos/prompt-as-interface/) - [Tools and function calling](https://ai-guru-academy.vercel.app/en/fundamentals/tools-and-function-calling/): Tools and function calling is an AI engineering fundamental for people who work with LLMs. How the model asks your code to act and who decides what happens next. (pt-BR: https://ai-guru-academy.vercel.app/pt-br/fundamentos/tools-and-function-calling/) - [Embeddings](https://ai-guru-academy.vercel.app/en/fundamentals/embeddings/): Embeddings is an AI engineering fundamental for people who work with LLMs. Text turned into vectors: what similarity captures and where it misleads. (pt-BR: https://ai-guru-academy.vercel.app/pt-br/fundamentos/embeddings/) - [Chains, agents, and workflows](https://ai-guru-academy.vercel.app/en/fundamentals/chains-agents-workflows/): Chains, agents, and workflows is an AI engineering fundamental for people who work with LLMs. The difference between code choosing the path and the model choosing the path. (pt-BR: https://ai-guru-academy.vercel.app/pt-br/fundamentos/chains-agents-workflows/) - [Choosing a stack](https://ai-guru-academy.vercel.app/en/fundamentals/choosing-a-stack/): Choosing a stack is an AI engineering fundamental for people who work with LLMs. The layers of an LLM system, and when LangChain, LangGraph, a provider SDK, or another library earns its place. (pt-BR: https://ai-guru-academy.vercel.app/pt-br/fundamentos/choosing-a-stack/) - [What an eval is](https://ai-guru-academy.vercel.app/en/fundamentals/what-is-an-eval/): What an eval is is an AI engineering fundamental for people who work with LLMs. Tests for systems that never answer the same way twice, from unit case to benchmark. (pt-BR: https://ai-guru-academy.vercel.app/pt-br/fundamentos/what-is-an-eval/) - [Cost and latency](https://ai-guru-academy.vercel.app/en/fundamentals/cost-and-latency/): Cost and latency is an AI engineering fundamental for people who work with LLMs. Do the math on every call before you ship. (pt-BR: https://ai-guru-academy.vercel.app/pt-br/fundamentos/cost-and-latency/) - [Prompt injection in practice](https://ai-guru-academy.vercel.app/en/fundamentals/prompt-injection-basics/): Prompt injection in practice is an AI engineering fundamental for people who work with LLMs. Why any text the model reads can become a command, and what to do about it. (pt-BR: https://ai-guru-academy.vercel.app/pt-br/fundamentos/prompt-injection-basics/) - [Observability for AI](https://ai-guru-academy.vercel.app/en/fundamentals/observability-basics/): Observability for AI is an AI engineering fundamental for people who work with LLMs. Traces, spans, and logs that let you answer: why did the agent do that? (pt-BR: https://ai-guru-academy.vercel.app/pt-br/fundamentos/observability-basics/) ## AI Smells Code smells for AI: signs that a prompt, agent, or pipeline will hurt later. It works, but it gets expensive, fragile, or unsafe. Index: https://ai-guru-academy.vercel.app/en/smells/ - [Prompt Bloat](https://ai-guru-academy.vercel.app/en/smells/prompt-bloat/): Prompt Bloat is an AI code smell, a sign of trouble in LLM systems, in the Bloaters group. The system prompt is past 3k tokens and every fixed bug became one more paragraph. (pt-BR: https://ai-guru-academy.vercel.app/pt-br/smells/prompt-bloat/) - [Tool Sprawl](https://ai-guru-academy.vercel.app/en/smells/tool-sprawl/): Tool Sprawl is an AI code smell, a sign of trouble in LLM systems, in the Bloaters group. The agent has 40 similarly named tools and often picks the wrong one. (pt-BR: https://ai-guru-academy.vercel.app/pt-br/smells/tool-sprawl/) - [Context Rot](https://ai-guru-academy.vercel.app/en/smells/context-rot/): Context Rot is an AI code smell, a sign of trouble in LLM systems, in the Bloaters group. A long session drags old history that confuses the model and makes every turn pricier. (pt-BR: https://ai-guru-academy.vercel.app/pt-br/smells/context-rot/) - [Routing System Prompt](https://ai-guru-academy.vercel.app/en/smells/routing-system-prompt/): Routing System Prompt is an AI code smell, a sign of trouble in LLM systems, in the Bloaters group. One prompt tries to handle sales, support, and billing with IF the user asks X blocks. (pt-BR: https://ai-guru-academy.vercel.app/pt-br/smells/routing-system-prompt/) - [Few-Shot Hoarding](https://ai-guru-academy.vercel.app/en/smells/few-shot-hoarding/): Few-Shot Hoarding is an AI code smell, a sign of trouble in LLM systems, in the Bloaters group. The prompt carries 30 fixed examples and nobody remembers why each one is there. (pt-BR: https://ai-guru-academy.vercel.app/pt-br/smells/few-shot-hoarding/) - [Mega Agent](https://ai-guru-academy.vercel.app/en/smells/mega-agent/): Mega Agent is an AI code smell, a sign of trouble in LLM systems, in the Bloaters group. One agent researches, writes, reviews, and publishes with the same context and the same tools. (pt-BR: https://ai-guru-academy.vercel.app/pt-br/smells/mega-agent/) - [Rule Stacking](https://ai-guru-academy.vercel.app/en/smells/rule-stacking/): Rule Stacking is an AI code smell, a sign of trouble in LLM systems, in the Control-flow abusers group. The prompt piles up ALWAYS, NEVER, and IMPORTANT in caps, and the rules fight each other. (pt-BR: https://ai-guru-academy.vercel.app/pt-br/smells/rule-stacking/) - [Prompt as State Machine](https://ai-guru-academy.vercel.app/en/smells/prompt-state-machine/): Prompt as State Machine is an AI code smell, a sign of trouble in LLM systems, in the Control-flow abusers group. The prompt describes steps (first ask for the ID, then the address) and the model skips or repeats them. (pt-BR: https://ai-guru-academy.vercel.app/pt-br/smells/prompt-state-machine/) - [Unbounded Loop](https://ai-guru-academy.vercel.app/en/smells/unbounded-loop/): Unbounded Loop is an AI code smell, a sign of trouble in LLM systems, in the Control-flow abusers group. The agent can call tools forever; the only limit is the credit card. (pt-BR: https://ai-guru-academy.vercel.app/pt-br/smells/unbounded-loop/) - [Agent Where a Chain Would Do](https://ai-guru-academy.vercel.app/en/smells/agent-where-chain-would-do/): Agent Where a Chain Would Do is an AI code smell, a sign of trouble in LLM systems, in the Control-flow abusers group. The path never changes, yet an autonomous agent decides the order on every run. (pt-BR: https://ai-guru-academy.vercel.app/pt-br/smells/agent-where-chain-would-do/) - [Blind Retry](https://ai-guru-academy.vercel.app/en/smells/blind-retry/): Blind Retry is an AI code smell, a sign of trouble in LLM systems, in the Control-flow abusers group. Every error triggers another attempt, including errors that will never succeed. (pt-BR: https://ai-guru-academy.vercel.app/pt-br/smells/blind-retry/) - [Subagent Recursion](https://ai-guru-academy.vercel.app/en/smells/subagent-recursion/): Subagent Recursion is an AI code smell, a sign of trouble in LLM systems, in the Control-flow abusers group. Subagents spawn subagents with no depth or cost limit. (pt-BR: https://ai-guru-academy.vercel.app/pt-br/smells/subagent-recursion/) - [Untested Prompt](https://ai-guru-academy.vercel.app/en/smells/untested-prompt/): Untested Prompt is an AI code smell, a sign of trouble in LLM systems, in the Change preventers group. The prompt changes in production with no test set to prove it did not get worse. (pt-BR: https://ai-guru-academy.vercel.app/pt-br/smells/untested-prompt/) - [Model-Pinned Prompt](https://ai-guru-academy.vercel.app/en/smells/model-pinned-prompt/): Model-Pinned Prompt is an AI code smell, a sign of trouble in LLM systems, in the Change preventers group. Switching models or versions breaks everything because the prompt relies on the old model's quirks. (pt-BR: https://ai-guru-academy.vercel.app/pt-br/smells/model-pinned-prompt/) - [Hardcoded Few-Shots](https://ai-guru-academy.vercel.app/en/smells/hardcoded-few-shots/): Hardcoded Few-Shots is an AI code smell, a sign of trouble in LLM systems, in the Change preventers group. Examples live inside the code and changing one requires a deploy. (pt-BR: https://ai-guru-academy.vercel.app/pt-br/smells/hardcoded-few-shots/) - [Scattered Prompt Strings](https://ai-guru-academy.vercel.app/en/smells/scattered-prompt-strings/): Scattered Prompt Strings is an AI code smell, a sign of trouble in LLM systems, in the Change preventers group. Prompt fragments assembled with string concatenation across many files. (pt-BR: https://ai-guru-academy.vercel.app/pt-br/smells/scattered-prompt-strings/) - [Unversioned Prompt](https://ai-guru-academy.vercel.app/en/smells/unversioned-prompt/): Unversioned Prompt is an AI code smell, a sign of trouble in LLM systems, in the Change preventers group. Nobody knows which prompt version produced the answer the customer complained about. (pt-BR: https://ai-guru-academy.vercel.app/pt-br/smells/unversioned-prompt/) - [Redundant Self-Critique](https://ai-guru-academy.vercel.app/en/smells/redundant-self-critique/): Redundant Self-Critique is an AI code smell, a sign of trouble in LLM systems, in the Dispensables group. A review your answer step that doubles the cost and almost never changes anything. (pt-BR: https://ai-guru-academy.vercel.app/pt-br/smells/redundant-self-critique/) - [Unused Tools](https://ai-guru-academy.vercel.app/en/smells/unused-tools/): Unused Tools is an AI code smell, a sign of trouble in LLM systems, in the Dispensables group. Tools in the schema that have not been called in months but take up context on every request. (pt-BR: https://ai-guru-academy.vercel.app/pt-br/smells/unused-tools/) - [LLM Doing Deterministic Work](https://ai-guru-academy.vercel.app/en/smells/llm-doing-deterministic-work/): LLM Doing Deterministic Work is an AI code smell, a sign of trouble in LLM systems, in the Dispensables group. The model calculates taxes, formats dates, or validates IDs, things a function does without error. (pt-BR: https://ai-guru-academy.vercel.app/pt-br/smells/llm-doing-deterministic-work/) - [RAG for Small Data](https://ai-guru-academy.vercel.app/en/smells/rag-for-small-data/): RAG for Small Data is an AI code smell, a sign of trouble in LLM systems, in the Dispensables group. A vector search pipeline for 20 pages that fit entirely in the context. (pt-BR: https://ai-guru-academy.vercel.app/pt-br/smells/rag-for-small-data/) - [Decorative Multi-Agent](https://ai-guru-academy.vercel.app/en/smells/decorative-multi-agent/): Decorative Multi-Agent is an AI code smell, a sign of trouble in LLM systems, in the Dispensables group. Five agents with job titles passing text to each other without splitting any real work. (pt-BR: https://ai-guru-academy.vercel.app/pt-br/smells/decorative-multi-agent/) - [Free-Text Handoff](https://ai-guru-academy.vercel.app/en/smells/free-text-handoff/): Free-Text Handoff is an AI code smell, a sign of trouble in LLM systems, in the Couplers group. One step hands loose text to the next, which has to guess the format. (pt-BR: https://ai-guru-academy.vercel.app/pt-br/smells/free-text-handoff/) - [Shared Scratchpad](https://ai-guru-academy.vercel.app/en/smells/shared-scratchpad/): Shared Scratchpad is an AI code smell, a sign of trouble in LLM systems, in the Couplers group. Several agents write to the same history and one pollutes the other's reasoning. (pt-BR: https://ai-guru-academy.vercel.app/pt-br/smells/shared-scratchpad/) - [Raw HTML Tool Output](https://ai-guru-academy.vercel.app/en/smells/raw-html-tool-output/): Raw HTML Tool Output is an AI code smell, a sign of trouble in LLM systems, in the Couplers group. The tool returns the whole page, menus and footer included, and the model gets lost. (pt-BR: https://ai-guru-academy.vercel.app/pt-br/smells/raw-html-tool-output/) - [Provider Format Leak](https://ai-guru-academy.vercel.app/en/smells/provider-format-leak/): Provider Format Leak is an AI code smell, a sign of trouble in LLM systems, in the Couplers group. One provider's message format has spread into the business code. (pt-BR: https://ai-guru-academy.vercel.app/pt-br/smells/provider-format-leak/) - [Ungated Side Effect](https://ai-guru-academy.vercel.app/en/smells/ungated-side-effect/): Ungated Side Effect is an AI code smell, a sign of trouble in LLM systems, in the Security group. The agent sends email, pays, or deletes data with no confirmation at all. (pt-BR: https://ai-guru-academy.vercel.app/pt-br/smells/ungated-side-effect/) - [Instructions from Untrusted Data](https://ai-guru-academy.vercel.app/en/smells/untrusted-instructions/): Instructions from Untrusted Data is an AI code smell, a sign of trouble in LLM systems, in the Security group. Text from pages, emails, or documents enters the prompt with the same weight as instructions. (pt-BR: https://ai-guru-academy.vercel.app/pt-br/smells/untrusted-instructions/) - [Secret in Prompt](https://ai-guru-academy.vercel.app/en/smells/secret-in-prompt/): Secret in Prompt is an AI code smell, a sign of trouble in LLM systems, in the Security group. Keys, passwords, or internal data sit in the prompt and can be echoed back to the user. (pt-BR: https://ai-guru-academy.vercel.app/pt-br/smells/secret-in-prompt/) - [Overprivileged Tool](https://ai-guru-academy.vercel.app/en/smells/overprivileged-tool/): Overprivileged Tool is an AI code smell, a sign of trouble in LLM systems, in the Security group. A read tool has write access, or a run_sql tool accepts any statement. (pt-BR: https://ai-guru-academy.vercel.app/pt-br/smells/overprivileged-tool/) - [Unvalidated Executed Output](https://ai-guru-academy.vercel.app/en/smells/unvalidated-executed-output/): Unvalidated Executed Output is an AI code smell, a sign of trouble in LLM systems, in the Security group. Code, SQL, or commands generated by the model run directly, with no check or sandbox. (pt-BR: https://ai-guru-academy.vercel.app/pt-br/smells/unvalidated-executed-output/) - [No Cost Budget](https://ai-guru-academy.vercel.app/en/smells/no-cost-budget/): No Cost Budget is an AI code smell, a sign of trouble in LLM systems, in the Operations group. There is no spending limit per user, per task, or per day. (pt-BR: https://ai-guru-academy.vercel.app/pt-br/smells/no-cost-budget/) - [No Tracing](https://ai-guru-academy.vercel.app/en/smells/no-tracing/): No Tracing is an AI code smell, a sign of trouble in LLM systems, in the Operations group. When something goes wrong, nobody can see which calls, tools, and context led to the answer. (pt-BR: https://ai-guru-academy.vercel.app/pt-br/smells/no-tracing/) - [Serial Latency Stack](https://ai-guru-academy.vercel.app/en/smells/serial-latency-stack/): Serial Latency Stack is an AI code smell, a sign of trouble in LLM systems, in the Operations group. Five independent calls run one after another and the user waits 20 seconds. (pt-BR: https://ai-guru-academy.vercel.app/pt-br/smells/serial-latency-stack/) - [Missing Cache](https://ai-guru-academy.vercel.app/en/smells/missing-cache/): Missing Cache is an AI code smell, a sign of trouble in LLM systems, in the Operations group. The same large context and the same questions are processed from scratch every time. (pt-BR: https://ai-guru-academy.vercel.app/pt-br/smells/missing-cache/) - [Vibe-Check Eval](https://ai-guru-academy.vercel.app/en/smells/vibe-check-eval/): Vibe-Check Eval is an AI code smell, a sign of trouble in LLM systems, in the Operations group. Quality is measured by trying five questions by hand before deploying. (pt-BR: https://ai-guru-academy.vercel.app/pt-br/smells/vibe-check-eval/) - [Single Provider Dependency](https://ai-guru-academy.vercel.app/en/smells/single-provider-dependency/): Single Provider Dependency is an AI code smell, a sign of trouble in LLM systems, in the Operations group. When the model API goes down or slows down, the whole product stops with it. (pt-BR: https://ai-guru-academy.vercel.app/pt-br/smells/single-provider-dependency/) ## AI Refactorings How to change the structure of an LLM system without changing what users get. Every refactoring starts and ends with an eval. Index: https://ai-guru-academy.vercel.app/en/refactorings/ - [Extract Subprompt](https://ai-guru-academy.vercel.app/en/refactorings/extract-subprompt/): Extract Subprompt is an AI refactoring for LLM systems, in the Composing prompts group. Pull one responsibility out of the main prompt and give it its own call. (pt-BR: https://ai-guru-academy.vercel.app/pt-br/refatoracoes/extract-subprompt/) - [Inline Trivial Step](https://ai-guru-academy.vercel.app/en/refactorings/inline-trivial-step/): Inline Trivial Step is an AI refactoring for LLM systems, in the Composing prompts group. Remove a call that does not change the result and fold its work into the neighboring step. (pt-BR: https://ai-guru-academy.vercel.app/pt-br/refatoracoes/inline-trivial-step/) - [Replace Rules with Examples](https://ai-guru-academy.vercel.app/en/refactorings/replace-rules-with-examples/): Replace Rules with Examples is an AI refactoring for LLM systems, in the Composing prompts group. Replace a pile of rules with a few well chosen examples that show the behavior. (pt-BR: https://ai-guru-academy.vercel.app/pt-br/refatoracoes/replace-rules-with-examples/) - [Move Instruction to Tool Description](https://ai-guru-academy.vercel.app/en/refactorings/move-instruction-to-tool-description/): Move Instruction to Tool Description is an AI refactoring for LLM systems, in the Composing prompts group. Move a tool's usage rule into its description, right where the model makes the choice. (pt-BR: https://ai-guru-academy.vercel.app/pt-br/refatoracoes/move-instruction-to-tool-description/) - [Extract Versioned Template](https://ai-guru-academy.vercel.app/en/refactorings/extract-versioned-template/): Extract Versioned Template is an AI refactoring for LLM systems, in the Composing prompts group. Gather scattered prompt fragments into one template with a name, version, and variables. (pt-BR: https://ai-guru-academy.vercel.app/pt-br/refatoracoes/extract-versioned-template/) - [Separate Instructions from Data](https://ai-guru-academy.vercel.app/en/refactorings/separate-instructions-from-data/): Separate Instructions from Data is an AI refactoring for LLM systems, in the Composing prompts group. Clearly mark what is a system instruction and what is content to be read. (pt-BR: https://ai-guru-academy.vercel.app/pt-br/refatoracoes/separate-instructions-from-data/) - [Move Few-Shots to a Dataset](https://ai-guru-academy.vercel.app/en/refactorings/move-few-shots-to-dataset/): Move Few-Shots to a Dataset is an AI refactoring for LLM systems, in the Composing prompts group. Take examples out of the code into a versioned set, picked at request time. (pt-BR: https://ai-guru-academy.vercel.app/pt-br/refatoracoes/move-few-shots-to-dataset/) - [Replace Prompt Rule with Graph Edge](https://ai-guru-academy.vercel.app/en/refactorings/replace-prompt-rule-with-graph-edge/): Replace Prompt Rule with Graph Edge is an AI refactoring for LLM systems, in the Moving control group. Turn an IF this, do that written in the prompt into an explicit transition in code. (pt-BR: https://ai-guru-academy.vercel.app/pt-br/refatoracoes/replace-prompt-rule-with-graph-edge/) - [Replace Agent with Chain](https://ai-guru-academy.vercel.app/en/refactorings/replace-agent-with-chain/): Replace Agent with Chain is an AI refactoring for LLM systems, in the Moving control group. When the path is always the same, fix the order of steps in code. (pt-BR: https://ai-guru-academy.vercel.app/pt-br/refatoracoes/replace-agent-with-chain/) - [Extract Subagent](https://ai-guru-academy.vercel.app/en/refactorings/extract-subagent/): Extract Subagent is an AI refactoring for LLM systems, in the Moving control group. Give a large task its own agent with a clean context and only the tools it needs. (pt-BR: https://ai-guru-academy.vercel.app/pt-br/refatoracoes/extract-subagent/) - [Add Loop Budget](https://ai-guru-academy.vercel.app/en/refactorings/add-loop-budget/): Add Loop Budget is an AI refactoring for LLM systems, in the Moving control group. Cap steps, time, and money for each run and define what happens at the limit. (pt-BR: https://ai-guru-academy.vercel.app/pt-br/refatoracoes/add-loop-budget/) - [Parallelize Independent Steps](https://ai-guru-academy.vercel.app/en/refactorings/parallelize-independent-steps/): Parallelize Independent Steps is an AI refactoring for LLM systems, in the Moving control group. Run calls that do not depend on each other at the same time. (pt-BR: https://ai-guru-academy.vercel.app/pt-br/refatoracoes/parallelize-independent-steps/) - [Introduce Router](https://ai-guru-academy.vercel.app/en/refactorings/introduce-router/): Introduce Router is an AI refactoring for LLM systems, in the Moving control group. Classify the input first and send it to a specialized prompt or agent. (pt-BR: https://ai-guru-academy.vercel.app/pt-br/refatoracoes/introduce-router/) - [Collapse Agents](https://ai-guru-academy.vercel.app/en/refactorings/collapse-agents/): Collapse Agents is an AI refactoring for LLM systems, in the Moving control group. Merge agents that only pass text along into one agent with the right tools. (pt-BR: https://ai-guru-academy.vercel.app/pt-br/refatoracoes/collapse-agents/) - [Replace Free Text with Structured Output](https://ai-guru-academy.vercel.app/en/refactorings/replace-free-text-with-structured-output/): Replace Free Text with Structured Output is an AI refactoring for LLM systems, in the Organizing data group. Define a schema for the step's output and validate it before moving on. (pt-BR: https://ai-guru-academy.vercel.app/pt-br/refatoracoes/replace-free-text-with-structured-output/) - [Replace History with Summary](https://ai-guru-academy.vercel.app/en/refactorings/replace-history-with-summary/): Replace History with Summary is an AI refactoring for LLM systems, in the Organizing data group. Replace old turns with a summary and with facts stored outside the context. (pt-BR: https://ai-guru-academy.vercel.app/pt-br/refatoracoes/replace-history-with-summary/) - [Move Retrieval Out of the Prompt](https://ai-guru-academy.vercel.app/en/refactorings/move-retrieval-out-of-prompt/): Move Retrieval Out of the Prompt is an AI refactoring for LLM systems, in the Organizing data group. Stop pasting documents into the system prompt and fetch only the relevant passage. (pt-BR: https://ai-guru-academy.vercel.app/pt-br/refatoracoes/move-retrieval-out-of-prompt/) - [Replace RAG with Direct Context](https://ai-guru-academy.vercel.app/en/refactorings/replace-rag-with-direct-context/): Replace RAG with Direct Context is an AI refactoring for LLM systems, in the Organizing data group. When the material fits in the window, send it whole and use prompt caching. (pt-BR: https://ai-guru-academy.vercel.app/pt-br/refatoracoes/replace-rag-with-direct-context/) - [Normalize Tool Output](https://ai-guru-academy.vercel.app/en/refactorings/normalize-tool-output/): Normalize Tool Output is an AI refactoring for LLM systems, in the Organizing data group. Make every tool return only the useful fields in a stable format. (pt-BR: https://ai-guru-academy.vercel.app/pt-br/refatoracoes/normalize-tool-output/) - [Consolidate Tools](https://ai-guru-academy.vercel.app/en/refactorings/consolidate-tools/): Consolidate Tools is an AI refactoring for LLM systems, in the Simplifying tools group. Merge similar tools and remove the ones nobody uses. (pt-BR: https://ai-guru-academy.vercel.app/pt-br/refatoracoes/consolidate-tools/) - [Replace LLM Call with Code](https://ai-guru-academy.vercel.app/en/refactorings/replace-llm-call-with-code/): Replace LLM Call with Code is an AI refactoring for LLM systems, in the Simplifying tools group. Move calculation, formatting, and validation into a function the model calls. (pt-BR: https://ai-guru-academy.vercel.app/pt-br/refatoracoes/replace-llm-call-with-code/) - [Narrow Tool Permissions](https://ai-guru-academy.vercel.app/en/refactorings/narrow-tool-permissions/): Narrow Tool Permissions is an AI refactoring for LLM systems, in the Simplifying tools group. Give each tool only the access it needs for its use case. (pt-BR: https://ai-guru-academy.vercel.app/pt-br/refatoracoes/narrow-tool-permissions/) - [Split God Tool](https://ai-guru-academy.vercel.app/en/refactorings/split-god-tool/): Split God Tool is an AI refactoring for LLM systems, in the Simplifying tools group. Break a generic tool (run_sql, call_api) into named, safe operations. (pt-BR: https://ai-guru-academy.vercel.app/pt-br/refatoracoes/split-god-tool/) - [Expose Tool via MCP](https://ai-guru-academy.vercel.app/en/refactorings/expose-tool-via-mcp/): Expose Tool via MCP is an AI refactoring for LLM systems, in the Simplifying tools group. Publish the integration as an MCP server so any agent uses the same contract. (pt-BR: https://ai-guru-academy.vercel.app/pt-br/refatoracoes/expose-tool-via-mcp/) - [Add Approval Before Side Effect](https://ai-guru-academy.vercel.app/en/refactorings/add-approval-before-side-effect/): Add Approval Before Side Effect is an AI refactoring for LLM systems, in the Safety and reliability group. Pause the run and show the action to a human before paying, sending, or deleting. (pt-BR: https://ai-guru-academy.vercel.app/pt-br/refatoracoes/add-approval-before-side-effect/) - [Quarantine Untrusted Content](https://ai-guru-academy.vercel.app/en/refactorings/quarantine-untrusted-content/): Quarantine Untrusted Content is an AI refactoring for LLM systems, in the Safety and reliability group. Read outside content with a tool-less model and pass along only structured data. (pt-BR: https://ai-guru-academy.vercel.app/pt-br/refatoracoes/quarantine-untrusted-content/) - [Validate Before Execute](https://ai-guru-academy.vercel.app/en/refactorings/validate-before-execute/): Validate Before Execute is an AI refactoring for LLM systems, in the Safety and reliability group. Check generated code, SQL, or commands and run them in an isolated environment. (pt-BR: https://ai-guru-academy.vercel.app/pt-br/refatoracoes/validate-before-execute/) - [Add Fallback Path](https://ai-guru-academy.vercel.app/en/refactorings/add-fallback-path/): Add Fallback Path is an AI refactoring for LLM systems, in the Safety and reliability group. Define what happens when the model, the tool, or the provider fails. (pt-BR: https://ai-guru-academy.vercel.app/pt-br/refatoracoes/add-fallback-path/) - [Classify Errors Before Retry](https://ai-guru-academy.vercel.app/en/refactorings/classify-errors-before-retry/): Classify Errors Before Retry is an AI refactoring for LLM systems, in the Safety and reliability group. Separate transient errors from permanent ones and retry only what can succeed. (pt-BR: https://ai-guru-academy.vercel.app/pt-br/refatoracoes/classify-errors-before-retry/) - [Move Secret Out of the Prompt](https://ai-guru-academy.vercel.app/en/refactorings/move-secret-out-of-prompt/): Move Secret Out of the Prompt is an AI refactoring for LLM systems, in the Safety and reliability group. Keep credentials inside the tool code, where the model never sees them. (pt-BR: https://ai-guru-academy.vercel.app/pt-br/refatoracoes/move-secret-out-of-prompt/) - [Add Eval Before Changing the Prompt](https://ai-guru-academy.vercel.app/en/refactorings/add-eval-before-prompt-change/): Add Eval Before Changing the Prompt is an AI refactoring for LLM systems, in the Operations group. Build a test set and measure the current version before any tweak. (pt-BR: https://ai-guru-academy.vercel.app/pt-br/refatoracoes/add-eval-before-prompt-change/) - [Add Tracing](https://ai-guru-academy.vercel.app/en/refactorings/add-tracing/): Add Tracing is an AI refactoring for LLM systems, in the Operations group. Record every call, tool, prompt version, and cost in a browsable trace. (pt-BR: https://ai-guru-academy.vercel.app/pt-br/refatoracoes/add-tracing/) - [Introduce Cache](https://ai-guru-academy.vercel.app/en/refactorings/introduce-cache/): Introduce Cache is an AI refactoring for LLM systems, in the Operations group. Reuse prompt prefixes and answers for equivalent questions. (pt-BR: https://ai-guru-academy.vercel.app/pt-br/refatoracoes/introduce-cache/) - [Introduce Model Cascade](https://ai-guru-academy.vercel.app/en/refactorings/introduce-model-cascade/): Introduce Model Cascade is an AI refactoring for LLM systems, in the Operations group. Try a cheap model first and escalate only when confidence is low. (pt-BR: https://ai-guru-academy.vercel.app/pt-br/refatoracoes/introduce-model-cascade/) - [Move to Durable Execution](https://ai-guru-academy.vercel.app/en/refactorings/move-to-durable-execution/): Move to Durable Execution is an AI refactoring for LLM systems, in the Operations group. Persist state at every step so the run can resume after a crash, a wait, or an approval. (pt-BR: https://ai-guru-academy.vercel.app/pt-br/refatoracoes/move-to-durable-execution/) ## AI Design Patterns Proven answers to recurring problems in LLM apps and AI agents: composition, RAG, memory, tools, guardrails, and operations. Index: https://ai-guru-academy.vercel.app/en/patterns/ - [Prompt Chaining](https://ai-guru-academy.vercel.app/en/patterns/prompt-chaining/): Prompt Chaining is an AI design pattern for LLM apps and agents, in the Composition group. Split the task into fixed steps where each output feeds the next input. (pt-BR: https://ai-guru-academy.vercel.app/pt-br/padroes/prompt-chaining/) - [Routing](https://ai-guru-academy.vercel.app/en/patterns/routing/): Routing is an AI design pattern for LLM apps and agents, in the Composition group. Classify the input and send each kind down a specialized path. (pt-BR: https://ai-guru-academy.vercel.app/pt-br/padroes/routing/) - [Sectioning](https://ai-guru-academy.vercel.app/en/patterns/sectioning/): Sectioning is an AI design pattern for LLM apps and agents, in the Composition group. Break the task into independent parts and run them all in parallel. (pt-BR: https://ai-guru-academy.vercel.app/pt-br/padroes/sectioning/) - [Voting](https://ai-guru-academy.vercel.app/en/patterns/voting/): Voting is an AI design pattern for LLM apps and agents, in the Composition group. Run the same task several times or with several models and decide by majority or threshold. (pt-BR: https://ai-guru-academy.vercel.app/pt-br/padroes/voting/) - [Orchestrator-Workers](https://ai-guru-academy.vercel.app/en/patterns/orchestrator-workers/): Orchestrator-Workers is an AI design pattern for LLM apps and agents, in the Composition group. One model decides subtasks on the fly and hands them to workers. (pt-BR: https://ai-guru-academy.vercel.app/pt-br/padroes/orchestrator-workers/) - [Evaluator-Optimizer](https://ai-guru-academy.vercel.app/en/patterns/evaluator-optimizer/): Evaluator-Optimizer is an AI design pattern for LLM apps and agents, in the Composition group. One model generates, another grades against clear criteria, and the loop repeats until it passes. (pt-BR: https://ai-guru-academy.vercel.app/pt-br/padroes/evaluator-optimizer/) - [Structured Output](https://ai-guru-academy.vercel.app/en/patterns/structured-output/): Structured Output is an AI design pattern for LLM apps and agents, in the Composition group. Require the model to answer in a schema and validate the response. (pt-BR: https://ai-guru-academy.vercel.app/pt-br/padroes/structured-output/) - [Few-Shot Selector](https://ai-guru-academy.vercel.app/en/patterns/few-shot-selector/): Few-Shot Selector is an AI design pattern for LLM apps and agents, in the Composition group. Pick, at request time, the examples most similar to the current input. (pt-BR: https://ai-guru-academy.vercel.app/pt-br/padroes/few-shot-selector/) - [Prompt Template Registry](https://ai-guru-academy.vercel.app/en/patterns/prompt-template-registry/): Prompt Template Registry is an AI design pattern for LLM apps and agents, in the Composition group. Store prompts as versioned artifacts with variables and history. (pt-BR: https://ai-guru-academy.vercel.app/pt-br/padroes/prompt-template-registry/) - [Map-Reduce](https://ai-guru-academy.vercel.app/en/patterns/map-reduce/): Map-Reduce is an AI design pattern for LLM apps and agents, in the Composition group. Process chunks in parallel and then combine the results into one answer. (pt-BR: https://ai-guru-academy.vercel.app/pt-br/padroes/map-reduce/) - [Retrieval-Augmented Generation (RAG)](https://ai-guru-academy.vercel.app/en/patterns/rag/): Retrieval-Augmented Generation (RAG) is an AI design pattern for LLM apps and agents, in the Context and knowledge group. Fetch relevant passages and hand them to the model along with the question. (pt-BR: https://ai-guru-academy.vercel.app/pt-br/padroes/rag/) - [Hybrid Search](https://ai-guru-academy.vercel.app/en/patterns/hybrid-search/): Hybrid Search is an AI design pattern for LLM apps and agents, in the Context and knowledge group. Combine keyword and vector search so you miss neither synonyms nor exact codes. (pt-BR: https://ai-guru-academy.vercel.app/pt-br/padroes/hybrid-search/) - [Reranking](https://ai-guru-academy.vercel.app/en/patterns/reranking/): Reranking is an AI design pattern for LLM apps and agents, in the Context and knowledge group. Retrieve many candidates and use a sharper model to pick the best ones. (pt-BR: https://ai-guru-academy.vercel.app/pt-br/padroes/reranking/) - [Query Rewriting](https://ai-guru-academy.vercel.app/en/patterns/query-rewriting/): Query Rewriting is an AI design pattern for LLM apps and agents, in the Context and knowledge group. Turn the user's question into one or more better searches. (pt-BR: https://ai-guru-academy.vercel.app/pt-br/padroes/query-rewriting/) - [GraphRAG](https://ai-guru-academy.vercel.app/en/patterns/graph-rag/): GraphRAG is an AI design pattern for LLM apps and agents, in the Context and knowledge group. Walk relationships between entities when the answer depends on connections, not one passage. (pt-BR: https://ai-guru-academy.vercel.app/pt-br/padroes/graph-rag/) - [Agentic RAG](https://ai-guru-academy.vercel.app/en/patterns/agentic-rag/): Agentic RAG is an AI design pattern for LLM apps and agents, in the Context and knowledge group. Let the agent decide when, where, and how many times to search. (pt-BR: https://ai-guru-academy.vercel.app/pt-br/padroes/agentic-rag/) - [Contextual Chunking](https://ai-guru-academy.vercel.app/en/patterns/contextual-chunking/): Contextual Chunking is an AI design pattern for LLM apps and agents, in the Context and knowledge group. Split documents along their structure and attach to each chunk the context it came from. (pt-BR: https://ai-guru-academy.vercel.app/pt-br/padroes/contextual-chunking/) - [Context Compaction](https://ai-guru-academy.vercel.app/en/patterns/context-compaction/): Context Compaction is an AI design pattern for LLM apps and agents, in the Context and knowledge group. Summarize or prune the context as it grows, keeping what matters. (pt-BR: https://ai-guru-academy.vercel.app/pt-br/padroes/context-compaction/) - [Context Isolation](https://ai-guru-academy.vercel.app/en/patterns/context-isolation/): Context Isolation is an AI design pattern for LLM apps and agents, in the Context and knowledge group. Run subtasks in separate contexts and bring back only the result. (pt-BR: https://ai-guru-academy.vercel.app/pt-br/padroes/context-isolation/) - [Progressive Disclosure](https://ai-guru-academy.vercel.app/en/patterns/progressive-disclosure/): Progressive Disclosure is an AI design pattern for LLM apps and agents, in the Context and knowledge group. Show the model only a summary of each skill and load the details when it asks. (pt-BR: https://ai-guru-academy.vercel.app/pt-br/padroes/progressive-disclosure/) - [Citation Grounding](https://ai-guru-academy.vercel.app/en/patterns/citation-grounding/): Citation Grounding is an AI design pattern for LLM apps and agents, in the Context and knowledge group. Require every claim to point at a source and check that the source says it. (pt-BR: https://ai-guru-academy.vercel.app/pt-br/padroes/citation-grounding/) - [Short-Term Memory](https://ai-guru-academy.vercel.app/en/patterns/short-term-memory/): Short-Term Memory is an AI design pattern for LLM apps and agents, in the Memory and state group. Keep the current conversation's state explicit, outside the raw transcript. (pt-BR: https://ai-guru-academy.vercel.app/pt-br/padroes/short-term-memory/) - [Long-Term Memory](https://ai-guru-academy.vercel.app/en/patterns/long-term-memory/): Long-Term Memory is an AI design pattern for LLM apps and agents, in the Memory and state group. Store facts and preferences across sessions and bring back only the relevant ones. (pt-BR: https://ai-guru-academy.vercel.app/pt-br/padroes/long-term-memory/) - [Episodic Memory](https://ai-guru-academy.vercel.app/en/patterns/episodic-memory/): Episodic Memory is an AI design pattern for LLM apps and agents, in the Memory and state group. Remember past runs, what worked and what failed, to act better next time. (pt-BR: https://ai-guru-academy.vercel.app/pt-br/padroes/episodic-memory/) - [Memory Consolidation](https://ai-guru-academy.vercel.app/en/patterns/memory-consolidation/): Memory Consolidation is an AI design pattern for LLM apps and agents, in the Memory and state group. Review memories in the background to merge, correct, and forget. (pt-BR: https://ai-guru-academy.vercel.app/pt-br/padroes/memory-consolidation/) - [Scratchpad](https://ai-guru-academy.vercel.app/en/patterns/scratchpad/): Scratchpad is an AI design pattern for LLM apps and agents, in the Memory and state group. Give the agent a place to note its plan and partial results outside the conversation. (pt-BR: https://ai-guru-academy.vercel.app/pt-br/padroes/scratchpad/) - [Checkpoint and Resume](https://ai-guru-academy.vercel.app/en/patterns/checkpoint-resume/): Checkpoint and Resume is an AI design pattern for LLM apps and agents, in the Memory and state group. Save state at safe points so the run can continue where it stopped. (pt-BR: https://ai-guru-academy.vercel.app/pt-br/padroes/checkpoint-resume/) - [Durable Workflow](https://ai-guru-academy.vercel.app/en/patterns/durable-workflow/): Durable Workflow is an AI design pattern for LLM apps and agents, in the Memory and state group. Run the agent on an engine that guarantees each step through crashes and long waits. (pt-BR: https://ai-guru-academy.vercel.app/pt-br/padroes/durable-workflow/) - [Shared Blackboard](https://ai-guru-academy.vercel.app/en/patterns/shared-blackboard/): Shared Blackboard is an AI design pattern for LLM apps and agents, in the Memory and state group. A structured space where several agents post and read facts, each with an owner and a format. (pt-BR: https://ai-guru-academy.vercel.app/pt-br/padroes/shared-blackboard/) - [Tool Use](https://ai-guru-academy.vercel.app/en/patterns/tool-use/): Tool Use is an AI design pattern for LLM apps and agents, in the Tools and action group. Give the model well described functions to fetch data and take action. (pt-BR: https://ai-guru-academy.vercel.app/pt-br/padroes/tool-use/) - [Tool Router](https://ai-guru-academy.vercel.app/en/patterns/tool-router/): Tool Router is an AI design pattern for LLM apps and agents, in the Tools and action group. Pick a small subset of tools before calling the main model. (pt-BR: https://ai-guru-academy.vercel.app/pt-br/padroes/tool-router/) - [Code Execution Sandbox](https://ai-guru-academy.vercel.app/en/patterns/code-execution-sandbox/): Code Execution Sandbox is an AI design pattern for LLM apps and agents, in the Tools and action group. Let the model write and run code in an isolated, disposable environment. (pt-BR: https://ai-guru-academy.vercel.app/pt-br/padroes/code-execution-sandbox/) - [Computer Use](https://ai-guru-academy.vercel.app/en/patterns/computer-use/): Computer Use is an AI design pattern for LLM apps and agents, in the Tools and action group. Drive graphical interfaces through screen, mouse, and keyboard when there is no API. (pt-BR: https://ai-guru-academy.vercel.app/pt-br/padroes/computer-use/) - [Browser Agent](https://ai-guru-academy.vercel.app/en/patterns/browser-agent/): Browser Agent is an AI design pattern for LLM apps and agents, in the Tools and action group. Navigate, read, and fill web pages using the DOM structure. (pt-BR: https://ai-guru-academy.vercel.app/pt-br/padroes/browser-agent/) - [MCP Adapter](https://ai-guru-academy.vercel.app/en/patterns/mcp-adapter/): MCP Adapter is an AI design pattern for LLM apps and agents, in the Tools and action group. Expose systems as MCP servers so any agent uses the same contract. (pt-BR: https://ai-guru-academy.vercel.app/pt-br/padroes/mcp-adapter/) - [Tool Result Summarizer](https://ai-guru-academy.vercel.app/en/patterns/tool-result-summarizer/): Tool Result Summarizer is an AI design pattern for LLM apps and agents, in the Tools and action group. Shrink large tool responses to what matters before they reach the model. (pt-BR: https://ai-guru-academy.vercel.app/pt-br/padroes/tool-result-summarizer/) - [Dry Run](https://ai-guru-academy.vercel.app/en/patterns/dry-run/): Dry Run is an AI design pattern for LLM apps and agents, in the Tools and action group. Produce the action plan and show its effect before actually running it. (pt-BR: https://ai-guru-academy.vercel.app/pt-br/padroes/dry-run/) - [Idempotent Action](https://ai-guru-academy.vercel.app/en/patterns/idempotent-action/): Idempotent Action is an AI design pattern for LLM apps and agents, in the Tools and action group. Make sure repeating the same call never duplicates the effect. (pt-BR: https://ai-guru-academy.vercel.app/pt-br/padroes/idempotent-action/) - [Compensating Action](https://ai-guru-academy.vercel.app/en/patterns/compensating-action/): Compensating Action is an AI design pattern for LLM apps and agents, in the Tools and action group. For every step with an effect, have a step that undoes it, as in a saga. (pt-BR: https://ai-guru-academy.vercel.app/pt-br/padroes/compensating-action/) - [ReAct Loop](https://ai-guru-academy.vercel.app/en/patterns/react-loop/): ReAct Loop is an AI design pattern for LLM apps and agents, in the Agent behavior group. Alternate reasoning, action, and observation until the task is done. (pt-BR: https://ai-guru-academy.vercel.app/pt-br/padroes/react-loop/) - [Plan-then-Execute](https://ai-guru-academy.vercel.app/en/patterns/plan-then-execute/): Plan-then-Execute is an AI design pattern for LLM apps and agents, in the Agent behavior group. Write the full plan first and execute steps with a simpler model or with code. (pt-BR: https://ai-guru-academy.vercel.app/pt-br/padroes/plan-then-execute/) - [Replanning](https://ai-guru-academy.vercel.app/en/patterns/replanning/): Replanning is an AI design pattern for LLM apps and agents, in the Agent behavior group. Revise the plan when reality does not match expectations. (pt-BR: https://ai-guru-academy.vercel.app/pt-br/padroes/replanning/) - [Reflection](https://ai-guru-academy.vercel.app/en/patterns/reflection/): Reflection is an AI design pattern for LLM apps and agents, in the Agent behavior group. Have the model critique its own result against an external signal and fix it. (pt-BR: https://ai-guru-academy.vercel.app/pt-br/padroes/reflection/) - [Self-Consistency](https://ai-guru-academy.vercel.app/en/patterns/self-consistency/): Self-Consistency is an AI design pattern for LLM apps and agents, in the Agent behavior group. Generate several reasoning paths and keep the most frequent answer. (pt-BR: https://ai-guru-academy.vercel.app/pt-br/padroes/self-consistency/) - [Tree of Thoughts](https://ai-guru-academy.vercel.app/en/patterns/tree-of-thoughts/): Tree of Thoughts is an AI design pattern for LLM apps and agents, in the Agent behavior group. Explore alternatives as a tree, score each branch, and prune the bad ones. (pt-BR: https://ai-guru-academy.vercel.app/pt-br/padroes/tree-of-thoughts/) - [Human-in-the-Loop](https://ai-guru-academy.vercel.app/en/patterns/human-in-the-loop/): Human-in-the-Loop is an AI design pattern for LLM apps and agents, in the Agent behavior group. Pause at defined points for a human to approve, edit, or reject. (pt-BR: https://ai-guru-academy.vercel.app/pt-br/padroes/human-in-the-loop/) - [Multi-Agent Handoff](https://ai-guru-academy.vercel.app/en/patterns/multi-agent-handoff/): Multi-Agent Handoff is an AI design pattern for LLM apps and agents, in the Agent behavior group. Transfer the conversation to another specialist agent along with the needed state. (pt-BR: https://ai-guru-academy.vercel.app/pt-br/padroes/multi-agent-handoff/) - [Subagent Delegation](https://ai-guru-academy.vercel.app/en/patterns/subagent-delegation/): Subagent Delegation is an AI design pattern for LLM apps and agents, in the Agent behavior group. The main agent spawns subagents for focused tasks and receives only the conclusion. (pt-BR: https://ai-guru-academy.vercel.app/pt-br/padroes/subagent-delegation/) - [Supervisor](https://ai-guru-academy.vercel.app/en/patterns/supervisor/): Supervisor is an AI design pattern for LLM apps and agents, in the Agent behavior group. One agent coordinates others, decides who works, and checks the delivery. (pt-BR: https://ai-guru-academy.vercel.app/pt-br/padroes/supervisor/) - [Debate](https://ai-guru-academy.vercel.app/en/patterns/debate/): Debate is an AI design pattern for LLM apps and agents, in the Agent behavior group. Two or more models argue positions and a judge decides. (pt-BR: https://ai-guru-academy.vercel.app/pt-br/padroes/debate/) - [Stop Conditions](https://ai-guru-academy.vercel.app/en/patterns/stop-conditions/): Stop Conditions is an AI design pattern for LLM apps and agents, in the Agent behavior group. Define clearly when the agent is done, has given up, or needs help. (pt-BR: https://ai-guru-academy.vercel.app/pt-br/padroes/stop-conditions/) - [Long-Running Agent](https://ai-guru-academy.vercel.app/en/patterns/long-running-agent/): Long-Running Agent is an AI design pattern for LLM apps and agents, in the Agent behavior group. Keep an agent working for hours or days with goals, checkpoints, and reports. (pt-BR: https://ai-guru-academy.vercel.app/pt-br/padroes/long-running-agent/) - [Input Guardrails](https://ai-guru-academy.vercel.app/en/patterns/input-guardrails/): Input Guardrails is an AI design pattern for LLM apps and agents, in the Safety and reliability group. Check input before the main model: topic, abuse, injection, and sensitive data. (pt-BR: https://ai-guru-academy.vercel.app/pt-br/padroes/input-guardrails/) - [Output Guardrails](https://ai-guru-academy.vercel.app/en/patterns/output-guardrails/): Output Guardrails is an AI design pattern for LLM apps and agents, in the Safety and reliability group. Check the response before it reaches the user or a tool. (pt-BR: https://ai-guru-academy.vercel.app/pt-br/padroes/output-guardrails/) - [Dual LLM](https://ai-guru-academy.vercel.app/en/patterns/dual-llm/): Dual LLM is an AI design pattern for LLM apps and agents, in the Safety and reliability group. A quarantined model reads untrusted content; another, with tools, only sees the structured result. (pt-BR: https://ai-guru-academy.vercel.app/pt-br/padroes/dual-llm/) - [Least-Privilege Tools](https://ai-guru-academy.vercel.app/en/patterns/least-privilege-tools/): Least-Privilege Tools is an AI design pattern for LLM apps and agents, in the Safety and reliability group. Each tool with its own scope, credential, and limits. (pt-BR: https://ai-guru-academy.vercel.app/pt-br/padroes/least-privilege-tools/) - [Constitutional Check](https://ai-guru-academy.vercel.app/en/patterns/constitutional-check/): Constitutional Check is an AI design pattern for LLM apps and agents, in the Safety and reliability group. Grade the response against a short list of written principles and revise on violation. (pt-BR: https://ai-guru-academy.vercel.app/pt-br/padroes/constitutional-check/) - [Fallback Model](https://ai-guru-academy.vercel.app/en/patterns/fallback-model/): Fallback Model is an AI design pattern for LLM apps and agents, in the Safety and reliability group. Keep another model or provider ready to take over when the main one fails. (pt-BR: https://ai-guru-academy.vercel.app/pt-br/padroes/fallback-model/) - [Circuit Breaker](https://ai-guru-academy.vercel.app/en/patterns/circuit-breaker/): Circuit Breaker is an AI design pattern for LLM apps and agents, in the Safety and reliability group. Stop calling a failing service and resume once it recovers. (pt-BR: https://ai-guru-academy.vercel.app/pt-br/padroes/circuit-breaker/) - [Output Validation and Repair](https://ai-guru-academy.vercel.app/en/patterns/output-validation-repair/): Output Validation and Repair is an AI design pattern for LLM apps and agents, in the Safety and reliability group. Validate output with code and, on failure, send the error back to the model to fix. (pt-BR: https://ai-guru-academy.vercel.app/pt-br/padroes/output-validation-repair/) - [PII Redaction](https://ai-guru-academy.vercel.app/en/patterns/pii-redaction/): PII Redaction is an AI design pattern for LLM apps and agents, in the Safety and reliability group. Remove or mask personal data before the model and the logs, in line with privacy law. (pt-BR: https://ai-guru-academy.vercel.app/pt-br/padroes/pii-redaction/) - [Audit Log](https://ai-guru-academy.vercel.app/en/patterns/audit-log/): Audit Log is an AI design pattern for LLM apps and agents, in the Safety and reliability group. Record who asked, what the model saw, what it decided, and what it ran. (pt-BR: https://ai-guru-academy.vercel.app/pt-br/padroes/audit-log/) - [Eval Harness](https://ai-guru-academy.vercel.app/en/patterns/eval-harness/): Eval Harness is an AI design pattern for LLM apps and agents, in the Operations and quality group. Run test cases automatically on every prompt, model, or code change. (pt-BR: https://ai-guru-academy.vercel.app/pt-br/padroes/eval-harness/) - [LLM-as-Judge](https://ai-guru-academy.vercel.app/en/patterns/llm-as-judge/): LLM-as-Judge is an AI design pattern for LLM apps and agents, in the Operations and quality group. Use a model with a rubric to grade answers that have no exact expected output. (pt-BR: https://ai-guru-academy.vercel.app/pt-br/padroes/llm-as-judge/) - [Golden Dataset](https://ai-guru-academy.vercel.app/en/patterns/golden-dataset/): Golden Dataset is an AI design pattern for LLM apps and agents, in the Operations and quality group. Keep a curated set of inputs and expected answers that grows with real bugs. (pt-BR: https://ai-guru-academy.vercel.app/pt-br/padroes/golden-dataset/) - [Shadow Deploy](https://ai-guru-academy.vercel.app/en/patterns/shadow-deploy/): Shadow Deploy is an AI design pattern for LLM apps and agents, in the Operations and quality group. Run the new version alongside real traffic, hidden from users, and compare. (pt-BR: https://ai-guru-academy.vercel.app/pt-br/padroes/shadow-deploy/) - [Model Cascade](https://ai-guru-academy.vercel.app/en/patterns/model-cascade/): Model Cascade is an AI design pattern for LLM apps and agents, in the Operations and quality group. Start with the cheapest model and move up only when needed. (pt-BR: https://ai-guru-academy.vercel.app/pt-br/padroes/model-cascade/) - [Semantic Cache](https://ai-guru-academy.vercel.app/en/patterns/semantic-cache/): Semantic Cache is an AI design pattern for LLM apps and agents, in the Operations and quality group. Answer equivalent questions with an already generated response. (pt-BR: https://ai-guru-academy.vercel.app/pt-br/padroes/semantic-cache/) - [Prompt Caching](https://ai-guru-academy.vercel.app/en/patterns/prompt-caching/): Prompt Caching is an AI design pattern for LLM apps and agents, in the Operations and quality group. Reuse the fixed prompt prefix to cut cost and latency. (pt-BR: https://ai-guru-academy.vercel.app/pt-br/padroes/prompt-caching/) - [Cost Budget](https://ai-guru-academy.vercel.app/en/patterns/cost-budget/): Cost Budget is an AI design pattern for LLM apps and agents, in the Operations and quality group. Measure and cap spending per task, user, and day, with alerts and a cut-off plan. (pt-BR: https://ai-guru-academy.vercel.app/pt-br/padroes/cost-budget/) ## Real-world scenarios Case studies told from the start: the naive version, what broke in production, the refactorings, and the final architecture. Index: https://ai-guru-academy.vercel.app/en/scenarios/ - [Support bot with human escalation](https://ai-guru-academy.vercel.app/en/scenarios/support-bot-escalation/): Support bot with human escalation is a real-world case study of an LLM system, in the Customer service group. A WhatsApp bot that answers questions, looks up orders, and knows when to call a human. (pt-BR: https://ai-guru-academy.vercel.app/pt-br/cenarios/support-bot-escalation/) - [Automatic ticket triage](https://ai-guru-academy.vercel.app/en/scenarios/ticket-triage/): Automatic ticket triage is a real-world case study of an LLM system, in the Customer service group. Classify thousands of tickets a day by queue, priority, and product. (pt-BR: https://ai-guru-academy.vercel.app/pt-br/cenarios/ticket-triage/) - [Call center voice assistant](https://ai-guru-academy.vercel.app/en/scenarios/call-center-voice/): Call center voice assistant is a real-world case study of an LLM system, in the Customer service group. Handle live calls with response time under one second. (pt-BR: https://ai-guru-academy.vercel.app/pt-br/cenarios/call-center-voice/) - [Coding agent](https://ai-guru-academy.vercel.app/en/scenarios/coding-agent/): Coding agent is a real-world case study of an LLM system, in the Engineering group. An agent that reads the repo, edits files, runs tests, and opens a PR. (pt-BR: https://ai-guru-academy.vercel.app/pt-br/cenarios/coding-agent/) - [Automated PR reviewer](https://ai-guru-academy.vercel.app/en/scenarios/pr-reviewer/): Automated PR reviewer is a real-world case study of an LLM system, in the Engineering group. Comment on PRs with real findings and few false positives. (pt-BR: https://ai-guru-academy.vercel.app/pt-br/cenarios/pr-reviewer/) - [Test generator](https://ai-guru-academy.vercel.app/en/scenarios/test-generator/): Test generator is a real-world case study of an LLM system, in the Engineering group. Generate tests that compile, pass, and catch real bugs. (pt-BR: https://ai-guru-academy.vercel.app/pt-br/cenarios/test-generator/) - [Legacy code migration](https://ai-guru-academy.vercel.app/en/scenarios/legacy-migration/): Legacy code migration is a real-world case study of an LLM system, in the Engineering group. Migrate hundreds of files off an old framework over several days. (pt-BR: https://ai-guru-academy.vercel.app/pt-br/cenarios/legacy-migration/) - [On-call incident agent](https://ai-guru-academy.vercel.app/en/scenarios/incident-agent/): On-call incident agent is a real-world case study of an LLM system, in the Engineering group. Investigate alerts, read logs, and suggest the likely cause before the human wakes up. (pt-BR: https://ai-guru-academy.vercel.app/pt-br/cenarios/incident-agent/) - [Invoice and contract extraction](https://ai-guru-academy.vercel.app/en/scenarios/nfe-contract-extraction/): Invoice and contract extraction is a real-world case study of an LLM system, in the Data and documents group. Read invoices and contracts in PDF and fill the ERP with no manual typing. (pt-BR: https://ai-guru-academy.vercel.app/pt-br/cenarios/nfe-contract-extraction/) - [Internal knowledge base chat](https://ai-guru-academy.vercel.app/en/scenarios/internal-knowledge-chat/): Internal knowledge base chat is a real-world case study of an LLM system, in the Data and documents group. Answer employee questions from wikis, policies, and manuals. (pt-BR: https://ai-guru-academy.vercel.app/pt-br/cenarios/internal-knowledge-chat/) - [Deep research with citations](https://ai-guru-academy.vercel.app/en/scenarios/deep-research/): Deep research with citations is a real-world case study of an LLM system, in the Data and documents group. Investigate an open question across dozens of sources and deliver a cited report. (pt-BR: https://ai-guru-academy.vercel.app/pt-br/cenarios/deep-research/) - [Spreadsheet analysis with code execution](https://ai-guru-academy.vercel.app/en/scenarios/spreadsheet-analysis/): Spreadsheet analysis with code execution is a real-world case study of an LLM system, in the Data and documents group. Answer spreadsheet questions by writing and running code, not by guessing numbers. (pt-BR: https://ai-guru-academy.vercel.app/pt-br/cenarios/spreadsheet-analysis/) - [Natural language to SQL](https://ai-guru-academy.vercel.app/en/scenarios/text-to-sql/): Natural language to SQL is a real-world case study of an LLM system, in the Data and documents group. Let business teams query the database without knowing SQL and without risk of damage. (pt-BR: https://ai-guru-academy.vercel.app/pt-br/cenarios/text-to-sql/) - [Automated sales SDR](https://ai-guru-academy.vercel.app/en/scenarios/sales-sdr/): Automated sales SDR is a real-world case study of an LLM system, in the Business group. Research leads, write the first message, and book a meeting. (pt-BR: https://ai-guru-academy.vercel.app/pt-br/cenarios/sales-sdr/) - [Legal assistant](https://ai-guru-academy.vercel.app/en/scenarios/legal-assistant/): Legal assistant is a real-world case study of an LLM system, in the Business group. Review contracts, flag risky clauses, and cite the legal basis. (pt-BR: https://ai-guru-academy.vercel.app/pt-br/cenarios/legal-assistant/) - [Resume screening with bias control](https://ai-guru-academy.vercel.app/en/scenarios/resume-screening/): Resume screening with bias control is a real-world case study of an LLM system, in the Business group. Pre-screen candidates in an explainable, auditable way. (pt-BR: https://ai-guru-academy.vercel.app/pt-br/cenarios/resume-screening/) - [Content moderation](https://ai-guru-academy.vercel.app/en/scenarios/content-moderation/): Content moderation is a real-world case study of an LLM system, in the Business group. Moderate text and images at scale with a clear policy and low cost. (pt-BR: https://ai-guru-academy.vercel.app/pt-br/cenarios/content-moderation/) - [Personal finance assistant with approval](https://ai-guru-academy.vercel.app/en/scenarios/personal-finance-assistant/): Personal finance assistant with approval is a real-world case study of an LLM system, in the Business group. Read statements, suggest payments, and schedule Pix transfers only with explicit confirmation. (pt-BR: https://ai-guru-academy.vercel.app/pt-br/cenarios/personal-finance-assistant/) - [Conversational onboarding](https://ai-guru-academy.vercel.app/en/scenarios/conversational-onboarding/): Conversational onboarding is a real-world case study of an LLM system, in the Product group. Sign up customers over WhatsApp, collect documents, and resume days later. (pt-BR: https://ai-guru-academy.vercel.app/pt-br/cenarios/conversational-onboarding/) - [E-commerce semantic search](https://ai-guru-academy.vercel.app/en/scenarios/ecommerce-semantic-search/): E-commerce semantic search is a real-world case study of an LLM system, in the Product group. Understand running shoes for rainy days and find the right product in milliseconds. (pt-BR: https://ai-guru-academy.vercel.app/pt-br/cenarios/ecommerce-semantic-search/) - [Educational tutor](https://ai-guru-academy.vercel.app/en/scenarios/edu-tutor/): Educational tutor is a real-world case study of an LLM system, in the Product group. A tutor that remembers the student, adapts exercises, and never just hands over the answer. (pt-BR: https://ai-guru-academy.vercel.app/pt-br/cenarios/edu-tutor/) - [Browser agent for repetitive tasks](https://ai-guru-academy.vercel.app/en/scenarios/browser-task-agent/): Browser agent for repetitive tasks is a real-world case study of an LLM system, in the Product group. Fetch duplicate bills, download invoices, and fill portals that have no API. (pt-BR: https://ai-guru-academy.vercel.app/pt-br/cenarios/browser-task-agent/) - [Content creation pipeline](https://ai-guru-academy.vercel.app/en/scenarios/content-pipeline/): Content creation pipeline is a real-world case study of an LLM system, in the Product group. From brief to published post, with research, draft, review, and brand check. (pt-BR: https://ai-guru-academy.vercel.app/pt-br/cenarios/content-pipeline/) - [Health assistant with guardrails](https://ai-guru-academy.vercel.app/en/scenarios/health-assistant/): Health assistant with guardrails is a real-world case study of an LLM system, in the Product group. Answer patient questions without diagnosing and knowing when to refer to a doctor. (pt-BR: https://ai-guru-academy.vercel.app/pt-br/cenarios/health-assistant/) - [Back-office automation with durable execution](https://ai-guru-academy.vercel.app/en/scenarios/back-office-automation/): Back-office automation with durable execution is a real-world case study of an LLM system, in the Product group. Reconcile payments, issue invoices, and collect from customers in processes that last days. (pt-BR: https://ai-guru-academy.vercel.app/pt-br/cenarios/back-office-automation/)