
Why it mattersA retrieval stack that used four steps is now one call. The embedding and reranking stay on the database side, not the agent's.
MongoDB published an updated Mastra integration on 24 November 2026, written by Raschid Jimenez and Nasir Qureshi. Mastra is an open-source TypeScript framework for building agents, and MongoDB is the vector and document store underneath it. The new version puts the retrieval pipeline into one call.
Before the update, a team wanted four steps to serve a retrieval query to an agent. One: copy the operational data into a separate collection that supported vector search. Two: call an embedding service to turn text into vectors. Three: track source IDs so the agent could fetch the full record after the vector hit. Four: watch for changes and re-embed when a source field was edited. Each step is a place where the agent's view of the data can drift from the real data.
What the one query does
The integration combines five features into a single hybrid query. Hybrid search runs semantic and keyword matching together. Automated embedding generates and maintains the vectors for the fields you name, with no code on the application side. Bring Your Own Collection lets the search run against the original MongoDB collection. The agent reads full documents from that search, and does not need a second fetch. Pre-filtering narrows the vector search candidates by declared fields, and applies the same filter to the keyword results. Native reranking reorders the candidates to put the most relevant first.
The authors describe the effect in one line: "Together, they simplify retrieval from ingestion through query." The code changes shape to match. A hybrid query now takes one call to store.hybridQuery. The vector step, the text step, the reranker and the filter sit in one object. The result is a list of the full documents, in order.
The named models and the one hard requirement
MongoDB's example uses Voyage AI's voyage-4 for embeddings and rerank-2.5 for the reranker. Native reranking requires a MongoDB Atlas cluster on version 9.0. Hybrid search and auto-embedding work on earlier Atlas versions. The integration is installed as @mastra/mongodb.
Where the value sits
Retrieval pipelines drift in two places. The first is the embedding job falling behind a source update. When the job is late, the vector search returns yesterday's answer. The second is the ID map between the vector store and the operational collection falling out of step. A top-ranked hit then returns a missing record from the main database. The MongoDB integration takes both of those out of the application code. The embeddings live next to the field they describe. The search runs against the collection the operational writes already touch.
A team on MongoDB Atlas, building an agent with Mastra, now has fewer parts to maintain. A team on a split stack has a harder comparison to make. Teams that use Pinecone or Weaviate for vectors and MongoDB for operational data already wrote glue code. That glue has a one-service replacement on the database that already holds their data.
Source
This item was written by an AI system from the linked source. Reveneau is responsible for what it publishes.
Get AI News in your inbox
New developer tools, model and agent releases, and how teams are actually using them to release software. Short, and only when there is something worth reading.

