Technical requirements
To follow the examples in this chapter, you will need the following prerequisites:
- A MongoDB Atlas cluster. An Atlas
M0
free cluster should be sufficient as you will store a small set of documents and create only one vector index. - An OpenAI account and API key with access to the
text-embedding-3-large
model. - A Python 3 working environment.
You will also need to have installed Python libraries for MongoDB, LangChain, and OpenAI. You can install these libraries in your Python 3 environment as follows:
%pip3 install --upgrade --quiet pymongo pythondns langchain langchain-community langchain-mongodb langchain-openai
To successfully execute the example in this chapter, you will need a MongoDB Atlas Vector Index created on the MongoDB Atlas cluster. The index name must be text_vector_index
, created on the embeddings.text
collection as follows:
{ "fields": [ { ...