AI / LlamaIndex Interview Questions
What is the difference between ReActAgent and FunctionCallingAgent?
Both are ways to build tool-using agents in LlamaIndex, but they rely on different mechanisms for deciding which tool to call.
ReActAgent uses the ReAct prompting pattern: the LLM writes out a free-text loop of Thought, Action, and Observation, where the "Action" line names a tool and its arguments in plain text that LlamaIndex then parses and executes. Because it only depends on text generation, it works with essentially any LLM, even ones without native tool-calling support.
FunctionCallingAgent instead relies on the LLM provider's native function/tool calling capability, where the model returns a structured, schema-validated tool call directly rather than free text to be parsed. This is more reliable, since there's no risk of a malformed action string breaking the parser, but it only works with LLMs that actually support function calling, such as OpenAI or Claude models.
In practice, FunctionCallingAgent is preferred whenever the underlying model supports it, and ReActAgent serves as the fallback for models that don't.
More Related questions...