Skip to content

Cookies

We use cookies to enhance your experience. Learn more

ResearchPublication

How to give a conversational layer to a B2B travel API: multi-agent architecture on A2A

A post of March 2026 from Despegar, part of the Prosus group. A router, a decomposer, specialist agents and a synthesizer, each its own call to a language model and joined on the A2A protocol, put a conversation on top of a travel API for business partners.

A small navy paper disc on red paper. Three cream strips fan out from it to a column of three small squares, navy, cream and navy, then join again at a larger navy disc on the right.

Where this comes from

This is a post on the Prosus AI Tech Blog, published on 24 March 2026 and written by G. Balonga, who works at Despegar, an online travel agency in Latin America that is part of the Prosus group. His first attempt was a server of flight tools on the Model Context Protocol, built for an internal AI Olympics in December 2025. The system the post describes came after an AI bootcamp that Prosus held in Amsterdam in February 2026, a week of sessions with AI teams from across the group and guests from other companies. What follows is from the post.

What the post asks

Hundreds of business partners connect to Despegar’s API. The author set out to build an AI suite that handles the whole of a trip through conversation, from search and booking to after-sales. One agent with access to the flight API works for straightforward cases, but a user may ask about flights, cancel a booking and ask for an itinerary in the same message. An agent that handles all of it either grows bloated and hard to maintain or gets lost in the details. The answer is specialist agents, one for each domain, and that raises the question of who coordinates them.

The architecture

After several iterations the system settled into an orchestrator over four kinds of part. Each is a separate call to a language model, with its own prompt and one responsibility, and knows nothing about the others: the router does not know how the specialists answer, and the specialists do not know the synthesizer exists. The author writes that this separation came out of weeks of debugging.

  1. Router

    Reads each message from the user and decides which specialists it needs. It sees the last message and the last three turns of the conversation, since the full history holds answers from external APIs in JSON that run to thousands of tokens.

  2. Decomposer

    Comes in when the router picks more than one specialist, and splits the message into a task for each, holding only what concerns that specialist’s domain. The post calls this context pruning.

  3. Specialists

    Agents for one domain each, such as flights-agent, aftersales-agent and hotels-agent, which call the travel API’s tools. When there are several they run in parallel with Python’s asyncio.gather(), so a turn waits only for the slowest of them.

  4. Synthesizer

    Brings the specialists’ answers together into a single voice for the user.

Pruning the context gives each call fewer tokens, lowers latency and keeps an agent from being distracted by what does not concern it. The post gives an example of what it prevents: a generalist agent that confuses the booking number of a cancellation with a seat number on a new flight.

Memory across turns

The hardest problem, the author writes, was the flights agent forgetting the results of earlier searches on each turn and calling the API again, though the data was already in its context. The fix was to have the agent append its tool messages, in place, to the shared history of messages that persists across turns.

Agents that speak A2A

Google published the A2A protocol, Agent-to-Agent, in mid 2025, and someone from Google walked the bootcamp through it. It sets one contract for agents: each receives a Task, with an ID, the session’s context, the message and its history, and returns an Artifact, with the result, a state (completed, input-required or failed) and metadata. Agents announce what they can do to the orchestrator with an AgentCard. Agents that speak the same protocol can be swapped: a specialist can be replaced or added, or an external agent connected, without touching the orchestrator. The implementation departs from the standard in one way: the AgentCards are kept together in the router, to avoid the latency of discovery in local development. Once the agents are separate services, each will serve its own card at /.well-known/agent.json.

Seeing what happened

To debug the system the author built a traceability panel that shows, beside each turn’s answer, what the router decided and why, how the decomposer split the task, which tools each specialist called and what the API returned, what the synthesizer received and how it built the answer, a sequence diagram drawn in Mermaid, and the cost in tokens of each agent’s exchange and of the whole turn. A turn with several agents makes more calls to a model, and measuring its cost is what lets one decide, for instance, whether the router can run on a cheaper model. After the proof of concept he read about Langfuse, a tool that does the same.

Three ways for a partner to connect

Because each layer speaks an open standard, the same system can be offered to partners at three levels, without rewriting anything, from a fintech with a mature AI team to a regional travel agency with none:

  1. MCP. A partner with its own AI team connects to the flight server on the Model Context Protocol and builds its own experience on the tools.
  2. A2A agents. A partner with its own orchestration takes ready specialists, such as the flights agent or the after-sales agent, as agents that speak A2A.
  3. The whole stack, fine-tuned. A partner that wants a turnkey solution gets the full system, with a model fine-tuned for its brand, its products and its customers.

Partners can also move away, combine it with other providers or change how they connect over time, which the author sees as building trust with enterprise customers wary of being tied to one vendor.

Where it stands

The post describes a proof of concept under active development, built in Python 3.12 with OpenAI and the flight API of Despegar, and reports no measurements of it. The flights agent can search and pre-book. The system is meant to grow with more tools for each agent, such as comparisons with past prices, alerts and recommendations, and with more agents, for hotels, packages and transfers, each registering with its AgentCard. The next step the author names is automated evaluation: running a set of synthetic conversations against the system, measuring each component on its own and catching regressions before they reach production. Of building it with AI tools, he writes that it took weeks of iteration, in which edits to the code far outnumbered new generations, and that the judgment of what to change and why cannot be replaced: “AI accelerates the execution of that judgment.”

The post

How to Give a Conversational Layer to a B2B Travel API — Multi-Agent Architecture on A2AG. Balonga. Prosus AI Tech Blog, 2026

Author

  • G. Balonga

References

  1. How to Give a Conversational Layer to a B2B Travel API — Multi-Agent Architecture on A2AG. Balonga. Prosus AI Tech Blog, Medium, 24 March 2026

Keep reading

  • Publication

    One model for the whole home page

    A shopping app’s home page is filled by many recommenders, each tuned for its own slot. This model writes one page per person, per meal moment: the title, the subtitle and what to show. In a live test on one slot it brought 137% more orders from that list.

  • Publication

    New robots, old tricks: teaching robots to speak AI

    A post of November 2026 on a year of wiring Darwin, the Prosus humanoid robot. Five parts spoke five protocols, and the post asks what a robot should tell an AI agent about its actions before the agent can use it.

  • Method

    Meet the large commerce model

    Language models learn from text. Magnet Decision learns from what people search for, look at, buy and come back for. Here’s how it’s built.