The first number is the count of modules that contain a package that imports this one.
The module count is a better indicator of popularity than the package count.
A module with 100 importing packages is counted only once instead of 100 times,
reflecting the fact that the choice to use the package was likely made only once,
not 100 times.
A '?' means that the value hasn't been computed yet.
Using MongoDB Atlas as a Vector Store with OpenAI Embeddings
This project illustrates how to leverage MongoDB as a vector store for performing similarity searches, utilizing OpenAI embeddings within a Go application. It integrates the LangChainGo library, OpenAI's API, and MongoDB to create an efficient vector database for semantic search.
Connects to a MongoDB Atlas instance using a specified connection string.
Automatically checks for and creates a vector search index on the collection if it is not already present, ensuring compatibility with OpenAI's embedding model.
OpenAI Embeddings Initialization:
Establishes an embeddings client through the OpenAI API.
Requires the OpenAI API key to be set as an environment variable for authentication.
Creating the Vector Store:
Connects to the MongoDB database and sets up a vector store that utilizes OpenAI embeddings for document representation.
Inserting Sample Data:
Adds a collection of documents (cities) along with their metadata into the vector store.
Each document contains information such as the city name, population, and area.
Executing Similarity Searches:
Demonstrates various types of similarity searches.
Running the Example
Configure your environment by setting the MongoDB URI and OpenAI API key: