Agentic LLMs & RAG: Tools, ReAct, and Retrieval (Lecture 7) - Stanford CME295

Added:

Deterministic Flow Engineering over Autonomous Agentic LLMs

While agentic LLM systems and ReAct loops offer high flexibility, a significant counter-perspective argues that autonomous agents are too unreliable, slow, costly, and insecure for production environments. Critics, including many practical software engineers, advocate for 'deterministic flow engineering' or structured state machines over autonomous decision-making. In this view, LLMs should be used strictly as stateless processing nodes within a predictable, developer-controlled pipeline rather than acting as the central controller. Furthermore, autonomous tool-use introduces compounding error loops—where a single hallucination derails the entire execution path—and severe security risks, such as prompt injection vulnerabilities. For most enterprise applications, structured workflows provide the predictability and safety that autonomous agentic systems currently lack.

Fundamental concepts of Large Language Models (LLMs), including transformer architecture, tokenization, and basic prompting techniques (such as few-shot and chain-of-thought).
The core mechanics of standard Retrieval-Augmented Generation (RAG), including text chunking, vector embeddings, vector databases, and basic semantic search.
Familiarity with API integration and Python programming, specifically how to pass structured data like JSON schemas between models and external applications.
A basic understanding of LLM orchestration frameworks, such as LangChain or LlamaIndex, and how they coordinate model prompts and memory.
Designing Multi-Agent Systems, where multiple specialized agents collaborate, negotiate, and delegate tasks to solve complex, multi-step problems.
Implementing advanced LLMOps (Large Language Model Operations) for agents, including state management, long-term memory architectures, and tracing agentic decision-making steps.
Comprehensive evaluation and benchmarking of agentic systems, focusing on tool-calling accuracy, agent trajectory analysis, and safety/security vulnerabilities (e.g., prompt injection through tools).
Fine-tuning open-source models specifically for tool usage, JSON output formatting, and ReAct-style reasoning to reduce latency and dependency on proprietary APIs.
66K views1.3Klikes1:49:22@stanfordonlineOriginal Release: 2025-11-18

This lecture covers practical techniques for connecting LLMs to external systems, including Retrieval-Augmented Generation (RAG) which retrieves relevant documents from a knowledge base to augment prompts, and agentic workflows using the ReAct framework (Reason + Act) that enable LLMs to perform multi-step reasoning and tool calling to complete complex tasks autonomously.