How to Give an Agent a Query Language Instead of a Code Interpreter
A four-step pattern for letting a document agent write validated aggregation pipelines instead of arbitrary code, so results come back shaped and tenancy stays enforced.
Loading…
Topic
80 posts about MongoDB. Every summary links to the original.
See the idea
A four-step pattern for letting a document agent write validated aggregation pipelines instead of arbitrary code, so results come back shaped and tenancy stays enforced.
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.
Newest first
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.
Piramal Finance, a large Indian NBFC with over ₹1,00,000 Cr in assets, built its entire tech stack in-house and uses MongoDB Atlas for over 80% of its services. In 2024, the company developed an internal agentic AI assistant for its 18,000+ employees to improve productivity across engineering, HR, and customer service. Initially, the assistant relied on a fragmented architecture combining Neo4j, pgVector, and PostgreSQL, which caused update latencies of over 30 minutes. Piramal Finance migrated to a unified MongoDB Atlas platform, using its document model, aggregation framework with $graphLookup, MongoDB Search, and Vector Search. The migration reduced knowledge graph updates to 15 seconds, delivered 3x faster vector retrieval, and now over 80% of employees use the assistant weekly, handling 15,000 daily queries.
MongoDB’s sales culture is built on excellence, teamwork, and recognition, with sellers owning the full sales cycle from pipeline generation to close. The company emphasizes peer-to-peer learning, where solutions are shared immediately across teams and a “teach-back” approach deepens understanding. Career progression is structured through the BDR to CRO program, which provides a transparent, performance-based framework for advancement into leadership. Sellers describe MongoDB as a demanding environment where challenging projects and hands-on coaching from leaders accelerate professional growth. The company positions itself at the intersection of data modernization and AI adoption, offering sellers the opportunity to work with enterprises building for the next decade.
Payment platforms must protect payment account data while enabling authorized workflows, and PCI DSS provides a framework for balancing security and access. For self-managed deployments, organizations can combine MongoDB Enterprise Advanced with Red Hat OpenShift and the MongoDB Controllers for Kubernetes (MCK) Operator to implement a defense-in-depth architecture across three tiers. The application layer enforces data minimization, tokenizes primary account numbers, and isolates external clients through an API gateway, reducing unnecessary exposure. The database layer uses queryable encryption to keep selected fields encrypted while supporting defined queries, with keys managed by a separate key management service, and supplements this with role-based access control, IP-based authentication, and auditing. Infrastructure controls via OpenShift NetworkPolicies restrict workload communication, while Ops Manager handles automation and backup, and together these layered controls support PCI DSS objectives such as protecting stored data, restricting access, and monitoring activity.
MongoDB has been recognized as a Leader in the Forrester Wave: Translytical Data Platforms, Q4 2024, with the designation reaffirmed in 2026. Forrester defines translytical platforms as databases that handle transactional, operational, and analytical workloads on a single engine without compromising integrity or performance. The evaluation covered 15 vendors across 26 criteria for current offering, strategy, and market presence, with MongoDB achieving the highest scores in nine categories, including multimodel support, search, development tools, scale optimization, streaming, platform management, roadmap, adoption, and customer count. MongoDB Atlas integrates documents, vectors, streaming data, and time-series into one system for unified workloads. The report notes that MongoDB continues to expand its translytical market share through new capabilities in automation, intelligent memory tiering, and multimodel support, and is an excellent choice for organizations seeking real-time insights.
MongoDB Atlas for Government has achieved FedRAMP Class D (High) Certification, the highest level under the Federal Risk and Authorization Management Program. It is now the only FedRAMP Class D certified cross-cloud operational database, supporting AWS GovCloud, Azure Government, and Google Cloud Assured Workloads. The platform provides a fully managed environment for U.S. public sector agencies and ISVs to run sensitive, high-impact workloads including transactional data, search, vector search for AI applications, and time series data, all within a single unified data platform. Data protection includes FIPS 140-3 validated encryption, customer-managed keys, and Queryable Encryption for client-side encryption of fields in use. With this certification, agencies can build production AI applications using MongoDB Vector Search for retrieval-augmented generation directly on operational data within a single FedRAMP Class D environment.
AWS and MongoDB launched the open-source strands-mongodb Python package, integrating MongoDB as the data platform for Strands AI agents. The integration provides session persistence so agents resume conversations after a restart or on a different instance, and long-term memory for facts that carry across conversations. Atlas Automated Embedding generates vector embeddings from plain text without an external embedding pipeline, enabling vector, text, or hybrid search. The memory store enforces tenant isolation through scoped stamps and deduplicates repeated extractions using a content hash. OpenTelemetry tracing is included, and the package requires Python 3.10 or later and strands-agents 1.54.0 or later.
MongoDB acquired Firebolt to bring real-time analytics into its Intelligent Data Platform, enabling applications and AI agents to analyze live operational data without moving it to a separate system. The acquisition eliminates the data-movement tax of building and maintaining pipelines, as Firebolt’s engine will run alongside MongoDB with automatic synchronization. Firebolt was built for high concurrency and sub-second queries on fast-changing data, proven in production at petabyte scale by customers like Similarweb. MongoDB plans to offer real-time analytics as a toggle for its data, with future support for analyzing data from other sources alongside MongoDB data. The combined platform aims to provide the same reliability and operational excellence for analytics that MongoDB delivers for mission-critical operational workloads.
JSONBench, an open-source benchmark for analytical queries on JSON data, has grown from five to 27 database engines since its debut. ClickHouse continues to lead the billion-document comparison on identical hardware, returning a cold-run aggregation query in 661 milliseconds versus MongoDB’s 32 minutes and 26 seconds. The benchmark uses real Bluesky events with nested JSON structures and measures combined scores from query runtimes, loading time, and storage size. ClickHouse’s native columnar storage, compression, and parallel query engine allow it to read only the needed fields while preserving document flexibility. Since the original benchmark, ClickHouse has shipped 178 changes to its native JSON type, including faster reads, lower memory use, and new indexes over JSON field names and values.
MongoDB Atlas Infinite is a new deployment option that separates compute from storage, enabling each to scale independently and rapidly. This architecture eliminates the need to copy data when scaling, with read replicas coming online in minutes and a single shard supporting up to 128 TB. MongoDB Search and Vector Search are now supported on Atlas Infinite in public preview, allowing retrieval to live on the same platform as the database without stitching separate systems together. Storage is billed per logical gigabyte stored, metered hourly, with no headroom to provision, which reduces costs for vector-heavy workloads by about 25% at 100 million vectors and 30% at 1 billion vectors compared to Atlas Core. The platform is designed to absorb unpredictable demand from agentic applications while letting teams start with a small prototype and grow to petabyte scale without re-architecting.
Agentic treasury uses AI agents to monitor real-time cash positions, payment statuses, and market signals, then recommends actions such as cash sweeps or FX hedges only when authorized. The approach replaces traditional batch processing with a continuous sense-plan-propose-check-act loop that keeps context current. MongoDB provides the data layer by detecting relevant changes via change streams, storing flexible governance controls and audit logs, and supporting vector search and agent memory. The Monetary Authority of Singapore’s SAFR framework offers a reference for governing agents at runtime through a governance envelope processed by identity, controls, disposition engine, and audit log. Adoption is early but growing, with 22% of companies already using agentic AI and 18% within treasury or finance departments.
MongoDB has been named a Leader in the new Gartner Magic Quadrant for Cloud Operational Database Management Systems, a category split from the former Cloud Database Management Systems report. The company attributes this placement to its data platform investments and the trust of over 70,000 customers, including roughly 75% of the Fortune 100. MongoDB 9.0 delivers up to 20% higher transactional throughput and faster find-one and update-one queries compared to version 8.0. Atlas Infinite, described as the largest architectural innovation for MongoDB Atlas, is built to absorb bursts of traffic and scale from prototype to petabyte. Atlas Agent Engine enables developers to build agents with persistent memory, context, guardrails, and state management without stitching together separate components.
MongoDB Atlas Agent Engine provides a managed control layer for AI agents, including identity, runtime, long-term memory, auditability, and guardrails, and is model- and framework-neutral. This tutorial demonstrates migrating a LangGraph-based travel agent to Agent Engine with minimal code changes, using the agent_engine_sdk_langgraph adapter. The agent uses custom tools and MongoDB Atlas Managed MCP Server tools to query flight and accommodation data stored in MongoDB, and its state is persisted via Agent Engine’s checkpointer. Migration steps include wrapping the agent with the App class, routing LLM calls through Agent Engine, registering tools with the @app.tool() decorator, and configuring memory and governance policies. After deployment, administrators can enforce policies that limit tools and models, and content guardrails that block sensitive data like credit card numbers from reaching the LLM.
Insurance policies are naturally nested business objects, yet most core systems slice them across dozens of relational tables that must be joined on every screen load. A document database like MongoDB lets you store one policy as a single nested document, but the critical design decision is whether to embed or reference each piece of data. The rule is to embed data that is always read alongside its parent, such as coverages inside a policy, and to reference data with its own lifecycle, such as a customer or agent. For outlier cases like a hurricane claim with 60 attachments, the outlier pattern embeds by default and overflows to a side collection only when a threshold is crossed. Sharding by a hashed claim number spreads write load evenly, avoiding the trap of sharding by catastrophe event code, which would route all surge claims to one server.
MongoDB engineers identified that document materialization in Atlas Search and Vector Search spent roughly 30% of mongod CPU time on repeated query planning and collection resource acquisition rather than actual document retrieval. They redesigned the $_internalSearchIdLookup stage to reuse a parameterized SBE execution plan and batch lookups within a shared resource scope. This eliminated redundant plan construction and amortized resource acquisition across multiple documents. In benchmarks, end-to-end query latency dropped up to 4.9x for $search and 5.5x for $vectorSearch at 10,000 results, and throughput under 16 concurrent clients increased approximately 2.75x. The optimizations ship in MongoDB 9.0, are enabled by default, and require no application changes.
Retail is entering the era of multi-agent shopping assistants, with McKinsey estimating AI agents could mediate $3 trillion to $5 trillion of global consumer commerce by 2030. Building production multi-agent systems requires five distinct data needs: semantic search over vector embeddings, flexible user context, conversation state across sessions, long-term memory that evolves, and observability through audit logs. Engineering teams often pay a “siloed database tax” by using separate datastores for each need, leading to fragmentation and inconsistency when agents read from different stores. MongoDB Atlas consolidates all five needs into one platform, using Vector Search, flexible document models, and unified observability to give every agent the same version of truth, as demonstrated in the Multi Agent Retail Advisor (MARA) reference implementation. This architectural simplicity enables faster development, lower total cost of ownership, and a seamless customer experience where preferences carry across sessions and channels without the customer repeating themselves.
Observe.AI partnered with MongoDB Consulting to scale a production MongoDB Atlas cluster from two data shards holding roughly 50 TB of uncompressed data to a healthier multi-shard layout. The team used MongoDB 8.0 resharding instead of relying solely on the balancer for the initial large-scale data movement, because balancer-driven chunk migrations would have extended the migration window and kept original shards under pressure. Resharding was run sequentially on the largest collections, with the largest collection (collection7) taking 38.8 hours to redistribute 19.67 TB. Production reads and writes continued during the clone and catch-up phases, with only a brief write-blocking critical section during the final commit. After migration, the balancer returned to incremental rebalancing while the heavy data movement was handled through the resharding workflow.
The MongoDB CDC connector for ClickPipes is now generally available after replicating over 1.5PB of data for hundreds of production customers. It leverages MongoDB Change Streams for low-latency synchronization and introduces parallel snapshotting that automatically chunks collections by document ID to speed up initial loads and resyncs. A structured ingestion mode samples documents to infer a schema, mapping top-level fields to typed ClickHouse columns while storing unexpected or type-mismatched values in a JSON column for later handling. Observability has been extended with metrics for CPU, memory, network bandwidth, and replication lag, available in the ClickPipes UI and via Prometheus endpoint. The connector supports programmatic management through Open API and Terraform, and its billing is based on data volume with a fixed compute cost per service, offering 5-10x cost savings over third-party ETL tools.
The MongoDB Vercel AI SDK integration provides AI applications built with Vercel’s SDK with a persistent memory store in MongoDB Atlas that retains conversations, user facts, and past events across sessions. It is now open source, licensed under Apache 2.0, and generally available on npm for AI SDK versions 6 and 7. The integration automatically categorizes five types of memory—session, semantic, procedural, episodic, and scratchpad—each with a different retention policy, where semantic and procedural memories are versioned and scratchpad notes expire after an hour. Semantic, procedural, and episodic memories use MongoDB Vector Search, which the integration auto-configures by creating vector indexes and detecting embedding dimensions at startup. For production, developers can enforce reliable session history, isolate data per customer using filter fields such as tenant_id, and customize collection and index names.
The MongoDB Google ADK Integration provides developers with durable memory for agent state using MongoDB as the unified data platform. It introduces MongoDbSessionService to persist sessions, events, and scoped state with optimistic concurrency control, and MongoDBMemoryService that ingests session events idempotently and recalls memories through keyword matching across sessions. Working with Google ADK 2.0 and the Gemini Enterprise Agent Platform, the integration supports MongoDB Atlas and self-managed MongoDB 8.0+ deployments. Built-in search capabilities, including vector search via Voyage AI embeddings and hybrid search combining vector and full-text search through the $rankFusion stage, give agents fast access to operational data without separate systems. This unified architecture means developers can keep agent state, searchable data, and application records in the same database, eliminating separate databases, search engines, and synchronization pipelines.
The best engineering reads, once a week.