Skip to content

When to Use Agents?

AI agents are most effective when the workflow of an application is non-deterministic and an LLM can be used to decide the next course of action. However, they can be overkill in scenarios where simpler, pre-defined systems are sufficient. The decision to use agents would depend on the task at hand; if a deterministic workflow adequately handles all the requests to a system, a purely coded solution is preferable because it is a 100% reliable system, eliminating potential errors introduced by inherently stochastic LLM decision-making. However, when the task requires adaptation, external data integration, and flexible decision-making, an agentic setup offers a significant advantage.

Here, we show an IT helpdesk and a legal document generation application, each with two scenarios: One where a pre-defined workflow is sufficient, and one where an agentic system would help.

IT Helpdesk Example


Scenario 1: An employee requests a password reset.

Workflow:

  1. Employee requests password reset through the helpdesk portal.
  2. System verifies identity through pre-defined security questions.
  3. System generates a temporary password.
  4. System sends temporary password to employee's registered email.
  5. Employee resets password.

Scenario 2: An employee reports that a critical application is crashing frequently, impacting productivity.

Workflow:

  1. Employee describes the issue.
  2. Agent analyses the description and extracts key information.
  3. Agent accesses system logs (tool) to identify error codes and patterns.
  4. Agent consults a knowledge base (tool) of known issues and troubleshooting steps.
  5. Agent uses monitoring tools (tool) to check system resource usage and identify potential bottlenecks.
  6. Agent suggests possible solutions, guiding the employee through troubleshooting steps.
  7. If the issue persists, the agent creates a detailed ticket and escalates it to a specialist.

In Scenario 1, the password reset process is routine, well-defined, and can be automated with minimal human interaction. Thus, using an agent is unnecessary as there is no need for an LLM to make decisions on alternative paths or tool usage. On the other hand, Scenario 2 requires analysing unstructured text, correlating information from multiple sources (logs, knowledge base, monitoring tools), and making informed decisions about troubleshooting steps. An agent helps by using LLMs to adapt its approach based on the specifics of the issue and the employee's technical skills.


Scenario 1: Generating a standard Non-Disclosure Agreement with a pre-defined template.

Workflow:

  1. User fills out a form with the counterparty company name and address.
  2. System populates the template fields with the given information
  3. System provides the completed NDA in PDF form.

Scenario 2: Generating a detailed service contract with variable terms.

Workflow:

  1. User types out the main idea of the document.
  2. Agent uses LLM to generate various possible clauses.
  3. Agent queries legal databases (tool) to check for legal precedents.
  4. Agent queries internal databases to retrieve similar contracts as references.
  5. Agent provides summaries of the various implications of the contract

In Scenario 1, the user only has to input the necessary data into the provided form fields and no additional intelligence is required to process the inputs. Scenario 2, however, requires analysing the user’s input, using tools to retrieve and collate information, followed by analysing the retrieved information to make informed decisions. This is a stronger agentic use case than the former; first, the desired outcome cannot be achieved without the help of an LLM (the alternative is a human) in the loop and, second, the LLM itself does not have access to databases (legal and internal contracts) to make good assessments. Knowledge retrievers can be used as tools to help the LLM make better decisions.

TL;DR

Agents should only be used when a complete course of actions to perform a task cannot be pre-determined without analysing feedback from the environment (system).