AI agents are powerful, doing anything from diagnosing disease to helping us write music. All this power doesn’t come easily, though. Agents require developers to build data pipelines, choose embedding models and chunking strategies, and account for new security concerns like prompt injection. It’s a lot of work before you can even think about getting a single user.
The more developers have to think about infrastructure, the less time they have to focus on building something that is actually useful. Squid AI is an AI agent platform that makes it easy to build, secure, and run AI agents using your private data. Squid connects to dozens of APIs and databases, including MongoDB with built-in secured connectors. So in this post, we’re going to walk through what a basic AI agent on MongoDB would look like and how it works.
What is Squid AI?
There are a lot of tools in the AI space these days. Let’s start by explaining where Squid fits in the stack.
Squid provides an AI agent platform and configurable agents. It can be hosted for you, or deployed in your own environment. It comes with:
Dozens of data connectors, enabling you to connect to data sources like APIs, databases, and SaaS tools like Google Docs and Confluence
Automatic schema discovery and endpoint mapping, which makes it easy to find and connect the data you need for your agent
A semantic collection of your data that supports schema joins and automated or manual descriptions of collections and documents
A universal RAG engine that includes a vector database. It does embedding and chunking, and supports both structured and unstructured data
Hermetic security rules that allow you to set up policies as code
AI functions so that your agent can take action on your data
Squid enables you to connect to the LLM of your choice or you can bring your own.
An AI data agent example using MongoDB Atlas
MongoDB Atlas enables you to build charts with your data using natural language. But what if you want to expose this data to others within your organization? And what if you don’t want to just plot charts – you want to generate written reports and import them into a Slack channel?
Squid AI’s Query with AI functionality enables you to immediately create data visualizations of your Atlas instance as soon as you connect it. Under the hood, Squid automatically discovers your Atlas schema and maps its collections and documents instantly. It also auto-generates a semantic layer across your data schema to optimize accuracy for your data.
When a natural language query comes in, this layer allows an AI data agent to understand the semantic intent and generate an appropriate MongoDB query to fetch the relevant data. Another built-in AI agent automatically validates the first agent’s response and, once completed, Squid AI translates the answer back into natural language for the user, along with the exact query executed and a walkthrough of the steps the agent took for full transparency.
Imagine you work for an online fitness equipment store, and the owner would like to figure out which products are selling:
Query with AI eliminates the tedious manual data preparation typically required for RAG. Developers can simply connect their MongoDB database and let Squid AI handle the rest to create data products that are intuitive to use even by non-technical audiences.
Powering AI Agents with MongoDB Atlas
Squid and MongoDB's highly scalable architecture ensures high performance and availability even for the most demanding AI/ML workloads. With Atlas, you can provision MongoDB clusters with the click of a button, automatically scale based on load, and access a full suite of productivity tools. And Squid’s container- and serverless-based architecture means that its AI agents can flexibly be deployed on AWS, GCP, Azure, behind VPCs and firewalls, or even on private clouds.
Connecting your Atlas cluster to Squid AI takes just a few quick steps. You can connect to your existing instance (or create a new one):
In the Squid Console, add a new MongoDB integration
Enter your Atlas connection URI, database name, username and password
Click "Add Integration" and Squid will automatically discover your schema
That's it. You're ready to start querying your data immediately using natural language or building your AI agent! Squid will handle chunking, embedding, contextualizing data, providing a semantic layer, and ultimately exposing an endpoint for your AI agent so that you can seamlessly integrate it into your existing systems and workflows to help automate operational processes.
Embedding Relevant Agents in your Apps
Now to build the app for your CEO. With Squid and MongoDB powering your AI agent backend, the next step is to build the client-facing experience. Squid provides a powerful Typescript SDK to embed intelligent agents in your web and mobile apps.
To create a new agent, specify the underlying LLM, any persistent instructions, and relevant context to consult from Atlas. Here’s how you would do this using a sales assistant as an example AI agent:
With the agent configured, you can start a conversation by passing a user message to the ask
method:
The agent will parse the user's query, retrieve relevant data from Atlas and generate a response augmented with that context. You can even use context metadata filters to fine tune the knowledge retrieval. This will restrict Squid to only retrieving context tagged with a region of "Pacific Northwest", ensuring a focused and relevant response.
Now imagine building AI agents that can actually take action on this data using AI functions, triggers, and webhooks. Or, incorporating an educational component into the user interface as well, so that other people at your company can also ask about product information or competitors. Squid enables you to build AI agents from a variety of data sources without ever having to think about RAG.
Get Started
Ready to build your own intelligent agents powered by Squid AI and MongoDB? Sign up for a Squid AI account and check out the Squid AI documentation for more details and code samples. If you have a more complex use case in mind, contact us to discuss how Squid AI and MongoDB can help you build production-grade AI solutions tailored to your needs.
Building AI agents and workflows doesn't have to be complicated. The combination of Squid AI's semantic RAG capabilities and MongoDB Atlas provides a powerful foundation for building enterprise-grade AI agents. This approach allows organizations to leverage their existing data infrastructure while adding sophisticated AI capabilities that can scale with their needs.
We can't wait to see what you build!