skillfed

langchain-mongodb

An integration package connecting MongoDB and LangChain

langchain-mongodb v0.11.0 1.0M downloads/30d#4,465 on PyPI
License unclear AGING released

What it is and what it does

langchain-mongodb is a LangChain integration that wraps MongoDB Atlas Vector Search, allowing you to use MongoDB as a vector store for semantic search and retrieval-augmented generation (RAG) applications. It depends on langchain, langchain-core, pymongo, and several text-processing libraries to handle embeddings, document storage, and similarity queries.

The package provides a MongoDBAtlasVectorSearch class that connects to a MongoDB Atlas cluster, stores vector embeddings in a collection, and retrieves documents by semantic similarity. You supply connection credentials, a database and collection name, a vector search index name, and an embedding model, then call methods like similarity_search() to find relevant documents. It is designed for workflows where you want to leverage MongoDB's native vector capabilities within a LangChain application.

Use it for:

  • Build a RAG chatbot that retrieves context from MongoDB before generating answers with an LLM.
  • Implement semantic search over a large document corpus stored in MongoDB Atlas.
  • Integrate vector embeddings into an existing MongoDB-backed application without switching databases.
  • Prototype AI applications that combine LangChain orchestration with MongoDB vector storage.
  • Store and query embeddings from multiple embedding models in a single MongoDB collection.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Connects MongoDB Atlas Vector Search to LangChain for semantic search and retrieval-augmented generation workflows using vector embeddings stored in MongoDB.

Yes, if you are already committed to MongoDB Atlas and LangChain for a RAG or semantic search application. The package has low install friction and no known vulnerabilities. However, the aging maintenance status (211 days since last release) and unclear license warrant verification before production use. Confirm license terms and compatibility with your LangChain version before deploying.

Install

langchain-mongodb on PyPI

pip

pip install langchain-mongodb

uv

uv add langchain-mongodb

poetry

poetry add langchain-mongodb

Installing langchain-mongodb

Before you install

Low install friction with a pure-wheel distribution. Maintenance status is aging—last release was 211 days ago—so expect slower response to issues, though the package remains functional for current LangChain versions.

License in practice

License treatment is unclear; no SPDX identifier or raw license text is available in the package metadata. Verify the actual license terms before use in proprietary or restricted contexts.

Quickstart

pip install -U langchain-mongodb

from langchain_mongodb import MongoDBAtlasVectorSearch
import os

vectorstore = MongoDBAtlasVectorSearch.from_connection_string(
    connection_string=os.environ["MONGODB_CONNECTION_STRING"],
    namespace="langchain_db.test",
    embedding=embedding_model,
    index_name="index_name",
)

docs = vectorstore.similarity_search("query text")

Requires Python >= 3.10, a MongoDB Atlas cluster with a vector search index already configured, and credentials for both MongoDB and an embedding provider.

Verify before relying

  • Whether the package is actively maintained or in maintenance-only mode despite the 'aging' status.
  • Actual license under which the package is distributed (SPDX or raw text not provided).
  • Compatibility guarantees with future LangChain major versions given the aging maintenance signal.
  • Whether external embedding providers (e.g., OpenAI) are required or if embeddings can be sourced elsewhere.

Package facts

License not declared (unclear)
Python support supports the current Python release (>=3.10)
Install friction low — pure-Python wheel
Runtime dependencies 8 — langchain-classic, langchain-core, langchain-text-splitters, langchain, lark, numpy, pymongo-search-utils, pymongo
Maintenance aging — 211 days since the last release
First released
Downloads 1,033,318/month — #4,465 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: langchain_mongodb-0.11.0-py3-none-any.whl

Tags

mongodb atlas vector search langchainsemantic search mongodbrag with mongodbvector store mongodblangchain mongodb integrationembedding storage mongodbsimilarity search mongodb
vector-searchragmongodb

More Artificial Intelligence packages

litellm

LiteLLM provides a unified Python interface to…

permissive · top 100 on PyPI

huggingface-hub

Client library and CLI tool for downloading,…

permissive · top 100 on PyPI

langchain

LangChain provides a framework for building…

permissive · top 1,000 on PyPI

hf-xet

hf-xet provides chunk-based deduplication and…

permissive · top 1,000 on PyPI

tokenizers

Tokenizers converts raw text into token…

permissive · top 1,000 on PyPI

transformers

Transformers provides a unified framework for…

permissive · top 1,000 on PyPI

langchain-elasticsearch

Integrates Elasticsearch with LangChain to…

permissive · top 15,000 on PyPI

langchain-plaid

Integrates NextPlaid, a ColBERT-style…

permissive · top 15,000 on PyPI

langchain-qdrant

Connects LangChain applications to Qdrant…

permissive · top 5,000 on PyPI

pymongo-search-utils

Provides utility functions for vector search…

permissive · top 15,000 on PyPI

langchain-pinecone

Connects LangChain applications to Pinecone…

permissive · top 5,000 on PyPI

langchain-chroma

Connects LangChain applications to Chroma, a…

permissive · top 5,000 on PyPI

langchain-astradb

Integrates Astra DB (a serverless vector…

permissive · top 15,000 on PyPI

ragstack-ai-knowledge-store

Stores and retrieves LangChain documents using…

unclear · top 15,000 on PyPI

langgraph-checkpoint-mongodb

Provides a MongoDB-backed checkpoint storage…

unclear · top 15,000 on PyPI

langchain-graph-retriever

Retrieves documents from a graph structure…

permissive · top 15,000 on PyPI