Lesson 09.07 · Phase 09 · Frameworks & SDKs

LlamaIndex agents

LlamaIndex started as a data framework, and its agents show it: you wrap each index in a query engine, wrap each query engine in a tool, and let an agent choose which knowledge base to ask. The catch is hidden inside the tool. Every query engine call is its own retrieve-and-synthesise model call, so one "tool call" can cost as much as an agent step.

Learning objectives

  • Build the index → query engine → tool → agent stack and explain what each layer adds.
  • Implement a text ReAct parser that feeds parse errors back as observations and never evals model output.
  • Count the model calls a query-engine tool hides, and decide when to return raw chunks instead.
  • Run the same agent on real LlamaIndex with a scripted CustomLLM.

Your company has HR policies in one place, IT policies in another and a product wiki in a third. One big vector index mixes them, so "how many days do I get?" retrieves laptop-replacement rules. You want an agent that knows which knowledge base to ask, and can combine an answer with a calculation.

Loading the full lesson…