1. What is an AI "agent"?
The term agent can have multiple meanings. Some define an agent as a fully autonomous systemcapable of operating for hours, using various tools, and handling complex tasks independently. Others refer to "semi-autonomous" systems, which rely on a sequence of programmed blocks (workflows). In its research, Anthropic* distinguishes between two categories:
- Workflows when an LLM is orchestrated via predefined paths in the code.
- The agents LLM: when the LLM is freer to decide on the sequence of operations and tools, deciding for himself on the strategy to be followed to achieve the result.
This distinction helps you choose the right approach. Sometimes, a simple sequence of prompts will suffice. Other times, a more "free" and flexible agent is required. The challenge is to match technical sophistication to the actual task: it's generally preferable to start with a minimalist solution and move on to an autonomous agent only if the situation really calls for it.
2. The Golden Rule: add complexity only when necessary
A fundamental principle: start smallIt's a good idea to start with the simplest solution, and only add bricks (shared memories, multiple tools, iteration mechanisms, etc.) if this really improves task completion. An "all-in-one" agent can be costly in terms of time and resources, and prove slower or more expensive than a more basic version.
Not only can more elaborate workflows and agents multiply costs (number of API calls, increased latency), they also require development and supervision effort. Ongoing evaluation is therefore essential:
- Simplicity (fewer bricks, less code, less risk of bugs).
- Performance (real quality of the result).
- The cost/benefit ratio (Do the gains in precision or flexibility justify the complexity?).
3. The different design patterns
Numerous schemes (or workflows) exist to organize interactions between models and tools. They can be combined and adapted to suit your needs. Below are the main ones, illustrated by concrete examples and suggested visuals to help you better understand how they work.
From the simplest to the most complex :
3.1 LLM Augmented
The model (LLM) is enriched with a few additional capabilities - access to a knowledge base, a search tool, or a short/long memory. This is the basic block used by most systems: the model can, for example, fetch information from an internal document base, then compose its response by integrating this data.

Business examples:
- An in-house assistant that connects to the CRM to extract customer history and respond more accurately to support requests.
- An HR AI that consults a database of CVs and draws up a summary of candidates matching a position.
3.2 Prompt Chaining
This involves breaking down the task into several sequential steps, in order to simplify each sub-problem.
- Step 3: Finalize results (translation, formatting)
- Step 1: Generate a plan or draft
- Step 2: Check or improve

Business examples:
- A marketing process to design a slogan, then validate its legal conformity before publication.
- Press release writing: generate draft, check consistency with a separate LLM call, perform automatic translation for international subsidiaries.
3.3 Routing
A router determines which subsystem or agent to send the request to. This makes it possible to specialize agents (or prompts) and optimize both speed and cost.

Business examples:
- Customer service: refund questions are redirected to a specialized "Finance" agent, and technical questions to a "Technical Support" agent.
- Internal ticketing system: simple requests are handled by an inexpensive, basic agent, while complex requests are handled by a more expensive but more powerful LLM.
3.4 Parallelization
Some problems can be broken down into independent segments, processed in parallel. Another variant is to perform the same task several times, then compare (Voting).

Business examples:
- Process a long official document (e.g. regulatory) in several sections simultaneously, then aggregate the summaries.
- Quality control: several versions of the same text are evaluated in parallel by different agents, who vote for the most reliable.
3.5 Orchestrator-Workers
An orchestrator manages the distribution of sub-tasks and gathers the results produced by each "worker", without determining the exact number of steps in advance.

Business examples:
- A cross-team writing tool: the orchestrator identifies whether the text should be written by the "Marketing" agent, the "Legal" agent, etc., then consolidates their contributions.
- Competitive research: the orchestrator sends queries to "Web scraping", "Data analysis" and "Text synthesis" agents, then assembles them for the final report.
3.6 The Evaluator-Optimizer Duo
First a proposal is generated, then another LLM call (or another agent) screens it, criticizes it, and suggests improvements. The process is repeated until a quality threshold is reached.

