Configuring multi-agent systems with CrewAI: roles, tasks, Flows

A single agent takes on everything at once — it gets confused about priorities and loses task context. We set up multi-agent systems turnkey: distribute roles, define execution order, and control results. This removes manual routing and noticeably shortens the time for typical operations.
Frequently Asked Questions

CrewAI integration: where a single agent breaks down

A typical request — market analysis or counterparty verification — consists of three different actions: gather data from multiple sources, reconcile them with each other, and format the conclusion.

In a demo, a single agent handles all of this on its own and copes: on a short chain it does not have time to lose the thread.

Under workload, the picture is different. Search displaces the original task from the working context: the agent reaches the verification stage, but no longer remembers the constraints set by the customer and skips reconciliation.

The bottleneck of the process here is not the quality of the model, but the lack of separation of responsibility: a single performer cannot simultaneously search, doubt, and edit.

Multi-agent systems remove this limitation. CrewAI integration is built around agent roles: a researcher collects facts, a critic looks for contradictions and gaps, an editor brings the result to the specified format.

Each task has an explicit readiness criterion, so a step cannot be skipped — it is either completed or returned for revision.

On top of the roles, Flows are placed — a deterministic scenario that decides who connects and in what order, where a human is needed, and what to do when a source fails.

A failure is localized in one step and does not reset the entire chain, while intermediate artifacts remain suitable for review. We look at how this is handled on real tasks.

What separation of roles and tasks between agents provides

The share of manual operations falls not when the model becomes smarter, but when each step has one person responsible. A researcher collects data, an analyst interprets it, a verifier checks the result against rules — the output is an artifact with clear provenance.

In CrewAI this is described declaratively: role, goal, task, and expected result format are set in text, so the scheme can be reassembled without rewriting code.

Managing agent interaction is primarily transfer rules: what is considered a ready result, who decides that a step is accepted, and what happens on error. The mode is chosen for the task.

Mode When suitable Limitations
Single agent with extended instructions Short tasks, one data source An error at any step breaks the entire result, no intermediate control
Sequential chain of roles Fixed processing stages Requires stable data format between steps
Team with a coordinator Route depends on what was found at the previous step Time and number of calls grow, iteration limit needed
Flow with conditional transitions Branching, repetitions, rejection of result Harder to debug: tracing and tests for each branch are needed

The effect is measured before and after on the same input dataset: share of operations requiring human involvement, repeatability — how many runs produce a structurally identical result, and variance in processing time.

These are the acceptance criteria: not “it became more convenient,” but concrete numbers on three metrics.

CrewAI integration: operating modes of a multi-agent system

The operating mode of a multi-agent system is set not by the model, but by how roles are connected and how the result is transferred between them. In practice, a choice is made between a sequential chain, conditional branching, and parallel checks.

The criterion is one: the cost of an error at the output versus the cost of delay at each additional step.

Options for organizing work

The result of one agent becomes the input of the next: collection, parsing, verification, report.

Such a chain is predictable and reproducible on the same input, but latency accumulates along its entire length, and an error of an early step is replicated to the end — producing a confident but incorrect answer.

Option When suitable Limitations
Sequential chain steps depend on each other and order matters: collect → parse → verify → report latency grows with number of steps; failure of the first link devalues the work of the rest
Conditional branching some requests take a short path, some require extended processing or escalation to a human harder debugging: need to record which condition triggered and why; number of branches grows faster than it seems
Parallel tasks independent checks of one result: reliability, completeness, compliance with rules need a reconciliation layer and conflict resolution when checks contradict each other

Most often, schemes are combined: branching at the input decides whether a request takes the short path or the extended chain, while inside the long path parallel checks are launched with a final arbiter.

To keep this from falling apart under load, each step gets a contract for input and output, and the result gets a source label: on failure, one step is replayed from the saved state, not the entire scenario.

With CrewAI, such schemes are described declaratively — roles and tasks are set separately from transition order, so the mode changes without rewriting agent logic.

Implementation order: from process audit to handover

Implementing a multi-agent system starts not with code, but with process analysis: who makes the decision, on what data, where the result is approved manually.

The order of work is structured so that each next stage relies on the verified result of the previous one — then an error is visible at the scheme stage, not in operation.

  1. Process audit. We examine the area as a whole: input data, decision points, readiness criteria for the result, and places where time is currently lost on approvals. Output — a process map with automation boundaries: what the agent takes on, and what remains with the human.
  2. Role scheme. There are exactly as many roles as there are different competencies — each is assigned an area of responsibility, available sources, and response format. An extra role makes the run more expensive and adds a point of failure, so we coordinate the scheme before configuration.
  3. Task and route setup. We formulate tasks with an acceptance criterion and describe result transfer between roles: under which condition work continues, and under which it is returned for revision. Here we also fix behavior with incomplete data.
  4. Configuration on CrewAI. We assemble agents, connect them to the customer's systems — knowledge base, CRM, request storage — and limit access rights for each role. Configuration is stored in a repository, so role changes go through review rather than being edited manually on the server.
  5. Verification on historical data. We run the system on closed periods where the correct answer is already known and compare the result with specialists' work. We analyze discrepancies by roles: most often adjustments are needed in task formulation, not in the agents themselves.
  6. Handover to operation. We provide documentation on roles and routes, settings, instructions for the team, and an update procedure. For the first weeks we provide support, tracking the share of successful runs and the cost of processing one request.

Role scheme, regulations, and execution logs

A multi-agent system on CrewAI outlives its author: a few months later, roles, instructions, and access boundaries are already being edited by the customer's team.

So that each edit does not turn into a rewrite from scratch, after implementation a set of artifacts remains — working documents and exports from the system itself, not a presentation about it.

We separately hand over execution logs: they show at which step a run went off course, which agent returned an empty response, and how long each call took. This is what an engineer uses to investigate an incident, instead of reproducing the scenario again.

  • Role scheme — for each agent: purpose, input data, response format, and to whom control is transferred.
  • Operating regulations — when the scenario starts, who approves a disputed result, and what to do if a separate node fails.
  • Access rules — which sources the agent reads, which actions it performs itself, and which require human confirmation.
  • Scenario schemes — branches, parallel sections, and transition conditions between them with examples of real runs.
  • Execution logs — tracing of requests, tool calls, responses, and time at each step.
  • Documentation — how to add an agent, change an instruction, or roll back a scenario without stopping the system.
  • Failure map — known edge cases and prepared responses to them.

Case: agent roles instead of manual routing

What was before

Request processing was handled by one agent with a general set of instructions: it classified the request, it retrieved data from accounting systems, and it assembled the response.

While there were few scenarios, the scheme held, but with each new type of request priorities began to get confused — a refund request went into the consultation queue, while urgent requests waited for the general selection.

They compensated with manual work: an operator reviewed every fifth request and moved it to the correct queue.

Reconciliation took about a third of the shift, the routing error rate stayed at 18–20%, and some requests were closed repeatedly because data was pulled from the wrong source.

What was changed

We separated the process by roles in CrewAI: a classifier determines type and priority, a researcher collects data, an owner prepares the text, a verifier checks it against the regulations.

Transfer follows a fixed scheme with mandatory fields, so the next step is chosen not by the model but by the route — if input data is insufficient, the task is returned with a reason rather than being guessed.

Additionally, we limited role permissions and enabled logging of every transition. A disputed case is analyzed from the record in minutes, rather than by manually reconstructing context.

What became

The share of manual checks fell from 20% to 3%: the operator connects only to requests with low classifier confidence. Routing errors decreased to 4%, average request completion time was almost halved, and repeat requests on the same topic fell by about a third.

Stability produced a second effect: a new scenario is added as a separate role and does not affect the other branches. Previously, editing general instructions broke adjacent scenarios — now each role is tested in isolation, and regression is visible at the test run stage.

What to do if some agents are already deployed?

