Building MCP Before MCP Existed: Inside Despegar's Sofia Agent
A deep dive into Despegar's GenAI travel agent, Sofia. Explore its multi-agent architecture, the custom orchestration layer 'Chappi' built before MCP was a standard, and the strategy of decentralizing agent development across company squads to cover the entire five-phase travel arc.
Despegar’s vision for its AI travel assistant, Sofia, is to become the customer’s “channel of choice,” a comprehensive platform that handles the entire travel lifecycle. This ambition led to the creation of a sophisticated multi-agent system, architected and shipped before foundational frameworks like LangChain or standards like MCP (Multi-turn Conversation Protocol) were widely adopted.
Architectural Evolution: From Monolith to Multi-Agent Orchestration
The system’s brain is an internal application named Chappi. Initially, Sofia was a simpler system where a central LLM called tools directly. As the number of tools and use cases grew, the team recognized the need for a more robust architecture to prevent the model from getting “a little bit lost.” This led to a significant evolution:
- Initial State: A single application (Sofia) with a list of tools for the LLM to choose from.
- Evolution to Orchestration: The introduction of Chappi as a central orchestrator.
- Multi-Agent System: To prevent Chappi from becoming a monolith, the architecture was decentralized. Individual agents, each with their own dedicated tools, were separated from Chappi. These agents are organized by business verticals or “flows,” such as flights, hotels, activities, and cars.
This separation required a protocol for Chappi to communicate with the satellite agents. With no industry standard available at the time, the team developed their own custom tool-calling protocol, effectively creating an in-house version of MCP before it was established. While new connections are now being built using the MCP standard to stay current, the original custom protocol remains for legacy systems. The orchestration layer is still considered essential for managing the complexity and separating concerns between the very different use cases, from “dreaming” about a trip to after-sales support.
The Decentralized Development Model
A key factor in Sofia’s development is its decentralized ownership model. Instead of a large, centralized team, any squad within Despegar can create and maintain a flow for Sofia under the supervision of the core AI team.
- Squad Ownership: Squads, which typically include product, IT, and UX members, have the deepest “know-how” for their specific vertical (e.g., the Hotels team knows best how to sell hotels).
- Empowerment: These teams are empowered to take ownership of their agent and implement the improvements they see fit.
- Scalability: This approach distributes the development workload and allows the platform to scale its capabilities much faster than a single team ever could. The central team often builds the initial version of a flow and then hands it over to the corresponding business unit to enhance and maintain.
Covering the Full Travel Arc
Sofia is designed to engage users across five distinct phases of their travel journey, moving beyond the purely transactional nature of traditional Online Travel Agencies (OTAs).
- Dreaming: Assisting users who are unsure where they want to go. Sofia can provide recommendations based on budget, preferences, and time constraints, a use case that was difficult for transactional platforms to cover previously.
- Planning: Once a destination is chosen, Sofia helps with the logistics: finding the best dates, accommodations, and activities. It’s designed to handle complex comparisons that are cumbersome on traditional UIs, such as comparing flight prices across different dates or even different destinations (e.g., Madrid vs. Amsterdam).
- Anticipation (Pre-Trip): After booking, Sofia provides value by anticipating traveler needs. For example, if a user books a ski trip, Sofia can offer ski passes or equipment rentals.
- In-Trip (Experiencing): The team is exploring in-trip use cases, such as providing real-time recommendations for restaurants or coffee shops near the user’s hotel, leveraging the data Despegar already has.
- Sharing (Post-Trip): The final phase focuses on building a community layer. The goal is for users to share their reviews and recommendations directly with Sofia, creating a powerful source of social proof that can be surfaced to future travelers in the “dreaming” phase.
KPIs and Future Directions
The metrics for success have also evolved. An early KPI, “in-scope conversation rate,” plateaued at around 96%, indicating that Sofia could handle most queries. The focus has since shifted to more impactful business metrics:
- Client Interaction Rate: Currently, 30% of Despegar’s clients interact with Sofia at some point in their journey.
- Sofia’s First Booking: Measuring how many sales were significantly influenced by the AI assistant.
Future development is focused on deepening capabilities within each flow. A major area of exploration is group trip planning within WhatsApp, allowing friends to collaboratively plan and book a trip by interacting with Sofia in a group chat. Another powerful, yet-to-be-implemented use case is automating complex tasks like filing a claim for a delayed flight—a perfect agentic task that moves beyond providing information to taking action on the user’s behalf.