Core Agent Paradigms: ReAct, Tools, and Memory Β· Milestone Companion: Make Retrieval Prove Itself
What this milestone asks
Build a question-answering agent over your own notes β your real Obsidian vault, your exported docs, your actual markdown files. The agent must retrieve relevant passages, answer from them, and cite its sources: file name and section for every claim. When the answer is not in the notes, it must say so.
Two hard requirements separate this from a weekend demo. First, citations must come from retrieved chunks, not from the model's imagination β the citation string should be metadata attached to the retrieved chunk, never generated text. Second, the agent must handle multi-turn follow-ups ("tell me more about the second one"), which means conversation state is now your problem too.
You may use embeddings and a vector store, or plain keyword search. What you may not do is skip the question: what exactly am I retrieving, and where in the prompt does it land?
Why this milestone
Stage 1 taught you the loop; this stage teaches you what the loop is for. ReAct β Reason, Act, Observe β stops being a diagram the first time your agent searches the wrong notes, observes the disappointing result, rephrases its query, and recovers. You will learn more about agents from watching that recovery than from any lecture.
The citation requirement exists because it makes retrieval honest. An agent answering fluently from parametric memory looks identical to an agent answering from your notes β until you demand sources. Citation is your first evaluation instrument: it converts "the answer seems right" into a checkable claim about what was retrieved. This is also your first real encounter with the memory layering that runs through the whole path: short-term (the conversation in context), long-term (the note index), and task state (whatever you persist between runs). Decide what lives where before you build anything.
How to use the resources
- The backbone: Berkeley RDI's LLM Agents MOOC, led by Prof. Dawn Song with Xinyun Chen (Google DeepMind) and Kaiyu Yang (Meta FAIR). The Spring 2025 run has concluded and all certificates have been issued, but the lecture videos remain available on the syllabus page. Watch the reasoning, tool-use, and RAG lectures before or during your build; save the multi-agent and safety lectures for later stages. This is the one resource to do thoroughly rather than sample.
- In parallel, the Hugging Face Agents Course. Free, and the completion certificate is still available as of this writing β the Berkeley certificate window already closed, so do not repeat that mistake. Its units on smolagents and retrieval map directly onto this milestone; do the quizzes even where you skip the framework code.
- For tool-calling mechanics, the DeepLearning.AI short course Functions, Tools and Agents is an hour well spent, and Microsoft's AI Agents for Beginners on GitHub β eleven lessons with videos and code β is a source of clean reference implementations to compare against your own.
- For judgment, read the agent-architecture and RAG chapters of Chip Huyen's AI Engineering (O'Reilly, 2025) while you build. It will talk you out of at least one over-engineered component.
- If you read Chinese, εζ΅εθ±ͺε 's paper explainers are a strong supplement for the retrieval literature.
Build order matters: index ten notes with keyword search and get citations working end-to-end; only then swap in embeddings; only then add multi-turn memory.
Common failure modes
- Vector store on day one. Chunking an entire vault into embeddings before you can answer "what will I retrieve, and where does it go in the prompt" produces an expensive, undebuggable landfill. Start with filenames, headings, and keyword search; measure what is missing; then vectorize.
- Fabricated citations. The model cites
notes/budget.mdbecause the name sounds right. Structural fix: inject citations from retrieval metadata, and instruct the model to quote rather than invent. - Arbitrary chunking. Five-hundred-token chunks with fifty overlap, copied from a tutorial, with no thought about your notes' actual structure. Your headings are your first chunking strategy.
- No refusal path. The agent always answers, so out-of-corpus questions get hallucinated. Add an explicit "insufficient context" branch β and test it.
- Silent tool failures. The search call times out, returns nothing, and the model improvises. Every tool call gets a timeout, a retry policy, and a fallback message β from this stage onward, forever.
- Amnesiac follow-ups. Each turn re-embeds the raw last message instead of the conversational intent, so "what about the second one?" retrieves garbage.
Acceptance checklist
- Indexes a real folder of your own notes β dozens of files, not three toy documents.
- Every answer carries file-and-section citations that trace to retrieved chunks, not generated text.
- Asked a question outside the corpus, the agent declines and reports what it searched.
- Multi-turn follow-ups resolve correctly across at least three turns (coreference works).
- The retrieval tool has a timeout, a retry, and a fallback response β and you have watched it fire.
- You can print the full assembled prompt β system, retrieved chunks, history β for any turn.
- You can state, in one sentence each, where your short-term, long-term, and task-state memory live.
Going further
Compare keyword, embedding, and hybrid retrieval on the same ten questions and keep the notes β this is your first real evaluation dataset, and Stage 5 will teach you what to do with it. Try re-ranking retrieved chunks with the model before answering. For a frontier view of where agents are heading, look at Berkeley's follow-up events β the Agentic AI Summit and the AgentX competition. Then resist the urge to add a second agent: that temptation is Stage 3's subject.