langchain-mongodb: 0.9.0#

Integrate your operational database and vector search in a single, unified, fully managed platform with full vector database capabilities on MongoDB Atlas.

Store your operational data, metadata, and vector embeddings in oue VectorStore, MongoDBAtlasVectorSearch. Insert into a Chain via a Vector, FullText, or Hybrid Retriever.

agent_toolkit#

Classes

agent_toolkit.database.MongoDBDatabase(...)

Wrapper around a MongoDB database.

agent_toolkit.tool.BaseMongoDBDatabaseTool

Base tool for interacting with a MongoDB database.

agent_toolkit.tool.InfoMongoDBDatabaseTool

Tool for getting metadata about a MongoDB database.

agent_toolkit.tool.ListMongoDBDatabaseTool

Tool for getting collection names.

agent_toolkit.tool.QueryMongoDBCheckerTool

Use an LLM to check if a query is correct.

agent_toolkit.tool.QueryMongoDBDatabaseTool

Tool for querying a MongoDB database.

agent_toolkit.toolkit.MongoDBDatabaseToolkit

MongoDBDatabaseToolkit for interacting with MongoDB databases.

cache#

Classes

cache.MongoDBAtlasSemanticCache(...[,Β ...])

MongoDB Atlas Semantic cache.

cache.MongoDBCache(connection_string[,Β ...])

MongoDB Atlas cache

chat_message_histories#

Classes

chat_message_histories.MongoDBChatMessageHistory(...)

Chat message history that stores history in MongoDB.

docstores#

Classes

docstores.MongoDBDocStore(collection[,Β text_key])

MongoDB Collection providing BaseStore interface.

graphrag#

Classes

graphrag.graph.MongoDBGraphStore(*[,Β ...])

GraphRAG DataStore

indexes#

Classes

indexes.MongoDBRecordManager(collection)

A MongoDB-based implementation of the record manager.

loaders#

Classes

loaders.MongoDBLoader(collection,Β *[,Β ...])

Document Loaders are classes to load Documents.

pipelines#

Functions

pipelines.text_search_stage(query,Β ...[,Β ...])

Full-Text search using Lucene's standard (BM25) analyzer

retrievers#

Classes

retrievers.full_text_search.MongoDBAtlasFullTextSearchRetriever

Retriever performs full-text searches using Lucene's standard (BM25) analyzer.

retrievers.graphrag.MongoDBGraphRAGRetriever

RunnableSerializable API of MongoDB GraphRAG.

retrievers.hybrid_search.MongoDBAtlasHybridSearchRetriever

Hybrid Search Retriever combines vector and full-text searches weighting them the via Reciprocal Rank Fusion (RRF) algorithm.

retrievers.parent_document.MongoDBAtlasParentDocumentRetriever

MongoDB Atlas's ParentDocumentRetriever

retrievers.self_querying.MongoDBAtlasSelfQueryRetriever

Retriever that uses an LLM to deduce filters for Vector Search algorithm.

retrievers.self_querying.MongoDBStructuredQueryTranslator()

Translator between MongoDB Query API and LangChain's StructuredQuery.

utils#

Functions

utils.cosine_similarity(X,Β Y)

Row-wise cosine similarity between two equal-width matrices.

utils.make_serializable(obj)

Recursively cast values in a dict to a form able to json.dump

utils.maximal_marginal_relevance(...[,Β ...])

Compute Maximal Marginal Relevance (MMR).

utils.oid_to_str(oid)

Convert MongoDB's internal BSON ObjectId into a simple str for compatibility.

utils.str_to_oid(str_repr)

Attempt to cast string representation of id to MongoDB's internal BSON ObjectId.

vectorstores#

Classes

vectorstores.MongoDBAtlasVectorSearch(...[,Β ...])

MongoDB Atlas vector store integration.