MongoDB 官宣 AI Agent 全家桶:向量搜索 + 长期记忆 + MCP 支持,开发者工作流巨变
MongoDB 在 London 2026 大会上发布三大 Agent 生产级能力:Automated Voyage AI Embeddings(公开预览)、LangGraph.js 长期记忆(正式GA)、MCP 原生支持。Atlas 正成为 AI Agent 时代的统一数据平台。本文深度解析三大能力的核心技术原理和开发者接入指南。
声明: 本文事实来源为 MongoDB 官方文档(mongodb.com/docs)、MongoDB London 2026 大会公告及 Financial Times 报道。无任何未公开内部信息。
一、大会核心发布
MongoDB 在 London 2026 大会上宣布了三个 AI Agent 相关的重大更新:
| 更新 | 状态 | 核心价值 |
|---|---|---|
| Voyage AI Automated Embeddings | 🟡 公开预览 | 写入数据即自动生成向量,上下文实时注入,无需手动处理嵌入 pipeline |
| LangGraph.js Long-Term Memory Store | 🟢 正式GA | JS/TS 开发者终于拥有开箱即用的跨会话持久化 Agent 记忆方案 |
| MCP(Model Context Protocol)原生支持 | 🟡 公开预览 | Atlas 数据通过标准协议直接接入 Claude/ChatGPT/Gemini 等主流 Agent |
三个能力的共同目标:让 MongoDB Atlas 成为 AI Agent 的「记忆+数据+工具」一体化后端。
二、Automated Voyage AI Embeddings:数据入库即嵌入
传统嵌入 Pipeline 的痛苦
目前做向量检索的开发者,通常需要手动维护一个嵌入 pipeline:
数据 → ETL 脚本 → 调用 embedding API → 存入向量数据库 → 同步管理
↑
这步既贵又慢
问题:
- 嵌入成本:每次数据变更都要调用 embedding API(OpenAI/Cohere 等)
- 同步延迟:ETL 脚本跑完才能检索,旧数据可能落后几天
- 维护复杂度:嵌入模型版本、数据格式、向量维度都要自己管
Voyage AI 的解决思路
Voyage AI 嵌入是 Atlas 内置的嵌入服务,与数据写入深度集成:
// 写入数据时,自动触发嵌入生成
// 整个过程对开发者透明
// 1. 开启 Atlas 向量搜索 + Voyage AI 嵌入
const collection = db.collection('product_reviews');
// 2. 写入数据时指定向量字段,Atlas 自动调用 Voyage AI 嵌入
await collection.insertOne({
product_id: 'widget_123',
review_text: 'Great product, fast shipping!',
rating: 5,
// vectorField 由 Atlas + Voyage AI 自动填充
// 无需手动调用 embedding API
vectorField: {
$vectorize: {
textField: 'review_text',
model: 'voyage-3', // Voyage AI 的嵌入模型
dimensions: 1024,
}
}
});
// 3. 查询时直接向量检索,无需额外处理
const results = await collection.aggregate([
{
$vectorSearch: {
index: 'reviews_vector_index',
path: 'vectorField',
queryVector: await embedQuery('产品质量怎么样'),
numCandidates: 100,
limit: 5,
}
},
{ $project: { review_text: 1, rating: 1, _score: { $meta: 'vectorSearchScore' } } }
]);
核心优势:
| 维度 | 传统方式 | Voyage AI Embedded |
|---|---|---|
| 嵌入成本 | 每次变更独立调用 API | 内置服务,按存储量计费 |
| 数据同步 | ETL 脚本延迟 | 写入即嵌入,实时可用 |
| 模型管理 | 手动维护版本 | Atlas 统一管理 |
| 开发者体验 | 3 个系统协同 | 1 个数据库搞定 |
适用场景
- RAG(检索增强生成):文档/评论/知识库向量检索
- 语义搜索:产品搜索、推荐系统
- 多模态数据管理:文本 + 向量一体化存储
三、LangGraph.js Long-Term Memory Store:正式GA
为什么 Agent 需要长期记忆
之前的 LangGraph.js(JS/TS 版)没有官方的长期记忆方案,开发者只能:
- 用外部向量数据库(Pinecone/Chroma)存记忆
- 自己实现简单的键值存储
- 把完整对话历史塞进 context window(贵且慢)
问题:跨会话的知识积累、人格一致性、上下文延续——这些 Agent「变聪明」的核心能力,几乎无法实现。
Atlas Memory Store 的设计
MongoDB 与 LangGraph.js 合作推出Atlas Memory Store——一个开箱即用的长期记忆解决方案:
import { MongoDBAtlasMemoryStore } from '@langchain/community/memory';
import { ChatAnthropic } from '@langchain/core/language_models';
import { createReactAgent } from '@langchain/langgraph';
import { pullAtlanKit } from '@langchain/community/tools/atlan';
const memory = new MongoDBAtlasMemoryStore({
mongoUrl: process.env.MONGODB_ATLAS_URI,
sessionId: 'user_12345', // 关联到特定用户/会话
memoryCollection: 'agent_memories',
vectorCollection: 'agent_vectors',
indexName: 'agent_vector_index',
});
// 创建带记忆的 Agent
const agent = createReactAgent({
llm: new ChatAnthropic({ model: 'claude-3-5-sonnet' }),
tools: [pullAtlanKit],
memory,
});
// 第一次对话
await agent.invoke({
input: '我叫李明,我喜欢用 Python 写后端服务',
memory: { user_preferences: { name: '李明', preferred_lang: 'Python' } }
});
// 第二次对话(跨会话,记忆自动加载)
const response = await agent.invoke({
input: '我的名字是什么?我偏好什么语言?'
});
// 响应:「你叫李明,你偏好使用 Python 写后端服务。」
Memory Store 的数据结构:
Atlas Memory Store
├── 语义记忆(Semantic Memory)
│ └── 向量索引 → 存储长期事实、偏好、模式
├── 工作记忆(Working Memory)
│ └── 文档存储 → 当前会话的临时上下文
└── 场景记忆(Episodic Memory)
└── 时间序列文档 → 记录 Agent 的「经历」
与传统方案对比
| 特性 | 外部向量数据库(Pinecone 等) | Atlas Memory Store |
|---|---|---|
| 集成难度 | 高(需维护独立服务) | 低(一套 Atlas 解决一切) |
| 数据一致性 | 中(双写/同步问题) | 高(数据库事务内) |
| 查询能力 | 仅向量检索 | 向量 + 结构化混合查询 |
| 成本 | 按向量数收费 | Atlas 存储费用,无额外溢价 |
| LangGraph 官方支持 | 社区集成 | 官方 GA |
四、MCP 原生支持:Atlas 成为 Agent 的「外脑」
MCP 的数据源角色
MCP(Model Context Protocol)的三大角色:MCP Host(AI 应用)、MCP Client(协议客户端)、MCP Server(工具适配器)。
Atlas 在这个架构中承担数据源的角色:
┌─────────────────────┐
│ Claude / ChatGPT │ ← MCP Host
│ / Gemini │
└──────────┬──────────┘
│ MCP Client
↓
┌─────────────────────┐
│ Atlas MCP Server │ ← Atlas 原生支持
│ (通过 MongoDB 驱动) │
└──────────┬──────────┘
│ 结构化 + 向量混合查询
↓
┌─────────────────────┐
│ MongoDB Atlas │
│ (记忆 + 数据 + 工具) │
└─────────────────────┘
Atlas MCP Server 接入示例
// 在 Claude Desktop 配置 Atlas MCP Server
// ~/.claude/config.json
{
"mcpServers": {
"mongodb-atlas": {
"command": "npx",
"args": ["-y", "@mongodb/mcp-server-atlas"],
"env": {
"MONGODB_ATLAS_URI": "mongodb+srv://user:[email protected]",
"MONGODB_DATABASE": "myapp"
}
}
}
}
// 之后在 Claude 中直接说:
// 「查询 myapp 数据库中过去30天的用户注册趋势」
// Claude 自动通过 MCP 调用 Atlas,返回数据 + 可视化分析
MCP 场景下的 Atlas 能力矩阵
| MCP 工具 | Atlas 实现 | 功能 |
|---|---|---|
atlas_query | MongoDB Aggregation | 结构化数据查询 |
atlas_vector_search | $vectorSearch | 语义向量检索 |
atlas_memory_read | Memory Store | 读取 Agent 长期记忆 |
atlas_memory_write | Memory Store | 写入 Agent 学习到的信息 |
五、开发者接入路径
快速开始步骤
# 1. 安装 LangChain.js + Atlas 集成包
npm install @langchain/community @langchain/langgraph
# 2. 配置环境变量
export MONGODB_ATLAS_URI="mongodb+srv://user:[email protected]"
# 3. 初始化 Memory Store(5 行代码)
import { MongoDBAtlasMemoryStore } from '@langchain/community/memory';
const memory = new MongoDBAtlasMemoryStore({ mongoUrl: process.env.MONGODB_ATLAS_URI });
# 4. 创建带记忆的 Agent
const agent = createReactAgent({ llm, tools, memory });
NixAPI 接入价值
对于 NixAPI 这样的多模型 API 聚合平台,MongoDB Agent 全家桶意味着:
// NixAPI × Atlas:Agent 数据层的最优后端
import { NixAPI } from '@nixapi/client';
import { MongoDBAtlasMemoryStore } from '@langchain/community/memory';
// 用户请求 → NixAPI 路由到最优模型
// → 模型调用 Atlas Memory Store 获取记忆/数据
// → 统一返回结构化结果
const memory = new MongoDBAtlasMemoryStore({
mongoUrl: process.env.MONGODB_ATLAS_URI,
sessionId: request.sessionId,
});
// Atlas Memory Store 为 NixAPI 用户提供:
// - 跨会话记忆(用户越用越懂你)
// - 向量检索(RAG 场景)
// - 结构化数据查询(业务数据)
六、关键结论
| 能力 | 状态 | 适合场景 | 推荐指数 |
|---|---|---|---|
| Voyage AI Automated Embeddings | 🟡 公开预览 | RAG、知识库、语义搜索 | ⭐⭐⭐⭐ |
| LangGraph.js Memory Store | 🟢 正式GA | 生产 Agent、需要跨会话记忆 | ⭐⭐⭐⭐⭐ |
| Atlas MCP Server | 🟡 公开预览 | Claude/ChatGPT/Gemini 接入 Atlas | ⭐⭐⭐⭐ |
总体判断:MongoDB Atlas 正从「文档数据库」进化为「AI Agent 数据平台」。LangGraph.js Memory Store 的正式GA 是本次最重磅更新——它让 JS/TS 开发者终于有了生产级的 Agent 记忆方案,无需维护复杂的外部向量服务。
建议 NixAPI 评估 Atlas 作为 Agent 记忆层的默认后端选项,这对多模型路由的上下文管理有直接价值。