Player not loading? Watch on YouTube
Dave Ebbelaar builds an agentic RAG system over Markdown engineering notes. He starts with Python tools that list files, search text with regular expressions, and read documents, then connects them to an AI agent through Pydantic AI. The example uses OpenAI GPT 3.5 and requires an OpenAI API key, though he says viewers can substitute another provider. Local files supply the knowledge; the demonstrated model calls use an API.
The tutorial contrasts this retrieval loop with semantic RAG. Ebbelaar recommends semantic retrieval as a starting point when latency or cost matters most. He argues that repeated searches and reads let an agent correct unsuccessful queries, at the expense of more model calls. One example makes five tool calls, and he estimates 10 to 15 seconds for the structured-output run.
Debugging examples expose tool arguments and returned search results. The output schema pairs an English answer with citations containing a filename, quote, and line number. Path checks restrict file access to the notes directory.
The production example adds logging, request limits, maximum read lengths, and readable error returns so the model can recover from mistakes. It calls Ripgrep through a Python subprocess and requires Ripgrep in both development and production. Ebbelaar also discusses adapting retrieval for PostgreSQL, a VPS, containers, or serverless functions.