Explore Developer Center's New Chatbot! MongoDB AI Chatbot can be accessed at the top of your navigation to answer all your MongoDB questions.

Join us at AWS re:Invent 2024! Learn how to use MongoDB for AI use cases.
MongoDB Developer
Atlas
plus
Sign in to follow topics
MongoDB Developer Centerchevron-right
Developer Topicschevron-right
Productschevron-right
Atlaschevron-right

Building AI Multi-Agents with BuildShip and MongoDB

Pavel Duchovny3 min read • Published Nov 18, 2024 • Updated Nov 18, 2024
AIJavaScriptAtlas
SNIPPET
Facebook Icontwitter iconlinkedin icon
Rate this quickstart
star-empty
star-empty
star-empty
star-empty
star-empty
In recent years, the world of artificial intelligence (AI) has made significant strides by focusing on how multiple AI agents can work together to solve complex problems. The collaboration between BuildShip and MongoDB opens up an exciting new frontier for developers looking to implement multi-agent systems that communicate and collaborate seamlessly.
This article explores how BuildShip's integration with MongoDB—particularly using BuildShip's Claude Assistant AI—offers a powerful framework for developing AI multi-agent systems that can leverage data from MongoDB's Atlas flexible and scalable platform. Let's explore the base infrastructure of this integration, from backend data aggregation to frontend interactivity.

Live stream demo

Overview of BuildShip and MongoDB integration

BuildShip is a robust platform designed to help developers easily build and connect AI agents to solve specific problems. MongoDB, with its flexible document data model, becomes the perfect database to manage and process the complex interactions between multiple agents. The integration is straightforward: MongoDB stores structured and semi-structured data, while BuildShip utilizes these datasets to feed its AI agents, specifically Claude Assistant, which can provide a conversational AI interface.
According to BuildShip's documentation, the Claude Assistant can assist with various backend and frontend processes, giving users an AI-first experience. Through MongoDB's aggregation pipelines, users can retrieve relevant data—such as property listings, customer details, or booking information—that Claude can then process to provide users with tailored recommendations and responses.

Backend logic

Booking Agent
The backend, shown in the images, provides an example of integrating MongoDB and BuildShip to build an AI booking agent. This agent aggregates data from the sample_airbnb database to pull information for property listings, booking options, and user preferences.
Here is how the backend logic typically flows:
  1. API calls and Claude Assistant:
    • API calls are made to retrieve or post data (such as booking information).
    • Claude Assistant acts as the conversational layer that helps users navigate these data points effectively. It utilizes the API key from BuildShip to communicate with the MongoDB database.
Claude Assistant Prompt
  1. Aggregation and search:
    • The Aggregate Collection block in the backend queries the listingsAndReviews collection within the sample_airbnb database.
    • Using an aggregation pipeline, specific properties are fetched based on user search criteria like location, number of people, or preferred amenities.
  2. Data processing and response generation:
    • Once the appropriate records are pulled from MongoDB, Claude Assistant can process this data to form human-readable outputs that guide users through making a booking.
    • Data can also be enriched with payment details, availability windows, or additional options, providing a seamless experience.

Frontend interactivity

Front End Application
The front end of this system is designed to interactively respond to user queries and booking requests. From the user interface, users can ask questions like, "What countries can I book from?" The BuildShip-powered AI assistant then responds by analyzing listings from MongoDB.
For example, as seen in the provided screenshots, the AI interface returns the number of listings by country. This is facilitated by Claude Assistant’s ability to leverage the MongoDB aggregation results and present them in a clear, understandable manner.
Here’s an example flow of the user journey:
  1. User input: Users can enter natural language queries about available properties.
  2. AI agent response: Claude Assistant interprets this input, queries MongoDB, and returns relevant results (e.g., "United States: 1222 listings").
  3. Booking requests: Users can then finalize their choice by entering booking details, which Claude will handle by interfacing with the backend API, using MongoDB to store the booking details.

Building your multi-agent system

Multi Agent Example
Leveraging the BuildShip and MongoDB integration allows developers to create a scalable multi-agent system. Here are some steps to get started:
  1. Define agents and responsibilities: Identify what specific tasks each agent will handle, such as data retrieval, user interaction, or booking finalization.
  2. Set up MongoDB for data storage: Use MongoDB’s collections to store information that agents need to access, ensuring data is structured logically for quick retrieval.
  3. Use Claude Assistant as your interface: With the Claude Assistant, integrate conversational AI capabilities that allow users to easily interact with multiple agents.
  4. Test and optimize aggregation pipelines: Ensure that the aggregation pipelines you design are efficient so that the agents can quickly pull and process data, providing a smooth experience to end-users.

Conclusion

The integration between BuildShip and MongoDB offers a flexible and efficient way to create AI multi-agent systems that can handle complex user interactions. With the use of MongoDB's powerful data aggregation and BuildShip's Claude Assistant, developers can deliver robust and scalable solutions, from booking agents to complex customer service applications. The combination of conversational AI with a powerful backend unlocks new possibilities for building interactive and smart applications.
Are you ready to build your own AI-driven, multi-agent system? Explore the full potential of BuildShip and MongoDB and take your AI projects to the next level.

Try it

Top Comments in Forums
There are no comments on this article yet.
Start the Conversation

Facebook Icontwitter iconlinkedin icon
Rate this quickstart
star-empty
star-empty
star-empty
star-empty
star-empty
Related
Tutorial

Getting Started With Deno 2.0 & MongoDB


Oct 22, 2024 | 13 min read
Tutorial

Movie Score Prediction with BigQuery, Vertex AI, and MongoDB Atlas


Jul 11, 2023 | 11 min read
Tutorial

How to Evaluate Your LLM Application


Jun 24, 2024 | 20 min read
Tutorial

Maintaining a Geolocation Specific Game Leaderboard with Phaser and MongoDB


Apr 02, 2024 | 18 min read
Table of Contents
  • Building your multi-agent system