Upserting and querying in .NET
When you’ve created an index, you possibly can rapidly add new values. Pinecone calls this course of “upserts.” Right here you’ll load the vectors created by an embedding, first offering a batch of IDs, after which the dense and sparse vectors, and eventually applicable metadata (which might embrace the unique textual content of the supply doc). This final choice permits you to prefilter knowledge when making a question. Different instructions within the SDK assist handle your vector index: deleting, updating, and itemizing vectors.
If you happen to’re constructing an index for a RAG software, you must first chunk your paperwork, so every embedding solely encodes a piece of textual content. This may then be included within the upsert as a part of the metadata,
Crucial a part of constructing the search part of a RAG software is, after all, querying your vector index. As a part of organising an index, you’ve already outlined the space metric used to pick out comparable paperwork. The kind of metric is determined by the kind of outcomes you wish to return. For many RAG purposes you most likely wish to select a cosine metric, as this finds paperwork which can be much like your question time period.