From RAG to AI Agents: Function Calling and Tool Use - Alexey Grigorev

DataTalks.Club
DataTalks.ClubMay 26, 2026

Why It Matters

Enabling LLMs to call functions transforms static retrieval pipelines into flexible agents, boosting accuracy and cutting development effort for AI‑driven support tools.

Key Takeaways

  • RAC follows a rigid search‑then‑LLM workflow, limiting adaptability.
  • AI agents empower LLMs to choose tools like search dynamically.
  • Function calling lets the model invoke external search functions on demand.
  • Using GitHub Codespaces, participants get a pre‑configured Jupyter environment instantly.
  • Dynamic tool use reduces errors from misspelled queries and improves answer relevance.

Summary

The session introduces the shift from traditional Retrieval‑Augmented Generation (RAG) – called RAC in the course – toward AI agents that can call functions and use tools dynamically. Hosted as part of the free LLM Zoom Camp, the presenter walks through environment setup with GitHub Codespaces, loads the FAQ dataset, and demonstrates the fixed RAC pipeline: search, prompt construction, then LLM response. Key insights include the rigidity of RAC’s linear flow, which can miss answers when queries contain typos or ambiguous terms. By exposing a search function to the LLM via OpenAI’s function‑calling API, the model can decide when and how to invoke the tool, correct misspellings, and filter results to the relevant course context. The code shows how to define the search tool, pass the index, and let the model orchestrate the workflow. A concrete example highlights a user asking “how do I run all llama?” – the plain RAC fails due to lexical mismatch, whereas the agent detects the typo, calls the search tool, and returns the correct answer from the FAQ. The presenter also urges viewers to star the GitHub repo and subscribe, emphasizing community growth and trending visibility. The approach demonstrates that dynamic tool use reduces error rates, improves answer relevance, and simplifies chatbot engineering. Developers can build more adaptable assistants without hard‑coding pipelines, accelerating AI product development and enhancing user experience.

Original Description

Links:
Connect with DataTalks.Club:
- Join the community - https://datatalks.club/slack.html
- Subscribe to our Google calendar to have all our events in your calendar - https://calendar.google.com/calendar/r?cid=ZjhxaWRqbnEwamhzY3A4ODA5azFlZ2hzNjBAZ3JvdXAuY2FsZW5kYXIuZ29vZ2xlLmNvbQ
- Check other upcoming events - https://lu.ma/dtc-events
Connect with Alexey
Check our free online courses:
- ML Engineering course - http://mlzoomcamp.com
👋🏼 Support/inquiries
If you want to support our community, use this link - https://github.com/sponsors/alexeygrigorev
If you’re a company, reach us at alexey@datatalks.club

Comments

Want to join the conversation?

Loading comments...