An AI agent can take a task, decide which tools it needs, and use their results to work towards an answer or outcome. Give it access to the right systems, and it can look up information, make decisions about the next step, and carry out actions.
The useful distinction is how much control the system has over what happens between a request and a result. A chatbot typically responds to a message. An agent can decide what to do next, call a tool, inspect the result, and continue working.
Chatbots, assistants, and agents
The terms overlap, which doesn't help anyone trying to build with them.
A chatbot is a conversational interface. In its simplest form, it takes a message and generates a response using a language model. More capable chatbots can also search documents, retrieve information, and call tools.
An AI assistant helps someone complete tasks, usually through a conversational interface. It might summarise a document, draft an email, or retrieve a patient's medical history. Assistants can use agents internally, but they don't have to.
An AI agent is a system that uses a model to decide which steps to take towards a goal. It can select tools, inspect their outputs, and choose what to do next without every step being specified in advance.
The distinction becomes clearer when you look at what happens after the first request. A chatbot might answer a question in one turn. An agent might need several tool calls before it has enough information to respond.
How an agent works
At the centre of an agent is a language model with access to tools. These might be functions for searching databases, calling APIs, reading documents, or interacting with other software.
The model decides which tool to call and what arguments to pass. The application executes the call and returns the result. The model can then use that result to decide its next step.
Suppose you build an agent that checks whether a patient's medication list contains a particular drug.
The execution might look like this:
- The agent receives the request and a list of available tools.
- The model selects
get_medicationsand provides the patient ID. - The application queries the electronic health record (EHR) and returns the medication list.
- The model checks the result against the requested drug.
- The agent returns its finding, or calls another tool if more information is needed.
The model doesn't access the EHR by itself. Your application manages the connection, permissions, and tool execution.
That separation matters. You can control which operations the agent is allowed to perform, validate its inputs, and require approval before sensitive actions.
An agent also doesn't need to plan the entire task upfront. Many agents work one step at a time, using each result to decide whether to continue.
When should you use an agent?
If you can draw the decision tree in advance, write code.
A conventional workflow is easier to test, cheaper to run, and more predictable when the steps are known. There's little reason to ask a language model to decide what happens after a form submission or which API to call for a fixed lookup.
Agents become useful when the right sequence of steps depends on information you haven't retrieved yet.
Imagine a system that reviews a patient's discharge documentation. Some records might be complete. Others might have pending laboratory results, missing medication information, or no follow-up appointment.
You could write rules for every combination. But as the number of systems, exceptions, and possible outcomes grows, that decision tree becomes harder to maintain.
An agent can inspect the available information and determine which checks are still needed. The surrounding application can enforce the rules that must never change.
The practical question is whether the task benefits from flexible decisions enough to justify the added latency, cost, and testing burden.
A simple agent in practice
A clinician asks:
"What allergies are recorded for this patient?"
A language model without access to patient records cannot answer reliably. It has no knowledge of that individual's medical history.
An agent connected to an EHR can retrieve the relevant record.
The model might produce a tool call like this:
{
"name": "search_ehr",
"arguments": {
"patient_id": "123",
"resource": "allergies"
}
}The application checks the permissions, executes the query, and returns a result.
{
"allergies": [
"Penicillin",
"Sulfonamides"
]
}The agent can now respond:
"The patient's allergy record lists penicillin and sulfonamides."
It's a small example, but it shows the mechanism. The answer comes from a patient record retrieved at runtime, rather than the model's training data.
There are still things to get right. The system needs to identify the correct patient, respect access controls, and distinguish a confirmed allergy from an unverified entry. A retrieved record can be incomplete or outdated, too.
Tool access gives the model better evidence. It doesn't guarantee the evidence is correct.
A more complex agent in practice
Now consider a discharge readiness review.
A clinician needs to know whether a patient has outstanding tasks before discharge. The information is spread across the EHR, laboratory system, medication records, and scheduling platform.
An agent could work through the task as follows:
- Check observations. Retrieve recent vital signs and identify any values that need clinical review.
- Check laboratory results. Find pending tests and determine whether any require follow-up.
- Review medications. Check whether medication reconciliation is complete.
- Check follow-up arrangements. Confirm whether required appointments have been scheduled.
- Prepare a summary. Report outstanding items with references to their source records.
The sequence can change as the agent learns more.
If the laboratory system returns a pending result, the agent might retrieve the related order and flag it for review. If the medication list has already been reconciled, it can move on.
This is where agents earn their complexity. They can work across systems without requiring developers to prescribe every possible path through the task.
But a discharge decision has clinical consequences. The agent should provide evidence and flag unresolved issues for the responsible clinician, rather than independently authorise discharge.
Building agents for healthcare
Healthcare is a good example of both the potential and the limits of agent-based systems.
A useful clinical answer might depend on patient records, current guidelines, medication databases, and local policies. No single language model can be assumed to hold all that information accurately.
Agents can retrieve information from those sources while the task is running. They can also prepare documentation, suggest codes, and coordinate actions across connected systems.
For production use, the difficult part is deciding what the agent can do, what it must verify, and when a person needs to take over.
An agent that retrieves an allergy list has a different risk profile from one that submits a prescription. The second needs stricter permissions, validation, and human approval.
You also need to know what happened when something goes wrong. Which tools did the agent call? What data did they return? Why did the agent take its next step? Can someone trace an answer back to its source?
These are design requirements, not optional additions after the agent works in a demo.
Corti's Agentic Framework provides infrastructure for building and managing healthcare agents, including connections to external tools, execution monitoring, and evaluation. Developers can define how agents operate within their applications while retaining control over the systems and actions they expose.
If you're building your first agent, start with a narrow task that has a clear outcome and a reliable source of information. Give it one or two tools, inspect the calls it makes, and test how it behaves when information is missing or contradictory.
Once that works, you have something worth extending.






