langchain-mongodb
Installation
pip install -U langchain-mongodb
Usage
- See Getting Started with the LangChain Integration for a walkthrough on using your first LangChain implementation with MongoDB Atlas.
Using MongoDBAtlasVectorSearch
from langchain_mongodb import MongoDBAtlasVectorSearch
# Pull MongoDB Atlas URI from environment variables
MONGODB_ATLAS_CLUSTER_URI = os.environ.get("MONGODB_ATLAS_CLUSTER_URI")
DB_NAME = "langchain_db"
COLLECTION_NAME = "test"
ATLAS_VECTOR_SEARCH_INDEX_NAME = "index_name"
MONGODB_COLLECTION = client[DB_NAME][COLLECTION_NAME]
# Create the vector search via `from_connection_string`
vector_search = MongoDBAtlasVectorSearch.from_connection_string(
MONGODB_ATLAS_CLUSTER_URI,
DB_NAME + "." + COLLECTION_NAME,
OpenAIEmbeddings(disallowed_special=()),
index_name=ATLAS_VECTOR_SEARCH_INDEX_NAME,
)
# Initialize MongoDB python client
client = MongoClient(MONGODB_ATLAS_CLUSTER_URI)
# Create the vector search via instantiation
vector_search_2 = MongoDBAtlasVectorSearch(
collection=MONGODB_COLLECTION,
embeddings=OpenAIEmbeddings(disallowed_special=()),
index_name=ATLAS_VECTOR_SEARCH_INDEX_NAME,
)
Metadata
Release files for gigachain-mongodb 0.1.8
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| gigachain_mongodb-0.1.8.tar.gz | 20.5 kB | Without provenance | Details for gigachain_mongodb-0.1.8.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| gigachain_mongodb-0.1.8-py3-none-any.whl | Python 3 | none | any | Details for gigachain_mongodb-0.1.8-py3-none-any.whl |
Total release size: 45.5 kB
Release files / gigachain_mongodb-0.1.8.tar.gz
| Download URL | gigachain_mongodb-0.1.8.tar.gz |
|---|---|
| Size | 20.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0b66146137bf84ddc909b409833a30a44a1311aaabc67e7f55bc007819cdf171
|
|
BLAKE2b-256 checksum How to use checksums |
a2768d89b95c3d4b00e0426610cc6e7815db9525665698b783389d8fe8d227fa
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.7.1 CPython/3.11.6 Darwin/23.5.0
|
Release files / gigachain_mongodb-0.1.8-py3-none-any.whl
| Download URL | gigachain_mongodb-0.1.8-py3-none-any.whl |
|---|---|
| Size | 25.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a3b41b15edc5c7aec147c08e5ec7d5c629a8d710b64240df6b0287c6b7cd6632
|
|
BLAKE2b-256 checksum How to use checksums |
b4ef9ff309b01fb94e6368c124968c2d53da3f7b6606638061c25424a54814b6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.7.1 CPython/3.11.6 Darwin/23.5.0
|
Security for gigachain-mongodb 0.1.8
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.