Skip to content
PluginStats

@mongodb-developer/vercel-ai-memory weekly downloads statistics

By mongodb-developer · npm · AI SDKs

MongoDB-backed persistent memory provider for the Vercel AI SDK and Vercel Eve — Session, Semantic, Procedural, Episodic, and Scratchpad memory with Atlas Vector Search (optional Atlas Automated Embedding).

View on npm Fresh · Oct 18, 2026

@mongodb-developer/vercel-ai-memory has 989 recorded weekly downloads on npm, a decrease of 72.4% over the past 30 days, ranking #1445 of 2,322 tracked listings.

Weekly downloads
989
Official API · Oct 18, 2026
7-day growth
-65.1%
-1.8K weekly downloads
30-day growth
-72.4%
-2.6K weekly downloads
90-day growth
+305%
+745 weekly downloads
Rank
#1445
Among tracked npm listings

About @mongodb-developer/vercel-ai-memory

@mongodb-developer/vercel-ai-memory

MongoDB-backed persistent memory for the Vercel AI SDK and a first-class memory provider for Vercel Eve. Gives your agent five structured memory tiers — Session, Semantic, Procedural, Episodic, and Scratchpad — all stored in MongoDB Atlas with automatic vector search indexes and per-type retention policies. Bring your own embedding model, or let Atlas Automated Embedding (Voyage AI) generate vectors server-side with zero client embedding pipeline.

Features

  • 🧠 5 memory types — session history, entity knowledge, how-to procedures, event episodes, and a temporary scratchpad
  • 🤖 Vercel Eve provider — drop-in mongodbMemory() for Eve's memory slots via the /eve subpath: automatic recall before every turn, automatic or agent-driven capture, and remember / forget tools — all partitioned by Eve's trusted scope key
  • ⚡ Atlas Automated Embedding — opt in with autoEmbed: { model: 'voyage-4' } and Atlas embeds your memories server-side (Voyage AI); no embedding API key or client pipeline required
  • 🔍 Atlas Vector Search — semantic retrieval powered by any Vercel AI SDK embedding model
  • 📏 Auto-detected dimensions — no need to configure vector dimensions; the package probes them at startup
  • ⏱️ Flexible retention — per-type policies: none, ttl, ttl+importance, or fully dynamic (forgetting curve)
  • 🗑️ Agent-driven memory_forget — let the model mark individual memories for immediate deletion
  • 🧩 Multi-tenant ready — custom collection/index names, extra filter fields (e.g. tenant_id), or disable types entirely
  • 🔄 Temporal versioning — semantic and procedural memories are versioned; history is preserved
  • 🏗️ Zero lock-in — works with any AI SDK model and any embedding provider (VoyageAI, OpenAI, Cohere, Google, etc.)
  • 🔌 Lazy connection — MongoDB connects on first tool use; call .connect() early if you prefer

Installation

npm install @mongodb-developer/vercel-ai-memory
# or
pnpm add @mongodb-developer/vercel-ai-memory

Peer dependencies (install separately):

npm install ai mongodb zod

This package supports AI SDK v6 and v7 (ai@^6.0.0 || ^7.0.0). The examples use APIs such as ToolLoopAgent and isLoopFinished() that are available in both major versions.

Quick Start

import { createMongoDBMemory } from '@mongodb-developer/vercel-ai-memory'
import { openai } from '@ai-sdk/openai'
import { ToolLoopAgent } from 'ai'

// ── 1. Create the memory instance (once, at module/server level) ──────────────
const mongodbMemory = createMongoDBMemory({
  uri: process.env.MONGODB_URI!,
  embedder: openai.embedding('text-embedding-3-small'),
})

// ── 2. Use per-request, scoped to a user and session ─────────────────────────
const agent = new ToolLoopAgent({
  model: openai('gpt-4.1'),
  tools: mongodbMemory({ userId: 'alice', sessionId: 'sess-001' }),
})

const result = await agent.generate({
  prompt: 'My name is Alice and I love hiking. Remember that.',
})

mongodbMemory({ userId, sessionId }) returns the tools record directly — no spreading needed.

Session memory: two modes

The package exposes session (short-term conversation) memory in two modes, both backed by the same Mongo collection. Pick based on how much determinism you need — they can't be combined for the same session.

Mode A — Tool-driven (LLM-controlled)

Shown in the Quick Start above. The LLM sees memory with session_append / session_recent commands and decides when to call them. This is the simplest setup but not deterministic: the model sometimes skips writes (only user or only assistant turns get persisted) or skips reads (agent forgets earlier turns).

Use this for demos, prototypes, or agents where the LLM genuinely curates what belongs in the transcript.

Mode B — Hook-driven (runtime-controlled) ✅ recommended for production

Hide the session tool commands from the LLM and let the runtime read/write the transcript on every turn via Vercel AI SDK hooks. Every user, assistant, and tool turn is captured exactly once per generation, regardless of what the LLM decides.

import { createMongoDBMemory } from '@mongodb-developer/vercel-ai-memory'
import { openai } from '@ai-sdk/openai'
import { ToolLoopAgent, isLoopFinished } from 'ai'
import { z } from 'zod'

