What is agentic RAG and how does it differ from standard RAG?
Agentic RAG gives the retrieval system agency to make decisions about how to find information, rather than following a fixed retrieve-then-generate pipeline. The agent can: decide whether retrieval is needed at all, choose which data sources to query (vector store, SQL database, API, web search), formulate and reformulate queries iteratively, evaluate retrieval results and retry with different strategies if unsatisfied, and decompose complex queries into sub-tasks. Implementation: use a tool-calling LLM as the orchestrator with retrieval tools (vector search, SQL query, web search, document lookup). The agent receives the user query, plans a retrieval strategy, executes it, evaluates results, and iterates until confidence is sufficient. Frameworks: LangGraph, CrewAI, or AutoGen enable multi-step agentic flows. Key differences from standard RAG: standard RAG is a fixed pipeline (query - retrieve - generate), while agentic RAG is a dynamic reasoning loop. Agentic RAG handles complex queries requiring multiple retrieval steps, cross-source synthesis, and adaptive strategies. Trade-offs: agentic RAG is slower (multiple LLM calls), more expensive, and harder to debug, but dramatically better for complex, ambiguous, or multi-part questions.