Well, Actually: Your 'AI Agent' Is Probably Just a Chatbot With Delusions of Grandeur
This tutorial from freeCodeCamp demonstrates how to improve an AI agent through two distinct techniques. Prompt engineering refines the instructions you give the model. Context engineering improves the information you feed it. The author builds a simple local agent, establishes a baseline input, then iteratively improves performance through both methods.
You must separate what you tell the model from what you show the model. Most novices conflate these. Prompt engineering shapes behavior. Context engineering grounds that behavior in relevant facts. Master both and your agent stops hallucinating and starts performing.
The freeCodeCamp community, specifically an author building a local agent tutorial for developers. The approach targets practitioners working with open-source or locally-hosted models rather than API-only consumers.
Step 1: Open any chat interface with a large language model and ask it a complex question about a niche topic. Record the answer. This is your baseline. Step 2: Rewrite your question with explicit role assignment, output format, and constraints. For example, 'You are a meticulous research assistant. Answer in three bullet points. Cite uncertainty where appropriate.' Compare outputs. Step 3: Paste 2-3 relevant paragraphs from a credible source into the chat first, then ask your rewritten question. This is context engineering. Measure whether the second answer is more accurate than the first.