const mongodbMemory = createMongoDBMemory({
  uri: process.env.MONGODB_URI!,
  embedder: openai.embedding('text-embedding-3-small'),
  // Hide session_append / session_recent from the LLM tool surface, but keep
  // the session collection + store methods live for the runtime hooks below.
  // (Use `disable: ['session']` instead if you want the collection entirely off.)
  topology: { hideToolCommands: ['session'] },
})

const agent = new ToolLoopAgent({
  model: openai('gpt-4o-mini'),

  callOptionsSchema: z.object({
    userId: z.string(),
    sessionId: z.string(),
    prompt: z.string(),
  }),

  // ── PRE hook: read history + scope onFinish ─────────────────────────────────
  // Strip `prompt` / `messages` from the incoming settings — the AI SDK enforces
  // `prompt` XOR `messages`, and we're replacing them with our restored history.
  prepareCall: async ({ options, prompt: _p, messages: _m, ...settings }) => {
    const { userId, sessionId, prompt } = options!
    const history = await mongodbMemory.loadSession({ userId, sessionId })

    return {
      ...settings,
      tools: mongodbMemory({ userId, sessionId }),
      messages: [...history, { role: 'user', content: prompt }],
      // per-call state flows to onFinish via experimental_context
      experimental_context: { userId, sessionId, prompt },
    }
  },

  // ── POST hook: write every turn exactly once ────────────────────────────────
  onFinish: mongodbMemory.onFinish(),

  stopWhen: isLoopFinished(),
})…

Description from the npm listing.

  • mongodb
  • vercel-ai
  • ai-sdk
  • eve
  • vercel-eve
  • memory
  • agent-memory
  • vector-search
  • atlas
  • llm
  • rag

README badge

Show your rank in a README or on your website. The badge updates automatically.

Charts

Images: 30d · 1y · all time · 1600×900 dark

Adoption over time

@mongodb-developer/vercel-ai-memory weekly downloads on npm, last 90 days: 989 weekly downloads as of Oct 18, 2026, +305% over 90 days.@mongodb-developer/vercel-ai-memoryWeekly downloads on npm · Last 90 days989downloads / week+305% over 90 days01K2K3K4K5K6KJul 20Aug 4Aug 19Sep 3Sep 18Oct 3Oct 18downloads / weekobservedarchived (Internet Archive)no observationsJul 22, 2026 – Oct 18, 2026 · 89 observations · Updated Oc…pluginstats.com
@mongodb-developer/vercel-ai-memory weekly downloads on npm, last 90 days: 989 weekly downloads as of Oct 18, 2026, +305% over 90 days.

7/30/90-day growth

@mongodb-developer/vercel-ai-memory weekly downloads growth on npm: -65.1% over 7 days, -72.4% over 30 days, +305% over 90 days.@mongodb-developer/vercel-ai-memoryWeekly downloads growth on npm989downloads / week now7-day growth-1,843 weekly downloads-65.1%30-day growth-2,595 weekly downloads-72.4%90-day growth+745 weekly downloads+305%Growth vs. nearest observation to each baseline date · Updated Oct 18, 2026pluginstats.com
@mongodb-developer/vercel-ai-memory weekly downloads growth on npm: -65.1% over 7 days, -72.4% over 30 days, +305% over 90 days.

Ranking history

@mongodb-developer/vercel-ai-memory npm ranking history: currently #1445 (by weekly downloads).@mongodb-developer/vercel-ai-memorynpm ranking · by weekly downloads · Last 90 days#1445current rank#1390#1400#1410#1420#1430#1440#1450Jul 22Aug 6Aug 21Sep 5Sep 20Oct 5Oct 20rankOct 18, 2026 – Oct 20, 2026 · 3 observations · Updated Oct 18, 2026pluginstats.com
@mongodb-developer/vercel-ai-memory npm ranking history: currently #1445 (by weekly downloads).

Listing placement

All npm2,320 listings · 116 pages · 1,162 shown · page 73, #8 (overall #1,448)
All npm: every listing in weekly downloads order

Listing placement

AI SDKs259 listings · 13 pages · page 7, #16 (overall #136)
AI SDKs: every listing in weekly downloads order

Filled points are observed values; hollow points come from Internet Archive snapshots of the listing page. Dashed segments span periods with no observations — values between points are not interpolated.

Each band is one page of 20. Weekly downloads on a linear scale. Placement is projected from weekly downloads, so it can differ from the marketplace's own sort order. Hover a dot to see the listing.

Recent observations

Full history (122)
Recent weekly downloads observations for @mongodb-developer/vercel-ai-memory
Date (UTC)Weekly downloadsChange vs. previous
989+52
937-108
1,045-146
1,191-892
2,083-814
2,8970
2,897+65
2,832+101
2,731+93
2,638+113
2,525+309
2,216+14
2,202-637
2,839—

Data source

Weekly downloads (trailing 7 complete days) come from the official npm downloads API. Downloads include CI and mirrors and are not equivalent to installs or users. npm publishes no ratings.

Listing: https://www.npmjs.com/package/@mongodb-developer/vercel-ai-memory. First seen Oct 16, 2026; last successful collection Oct 20, 2026. See the methodology.