Part 2 - Comprehensive Study Guide on LLMs, RAG, and Agentic Prompting Prompt Engineering and AI Agents

LLM Data Cutoffs and External Tools

  • Large Language Models (LLMsLLMs) frequently have a training data cutoff which determines the limit of the information they "know" from their initial training phase.

  • Chatbots have recently improved this limitation by attaching external tools to the model.

  • Even if a model's training data ends at a specific date (e.g., September), these external tools allow the model to execute actions such as a web search.

  • Through this process, the model pulls in live results from the search and augments its context with this extra data. This influences how the model generates tokens, allowing it to provide current information not found in its original training sets.

Retrieval Augmented Generation (RAGRAG)

  • Over the last few years, the modern era of LLMLLM usage has evolved to integrate more data from outside the fixed training set.

  • The common industry term for this flow is Retrieval Augmented Generation (RAGRAG).

  • Literal Definition: It involves "retrieving" extra information and "augmenting" the generation of the response with that data.

  • Distinction between Training and Retrieval: Models have a fixed training set that evolves slowly when new models are released. RAGRAG allows for the pulling of additional, live information to influence output in real-time.

Understanding AI Hallucinations and Speed vs. Understanding

  • Hallucinations occur when a model provides incorrect information confidently.

  • High user confidence can lead to a dangerous mindset where users stop reading or verifying the output. For example, programmers using tools to write code quickly may stop reading the code if it compiles, which becomes a problem if a large application breaks and the developer lacks the context to fix it.

  • Speed vs. Understanding Balance: There is a trade-off between how fast you can produce work and how deeply you understand the underlying concepts.

  • Causes of Hallucination:

    • Incorrect Training Data: If a model sees a wrong answer frequently on platforms like Reddit, it may treat that as the highest percentage correct answer.
    • Misapplication of Logic: A model may know that an adhesive keeps things in place and that pizza has toppings, resulting in the absurd suggestion to use glue to keep toppings on a pizza (an actual early Google AI search preview error).
    • Overconfidence: Models are trained on professional research papers and articles; they are designed to write eloquently and authoritatively, even when they are fundamentally wrong.

The Anatomy of an Effective Prompt

  • Prompt engineering is considered one of the most important skills currently. A well-structured prompt consists of context, task, and format.

  • Context is defined as everything that tells the model who it is, what it is doing, and the constraints it must follow.

    • Persona: Telling an LLMLLM it is a "senior engineer" makes it more scrutinizing; telling it that it is a "real estate analyst" vs. a "home buyer" changes how it interprets data.
    • Constraints: Defining what the model should not do helps prevent hallucinations. Constraints in the prompt are generally weighed more heavily than the base training data.
    • Technical Concept: The "context window" or "attention window" controls how the model weighs specific inputs during output generation.
  • Task: Clearly defining the action (e.g., analyze, summarize, compare). Precision leads to accuracy.

  • Format: Specifying the desired structure (e.g., JSONJSON). Modern models have moved beyond creative prompting (e.g., "my grandma needs this as JSONJSON") and now offer guarantees through specific APIAPI call formats.

Agentic Workflows and Agent Design

  • Focused Prompts: While large models (e.g., Opus 4.64.6, GPTGPT 5.15.1, 5.25.2) are better at multi-step instructions, focused and precise prompts are historically more effective.

  • Graph-Based Agents: Building agents for specific tasks and connecting them as a graph is recommended. For example, separating analysis and comparison into different prompts/nodes reduces noise compared to doing both in one prompt.

  • Chaining: Small, chained tasks are often more reliable than a single large, complex instruction.

Practical Iteration: Real Estate Use Case

  • AI can generate property descriptions by combining facts (type, size, location, features, target audience, and tone) that were traditionally written by hand.

  • Iteration Steps:

    • Vague Prompt: "Write a property listing description." Result: Too vague for the model to act; requires clarification.
    • Basic Prompt: "Write a property listing for a 33 bedroom, 22 bath house in Austin priced at 475k475k." Result: Functional but often contains "flowery" or "LinkedIn-style" fluff that lacks a specific tone.
    • Detailed Prompt: Including buyer persona and a specific tone (e.g., "tight description," "targeting key person"). Result: High-quality, targeted output with minimized "sycophant language."

