-
Notifications
You must be signed in to change notification settings - Fork 15.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
35 changed files
with
2 additions
and
6,407 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,3 @@ | ||
# langchain-mongodb | ||
This package has moved! | ||
|
||
# Installation | ||
``` | ||
pip install -U langchain-mongodb | ||
``` | ||
|
||
# Usage | ||
- See [Getting Started with the LangChain Integration](https://www.mongodb.com/docs/atlas/atlas-vector-search/ai-integrations/langchain/#get-started-with-the-langchain-integration) for a walkthrough on using your first LangChain implementation with MongoDB Atlas. | ||
|
||
## Using MongoDBAtlasVectorSearch | ||
```python | ||
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, | ||
) | ||
``` | ||
https://github.com/langchain-ai/langchain-mongodb/tree/main/libs/mongodb |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.