Section 21 of 24 · 18 lessons
Agents
A technician asks Botie about a pump, but the answer needs a manual held in another system. How can a model request that information, and who decides what it may do with it? Start with the pieces of an agent, then build the maintenance assistant using Pydantic AI, LangChain and LangGraph. As the job grows, add permission checks and guardrails, and handle calls whose replies never arrive.
From an Answer to an Action
The manual lives in another system. Follow the pieces that let Botie request it, use what comes back and stop when the evidence is insufficient.
Giving the Model a Clear Job
Botie has a maintenance question to answer. We need to say what a useful answer contains, give him the relevant evidence, and check the result before another program relies on it.
Letting the Model Use Tools
The answer may need a manual lookup or a proposed inspection. We will define what each tool accepts, control which records it can reach, and decide when the work should stop.
Choosing How Much Autonomy to Give
The maintenance team already follows a procedure. Where does a model's choice actually help? Compare that procedure with an agent on the same tickets before giving the system more freedom.
Building with Agent Frameworks
Once we understand the loop, a framework can organise its repeated work. Follow the same maintenance task through Pydantic AI, LangChain, and an explicit LangGraph workflow to see what each one manages.
State and Permissions
A paused job may resume after its details have changed. Keep the saved state and the technician's approval tied to the action, then examine what changes when tools come from another service.
Guardrails at the Point of Action
A manual can contain misleading instructions, and a valid tool request can still reach the wrong customer's records. Follow each proposal to the place where software can permit or prevent it. Then test what happens when a check is missing or gives the wrong answer.
Keeping an Agent Run Under Control
An inspection request times out. Did it fail, or did the service create it before the reply was lost? Work through that uncertainty, then give concurrent jobs a budget they cannot each spend twice.