Some deployed agents are not an obstacle but a point of support: we start with an inventory. We look at who is already being called, what data each agent accepts and returns, where its access rights live, and who owns the scenario. From this map it is clear which roles we keep as is, which we wrap, and which we actually replace.

Next we build a scheme compatibility layer. Tool descriptions and input/output contracts are brought to a unified form, and the existing agent connects to CrewAI as a tool or a separate role.

The logic inside is not rewritten — only the invocation method changes, so previously debugged scenarios continue to work without edits.

Process migration proceeds one area at a time. We launch the new contour in parallel with the working one on the same input data, compare results, and analyze discrepancies until the match rate becomes acceptable.

Only then is traffic switched — one role or one step at a time, with the previous route kept as a fallback.

A separate task is migrating scenarios that live outside the agents. Retries, rate limits, logging, and error handling must be idempotent: otherwise, on failure, a step will execute twice and data will diverge.

We keep the reverse path ready — the previous scheme can be returned by switching a setting, not by a new deployment.

As a result, the working contour does not stop at any stage, and each new role receives traffic only after verification on real data.

Technical limitations and common failures

A failure in a multi-agent system rarely looks like a crash: an agent produces a plausible but incorrect intermediate result, and subsequent steps neatly build it up.

Therefore we place checks between agents — response schema, mandatory fields, retry limit, and handover of the task to a human if the agent did not stay within bounds. The error is visible where it occurred, not in the final report.

The second group of limitations is access to internal data and context volume: too little source — we get a confident fabrication; passed everything indiscriminately — the needed part is lost. Below are answers to doubts that most often surface at the start.

How does an agent get access to internal data?

Through a separate access layer with the rights of a specific role: the agent sees only permitted records, requests come from a service account, and calls are logged. It has no direct access to the database.

What to do if there is more data than fits in the context?

The task is split: first selection of relevant fragments, then an answer based on them. We configure fragment size, overlap, and number returned — the answer remains on point, with references to sources.

How to roll back an unsuccessful change in agent behavior?

Roles, instructions, and connections between agents in CrewAI are described by configuration, not scattered code. An edit is versioned, run on a set of test scenarios, and released separately — the previous version remains working.

What about support and development after launch?

We hand over configurations, agent schemes, sets of test scenarios, and documentation, and train the team. After that, a new role or source is added in iterations, without rewriting logic.

Let's discuss the task and come back with an implementation plan

To ensure the scope estimate is based on facts rather than guesses, we start with a short description of the process: what is happening now, where time is lost, and what result is needed at the output.

Two paragraphs in free form are usually enough to understand the class of task — configuring a multi-agent system on CrewAI or automating a separate area.

Useful to note right away:

  • Roles and tasks: what steps exist today, what an agent can take on, and where the human decision remains.
  • Bottleneck: manual operations, waiting for a response, fragmented sources, repeated checks of the same thing.
  • Data and systems: what we connect to — knowledge base, reference data, internal services, documents.
  • Limitations: what cannot be moved outside the perimeter, what access and approval rules apply.
  • Current state: whether there is a prototype, scripts, test examples, and accumulated documentation.

In response, you get not general words, but a scope estimate and an implementation plan with the composition of stages: a pilot on a limited set of scenarios, expansion of agent roles, launch into the working contour, and handover of documentation to your team.

In the plan we fix checkpoints, quality metrics, and a rollback point — we verify the result at every step.

Describe the task — we will come back with an estimate and a stage-by-stage plan.

AI Development Areas

Latest works

  • Development of a web application for FEEDME
    Development of a web application for FEEDME
    1393
  • Development of an online store for the company FURNORO
    Development of an online store for the company FURNORO
    1368
  • B2B Advance company logo design
    B2B Advance company logo design
    815
  • Development of a web application for Enviok
    Development of a web application for Enviok
    1139
  • AIDER company logo development
    AIDER company logo development
    1057
  • CRM development for Chasseurs
    CRM development for Chasseurs
    1152