ydb-qdrant 2.0.0 → 2.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +58 -3
  2. package/logo.svg +1 -0
  3. package/package.json +4 -3
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
- <img src="./logo.svg" alt="YDB Qdrant logo" height="56">
1
+ <img src="https://ydb-qdrant.tech/logo.svg" alt="YDB Qdrant logo" height="56">
2
2
 
3
- # YDB Qdrant-compatible Service (Node.js)
3
+ # YDB Qdrant-compatible Service
4
4
 
5
5
  Qdrant-compatible Node.js/TypeScript service exposing a minimal REST API that stores and searches vectors in YDB using single‑phase top‑k with an automatic YDB vector index (`vector_kmeans_tree`) and table‑scan fallback. Topics: ydb, vector-search, qdrant-compatible, nodejs, typescript, express, yql, ann, semantic-search, rag.
6
6
 
@@ -9,7 +9,7 @@ Architecture diagrams: [docs page](http://ydb-qdrant.tech/docs/)
9
9
 
10
10
  ## How it works
11
11
 
12
- ![Architecture diagram](./diagram.svg)
12
+ ![Architecture diagram](https://ydb-qdrant.tech/assets/diagram.svg)
13
13
 
14
14
  ## Requirements
15
15
  - Node.js 18+
@@ -17,6 +17,13 @@ Architecture diagrams: [docs page](http://ydb-qdrant.tech/docs/)
17
17
  - One of the supported auth methods (via environment)
18
18
 
19
19
  ## Install
20
+
21
+ As a dependency in another project (npm package):
22
+ ```bash
23
+ npm install ydb-qdrant
24
+ ```
25
+
26
+ For local development of this repo:
20
27
  ```bash
21
28
  npm install
22
29
  ```
@@ -58,6 +65,54 @@ export PORT=8080
58
65
  export LOG_LEVEL=info
59
66
  ```
60
67
 
68
+ ## Use as a Node.js library (npm package)
69
+
70
+ The package entrypoint exports a programmatic API that mirrors the Qdrant HTTP semantics.
71
+
72
+ - Import and initialize a client (reuses the same YDB env vars as the server):
73
+ ```ts
74
+ import { createYdbQdrantClient } from "ydb-qdrant";
75
+
76
+ async function main() {
77
+ // defaultTenant is optional; defaults to "default"
78
+ const client = await createYdbQdrantClient({ defaultTenant: "myapp" });
79
+
80
+ await client.createCollection("documents", {
81
+ vectors: {
82
+ size: 1536,
83
+ distance: "Cosine",
84
+ data_type: "float",
85
+ },
86
+ });
87
+
88
+ await client.upsertPoints("documents", {
89
+ points: [
90
+ { id: "doc-1", vector: [/* embedding */], payload: { title: "Doc 1" } },
91
+ ],
92
+ });
93
+
94
+ const result = await client.searchPoints("documents", {
95
+ vector: [/* query embedding */],
96
+ top: 10,
97
+ with_payload: true,
98
+ });
99
+
100
+ console.log(result.points);
101
+ }
102
+ ```
103
+
104
+ - Multi-tenant usage with `forTenant`:
105
+ ```ts
106
+ const client = await createYdbQdrantClient();
107
+ const tenantClient = client.forTenant("tenant-a");
108
+
109
+ await tenantClient.upsertPoints("sessions", {
110
+ points: [{ id: "s1", vector: [/* ... */] }],
111
+ });
112
+ ```
113
+
114
+ The request/response shapes follow the same schemas as the HTTP API (`CreateCollectionReq`, `UpsertPointsReq`, `SearchReq`, `DeletePointsReq`), so code written against the REST API can usually be translated directly to the library calls.
115
+
61
116
  ## Quick Start
62
117
 
63
118
  ### Use with IDE agents (Roo Code, Cline)
package/logo.svg ADDED
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1320.80 656.82" data-guides="{&quot;vertical&quot;:[],&quot;horizontal&quot;:[]}"><defs><linearGradient id="tSvgGradient13c1b9935c0" x1="987.117717220558" x2="621.0576949800534" y1="662.3352388060675" y2="268.960116431007" fill="rgb(0, 0, 0)" gradientUnits="userSpaceOnUse" display="block"><stop offset="0" stop-color="hsl(186.33599999999998,51.9%,53.53%)" stop-opacity="1" transform="translate(-5377.88232421875, -4942.27294921875)"/><stop offset="1" stop-color="hsl(207.684,75.63%,46.67%)" stop-opacity="1" transform="translate(-5377.88232421875, -4942.27294921875)"/></linearGradient></defs><path fill="rgb(23,25,33)" stroke="none" fill-opacity="1" stroke-width="1" stroke-opacity="1" display="block" id="tSvg107ad8792ec" title="Path 1" d="M942.8477 50.1611C946.5877 49.8281 950.2777 49.9321 954.0277 50.1131C1072.1277 55.8141 1119.4977 118.2471 1197.1677 194.4661C1223.1877 219.6091 1248.8677 245.1121 1274.1877 270.9681C1314.9677 312.6861 1341.4477 329.6941 1295.8977 384.6981C1283.9377 401.9961 1261.4977 416.4961 1248.9977 432.4911C1231.9177 454.3401 1214.5977 468.3371 1195.4077 487.3371C1167.9877 514.4971 1143.3777 545.0131 1112.6577 568.8931C1106.6777 573.5391 1100.6977 581.7251 1094.4177 586.4391C1077.0277 602.3021 1057.4877 614.8841 1037.1977 626.6461C1034.0177 628.4861 1029.2477 630.6361 1025.7277 631.8781C1006.0477 638.8221 985.6277 646.3691 964.7577 648.5991C954.1677 649.7301 943.8177 648.3531 933.2377 648.4081C881.9777 650.1061 832.5077 631.4171 791.3677 601.6201C772.4377 587.7171 757.1277 569.8011 739.7277 554.3681C716.2877 533.5681 693.6177 511.7491 672.3177 488.7441C664.5677 480.3671 655.6677 460.6521 657.7777 448.9321C662.4377 422.9841 683.9777 382.9591 716.4277 398.9281C725.6277 403.5211 735.3477 417.1521 743.1877 424.2651C753.1877 433.3351 763.6977 442.0101 773.1677 451.3121C785.7343 463.6144 798.301 475.9167 810.8677 488.2191C828.4877 505.7381 841.4077 520.4991 863.1677 533.7841C880.7477 544.5111 910.6477 552.8871 931.1277 554.5651C960.7877 556.9951 999.9777 540.3291 1022.3277 521.4201C1032.9477 512.4361 1044.6777 499.6221 1054.6277 489.5311C1071.7277 472.3507 1088.8277 455.1704 1105.9277 437.9901C1134.0177 409.8701 1173.2577 384.2891 1176.4077 341.7121C1176.8777 335.3561 1175.2277 330.0841 1173.7477 323.9711C1162.3977 285.7941 1111.6877 251.2311 1086.1277 222.4221C1050.2477 182.0011 1004.8477 149.7281 948.6077 150.2411C911.9677 150.5761 877.0477 162.4061 846.8477 182.9801C828.9277 195.0961 815.0877 209.6951 800.0177 225.1211C773.0577 251.2281 747.1777 278.1791 720.5677 304.5941C612.7987 412.8127 505.0297 521.0314 397.2607 629.2501C369.5947 656.5491 341.9907 668.7101 309.5667 636.7431C296.6937 624.0511 297.5117 607.3341 297.9697 590.3721C306.5707 573.3061 328.6347 553.3381 342.2337 539.8871C356.1993 526.1101 370.165 512.3331 384.1307 498.5561C415.8527 467.4801 448.2907 434.4961 479.7377 402.8651C533.6677 348.9044 587.5977 294.9437 641.5277 240.9831C662.2877 220.1781 682.4177 198.9221 703.8677 178.6261C711.7777 170.4861 722.1977 163.0581 729.9677 154.9891C779.4277 103.6451 839.6477 61.4081 911.9777 51.9921C921.5277 50.7471 932.9177 50.6741 942.8477 50.1611Z"/><path fill="url(#tSvgGradient13c1b9935c0)" stroke="none" fill-opacity="1" stroke-width="1" stroke-opacity="1" display="block" id="tSvgffbf1fe4ad" title="Path 2" d="M995.8377 549.1911C1012.4977 539.3591 1025.4877 532.6041 1039.4977 518.4551C1080.1277 477.4191 1122.8777 437.5731 1162.5177 395.6491C1193.4277 359.8741 1190.8477 319.8251 1161.2277 284.4991C1139.4177 258.3311 1111.7377 235.9411 1088.7877 211.1021C1033.3577 151.1161 962.2777 121.3301 881.9477 153.4801C863.4977 160.6551 846.3477 170.8001 831.1677 183.5121C814.4277 197.2911 794.1677 218.2941 778.4577 233.9131C751.1443 261.1857 723.831 288.4584 696.5177 315.7311C608.7373 403.4974 520.957 491.2637 433.1767 579.0301C413.8207 598.3471 390.9717 623.1811 369.9697 639.8961C345.8087 659.1251 306.1287 633.1651 305.0737 604.6611C304.6607 593.4961 314.9427 581.0371 322.4817 573.3931C351.2657 544.5321 380.1947 515.8261 409.0007 486.9891C471.7357 424.2651 534.4707 361.5411 597.2057 298.8171C632.023 264.0911 666.8403 229.3651 701.6577 194.6391C733.5077 163.0061 763.8677 130.7551 801.2477 105.3821C909.8377 31.6921 1031.9477 45.3231 1125.8277 135.8651C1162.4577 171.5001 1198.8677 207.3451 1235.0777 243.3981C1257.0777 265.2271 1278.3977 285.5921 1298.5877 309.4161C1327.1377 343.0911 1294.0277 372.6301 1271.2177 397.6131C1256.1577 414.1121 1239.2777 430.3981 1223.4777 446.5121C1222.6677 437.2911 1227.0077 435.7951 1227.2077 429.4981C1226.801 429.3261 1226.3943 429.1541 1225.9877 428.9821C1210.5777 441.9691 1197.8877 429.2411 1198.5477 450.9871C1198.5577 451.3054 1198.5677 451.6237 1198.5777 451.9421C1198.3043 451.9404 1198.031 451.9387 1197.7577 451.9371C1197.5543 450.4187 1197.351 448.9004 1197.1477 447.3821C1199.3277 447.6621 1176.9077 452.5501 1176.0477 452.6911C1170.9077 453.5361 1160.1477 466.0411 1155.9277 466.7981C1152.2577 465.1691 1151.7877 463.3631 1149.7877 460.0291C1145.8077 462.4531 1148.3677 465.1691 1142.5977 464.3641C1136.2777 463.4801 1137.5577 468.3351 1136.9077 468.7871C1127.4677 475.3481 1119.0577 482.5741 1110.3077 490.0661C1108.0477 487.3691 1111.4277 486.3781 1108.2377 485.1081C1098.9877 489.5681 1099.4777 491.4211 1087.4577 495.9991C1083.7077 502.3631 1072.9177 514.0571 1065.7577 517.8191C1065.2077 518.1091 1061.2577 517.1371 1060.2777 516.8971C1049.5977 519.1861 1053.8777 527.7161 1043.6477 526.1371C1035.8977 533.3181 1010.9577 564.9731 998.7477 556.3791C997.4377 553.8141 996.3077 552.0601 995.8377 549.1911Z"/><path fill="rgb(77,187,197)" stroke="none" fill-opacity="1" stroke-width="1" stroke-opacity="1" display="block" id="tSvg17831652419" title="Path 3" d="M1223.4777 446.5121C1197.8177 472.3087 1172.1577 498.1054 1146.4977 523.9021C1085.9677 584.7401 1026.9977 641.3531 935.5877 640.4461C860.0377 639.6951 796.9777 602.8991 746.2777 548.7811C726.6577 527.8401 669.9577 484.0151 666.4277 453.3811C664.9877 440.8831 686.0477 400.8811 702.7477 402.9911C712.0877 403.1321 725.7677 417.8131 732.5277 424.4661C754.4843 446.1134 776.441 467.7607 798.3977 489.4081C814.6077 505.4031 832.7277 523.6031 851.2677 536.9111C882.9677 559.6631 926.0277 566.3941 963.9877 559.5161C974.4877 557.6131 985.9077 553.1061 995.8377 549.1911C996.3077 552.0601 997.4377 553.8141 998.7477 556.3791C1010.9577 564.9731 1035.8977 533.3181 1043.6477 526.1371C1053.8777 527.7161 1049.5977 519.1861 1060.2777 516.8971C1061.2577 517.1371 1065.2077 518.1091 1065.7577 517.8191C1072.9177 514.0571 1083.7077 502.3631 1087.4577 495.9991C1099.4777 491.4211 1098.9877 489.5681 1108.2377 485.1081C1111.4277 486.3781 1108.0477 487.3691 1110.3077 490.0661C1119.0577 482.5741 1127.4677 475.3481 1136.9077 468.7871C1137.5577 468.3351 1136.2777 463.4801 1142.5977 464.3641C1148.3677 465.1691 1145.8077 462.4531 1149.7877 460.0291C1151.7877 463.3631 1152.2577 465.1691 1155.9277 466.7981C1160.1477 466.0411 1170.9077 453.5361 1176.0477 452.6911C1176.9077 452.5501 1199.3277 447.6621 1197.1477 447.3821C1197.351 448.9004 1197.5543 450.4187 1197.7577 451.9371C1198.031 451.9387 1198.3043 451.9404 1198.5777 451.9421C1198.5677 451.6237 1198.5577 451.3054 1198.5477 450.9871C1197.8877 429.2411 1210.5777 441.9691 1225.9877 428.9821C1226.3943 429.1541 1226.801 429.3261 1227.2077 429.4981C1227.0077 435.7951 1222.6677 437.2911 1223.4777 446.5121Z"/><path fill="rgb(23,25,33)" stroke="none" fill-opacity="1" stroke-width="1" stroke-opacity="1" display="block" id="tSvgb0c60a5c0f" title="Path 4" d="M301.7467 1.1044C322.0237 0.2137 330.8997 4.9322 346.4407 18.2987C364.8427 34.1251 379.8897 52.5111 396.3057 70.1341C412.5197 87.5401 431.2517 103.8571 448.1087 120.7211C455.5777 128.2161 462.2687 136.5231 469.7377 144.0801C493.2883 167.8534 516.839 191.6267 540.3897 215.4001C561.2957 236.4351 585.6777 247.2921 562.0387 283.5441C557.5257 289.1771 549.5047 293.3531 544.8787 298.6261C519.6007 327.4391 490.3077 351.9771 464.4547 380.3951C456.3177 388.9641 445.6977 396.1981 437.7757 404.7861C393.4327 452.8551 344.5917 496.7461 299.9277 544.4521C290.6917 554.3171 281.3657 562.2881 270.5137 570.3141C239.5747 577.6091 230.4357 560.8301 211.2877 541.1951C196.3907 526.0961 181.4937 510.9971 166.5967 495.8981C133.6487 463.2711 100.7007 430.6441 67.7527 398.0171C46.3067 376.4221 12.2537 347.6071 2.2387 317.0741C0.1327 308.9271 0.2147 286.8931 6.4507 280.3161C22.0037 263.9121 41.0977 244.8381 56.9737 229.1041C96.4573 189.7367 135.941 150.3694 175.4247 111.0021C196.8707 89.5477 218.3167 68.0934 239.7627 46.6391C251.2597 35.0161 263.1737 22.4471 275.1907 11.4627C281.3437 5.8392 293.7367 2.9039 301.7467 1.1044Z"/><path fill="rgb(222,229,238)" stroke="none" fill-opacity="1" stroke-width="1" stroke-opacity="1" display="block" id="tSvgbfe057bc16" title="Path 5" d="M301.0477 10.874C313.0747 10.2136 324.0317 12.051 333.5487 20.2434C347.9887 32.6731 361.3647 46.9911 374.8037 60.5391C397.588 83.3721 420.3723 106.2051 443.1567 129.0381C467.8867 153.8874 492.6167 178.7367 517.3467 203.5861C531.0677 217.3981 545.2187 231.1301 558.0047 245.7991C564.6947 253.4741 561.5147 266.4211 554.9637 273.2121C537.9247 290.8781 520.3467 308.1471 502.9687 325.5141C467.546 360.9121 432.1233 396.3101 396.7007 431.7081C368.9147 459.5154 341.1287 487.3227 313.3427 515.1301C302.2947 526.1881 279.8727 549.9001 268.6607 558.6621C246.0997 571.1211 228.7657 544.0801 213.6767 529.5421C193.5137 510.1151 173.8427 489.5751 153.9717 469.7681C127.3087 443.1687 100.6457 416.5694 73.9827 389.9701C51.1907 367.1971 12.6567 336.7561 10.8667 303.0261C10.6687 299.2881 11.7637 291.1741 14.1387 288.1791C27.7967 270.9531 44.9847 255.4091 60.6417 239.8011C90.5797 209.8707 120.5177 179.9404 150.4557 150.0101C178.032 122.4341 205.6083 94.8581 233.1847 67.2821C248.5497 51.8501 264.1597 35.6321 280.1677 20.8721C286.3117 15.2072 293.1327 13.033 301.0477 10.874Z"/></svg>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ydb-qdrant",
3
- "version": "2.0.0",
3
+ "version": "2.1.1",
4
4
  "main": "dist/Api.js",
5
5
  "types": "dist/Api.d.ts",
6
6
  "exports": {
@@ -10,7 +10,8 @@
10
10
  "files": [
11
11
  "dist",
12
12
  "README.md",
13
- "LICENSE"
13
+ "LICENSE",
14
+ "logo.svg"
14
15
  ],
15
16
  "scripts": {
16
17
  "test": "vitest run",
@@ -70,4 +71,4 @@
70
71
  "typescript": "^5.9.3",
71
72
  "vitest": "^4.0.12"
72
73
  }
73
- }
74
+ }