{"id":22547802,"url":"https://github.com/qdrant/qdrant-dotnet","last_synced_at":"2025-08-04T08:33:26.103Z","repository":{"id":204666090,"uuid":"665462497","full_name":"qdrant/qdrant-dotnet","owner":"qdrant","description":"Qdrant .Net SDK","archived":false,"fork":false,"pushed_at":"2024-04-22T13:20:49.000Z","size":158,"stargazers_count":66,"open_issues_count":8,"forks_count":6,"subscribers_count":6,"default_branch":"main","last_synced_at":"2024-05-01T09:43:55.071Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/qdrant.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-07-12T08:59:34.000Z","updated_at":"2024-06-27T07:43:10.615Z","dependencies_parsed_at":null,"dependency_job_id":"dfc70bf2-0642-4799-aa3f-79aea0456cd5","html_url":"https://github.com/qdrant/qdrant-dotnet","commit_stats":null,"previous_names":["qdrant/qdrant-dotnet"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qdrant%2Fqdrant-dotnet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qdrant%2Fqdrant-dotnet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qdrant%2Fqdrant-dotnet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qdrant%2Fqdrant-dotnet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/qdrant","download_url":"https://codeload.github.com/qdrant/qdrant-dotnet/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":227252075,"owners_count":17754045,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-07T15:12:55.847Z","updated_at":"2024-12-07T15:12:57.176Z","avatar_url":"https://github.com/qdrant.png","language":"C#","funding_links":[],"categories":["Vector Store SDKs"],"sub_categories":["Teams"],"readme":"# Qdrant .NET SDK\n\n[![NuGet Release][Qdrant-image]][Qdrant-nuget-url]\n[![Build](https://github.com/qdrant/qdrant-dotnet/actions/workflows/test.yml/badge.svg)](https://github.com/qdrant/qdrant-dotnet/actions/workflows/test.yml)\n\n## 📥 Installation\n\n```sh\ndotnet add package Qdrant.Client\n```\n\n## 📖 Documentation\n\nUsage examples are available throughout the [Qdrant documentation](https://qdrant.tech/documentation/quick-start/).\n\n## 🔌 Getting started\n\n### Creating a client\n\nA client can be instantiated with\n\n```csharp\nvar client = new QdrantClient(\"localhost\");\n```\n\nwhich creates a client that will connect to Qdrant on `http://localhost:6334`.\n\nInternally, the high level client uses a low level gRPC client to interact with Qdrant.\nAdditional constructor overloads provide more control over how the gRPC client is\nconfigured. The following example configures a client to use TLS, validating the \ncertificate using its thumbprint, and also configures API key authentication:\n\n```csharp\nvar channel = QdrantChannel.ForAddress(\"https://localhost:6334\", new ClientConfiguration\n{\n    ApiKey = \"\u003capi key\u003e\",\n    CertificateThumbprint = \"\u003ccertificate thumbprint\u003e\"\n});\nvar grpcClient = new QdrantGrpcClient(channel);\nvar client = new QdrantClient(grpcClient);\n```\n\n\u003e [!IMPORTANT]\n\u003e **IMPORTANT NOTICE for .NET Framework**\n\u003e\n\u003e .NET Framework has limited supported for gRPC over HTTP/2, but it can be enabled by\n\u003e \n\u003e - Configuring qdrant to use TLS, and you **must** use HTTPS, so you will need to set up \n\u003e server certificate validation\n\u003e - Referencing `System.Net.Http.WinHttpHandler` 6.0.1 or later, and configuring \n\u003e `WinHttpHandler` as the inner handler for `GrpcChannelOptions`\n\u003e\n\u003e The following example configures a client for .NET Framework to use TLS, validating \n\u003e the certificate using its thumbprint, and also configures API key authentication:\n\u003e\n\u003e ```csharp\n\u003e var channel = GrpcChannel.ForAddress($\"https://localhost:6334\", new GrpcChannelOptions\n\u003e {\n\u003e   HttpHandler = new WinHttpHandler\n\u003e   {\n\u003e     ServerCertificateValidationCallback =\n\u003e       CertificateValidation.Thumbprint(\"\u003ccertificate thumbprint\u003e\")\n\u003e   }\n\u003e });\n\u003e var callInvoker = channel.Intercept(metadata =\u003e\n\u003e {\n\u003e   metadata.Add(\"api-key\", \"\u003capi key\u003e\");\n\u003e   return metadata;\n\u003e });\n\u003e\n\u003e var grpcClient = new QdrantGrpcClient(callInvoker);\n\u003e var client = new QdrantClient(grpcClient);\n\u003e ```\n\n### Working with collections\n\nOnce a client has been created, create a new collection\n\n```csharp\nawait client.CreateCollectionAsync(\"my_collection\", \n    new VectorParams { Size = 100, Distance = Distance.Cosine });\n```\n\nInsert vectors into a collection\n\n```csharp\n// generate some vectors\nvar random = new Random();\nvar points = Enumerable.Range(1, 100).Select(i =\u003e new PointStruct\n{\n  Id = (ulong)i,\n  Vectors = Enumerable.Range(1, 100).Select(_ =\u003e (float)random.NextDouble()).ToArray(),\n  Payload = \n  { \n    [\"color\"] = \"red\", \n    [\"rand_number\"] = i % 10 \n  }\n}).ToList();\n\nvar updateResult = await client.UpsertAsync(\"my_collection\", points);\n```\n\nSearch for similar vectors\n\n```csharp\nvar queryVector = Enumerable.Range(1, 100).Select(_ =\u003e (float)random.NextDouble()).ToArray();\n\n// return the 5 closest points\nvar points = await client.SearchAsync(\n  \"my_collection\",\n  queryVector,\n  limit: 5);\n```\n\nSearch for similar vectors with filtering condition\n\n```csharp\n// static import Conditions to easily build filtering\nusing static Qdrant.Client.Grpc.Conditions;\n\n// return the 5 closest points where rand_number \u003e= 3\nvar points = await _client.SearchAsync(\n  \"my_collection\",\n  queryVector,\n  filter: Range(\"rand_number\", new Range { Gte = 3 }),\n  limit: 5);\n```\n\n[Qdrant-nuget-url]:https://www.nuget.org/packages/Qdrant.Client/\n[Qdrant-image]:\nhttps://img.shields.io/nuget/v/Qdrant.Client.svg\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqdrant%2Fqdrant-dotnet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fqdrant%2Fqdrant-dotnet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqdrant%2Fqdrant-dotnet/lists"}