• Fri. Nov 15th, 2024

Using the Pinecone vector database in .NET

Byadmin

Sep 12, 2024



Upserting and querying in .NET

Once you’ve created an index, you can quickly add new values. Pinecone calls this process “upserts.” Here you’ll load the vectors created by an embedding, first providing a batch of IDs, and then the dense and sparse vectors, and finally appropriate metadata (which can include the original text of the source document). This last option allows you to prefilter data when making a query. Other commands in the SDK help manage your vector index: deleting, updating, and listing vectors.

If you’re building an index for a RAG application, you should first chunk your documents, so each embedding only encodes a section of text. This can then be included in the upsert as part of the metadata,

The most important part of building the search component of a RAG application is, of course, querying your vector index. As part of setting up an index, you’ve already defined the distance metric used to select similar documents. The type of metric depends on the type of results you want to return. For most RAG applications you probably want to choose a cosine metric, as this finds documents that are similar to your query term.



Source link