A travel assistant may need to find destinations, check their weather, and combine the results into an answer. An AI agent handles this kind of multi-step task by working with a large language model (LLM) to choose actions, call tools, and adapt to intermediate results. It can operate autonomously or under constraints set by its developer. section 1.1 section 11.0
A typical agent loop works as follows:
- Give the LLM the request and descriptions of the available tools. section 1.1.3
- Let the LLM select a tool and generate its query; the agent executes the call and collects the result. section 1.1.3
- Provide results to the LLM so it can choose another action or produce a final response. Repeat as needed until a stopping condition is reached. section 1.1.1 section 1.1.3
The distinction is where decisions happen. An engine generally runs a predefined chain, while an agent can choose and revise its approach at runtime. An agentic workflow can use an LLM to choose among predefined paths, but an agent dynamically selects and combines tools. This flexibility trades some predictability for adaptability. section 1.1.1 section 5.1
A holiday-planning agent
A booking request can lead the agent to consult flight, hotel, car rental, weather, and internal deals services. The LLM selects relevant tools and generates queries; the agent executes them and returns the collected data to the LLM for a summarized holiday plan. Multiple iterations may be needed. section 1.1.3
Figure 1.5 Workflow of an AI agent tasked with assembling holiday packages
Follow the holiday request through tool selection, data collection, and the final plan. section 1.1.3
A practical starting point is a single travel-information tool backed by a vector store of destination content. Add a weather tool to answer questions that need both destination and current conditions. LangGraph can manage branching and cycles; prebuilt components can reduce the code needed for tool calling. section 11.1 section 11.0 section 5.3 section 11.9.2
Do not assume a tool was called correctly just because an answer looks plausible. Debug the registered tools and inspect execution traces to verify calls. For critical actions in high-stakes settings, include human review. section 13.4.5 section 1.1.3













































