In the previous article, we examined the design decisions behind our RAG pipeline. Now we'll give the LLM the ability to call our search functions autonomously — this is Tool Use.

What Changes with Tool Use

In our RAG pipeline so far, we always called search() before generating an answer. The flow was hardcoded:

question → search() → generate_answer()

Enter fullscreen mode