- Raised the `go` directive from 1.24.1 to 1.26.5 to satisfy pgx/v5 and ollama's minimum Go version requirements and to pick up 15 patched standard library CVEs. - Updated `pgx/v5`, `otel`/`otel/sdk`/`otlptracehttp`, `x/net`, and the AWS `eventstream` protocol package to their latest requested versions. - Remediated govulncheck-flagged CVEs in `grpc`, `x/text`, `x/crypto`, `antchfx/xpath`, AWS SDK `bedrock*`/`s3` services, `etcd/server`, and `mongo-driver` v1/v2. - Fixed ollama's `MainGPU` API type change (`int` -> `*int`) in `llms/ollama/options.go` without breaking the public `WithRunnerMainGPU` signature.
Pinecone Vector Store Example
Welcome to this exciting example of using Pinecone as a vector store with LangChain in Go! 🚀
What This Example Does
This example demonstrates how to use Pinecone, a powerful vector database, in conjunction with LangChain to create and query a vector store. Here's a breakdown of the main features:
-
Setting up OpenAI Embeddings: The example uses OpenAI's embedding model to convert text into vector representations.
-
Creating a Pinecone Vector Store: It shows how to initialize a Pinecone vector store with custom configurations.
-
Adding Documents: The code adds several documents (cities) to the vector store, each with its own metadata (population and area).
-
Performing Similarity Searches: The example showcases different types of similarity searches:
- Basic similarity search
- Search with a score threshold
- Search with both a score threshold and metadata filters
Key Points
- The example uses the
github.com/vxcontrol/langchaingolibrary for LangChain functionality in Go. - It demonstrates how to handle errors and set up the necessary clients and stores.
- The code shows how to use metadata filters to refine search results based on specific criteria.
Running the Example
To run this example, make sure you have:
- Set up your OpenAI API key as an environment variable (
OPENAI_API_KEY). - Replaced
"YOUR_API_KEY"with your actual Pinecone API key.
This example is a great starting point for anyone looking to implement vector search capabilities in their Go applications using Pinecone and LangChain! 🎉
Happy coding! 💻🌟