Registry / database / rivet-plugin-mongodb

rivet-plugin-mongodb

JSON →
library6.4.0jsnpmunverified

A plugin for Rivet (AI graph application) providing 4 nodes to interact with MongoDB: store vectors, perform aggregations, search collections, and execute vector searches ($vectorSearch). Current stable version is 6.4.0, released as part of Rivet's plugin ecosystem. It is a community-maintained plugin that bridges Rivet's graph-based AI workflows with MongoDB's document and vector search capabilities. Key differentiators: native integration with Rivet nodes, support for MongoDB Atlas Vector Search, and simple plugin installation via Rivet's UI. Requires a MongoDB connection string and, for vector search, an appropriate Atlas index. Release cadence is irregular, with last major change being deprecation of MongoDBVectorKNN in favor of MongoDBVectorSearch.

npm install rivet-plugin-mongodb
INSTALL
IMPORT
SIG · RIVET-PLUGIN-MONGO
R
rivet-plugin-mongodb
databasejavascriptv6.4.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

MongoDBStore
✓ import { MongoDBStore } from '@rivet-gg/plugin-mongodb'
✗ import MongoDBStore from '@rivet-gg/plugin-mongodb'
Named import, not default import.
MongoDBAggregation
✓ import { MongoDBAggregation } from '@rivet-gg/plugin-mongodb'
✗ const MongoDBAggregation = require('@rivet-gg/plugin-mongodb').MongoDBAggregation
ESM-only package; CommonJS require not supported.
MongoDBCollectionSearch
✓ import { MongoDBCollectionSearch } from '@rivet-gg/plugin-mongodb'
Named import.
MongoDBVectorSearch
✓ import { MongoDBVectorSearch } from '@rivet-gg/plugin-mongodb'
✗ import { MongoDBVectorKNN } from '@rivet-gg/plugin-mongodb'
MongoDBVectorKNN was deprecated in v0.0.3; use MongoDBVectorSearch instead.

Demonstrates how to import and configure the MongoDBVectorSearch and MongoDBStore nodes for use within Rivet graphs.

import { MongoDBVectorSearch, MongoDBStore } from '@rivet-gg/plugin-mongodb'; // Plugin nodes are used within Rivet graphs, not standalone. // Example configuration for MongoDBVectorSearch node: const vectorSearchNode = new MongoDBVectorSearch({ collection: 'documents', vectorField: 'embedding', queryVector: [0.1, 0.2, 0.3], numCandidates: 100, limit: 10, index: 'vector_index', filter: { category: 'science' }, connectionString: process.env.MONGODB_URI ?? '' }); // Example for MongoDBStore node to store a vector: const storeNode = new MongoDBStore({ collection: 'documents', vector: [0.1, 0.2, 0.3], metadata: { title: 'Example', category: 'science' }, connectionString: process.env.MONGODB_URI ?? '' });
Debug
Known issues
breakingMongoDBVectorKNN node removed and replaced with MongoDBVectorSearch in version 0.0.3. Existing graphs using MongoDBVectorKNN will break.
fix
Remove MongoDBVectorKNN node and use MongoDBVectorSearch instead. Create a new Atlas Vector Search index per documentation.
affects: >=0.0.3
gotchaMongoDBVectorSearch requires a pre-created Atlas Vector Search index on the collection. Without it, the node will fail.
fix
Create an index using MongoDB Atlas UI or CLI as described in https://www.mongodb.com/docs/atlas/atlas-vector-search/vector-search-type/
affects: >=0.0.3
gotchaMongoDBCollectionSearch node loads entire collection into memory; may cause performance issues for large collections.
fix
Limit collection size or use MongoDBVectorSearch with filter for large datasets. The plugin roadmap notes this issue.
affects: *
deprecatedMongoDBVectorKNN is deprecated; new projects should use MongoDBVectorSearch.
fix
Replace MongoDBVectorKNN with MongoDBVectorSearch and update index.
affects: >=0.0.3
gotchaPlugin requires a MongoDB connection string set in Rivet settings or passed via environment variable. Missing connection string causes runtime errors.
fix
Ensure MONGODB_URI environment variable is set or connection string is configured in Rivet plugin settings.
affects: *
Errors
Common errors & fixes
MongoDBVectorKNN is not a constructor
Using deprecated MongoDBVectorKNN node in version >=0.0.3.
fix
Replace MongoDBVectorKNN with MongoDBVectorSearch.
MongoError: bad index specification for $vectorSearch
Missing or incorrect Atlas Vector Search index on the collection.
fix
Create a valid vector search index on the collection. See https://www.mongodb.com/docs/atlas/atlas-vector-search/vector-search-type/
MongoError: Authentication failed
Invalid MongoDB connection string or credentials.
fix
Check that the MONGODB_URI is correctly set and includes proper credentials.
Cannot find module '@rivet-gg/plugin-mongodb'
Plugin not installed in Rivet or incorrect import path.
fix
Install plugin via Rivet UI plugins tab or add @rivet-gg/plugin-mongodb to package.json if using custom setup.
Upgrade
Version history
6.4.0latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
3 hits · last 30 days
node
2
OpenAI (training)
1
Resources
rivet-plugin-mongodb — npm install rivet-plugin-mongodb · libregistry