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 (plus a Vercel Eve provider that is not yet production-ready) — Session, Semantic, Procedural, Episodic, and Scratchpad memory with Atlas Vector Search (optional Atlas Automated Embedding).

View on npm Fresh · Dec 6, 2026

@mongodb-developer/vercel-ai-memory has 3,883 recorded weekly downloads on npm, a decrease of 21.5% over the past 30 days, ranking #1633 of 3,247 tracked listings.

Weekly downloads
3,883
Official API · Dec 5, 2026
7-day growth
+26.2%
+806 weekly downloads
30-day growth
-21.5%
-1.1K weekly downloads
90-day growth
+4.4%
+164 weekly downloads
Rank
#1633
▲ 19 in 7 days

About @mongodb-developer/vercel-ai-memory

@mongodb-developer/vercel-ai-memory

MongoDB-backed persistent memory for the Vercel AI SDK and a memory provider for Vercel Eve (not yet production-ready). 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 (not yet production-ready) — 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 scope for the end hook. AI SDK v7 key; on v6 use
      // `experimental_context` instead (see the table below).
      runtimeContext: { userId, sessionId, prompt },
    }
  },…

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: 3,883 weekly downloads as of Dec 5, 2026, +4.4% over 90 days.@mongodb-developer/vercel-ai-memoryWeekly downloads on npm · Last 90 days3,883downloads / week+4.4% over 90 days01K2K3K4K5K6KSep 6Sep 21Oct 6Oct 21Nov 5Nov 20Dec 5downloads / weekobservedarchived (Internet Archive)no observationsSep 7, 2026 – Dec 5, 2026 · 90 observations · Updated Dec …pluginstats.com
@mongodb-developer/vercel-ai-memory weekly downloads on npm, last 90 days: 3,883 weekly downloads as of Dec 5, 2026, +4.4% over 90 days.

7/30/90-day growth

@mongodb-developer/vercel-ai-memory weekly downloads growth on npm: +26.2% over 7 days, -21.5% over 30 days, +4.4% over 90 days.@mongodb-developer/vercel-ai-memoryWeekly downloads growth on npm3,883downloads / week now7-day growth+806 weekly downloads+26.2%30-day growth-1,066 weekly downloads-21.5%90-day growth+164 weekly downloads+4.4%Growth vs. nearest observation to each baseline date · Updated Dec 5, 2026pluginstats.com
@mongodb-developer/vercel-ai-memory weekly downloads growth on npm: +26.2% over 7 days, -21.5% over 30 days, +4.4% over 90 days.

Ranking history

@mongodb-developer/vercel-ai-memory npm ranking history: currently #1633 (by weekly downloads).@mongodb-developer/vercel-ai-memorynpm ranking · by weekly downloads · Last 90 days#1633current rank#1200#1300#1400#1500#1600#1700#1800Sep 7Sep 22Oct 7Oct 22Nov 6Nov 21Dec 6rankOct 18, 2026 – Dec 6, 2026 · 44 observations · Updated Dec 5, 2026pluginstats.com
@mongodb-developer/vercel-ai-memory npm ranking history: currently #1633 (by weekly downloads).

Listing placement

All npm3,247 listings · 163 pages · 1,083 shown · page 82, #13 (overall #1,633)
All npm: every listing in weekly downloads order

Listing placement

AI SDKs378 listings · 19 pages · page 7, #13 (overall #133)
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 (170)
Recent weekly downloads observations for @mongodb-developer/vercel-ai-memory
Date (UTC)Weekly downloadsChange vs. previous
3,883+16
3,867+57
3,810+125
3,685+118
3,567+182
3,385+73
3,312+235
3,077+38
3,039+53
2,986+128
2,858+54
2,804+138
2,666+393
2,273—

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 Dec 6, 2026. See the methodology.