MongoDBAnnouncement
MongoDB Mastra Integration Adds Hybrid Search, Auto Embedding, and Reranking
Summary
Mastra, an open-source TypeScript framework for building agents, previously required developers to copy operational data into a separate vector collection, generate embeddings, merge semantic and keyword results, and track IDs for follow-up fetches, creating data drift. A new MongoDB integration combines Hybrid Search, Automated Embedding, Bring Your Own Collection (BYOC), pre-filtering, and Native Reranking into a single query. Automated Embedding uses Voyage AI to generate and maintain embeddings for text fields automatically, while BYOC allows Mastra to search the original collection directly, avoiding a separate retrieval copy. Pre-filtering narrows vector search candidates inside $vectorSearch using filterFields, and Native Reranking reorders results for relevance. Together, these features eliminate separate embedding sync jobs and allow one query to handle both semantic intent and concrete constraints, though Native Reranking requires MongoDB Atlas 9.0 with reranking enabled.
Approach / What changed
The integration combines Hybrid Search, Automated Embedding (using Voyage AI), Bring Your Own Collection (BYOC), pre-filtering via filterFields, and Native Reranking (requires Atlas 9.0) into a single MongoDB query, eliminating the need for separate embedding sync jobs and retrieval copies.
Takeaways
The integration eliminates separate vector collection and sync by combining Hybrid Search, Automated Embedding, BYOC, pre-filtering, and Native Reranking into one query.
Automated Embedding uses Voyage AI to handle embedding generation and maintenance, while BYOC avoids copying operational data into a separate retrieval collection.
Native Reranking requires MongoDB Atlas 9.0 with reranking enabled, and pre-filtering uses filterFields to narrow candidates inside $vectorSearch.
FAQ
What is Automated Embedding in the Mastra-MongoDB integration?
Automated Embedding uses a Voyage AI model to generate and maintain embeddings for specified text fields in MongoDB, removing the need for application-side embedding and synchronization.
How does Bring Your Own Collection (BYOC) work?
BYOC lets Mastra search the original MongoDB collection directly and return full documents, avoiding the need for a separate retrieval copy, ID tracking, and follow-up fetches.
What are the requirements for Native Reranking?
Native Reranking requires a MongoDB Atlas cluster running version 9.0 with reranking enabled.
Source and freshness
- Source
- mongodb.com
- Published
- Added to Yomu
Summaries are generated from the original by a language model. Check the original before relying on it.
Keep reading
Related reading
The Good Stuff
Paid picks we use ourselves. Links carry a referral code — a subscription through one earns us a commission at no extra cost to you.
The best engineering reads, once a week
One useful email. Unsubscribe anytime.