{"id":1181,"date":"2024-08-28T00:43:35","date_gmt":"2024-08-28T00:43:35","guid":{"rendered":"https:\/\/rssfeedtelegrambot.bnaya.co.il\/index.php\/2024\/08\/28\/introducing-the-pinecone-net-sdk\/"},"modified":"2024-08-28T00:43:35","modified_gmt":"2024-08-28T00:43:35","slug":"introducing-the-pinecone-net-sdk","status":"publish","type":"post","link":"https:\/\/rssfeedtelegrambot.bnaya.co.il\/index.php\/2024\/08\/28\/introducing-the-pinecone-net-sdk\/","title":{"rendered":"Introducing the Pinecone .NET SDK"},"content":{"rendered":"<p>The AI ecosystem in .NET is constantly growing. Today, we\u2019re excited to announce the newest member of the community: Pinecone.<\/p>\n<p>In this post, we introduce the Pinecone .NET SDK and show how you can quickly get started building AI applications with it.<\/p>\n<h2>What is Pinecone?<\/h2>\n<p>Pinecone is a robust vector database designed to efficiently handle and query large-scale vector data. With Pinecone, engineers and data scientists can effortlessly build vector-based AI applications that require efficient similarity search and ranking.<\/p>\n<p>To learn more about Pinecone, visit their <a href=\"https:\/\/www.pinecone.io\/\">website<\/a>.  <\/p>\n<h2>What is a vector database?<\/h2>\n<p>Building AI applications requires efficient vector data processing.  <\/p>\n<p>A vector database indexes and stores embedding vectors for fast retrieval and similarity search.<\/p>\n<p>Embeddings are numerical representations of data such as text, images, and audio. They capture semantic meaning and relationships, making them essential in AI applications.<\/p>\n<p>Due to the complexity of vector embeddings, you need a database designed specifically for handling this data type.<\/p>\n<p>To learn more, see the <a href=\"https:\/\/learn.microsoft.com\/dotnet\/ai\/conceptual\/embeddings\">Embeddings in .NET<\/a> and <a href=\"https:\/\/learn.microsoft.com\/dotnet\/ai\/conceptual\/vector-databases\">Vector Databases for .NET<\/a> documentation.<\/p>\n<h2>Get started with the Pinecone .NET SDK<\/h2>\n<p>Getting started with Pinecone in .NET is easy:<\/p>\n<p>Set up your Pinecone account and database, if you haven\u2019t already, and create an API key. For more details, see the <a href=\"https:\/\/docs.pinecone.io\/guides\/get-started\/quickstart\">documentation<\/a>.<br \/>\nDownload the <a href=\"https:\/\/aka.ms\/pinecone-dotnet-sdk\">Pinecone .NET SDK<\/a> from NuGet.<\/p>\n<p>After downloading the SDK, connect the .NET client to your Pinecone database:<\/p>\n<p>using Pinecone;<\/p>\n<p>var pinecone = new PineconeClient(&#8220;PINECONE_API_KEY&#8221;);<\/p>\n<h2>Create an index<\/h2>\n<p>An index is the high-level structure that stores vector data in Pinecone.<\/p>\n<p>An index serves queries over vectors it contains; and does other vector operations over its contents. For more details, wee the <a href=\"https:\/\/docs.pinecone.io\/guides\/indexes\/understanding-indexes\">Pinecone index documentation<\/a>.  <\/p>\n<p>var createIndexResponse = await pinecone.CreateIndexAsync(new CreateIndexRequest<br \/>\n {<br \/>\n    Name = \u201cexample_index\u201dindexName,<br \/>\n    Dimension = 3,<br \/>\n    Metric = CreateIndexRequestMetric.Cosine,<br \/>\n    Spec = new ServerlessIndexSpec<br \/>\n    {<br \/>\n    Serverless = new ServerlessSpec<br \/>\n    {<br \/>\n        Cloud = ServerlessSpecCloud.Azure,<br \/>\n        Region = &#8220;eastus2&#8221;<br \/>\n    }<br \/>\n    }<br \/>\n });<\/p>\n<h2>Add records<\/h2>\n<p>To start adding records your data store:<\/p>\n<p>var upsertResponse = await index.UpsertAsync(new UpsertRequest {<br \/>\n    Vectors = new[]<br \/>\n    {<br \/>\n        new Vector<br \/>\n        {<br \/>\n            Id = &#8220;v1&#8221;,<br \/>\n            Values = new[] { 0.1f, 0.2f, 0.3f }<br \/>\n        },<br \/>\n        new Vector<br \/>\n        {<br \/>\n            Id = &#8220;v2&#8221;,<br \/>\n            Values = new[] { 0.4f, 0.5f, 0.6f }<br \/>\n        },<br \/>\n        new Vector<br \/>\n        {<br \/>\n            Id = &#8220;v3&#8221;,<br \/>\n            Values = new[] { 0.7f, 0.8f, 0.9f }<br \/>\n        }<br \/>\n    }<br \/>\n });<\/p>\n<p>await Task.Delay(10000);<\/p>\n<h2>Query records<\/h2>\n<p>Once you have records in your data store, you can query them:<\/p>\n<p>var queryResponse = await index.QueryAsync(<br \/>\n   new QueryRequest<br \/>\n   {<br \/>\n       Id = &#8220;v1&#8221;,<br \/>\n       TopK = 1,<br \/>\n       IncludeValues = true,<br \/>\n   });<\/p>\n<h2>Conclusion<\/h2>\n<p>We can\u2019t wait to see what you build. Try out the <a href=\"https:\/\/aka.ms\/pinecone-dotnet-sdk\">Pinecone .NET SDK<\/a> and give us feedback!<\/p>\n<p>The post <a href=\"https:\/\/devblogs.microsoft.com\/dotnet\/introducing-pinecone-dotnet-sdk\/\">Introducing the Pinecone .NET SDK<\/a> appeared first on <a href=\"https:\/\/devblogs.microsoft.com\/dotnet\">.NET Blog<\/a>.<\/p>","protected":false},"excerpt":{"rendered":"<p>The AI ecosystem in .NET is constantly growing. Today, we\u2019re excited to announce the newest member of the community: Pinecone. [&hellip;]<\/p>\n","protected":false},"author":0,"featured_media":0,"comment_status":"","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[7],"tags":[],"class_list":["post-1181","post","type-post","status-publish","format-standard","hentry","category-dotnet"],"_links":{"self":[{"href":"https:\/\/rssfeedtelegrambot.bnaya.co.il\/index.php\/wp-json\/wp\/v2\/posts\/1181","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/rssfeedtelegrambot.bnaya.co.il\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/rssfeedtelegrambot.bnaya.co.il\/index.php\/wp-json\/wp\/v2\/types\/post"}],"replies":[{"embeddable":true,"href":"https:\/\/rssfeedtelegrambot.bnaya.co.il\/index.php\/wp-json\/wp\/v2\/comments?post=1181"}],"version-history":[{"count":0,"href":"https:\/\/rssfeedtelegrambot.bnaya.co.il\/index.php\/wp-json\/wp\/v2\/posts\/1181\/revisions"}],"wp:attachment":[{"href":"https:\/\/rssfeedtelegrambot.bnaya.co.il\/index.php\/wp-json\/wp\/v2\/media?parent=1181"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/rssfeedtelegrambot.bnaya.co.il\/index.php\/wp-json\/wp\/v2\/categories?post=1181"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/rssfeedtelegrambot.bnaya.co.il\/index.php\/wp-json\/wp\/v2\/tags?post=1181"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}