Prompt Engineering FAQ
Getting Started Questions
What is this course about?
This course, Prompt Engineering: From Fundamentals to Agentic AI, teaches you how to write effective instructions for large language models (LLMs) to produce accurate, relevant, and useful responses. It covers the full spectrum of prompt engineering — from basic principles like clarity and specificity through advanced techniques such as chain-of-thought reasoning, few-shot learning, retrieval-augmented generation (RAG), and agentic AI, where language models use tools and execute multi-step workflows autonomously. For a full overview, see the course description.
Who is this course for?
This course is designed for a general audience with at least a high school education. That includes business professionals, educators, students, and anyone seeking to communicate effectively with AI. No prior programming or AI experience is required. Whether you're a marketing manager drafting emails, a teacher designing lessons, or a curious learner exploring AI capabilities, this course meets you where you are. See the course description for more details.
What are the prerequisites for this course?
None. You need basic computer literacy and access to a web browser. Familiarity with any AI chatbot (such as ChatGPT, Claude, or Gemini) is helpful but not required. The course starts from the very beginning and builds up systematically.
How is the course structured?
The course is organized into 17 chapters that progress from foundational concepts to advanced topics. It begins with AI and ML Foundations and Prompt Fundamentals, moves through core and advanced techniques, covers specialized topics like RAG and Agentic AI, and concludes with Capstone Projects. There are also 17+ hands-on labs.
Do I need to install any software?
No special software installation is required. You'll primarily interact with AI through web-based chatbot interfaces like ChatGPT, Claude, or Gemini. Some labs use P5.js for interactive visualizations, which runs in your browser. A few data analysis labs use Python, but these are optional and clearly marked.
How long does the course take to complete?
The course is designed for classroom instruction but can also be completed through self-study. The 17 chapters plus labs provide enough material for a full semester course or an intensive multi-day workshop. You can also work through individual chapters and labs at your own pace.
What will I be able to do after completing this course?
You'll be able to write clear, well-structured prompts that consistently produce excellent AI responses, use advanced techniques like chain-of-thought and few-shot prompting, control output formats, manage context windows efficiently, evaluate AI outputs critically, and even design agentic workflows where AI systems use tools and execute complex tasks autonomously. See the full list of learning outcomes.
What AI tools does this course use?
The course is model-agnostic — the principles and techniques apply to any large language model. Labs and examples reference ChatGPT, Claude, and Gemini, but the skills transfer to any current or future AI system. The emphasis is on how to communicate effectively with AI, not on any specific tool.
Is this course free?
Yes. All course content is available online under a Creative Commons BY-NC-SA 4.0 license, which means you can use, share, and adapt the materials for non-commercial educational purposes with proper attribution.
How is prompt engineering different from programming?
Programming involves writing code in formal languages (Python, JavaScript, etc.) with strict syntax rules. Prompt engineering involves writing instructions in natural language — plain English — to guide AI behavior. You don't need to learn a programming language. However, the underlying skills are similar: clear thinking, specificity, structured communication, and iterative refinement. Both are about giving precise instructions to a computer system.
What makes this course different from other prompt engineering resources?
This course was first taught in March 2020 and has been continuously updated since. It emphasizes hands-on labs with real AI systems, teaches a systematic approach grounded in learning science (Bloom's Taxonomy), and covers the full range from basic prompting through agentic AI. Unlike many resources that focus on "secret hacks," this course builds genuine, transferable skills. The underlying message: good communication with AI is a superpower, not a gimmick.
How do I navigate the textbook?
Use the navigation menu on the left side of the site. Chapters are numbered sequentially and designed to be read in order, though you can jump to specific topics of interest. Each chapter lists its prerequisite chapters at the bottom. Labs are organized separately and can be completed alongside the relevant chapters.
Core Concept Questions
What is a large language model?
A Large Language Model (LLM) is a type of generative AI that specializes in understanding and producing human language. Models like GPT-4, Claude, Gemini, and Llama are all LLMs. They're called "large" because they have billions of parameters and are trained on enormous datasets. LLMs can answer questions, write essays and code, translate languages, summarize documents, analyze data, and much more. The same model that writes your marketing copy can debug your Python code — it all depends on how you prompt it. Learn more in Chapter 1.
What is a prompt?
A prompt is simply the text you send to an AI model. It can be a quick question like "What's the capital of France?" or a 500-word instruction with examples, formatting requirements, and persona definitions. The quality of the prompt directly determines the quality of the response — this is the core insight behind prompt engineering. See Chapter 2 for details.
What is prompt engineering?
Prompt engineering is the systematic practice of crafting prompts that consistently produce excellent results from AI models. It involves understanding how to structure instructions, provide context, set constraints, specify output formats, and iteratively refine your prompts based on the responses you receive. It's a skill that combines clear communication, structured thinking, and knowledge of how AI models work. This entire course is dedicated to building that skill. Start with Chapter 2.
What are tokens and why do they matter?
Tokens are the small chunks of text that AI models process. A token is roughly 3/4 of a word in English. "Hello" is 1 token, while "unbelievable" might be 2-3 tokens. Tokens matter for two reasons: cost (most AI services charge per token) and limits (every model has a maximum context window measured in tokens). Understanding tokens helps you write prompts that are efficient and stay within bounds. See Chapter 1 and Chapter 14.
What is a context window?
The context window is the maximum number of tokens an AI model can consider at once — both your input and its output combined. Think of it as the model's working memory. Current frontier models support 100,000-200,000+ tokens. A larger context window lets you provide more examples and background information, but models can sometimes lose track of information buried in very long contexts. Learn strategies for managing this in Chapter 7.
What is the difference between zero-shot, one-shot, and few-shot prompting?
These techniques differ in how many examples you provide. Zero-shot gives no examples — you just describe the task. One-shot provides one example to demonstrate the expected format. Few-shot provides 2-5+ examples to establish a clear pattern. Zero-shot is fast but less precise; few-shot is more precise but uses more tokens. The right choice depends on your task complexity and format requirements. See Chapter 4 for detailed comparisons and examples.
What is chain-of-thought prompting?
Chain-of-thought (CoT) prompting asks the AI to explain its reasoning step by step before arriving at a final answer. Simply adding "Let's think step by step" to your prompt can dramatically improve accuracy on math, logic, and multi-step reasoning tasks — sometimes by over 50%. The technique works because it forces the model to lay out intermediate reasoning tokens before jumping to a conclusion. See Chapter 4.
What is retrieval-augmented generation (RAG)?
Retrieval-augmented generation (RAG) is a technique that enhances AI responses by first retrieving relevant information from an external knowledge base, then using that information to generate a grounded, accurate answer. RAG helps overcome the knowledge cutoff limitation of LLMs and reduces hallucination by anchoring responses in specific source documents. Learn about RAG and its advanced variant GraphRAG in Chapter 8.
What is GraphRAG?
GraphRAG is an advanced form of retrieval-augmented generation that uses knowledge graphs to answer questions that depend on relationships between entities. While traditional RAG retrieves relevant text chunks, GraphRAG traverses a structured graph of connected concepts, enabling it to answer multi-hop relationship questions that traditional RAG cannot handle well. See Chapter 8.
What is an AI agent?
An AI agent is a software system that uses a language model as its reasoning engine to autonomously plan, decide, and take actions to achieve a goal. Unlike a chatbot (which waits for your next question), an agent receives a high-level objective, breaks it into steps, selects tools, executes them, evaluates results, and adjusts its plan as needed. Agents represent a fundamental shift from question-and-answer interaction to goal-driven autonomy. See Chapter 12.
What is prompt chaining?
Prompt chaining is the practice of using the output of one prompt as the input to the next, creating a sequence of prompts that work together to accomplish a complex task. Think of it like an assembly line: each prompt handles one specific job. Chaining produces higher-quality results than trying to do everything in a single massive prompt because each step is focused and manageable. See Chapter 4.
What is a system prompt?
A system prompt is a set of hidden instructions that shape the AI model's behavior throughout a conversation. It defines the model's role, personality, constraints, and response guidelines. System prompts are separate from user prompts and are typically set by developers building AI applications. They're a powerful tool for consistent, controlled AI behavior. Learn about system prompts in Chapter 4.
What is the transformer architecture?
The Transformer is the neural network architecture that powers virtually every modern large language model. Introduced in 2017 in the paper "Attention Is All You Need," transformers use an attention mechanism that allows the model to look at all words in a passage simultaneously and understand how they relate to each other. This parallel processing also made them enormously faster to train, enabling the creation of truly massive language models. See Chapter 1.
What is hallucination in AI?
Hallucination occurs when an AI model generates confident-sounding information that is factually incorrect or entirely fabricated. Models don't "know" they're wrong — they predict tokens based on patterns, and sometimes those patterns produce plausible-sounding nonsense. Hallucination is one of the most important risks to understand as a prompt engineer. Techniques like RAG, chain-of-thought prompting, and explicit verification requests can reduce hallucination. See Chapter 8.
What is the difference between pre-training and fine-tuning?
Pre-training is the initial training phase where a model learns language patterns from massive amounts of text by playing a prediction game: given a sequence of tokens, predict the next one. Fine-tuning takes that pre-trained model and trains it further on a smaller, specific dataset to adapt it for particular tasks or behaviors — like following instructions, refusing harmful requests, or specializing in a domain. Pre-training gives the model knowledge; fine-tuning gives it specialization. See Chapter 1.
How does inference work in language models?
Inference is the process of a trained model generating a response to your input. Language models generate text one token at a time, from left to right. Each time the model produces a token, it considers everything that came before and predicts the most likely next token. This is why the text appears word by word in chat interfaces. This token-by-token generation is also why chain-of-thought prompting works — it forces the model to lay out reasoning before jumping to a conclusion. See Chapter 1.
What is a prompt template?
A prompt template is a reusable prompt structure with placeholders (often marked with curly braces) that you fill in for each new use case. Templates capture proven prompt patterns so you and your team can use them consistently. For example, a template might define the role, task structure, and output format, with variables for the specific content. Building a library of templates is one of the most practical things you can do as a prompt engineer. See Chapter 4.
What are the five components of a well-structured prompt?
A well-structured prompt typically contains: (1) Role — who the AI should be, (2) Task — what it should do, (3) Context — background information it needs, (4) Constraints — limitations to follow, and (5) Output format — how the response should be structured. Not every prompt needs all five, but for complex requests, including more components consistently produces better results. See Chapter 2.
What is output format specification?
Output format specification is the practice of explicitly declaring the desired structure, syntax, and layout of an AI model's response. AI models can produce output in Markdown, JSON, CSV, XML, YAML, HTML, tables, numbered lists, and more — they just need clear instructions about which format to use. This skill separates casual AI users from people who get things done efficiently. See Chapter 6.
What is the difference between a chatbot and an AI agent?
A chatbot follows a question-and-answer pattern — you ask, it responds. An AI agent receives a high-level goal and autonomously plans, selects tools, executes steps, monitors results, and adjusts its approach. The chatbot is like a reference librarian; the agent is like a research assistant who goes off to gather data and comes back with a finished product. The key difference is autonomy. See Chapter 12.
What is function calling in AI?
Function calling is the mechanism by which a language model requests the execution of a predefined function. The model generates structured output (typically JSON) specifying which function to call and what arguments to pass. The system executes the function and returns the result. Importantly, the model never runs the function itself — it requests execution, and the surrounding system handles it. This separation is critical for security. See Chapter 12.
Technical Detail Questions
What does "temperature" mean in AI model settings?
Temperature is a parameter that controls the randomness of a model's output. A lower temperature (e.g., 0.1) makes the model more deterministic and focused, producing predictable, conservative responses. A higher temperature (e.g., 0.9) increases randomness, producing more creative and varied outputs. For factual tasks, use low temperature. For brainstorming or creative writing, use higher temperature. See Chapter 3.
What is Top-P sampling?
Top-P sampling (also called nucleus sampling) is an alternative to temperature for controlling output randomness. Instead of scaling all token probabilities, Top-P limits the model to consider only the smallest set of tokens whose cumulative probability exceeds a threshold P. For example, Top-P of 0.9 means the model considers the most likely tokens that together account for 90% of the probability mass. See Chapter 3.
What are frequency penalty and presence penalty?
These parameters discourage the model from repeating itself. Frequency penalty reduces the likelihood of tokens that have already appeared, proportional to how many times they've appeared. Presence penalty applies a flat penalty to any token that has appeared at all, regardless of count. Use frequency penalty to reduce repetitive phrasing and presence penalty to encourage the model to explore new topics. See Chapter 3.
What is the max tokens setting?
The max tokens setting limits the maximum length of the model's response. If you set max tokens to 500, the model will stop generating after 500 tokens even if its response isn't complete. This is useful for controlling costs and ensuring concise responses, but set it too low and you'll get truncated answers. See Chapter 3.
What are stop sequences?
Stop sequences are specific strings that tell the model to stop generating when they appear in the output. For example, you might set a stop sequence of "---" so the model stops when it reaches a divider. This gives you precise control over where the response ends, which is especially useful when generating structured data or multiple items. See Chapter 3.
What is the difference between JSON, CSV, and XML output?
These are different structured data formats that AI models can produce. JSON (JavaScript Object Notation) is lightweight and widely used in web applications — great for nested data. CSV (Comma-Separated Values) is simple and works well for tabular data that will go into spreadsheets. XML (Extensible Markup Language) is more verbose but supports complex hierarchical data with custom tags. Choose based on your downstream use case. See Chapter 6.
What is tokenization?
Tokenization is the process of splitting text into tokens before an AI model can process it. A token isn't exactly a word — it's a chunk of text the model has learned to recognize. Common words like "the" are usually one token, while longer words get split into multiple tokens. Understanding tokenization helps you estimate costs and stay within context window limits. See Chapter 1.
What is a vector database?
A vector database is a specialized database that stores and retrieves data as high-dimensional vectors (numerical representations). In the context of RAG, documents are converted into vector embeddings and stored in a vector database. When you ask a question, your query is also converted to a vector, and the database finds the most semantically similar documents. This enables semantic search — finding content by meaning, not just keywords. See Chapter 8.
What are embeddings?
An embedding is a numerical representation of text (or other data) as a vector of numbers. Embeddings capture semantic meaning: words and phrases with similar meanings have vectors that are close together in the embedding space. Embeddings power semantic search, recommendation systems, and the retrieval step in RAG pipelines. See Chapter 8.
What is document chunking?
Document chunking is the process of splitting large documents into smaller, manageable pieces for storage in a vector database. Chunk size matters: chunks that are too small lose context, while chunks that are too large may contain irrelevant information. Good chunking strategies consider natural document boundaries (paragraphs, sections) and overlap between chunks to preserve context. See Chapter 8.
What is the seed parameter?
The seed parameter allows you to set a fixed starting point for the model's random number generator, enabling more reproducible outputs. When you use the same seed with the same prompt and parameters, you'll get the same (or very similar) response each time. This is useful for testing and debugging prompts. See Chapter 3.
What is the difference between input tokens and output tokens for pricing?
Input tokens (your prompt, system message, and context) and output tokens (the model's response) are priced differently. Output tokens almost always cost 3-5x more than input tokens because generating new text requires more computation than processing existing text. This means every unnecessary word you ask the model to generate costs significantly more than extra context you send it. See Chapter 14.
What is rate limiting?
Rate limiting is a restriction on how many API requests you can make within a given time period. AI providers impose rate limits to prevent system overload and ensure fair access. Rate limits may apply per minute, per hour, or per day, and can restrict both the number of requests and the total tokens processed. Exceeding rate limits results in temporary throttling. See Chapter 14.
What is the five-hour token window?
The five-hour token window is a usage measurement period used by some AI platforms (including Claude) to track consumption. Instead of monthly caps, usage is measured within rolling five-hour windows. When you hit your limit within a window, you may experience throttling or reduced access until the window resets. Understanding this helps you plan intensive work sessions. See Chapter 14.
What is content moderation in AI systems?
Content moderation refers to the automated filtering and review of AI inputs and outputs to prevent the generation of harmful, inappropriate, or policy-violating content. This includes filtering hate speech, explicit content, dangerous instructions, and other categories of harmful output. Content moderation is a key layer in AI safety, working alongside guardrails and output filtering. See Chapter 11.
Common Challenge Questions
Why does the AI give me vague or generic responses?
The most common cause is a vague or generic prompt. If you ask "Tell me about dogs," you'll get a generic overview. Instead, be specific: include quantities, dimensions, scope, quality criteria, and audience. For example: "List 5 differences between Golden Retrievers and Labrador Retrievers in a markdown table." Every detail you don't specify is a decision the model makes for you. Review the principles of instruction clarity and specificity.
How do I fix responses that are too long or too short?
Explicitly state the desired length in your prompt. Use specific measurements: "Write exactly 200 words," "Respond in 3 bullet points," or "Keep your answer under 100 words." You can also use the max tokens parameter to enforce a hard length limit. For shorter responses, ask for "concise" or "brief" output. For longer ones, request "detailed" or "comprehensive" responses with specific section requirements. See Chapter 2.
What should I do when the AI hallucinates incorrect facts?
First, always verify critical facts independently. To reduce hallucination: (1) use chain-of-thought prompting so you can check the reasoning, (2) explicitly ask the model to cite sources or say "I don't know" when uncertain, (3) use RAG to ground responses in verified documents, (4) apply self-consistency by generating multiple responses and checking for agreement, and (5) lower the temperature setting for more deterministic outputs. See Chapter 8 and Chapter 4.
Why does the AI not follow my formatting instructions?
Common causes include: burying format instructions at the end of a long prompt (put them near the beginning), using ambiguous format descriptions ("make it pretty" vs. "use a markdown table with columns X, Y, Z"), or conflicting instructions. Be explicit about the format, provide an example of the desired output structure, and use few-shot prompting to demonstrate the exact format you want. See Chapter 6.
How do I get consistent results across multiple runs?
AI responses have inherent randomness. To increase consistency: (1) lower the temperature to 0-0.2, (2) use the seed parameter for reproducible outputs, (3) provide detailed, unambiguous prompts with few-shot examples, and (4) use prompt templates for repeated tasks. For critical applications, use self-consistency — generate multiple responses and select the most common answer. See Chapter 3 and Chapter 4.
What do I do when my prompt is too long for the context window?
Strategies include: (1) summarize background information instead of including full documents, (2) use document chunking to include only relevant sections, (3) remove redundant examples from few-shot prompts, (4) implement RAG to dynamically retrieve only what's needed, (5) use prompt compression techniques, and (6) consider using a model with a larger context window. See Chapter 7.
How do I avoid bias in AI-generated content?
Be aware that AI models reflect biases in their training data. To mitigate bias: (1) explicitly instruct the model to be balanced and inclusive, (2) specify diverse perspectives in your prompt, (3) review outputs critically for stereotypes or one-sided representations, (4) test prompts with different demographic contexts, and (5) use inclusive language guidelines in your system prompts. See Chapter 10.
Why does the model sometimes ignore parts of my prompt?
Models can lose track of instructions in very long prompts, a phenomenon sometimes called "lost in the middle." Key instructions buried in the center of a long prompt may be overlooked. Solutions: (1) put critical instructions at the beginning and end of your prompt, (2) use numbered lists for multiple requirements, (3) break complex prompts into chained, focused steps, and (4) explicitly ask the model to address each requirement. See Chapter 2 and Chapter 7.
How do I handle tasks that are too complex for a single prompt?
Use task decomposition and prompt chaining. Break the complex task into smaller, manageable steps, where each prompt handles one well-defined subtask. Use the output from one step as input to the next. This approach produces higher-quality results, makes debugging easier, and lets you course-correct between steps. See Chapter 2 and Chapter 4.
What is prompt injection and how do I defend against it?
Prompt injection is an attack where someone crafts input that causes the AI to ignore its original instructions and follow the attacker's instructions instead. It works because language models don't inherently distinguish between developer instructions and user input — both are just tokens. Defenses include input validation, output filtering, separating system and user prompts, adding guardrails, and red teaming your applications. See Chapter 11.
How do I know which AI model to use for my task?
Match model capability to task complexity. Simple tasks (basic Q&A, formatting, translation) work fine with smaller, cheaper models. Complex tasks (multi-step reasoning, nuanced analysis, creative writing) benefit from larger, more capable models. Consider cost, latency, context window size, and specific strengths of each model. Test your prompts across multiple models to find the best fit. See Chapter 13 and Chapter 14.
Best Practice Questions
How do I write a good system prompt for an AI application?
A good system prompt defines the AI's role, capabilities, constraints, and response guidelines. Be specific about what the AI should and should not do. Include: the persona or expertise area, the target audience, formatting expectations, content boundaries, and safety guardrails. Test the system prompt with adversarial inputs to ensure it holds up. Keep it as concise as possible while covering all necessary behaviors. See Chapter 4 and Chapter 11.
When should I use few-shot examples versus detailed instructions?
Use few-shot examples when the desired output format or style is easier to demonstrate than describe, when you want highly consistent output patterns, or when the task is unusual and hard to specify in words. Use detailed instructions when the task is straightforward but needs constraints, when examples would use too many tokens, or when the task varies too much for fixed examples to apply. Often, combining both approaches works best. See Chapter 4.
What is the best way to iterate on prompts?
Follow a systematic refinement cycle: (1) write your initial prompt, (2) send it and evaluate the response, (3) diagnose what went wrong, (4) change one thing at a time so you understand what's working, (5) repeat until the response meets your standards. Keep notes on what works. Test with different inputs to ensure consistency. Don't expect perfection on the first try — iteration is the process, not a sign of failure. See Chapter 2.
How should I structure prompts for data analysis tasks?
Include: (1) the specific data to analyze or describe the dataset clearly, (2) the exact analysis you want performed, (3) the output format (table, chart description, bullet points), (4) any statistical methods to use or avoid, and (5) the audience for the analysis. Use prompt chaining for multi-step analyses: first explore the data, then compute statistics, then generate visualizations, then write interpretive summaries. See Chapter 6 and Chapter 15.
How do I use role assignment effectively?
Role assignment tells the AI to adopt a specific persona or expertise. Use it to shape both the content and tone of responses. Be specific: "You are a senior data scientist with 10 years of experience in healthcare analytics" is better than "You are an expert." The role influences vocabulary, depth of explanation, and perspective. Match the role to your audience and purpose. Don't assign conflicting roles. See Chapter 4.
When should I use an agentic workflow versus a simple prompt?
Use simple prompts for one-step tasks with clear inputs and outputs: writing emails, answering questions, translating text, summarizing documents. Use agentic workflows for complex, multi-step tasks that require tool use, external data retrieval, iterative refinement, or autonomous decision-making. Agentic approaches shine when the task involves searching databases, running code, coordinating multiple operations, or adapting based on intermediate results. See Chapter 12.
How can I reduce AI costs while maintaining quality?
Key strategies: (1) use the smallest model capable of handling your task, (2) keep prompts concise — cut unnecessary context, (3) limit output length with max tokens and explicit length instructions, (4) cache and reuse responses for identical queries, (5) use prompt templates to avoid reinventing prompts, (6) remember that output tokens cost 3-5x more than input tokens, so requesting shorter responses saves disproportionately. See Chapter 14.
What are the most important ethical guidelines for prompt engineering?
Key principles include: (1) fairness — design prompts that produce equitable treatment across groups, (2) transparency — be honest about AI involvement in content, (3) accountability — take responsibility for AI outputs you use, (4) privacy — never include personally identifiable information in prompts unnecessarily, (5) accuracy — verify AI outputs before sharing them as fact, and (6) attribution — respect intellectual property and copyright. See Chapter 10.
How do I build a reusable prompt library?
Start by saving prompts that work well, then formalize them: give each prompt a name, purpose, template, and notes about what works best and common pitfalls. Organize by use case (email drafting, code review, data analysis). Test each prompt across different inputs and models. Share with your team and iterate based on feedback. Version control your library so you can track improvements over time. See Chapter 4.
How do I evaluate the quality of AI responses?
Assess responses on four dimensions: (1) Relevance — does it address your question? (2) Accuracy — is the information correct? (3) Completeness — did it cover everything you asked for? (4) Conciseness — is every sentence necessary? These dimensions sometimes trade off against each other. For formal evaluation, create rubrics, use A/B testing, and combine human judgment with automated metrics. See Chapter 2 and Chapter 13.
How do I secure AI applications against adversarial attacks?
Implement defense in depth: (1) input validation — filter and sanitize user input before it reaches the model, (2) output filtering — scan responses for policy violations before displaying them, (3) guardrails — define clear boundaries in system prompts, (4) least privilege — give AI systems only the minimum permissions needed, (5) red teaming — actively test your system with adversarial inputs before deployment, (6) monitoring — log and review AI interactions for anomalies. See Chapter 11.
Advanced Topic Questions
How do multi-agent systems work?
Multi-agent systems divide complex work across multiple specialized AI agents. Common patterns include: manager-worker (one agent plans, workers execute), pipeline (agents arranged in sequence), debate (agents argue opposing perspectives), and review (one agent produces work, another critiques it). Each agent has its own tools, specialization, and area of responsibility. Multi-agent systems enable tackling problems too complex for any single agent. See Chapter 12.
What is the Tree of Thoughts technique?
Tree of Thoughts (ToT) is an advanced prompting technique where the model explores multiple reasoning branches at each step, evaluates which are most promising, and continues only along the best paths. Unlike chain-of-thought (a single reasoning path), ToT considers alternatives, evaluates trade-offs, and backtracks when a path leads nowhere. It's especially useful for creative tasks, strategic planning, and problems without a single right answer. See Chapter 4.
How do I design effective approval workflows for AI agents?
Place human approval at the boundary between planning and execution — let the agent plan freely but require approval before executing high-impact steps. Define which actions need approval (sending communications, financial transactions, modifying production systems, deleting data). Design escalation paths for when approval is denied. Balance automation efficiency with appropriate human oversight. Never deploy agents with unrestricted authority in production. See Chapter 12.
What is sandboxed execution and why is it important for agents?
Sandboxed execution runs an AI agent's actions within a restricted, isolated environment that limits what the agent can access and affect. Sandboxing is essential because agents that can run code, call APIs, and modify files could cause real damage. Strategies include container isolation (Docker), network restrictions, file system boundaries, resource limits, time limits, and permission scoping (principle of least privilege). See Chapter 12.
What is the future of prompt engineering?
As AI models become more capable and autonomous, prompt engineering becomes more important, not less. In the agentic era, prompts define autonomous behavior — an agent's system prompt controls its personality, capabilities, constraints, and safety boundaries. The skills you build in this course (clear communication, structured thinking, context management) are durable and transferable across model generations. Models will get bigger and smarter, but they'll still need well-crafted instructions. See Chapter 12.
How can I combine RAG with agentic AI?
Agents can use RAG as one of their tools — retrieving relevant information from knowledge bases before reasoning about a task. A RAG pipeline builder is one example of a capstone project that combines these concepts. The agent plans what information is needed, retrieves it from a vector database, verifies its relevance, and incorporates it into its reasoning. This combination produces grounded, accurate, autonomous workflows. See Chapter 8 and Chapter 17.
How do I evaluate and compare different prompt strategies?
Use systematic A/B testing: run the same inputs through different prompt versions and measure which produces better results against defined criteria. Track metrics like accuracy, relevance, completeness, consistency, cost, and latency. Use both human evaluation (for subjective quality) and automated metrics (for measurable dimensions). Document your experiments and maintain a prompt testing log. See Chapter 13.
What is meta-prompting?
Meta-prompting is the technique of using prompts to generate or improve other prompts. Instead of crafting a prompt yourself, you ask the AI to help you design an optimal prompt for a specific task. This is one of the most powerful advanced techniques because it leverages the model's understanding of what makes prompts effective. Meta-prompting can also be used to create prompt templates, evaluation rubrics, and entire prompt engineering workflows. See Lab 17.