Pinecone is a vector database with broad functionality.This notebook goes over how to use a retriever that under the hood uses Pinecone and Hybrid Search. The logic of this retriever is taken from this documentation To use Pinecone, you must have an API key and an Environment. Here are the installation instructions.
OpenAIEmbeddings,所以需要获取 OpenAI API 密钥。
Setup pinecone
You should only have to do this part once.Get embeddings and sparse encoders
Embeddings are used for the dense vectors, tokenizer is used for the sparse vectorLoad retriever
We can now construct the retriever!Add texts (if necessary)
We can optionally add texts to the retriever (if they aren’t already in there)Use retriever
现在我们可以使用检索器了!连接这些文档到 Claude、VSCode 等工具,通过 MCP 获取实时答案。