The AI Technology Landscape

  • Foundation Models: Most current large models use the Transformers architecture and Reinforcement Learning from Human Feedback (RLHFRLHF).

  • Major Model Families:

    • ChatGPT: General reasoning and broad use cases. It functions by routing requests to specific internal models to optimize cost and quality.
    • Claude (Anthropic): Marketing is more enterprise-focused. It does not naturally generate raw images (PNGsPNGs) or videos, though it accepts image input for analysis. Opus 4.64.6 is the flagship, largest model.
    • Gemini (Google): Part of a large ecosystem ("hyperscalers") with strong image and video generation capabilities.
    • Grok: Large model with specific training data (e.g., platform X/Twitter); touted as "truth-seeking," though this is often subjective marketing.
  • Financial Tiers: Paid tiers (approximately 100/month100/month in some contexts) offer better throughput and quality than free tiers, which companies often lose money on to acquire users.

Security, Ethics, and Professional Standards

  • Data Privacy: Users should avoid uploading sensitive personal or proprietary information (e.g., Social Security numbers) to non-enterprise accounts. Third-party systems may log data, potentially leading to legal or contractual breaches.

  • Enterprise Agreements: These usually offer "no retention" guarantees to allow for the use of sensitive data safely.

  • Bias and Ethics: AI output can be biased based on training data. Proxy variables and historical biases can lead to unfair results. Decisions made by AI should be validated by humans.

  • Disclosure: It is best practice to own the use of AI as a tool, disclosing sources and validation steps taken rather than blaming the computer for errors.

Questions & Discussion

  • Michael: Asked about property APIsAPIs and tech stacks.

    • Response: ReGrid is a primary APIAPI for aggregating parcel data across the USUS. Zonomics is used for zoning data. For development, VS Code and Cursor are popular. Cursor integrates LLMsLLMs like Claude into the UIUI.
  • Mushtik Malan: Asked which prompt elements influence hallucinations and for a simplification of RAGRAG.

    • Response: Detailed context in the query matters most. Models are probability-based, so there are no 100%100\% guarantees. RAGRAG acts like a system doing a "lookup" in a database (like a SQLSQL database for rental prices) before answering a question.
  • Ifena Arbolese: Asked about model parameters (temperature) and if the course covers Machine Learning.

    • Response: Temperature controls creativity (higher is more "off-unhinged," lower is more stable). The course focuses on Agents and AI, not classical MLML.
  • Naina: Asked about challenges in coding/workflows for real estate.

    • Response: The biggest challenge is data freshness across different municipalities (e.g., ArcGIS servers in Illinois towns). Scaling a relationship across tens of thousands of counties to ensure up-to-date data is difficult.
  • Matthew Abaglia: Asked about sensitive data and enterprise tiers.

    • Response: Enterprise contracts offer no retention. Some high-security industries (Health Care/HIPAA or Chip Design) require hosting models locally on hardware/metal to ensure data never leaves the infrastructure.
  • Antonio: Asked if models prioritize training data over external data provided in the prompt.

    • Response: Models generally weigh current prompt data more heavily. Alternatively, "fine-tuning" involves training the base model on proprietary datasets to change its fundamental behavior.
  • Andrew Bach: Asked about the validity of Grok being a "truth-seeking" model.

    • Response: Most CEO claims about "truth-seeking" are marketing fluff. Grok is a high-quality model, but its behavior reflects its specific training data rather than an inherent truthfulness.
  • Elijah Agard: Asked about edge cases in Python/Jupyter when building agents.

    • Response: Ensure data fits in the context window (e.g., 50k50k rows in a spreadsheet might exceed an 8k8k token window). Use traditional code (NumPy) for math/preprocessing to save money and latency before passing data to an LLMLLM.
  • John: Asked how to double-check AI work efficiently.

    • Response: Use "tracing" to capture inputs/outputs. Run "Evaluations" (EvalsEvals) to check response quality. "LLMLLM as a judge" is a common flow where a larger model evaluates the output of a smaller model based on specific policies.