Business examples:
- Responses to calls for tender: one agent drafts the proposal, a second evaluates it according to precise criteria (conformity, tone, coherence), then sends back corrections to be incorporated.
- Creation of a pitch deck for investors: the AI designs a slideshow, the evaluator detects flaws or missing information, the optimizer repeats until validation.
3.7 The Autonomous Agent
When it becomes difficult to predict in advance the number of sub-tasks or the precise sequence for solving a problem, it may make sense to let the LLM make decisions autonomously. An autonomous agent is distinguished by its ability to :
- Dynamically determine the necessary sub-objectives or tools.
- Curl many times, evaluating the results of its own actions.
- Interact with one or more humans if validation or feedback is required.
The "autonomous" nature of the agent is accompanied by a number of precautions:
- Potentially high cost and latency (large number of calls).
- The need for safeguards For example, we can define a maximum number of iterations or a sandbox mechanism to prevent uncontrolled overruns.
When should you use an autonomous agent?
- Flexible resource consolidation When a project involves several databases and different analysis tools, and the sequence of actions cannot be predicted (for example, starting a web search, then adjusting a project plan according to the findings).
- Automating interdependent tasks For example, a "virtual project manager" who has to coordinate marketing, technical, logistics and HR departments to bring a new product to fruition.
- Advanced code generation the agent can create, test and correct several files or modules, without it being known in advance how many modifications will be necessary, in which languages or which parts of the code base.

Business examples:
- Automatic migration of Legacy applications For example, an agent is asked to transform existing SAS code into Python + SQL scripts, while preserving the business logic. He can then analyze each SAS routine, generate the corresponding Python version, check the syntax, then iterate by testing the codes and comparing the results to validate non-regression.
- An e-commerce agent E-commerce: in charge of regularly updating the content of an e-commerce site, drawing on product databases, writing descriptions and monitoring user feedback.
4. Frameworks: where to insert these patterns?
There are a number of libraries or tools available to simplify the implementation of these workflows, each offering a set of modules to manage LLM calls, tool definition, context sharing and so on.
- Some frameworks focus on simplicity and a low abstraction layer, to maintain control and visibility over each step.
- Others offer graphical interfaces, connectors to cloud services, or advanced debugging mechanisms.
The important thing is to check whether you really need a complex framework, or whether a few dozen lines of code are enough to cover a specific use case. When agents multiply and interactions intensify, however, the use of a framework becomes highly relevant for maintaining a clear, scalable architecture.
More on AI Agent Frameworks in my previous article: here
5. Key tips for building reliable agents
- Starting small test a single call to the model, or even a light chaining prompt, before deploying a fully autonomous agent.
- Making tools easy to use These include explicit parameter names, stable output formats, and examples to guide the model in the use of these tools.
- Setting up safeguards These include: defining a maximum number of iterations, providing a sandbox mode to avoid potential excesses, and logging all agent actions.
- Continuous assessment The following features are available: evaluation loops (human verification, second evaluation agent) to quickly identify and correct inconsistencies and hallucinations.
- Optimize cost and latency These include exploiting routing to redirect simple requests to a small model, testing parallelization to reduce total time, and considering rapid inference solutions if call volumes are high.
6. Conclusion and outlook
Within companies, AI agents represent an opportunity to transform complex processes (customer support, marketing copywriting, competitive intelligence, etc.) into more responsive, collaborative workflows. Before embarking on ambitious architectures, it's best to define your needs precisely and choose a suitable scheme (or mix of schemes): prompt chaining, orchestrator-workers, iterative evaluation, or even a fully autonomous agent.
The key to success lies in regularly measuring performance and adjusting step by step. It's often better to intelligently combine two or three simple patterns than to build an overly sophisticated agent that risks being less stable or too costly.
Well done for getting to the end of the article! Now I'd like to know:
- In your sector, which processes could benefit most from automation via an AI agent or intelligent workflow?
- What concrete benefits do you anticipate for your costs, reliability and efficiency? And what possible risks do you foresee in implementation?
Don't hesitate to contact me to discuss your project. I'd be delighted to discuss your projects and see how these approaches could fit into your professional environment!
Discover our AI expertise and contact our experts to discuss your specific projects and needs.
By Jérémy BRON, AI Director, Silamir Group
*Source : Building Effective Agents (Dec. 19, 2024) by Anthropic.