Engineering

Written by Memori Labs and MongoDB

Bring Production Memory to Your Agents on the Database You Already Run

Memori Labs and MongoDB are partnering to make agent memory a first-class workload on MongoDB. Capture, store, and recall persistent agent memory in your own Atlas cluster, with data ownership, retention, and access control built in.

Memori and MongoDB — Integrating AI agents with scalable memory solutions

Good teams make progress because everyone shares the same context. The team knows what was tried, what worked, and where things stand. When they sit down the next day, they pick up where they left off. That ability to carry knowledge forward is so fundamental that we rarely think about it. It's just called memory.

AI agents are being deployed to do exactly that kind of work: customer support, research pipelines, and complex multi-step workflows. The investment is real, and so is the expectation that agents improve over time. But without memory, they can't. Agents without memory start every conversation and task from scratch. They re-ask for context they were already given, repeat mistakes they already made, and lose the thread the moment a session ends.

The fix is a memory layer: a durable place to capture what an agent learns and an efficient way to recall it on the next turn. That memory has to live somewhere. Teams building AI applications with MongoDB already store their operational data in it. They don't need a separate memory database, with all the provisioning, security, and maintenance that comes with it.

The Memori Labs and MongoDB partnership solves this exact problem. Memori writes agent memory directly into your MongoDB cluster, so memory sits alongside the application data it serves. This proximity means agent memory stays current with the data it references, with no syncing, no drift, and no additional infrastructure to manage.

Why this pairing works

Memori is agent-native memory infrastructure: an LLM-agnostic layer that transforms agent execution and conversation history into structured, persistent state for production systems.

It is enterprise-grade and built to run in production, and unlike conversational memory wrappers or vector retrieval layers, Memori captures tool calls, decisions, workflow traces, and user context as a durable, queryable state that agents can rely on across sessions, models, and workflows. For example, consider a support agent handling a billing dispute. It looks up the account, reviews the transaction history, decides to escalate, and the session ends. Without memory, the next interaction starts cold. The user has to explain everything again, and the agent re-runs the same lookups.

With Memori, the agent knows which tools it called, what it found, and what it decided. That's a complete record of what the agent did and why, not just a chat log. Memori captures the execution trace, so the next session doesn't repeat work already done.

As a result, your agents will perform better in production: 2x faster task completion, better accuracy, and up to 95.03% inference spend reduction on peer-reviewed benchmarks.

MongoDB is where that memory belongs:

  • The document model fits memory directly. One database, not two. Memori lives next to your operational data, under a single connection, a single set of access controls, and a single operational playbook. No sync jobs and no second system to run.
  • Your data stays yours. Memori integrates seamlessly with your existing enterprise architecture. There are three deployment options:
    • Memori Cloud: Fully managed agent-native memory hosted and operated by Memori.
    • Memori BYOC: Memori deployed inside your cloud account or VPC, with Memori-supported deployment, upgrades, and operations.
    • Memori Self-Hosted: Memori deployed and operated by you in your own cloud or on-prem environment.
  • Built for scale. Atlas handles high-volume capture and recall across millions of conversations, with time-to-live (TTL) indexes for retention and replica sets for durability. This means you can set a retention window (e.g., 90 days) and MongoDB handles the expiry in the background. This keeps storage costs predictable and prevents the memory layer from accumulating a stale state.
Memori architecture: Advanced Augmentation and Intelligent Recall backed by MongoDB Atlas

Prototype with Memori BYODB and MongoDB: set up persistent memory in three lines

MongoDB is a first-tier database substrate. Point Memori at a MongoDB connection, register your LLM client, and memory capture and recall run automatically around every model call.

from memori import Memori
from pymongo import MongoClient
from openai import OpenAI

mongo_client = MongoClient("mongodb+srv://user:password@cluster.mongodb.net")

def get_db():
    return mongo_client["memori_db"]

client = OpenAI()
mem = Memori(conn=get_db).llm.register(client)
mem.attribution(entity_id="user_123", process_id="support_agent")
mem.config.storage.build()

From here, every chat turn is captured as a memory MongoDB document, and relevant facts are recalled on the next prompt with no extra plumbing.

Recall that returns facts, not raw transcripts. Memori extracts durable facts from conversation and agent traces, and serves them back on demand, so a vegan user does not have to restate their diet, and a support agent opens with the customer's history already in context.

mem.augmentation.wait()
facts = mem.recall("dietary preferences")

Memory primitives mapped to collections. Memori's memory creation process, Advanced Augmentation, works in the background to normalize and structure the most important interactions for agent performance and store them as MongoDB documents you can query and index directly.

Memory TypeWhat it isWhere it lives
DomainProject or task-level context for agent-to-agent transferMongoDB
EntityPerson, place or thing; like a userMongoDB
ProcessAgent, LLM, or program context with execution traceMongoDB
SessionImplicit layer for intelligent context managementMongoDB

Retention you control. Apply a TTL index to automatically expire old memory, with retention windows set per use case.

db.memory_entries.createIndex(
  { timestamp: 1 },
  { expireAfterSeconds: 60 * 60 * 24 * 30 }, // 30 days
);

Native MongoDB backend in the open-source Memori SDK via PyMongo. Framework and provider coverage spanning OpenAI, Anthropic, Gemini, and others on the model side, and LangChain, Agno, and Pydantic AI on the agent side, all writing memory to the same MongoDB store.

Move from prototype to production: Memori Production Plans

As your MongoDB agents move to production, Memori's production plans pair enterprise scale, governance, and deployment with best-in-class agent memory benchmarks.

PlanScaleDeploymentEnterprise Features
TeamSingle agentManaged, multi-tenantAgent Access Control, SSO, and Full Observability and Audit logging.
BusinessMultiple agentsManaged, single-tenantAgent Access Control, SSO, and Full Observability and Audit logging.
EnterpriseOrg-wide, unlimited agentsBring-your-own-cloud VPC or on-prem, connected to MongoDB within your infrastructure.Plus custom SLA, solutions engineering, advanced evals, holdout attribution and outcome-based pricing.

All plans include:

  • Unlimited memories. Each plan includes unlimited memories created and recalled.
  • Memory pools. Shared, permissioned collections of memories, available to agents across users, teams, workflows, and applications.
  • Governance. Agent Access Control with role and relationship-based control (ReBAC). Tie memory operations to your database's permissions. Assign read, write, and admin roles, or map directly to your existing policies, and control which agents can read which memories. Integrate your SSO and OAuth to centrally manage permissions.
  • Observability and audit. Immutable audit logs showing who accessed what, when, and why. Full observability with memory telemetry exported into your existing stack.
  • Compliance. Enterprise-grade controls for regulated workloads, compliant across SOC 2 Type II, HIPAA, and GDPR.
  • Data ownership with Memori Enterprise. Memori Enterprise runs in your own cloud or on-prem with MongoDB as the storage layer and dedicated infrastructure, custom SLAs, and solutions engineering. Nothing is moved, stored, or indexed outside your chosen environment.
  • Advanced evals with Memori Enterprise. Evaluation and holdout attribution to continuously measure and compound agent performance gains.

With these in place, you get industry-leading agent performance with the precise enterprise scale and control you need, on the database you're familiar with.

Memori benchmark results: 81.95% accuracy at 4.97% of full-context token cost

Get started

Ready to give your agents memories? Use the resources below to configure your MongoDB-backed memory layer and start building smarter, context-aware agents today.

About Memori Labs

Memori Labs builds agent-native memory infrastructure: an LLM-agnostic layer that turns agent execution and conversation into structured, persistent state for production systems. Enterprises see 95.03% token-cost reduction and improved agent performance with Memori on peer-reviewed benchmarks. All Memori production plans offer unlimited memories, memory pooling, and complete enterprise controls. Memori Enterprise deploys on-prem or in your own cloud, with private connectivity to MongoDB inside your cloud boundary. Memori is also available open-source and as a managed service through Memori Cloud.

About MongoDB

MongoDB is a leading developer data platform that empowers developers to build, scale, and modernize applications faster. Headquartered in New York, MongoDB provides an integrated suite of cloud database services centered around its pioneer document model.

At the core of its ecosystem is MongoDB Atlas, a fully managed multi-cloud developer data platform designed to handle both operational workloads and advanced AI applications in a single unified architecture. By natively integrating flexible JSON-like documents, powerful aggregation pipelines, full-text search, and multi-cloud Atlas Vector Search, MongoDB removes the operational complexity of managing disparate database systems.

Trusted by millions of developers and thousands of customers globally - ranging from disruptive startups to the world's largest enterprises - MongoDB provides the scalable, secure, and highly resilient data foundation required to power the next generation of data-aware, intelligent applications.