@mastra/turbopuffer 0.0.0-mastra-3338-mastra-memory-pinecone-20250507174328 → 0.0.0-mastra-auto-detect-server-20260108233416

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.
@@ -0,0 +1,50 @@
1
+ import type { OperatorSupport, VectorFilter, OperatorValueMap, LogicalOperatorValueMap, BlacklistedRootOperators } from '@mastra/core/vector/filter';
2
+ import { BaseFilterTranslator } from '@mastra/core/vector/filter';
3
+ import type { Filters } from '@turbopuffer/turbopuffer';
4
+ type TurbopufferOperatorValueMap = Omit<OperatorValueMap, '$regex' | '$options' | '$elemMatch'>;
5
+ type TurbopufferLogicalOperatorValueMap = Omit<LogicalOperatorValueMap, '$nor' | '$not'>;
6
+ type TurbopufferBlacklistedRootOperators = BlacklistedRootOperators | '$nor' | '$not';
7
+ export type TurbopufferVectorFilter = VectorFilter<keyof TurbopufferOperatorValueMap, TurbopufferOperatorValueMap, TurbopufferLogicalOperatorValueMap, TurbopufferBlacklistedRootOperators>;
8
+ /**
9
+ * Translator for converting Mastra filters to Turbopuffer format
10
+ *
11
+ * Mastra filters: { field: { $gt: 10 } }
12
+ * Turbopuffer filters: ["And", [["field", "Gt", 10]]]
13
+ */
14
+ export declare class TurbopufferFilterTranslator extends BaseFilterTranslator<TurbopufferVectorFilter, Filters | undefined> {
15
+ protected getSupportedOperators(): OperatorSupport;
16
+ /**
17
+ * Map Mastra operators to Turbopuffer operators
18
+ */
19
+ private operatorMap;
20
+ /**
21
+ * Convert the Mastra filter to Turbopuffer format
22
+ */
23
+ translate(filter?: TurbopufferVectorFilter): Filters | undefined;
24
+ /**
25
+ * Recursively translate a filter node
26
+ */
27
+ private translateNode;
28
+ /**
29
+ * Translate a field condition
30
+ */
31
+ private translateFieldCondition;
32
+ /**
33
+ * Translate a logical operator
34
+ */
35
+ private translateLogical;
36
+ /**
37
+ * Translate a specific operator
38
+ */
39
+ private translateOperator;
40
+ /**
41
+ * Normalize a value for comparison operations
42
+ */
43
+ protected normalizeValue(value: any): any;
44
+ /**
45
+ * Normalize array values
46
+ */
47
+ protected normalizeArrayValues(values: any[]): any[];
48
+ }
49
+ export {};
50
+ //# sourceMappingURL=filter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"filter.d.ts","sourceRoot":"","sources":["../../src/vector/filter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,eAAe,EACf,YAAY,EACZ,gBAAgB,EAChB,uBAAuB,EACvB,wBAAwB,EACzB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,KAAK,EAAqD,OAAO,EAAE,MAAM,0BAA0B,CAAC;AAE3G,KAAK,2BAA2B,GAAG,IAAI,CAAC,gBAAgB,EAAE,QAAQ,GAAG,UAAU,GAAG,YAAY,CAAC,CAAC;AAEhG,KAAK,kCAAkC,GAAG,IAAI,CAAC,uBAAuB,EAAE,MAAM,GAAG,MAAM,CAAC,CAAC;AAEzF,KAAK,mCAAmC,GAAG,wBAAwB,GAAG,MAAM,GAAG,MAAM,CAAC;AAEtF,MAAM,MAAM,uBAAuB,GAAG,YAAY,CAChD,MAAM,2BAA2B,EACjC,2BAA2B,EAC3B,kCAAkC,EAClC,mCAAmC,CACpC,CAAC;AAEF;;;;;GAKG;AACH,qBAAa,2BAA4B,SAAQ,oBAAoB,CAAC,uBAAuB,EAAE,OAAO,GAAG,SAAS,CAAC;cAC9F,qBAAqB,IAAI,eAAe;IAW3D;;OAEG;IACH,OAAO,CAAC,WAAW,CASjB;IAEF;;OAEG;IACH,SAAS,CAAC,MAAM,CAAC,EAAE,uBAAuB,GAAG,OAAO,GAAG,SAAS;IAoBhE;;OAEG;IACH,OAAO,CAAC,aAAa;IAwCrB;;OAEG;IACH,OAAO,CAAC,uBAAuB;IAsD/B;;OAEG;IACH,OAAO,CAAC,gBAAgB;IAoBxB;;OAEG;IACH,OAAO,CAAC,iBAAiB;IA6BzB;;OAEG;IACH,SAAS,CAAC,cAAc,CAAC,KAAK,EAAE,GAAG,GAAG,GAAG;IAQzC;;OAEG;IACH,SAAS,CAAC,oBAAoB,CAAC,MAAM,EAAE,GAAG,EAAE,GAAG,GAAG,EAAE;CAGrD"}
@@ -0,0 +1,91 @@
1
+ import type { CreateIndexParams, DeleteIndexParams, DeleteVectorParams, DescribeIndexParams, IndexStats, QueryResult, QueryVectorParams, UpdateVectorParams, UpsertVectorParams, DeleteVectorsParams } from '@mastra/core/vector';
2
+ import { MastraVector } from '@mastra/core/vector';
3
+ import type { Schema } from '@turbopuffer/turbopuffer';
4
+ import type { TurbopufferVectorFilter } from './filter.js';
5
+ type TurbopufferQueryVectorParams = QueryVectorParams<TurbopufferVectorFilter>;
6
+ export interface TurbopufferVectorOptions {
7
+ /** The API key to authenticate with. */
8
+ apiKey: string;
9
+ /** The base URL. Default is https://api.turbopuffer.com. */
10
+ baseUrl?: string;
11
+ /** The timeout to establish a connection, in ms. Default is 10_000. Only applicable in Node and Deno.*/
12
+ connectTimeout?: number;
13
+ /** The socket idle timeout, in ms. Default is 60_000. Only applicable in Node and Deno.*/
14
+ connectionIdleTimeout?: number;
15
+ /** The number of connections to open initially when creating a new client. Default is 0. */
16
+ warmConnections?: number;
17
+ /** Whether to compress requests and accept compressed responses. Default is true. */
18
+ compression?: boolean;
19
+ /**
20
+ * A callback function that takes an index name and returns a config object for that index.
21
+ * This allows you to define explicit schemas per index.
22
+ *
23
+ * Example:
24
+ * ```typescript
25
+ * schemaConfigForIndex: (indexName: string) => {
26
+ * // Mastra's default embedding model and index for memory messages:
27
+ * if (indexName === "memory_messages_384") {
28
+ * return {
29
+ * dimensions: 384,
30
+ * schema: {
31
+ * thread_id: {
32
+ * type: "string",
33
+ * filterable: true,
34
+ * },
35
+ * },
36
+ * };
37
+ * } else {
38
+ * throw new Error(`TODO: add schema for index: ${indexName}`);
39
+ * }
40
+ * },
41
+ * ```
42
+ */
43
+ schemaConfigForIndex?: (indexName: string) => {
44
+ dimensions: number;
45
+ schema: Schema;
46
+ };
47
+ }
48
+ export declare class TurbopufferVector extends MastraVector<TurbopufferVectorFilter> {
49
+ private client;
50
+ private filterTranslator;
51
+ private createIndexCache;
52
+ private opts;
53
+ constructor(opts: TurbopufferVectorOptions & {
54
+ id: string;
55
+ });
56
+ createIndex({ indexName, dimension, metric }: CreateIndexParams): Promise<void>;
57
+ upsert({ indexName, vectors, metadata, ids }: UpsertVectorParams): Promise<string[]>;
58
+ query({ indexName, queryVector, topK, filter, includeVector, }: TurbopufferQueryVectorParams): Promise<QueryResult[]>;
59
+ listIndexes(): Promise<string[]>;
60
+ /**
61
+ * Retrieves statistics about a vector index.
62
+ *
63
+ * @param {string} indexName - The name of the index to describe
64
+ * @returns A promise that resolves to the index statistics including dimension, count and metric
65
+ */
66
+ describeIndex({ indexName }: DescribeIndexParams): Promise<IndexStats>;
67
+ deleteIndex({ indexName }: DeleteIndexParams): Promise<void>;
68
+ /**
69
+ * Updates a vector by its ID or filter with the provided vector and/or metadata.
70
+ * @param indexName - The name of the index containing the vector.
71
+ * @param id - The ID of the vector to update.
72
+ * @param filter - The filter to match vectors to update.
73
+ * @param update - An object containing the vector and/or metadata to update.
74
+ * @param update.vector - An optional array of numbers representing the new vector.
75
+ * @param update.metadata - An optional record containing the new metadata.
76
+ * @returns A promise that resolves when the update is complete.
77
+ * @throws Will throw an error if no updates are provided or if the update operation fails.
78
+ */
79
+ updateVector({ indexName, id, filter, update }: UpdateVectorParams<TurbopufferVectorFilter>): Promise<void>;
80
+ /**
81
+ * Deletes a vector by its ID.
82
+ * @param indexName - The name of the index containing the vector.
83
+ * @param id - The ID of the vector to delete.
84
+ * @returns A promise that resolves when the deletion is complete.
85
+ * @throws Will throw an error if the deletion operation fails.
86
+ */
87
+ deleteVector({ indexName, id }: DeleteVectorParams): Promise<void>;
88
+ deleteVectors({ indexName, filter, ids }: DeleteVectorsParams<TurbopufferVectorFilter>): Promise<void>;
89
+ }
90
+ export {};
91
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/vector/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,iBAAiB,EACjB,iBAAiB,EACjB,kBAAkB,EAClB,mBAAmB,EACnB,UAAU,EACV,WAAW,EACX,iBAAiB,EACjB,kBAAkB,EAClB,kBAAkB,EAClB,mBAAmB,EACpB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAEnD,OAAO,KAAK,EAAgC,MAAM,EAAU,MAAM,0BAA0B,CAAC;AAE7F,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAC;AAExD,KAAK,4BAA4B,GAAG,iBAAiB,CAAC,uBAAuB,CAAC,CAAC;AAE/E,MAAM,WAAW,wBAAwB;IACvC,wCAAwC;IACxC,MAAM,EAAE,MAAM,CAAC;IACf,4DAA4D;IAC5D,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,wGAAwG;IACxG,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,0FAA0F;IAC1F,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,4FAA4F;IAC5F,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,qFAAqF;IACrF,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;;;;;;;;;;;;;;;;;;;;;;OAuBG;IACH,oBAAoB,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK;QAC5C,UAAU,EAAE,MAAM,CAAC;QACnB,MAAM,EAAE,MAAM,CAAC;KAChB,CAAC;CACH;AAED,qBAAa,iBAAkB,SAAQ,YAAY,CAAC,uBAAuB,CAAC;IAC1E,OAAO,CAAC,MAAM,CAAc;IAC5B,OAAO,CAAC,gBAAgB,CAA8B;IAItD,OAAO,CAAC,gBAAgB,CAKV;IACd,OAAO,CAAC,IAAI,CAA2B;gBAE3B,IAAI,EAAE,wBAAwB,GAAG;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE;IAOrD,WAAW,CAAC,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC;IA+C/E,MAAM,CAAC,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,EAAE,EAAE,kBAAkB,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;IA6EpF,KAAK,CAAC,EACV,SAAS,EACT,WAAW,EACX,IAAI,EACJ,MAAM,EACN,aAAa,GACd,EAAE,4BAA4B,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC;IA2DlD,WAAW,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;IAgBtC;;;;;OAKG;IACG,aAAa,CAAC,EAAE,SAAS,EAAE,EAAE,mBAAmB,GAAG,OAAO,CAAC,UAAU,CAAC;IA4BtE,WAAW,CAAC,EAAE,SAAS,EAAE,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC;IAkBlE;;;;;;;;;;OAUG;IACG,YAAY,CAAC,EAAE,SAAS,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE,kBAAkB,CAAC,uBAAuB,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAqJjH;;;;;;OAMG;IACG,YAAY,CAAC,EAAE,SAAS,EAAE,EAAE,EAAE,EAAE,kBAAkB,GAAG,OAAO,CAAC,IAAI,CAAC;IAiBlE,aAAa,CAAC,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,EAAE,EAAE,mBAAmB,CAAC,uBAAuB,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;CAmG7G"}
package/package.json CHANGED
@@ -1,10 +1,11 @@
1
1
  {
2
2
  "name": "@mastra/turbopuffer",
3
- "version": "0.0.0-mastra-3338-mastra-memory-pinecone-20250507174328",
3
+ "version": "0.0.0-mastra-auto-detect-server-20260108233416",
4
4
  "description": "Turbopuffer vector store provider for Mastra",
5
5
  "type": "module",
6
6
  "files": [
7
- "dist"
7
+ "dist",
8
+ "CHANGELOG.md"
8
9
  ],
9
10
  "main": "dist/index.js",
10
11
  "types": "dist/index.d.ts",
@@ -15,30 +16,49 @@
15
16
  "default": "./dist/index.js"
16
17
  },
17
18
  "require": {
18
- "types": "./dist/index.d.cts",
19
+ "types": "./dist/index.d.ts",
19
20
  "default": "./dist/index.cjs"
20
21
  }
21
22
  },
22
23
  "./package.json": "./package.json"
23
24
  },
24
- "license": "MIT",
25
+ "license": "Apache-2.0",
25
26
  "dependencies": {
26
- "@turbopuffer/turbopuffer": "^0.6.4",
27
- "@mastra/core": "0.0.0-mastra-3338-mastra-memory-pinecone-20250507174328"
27
+ "@turbopuffer/turbopuffer": "^0.6.17"
28
28
  },
29
29
  "devDependencies": {
30
- "@microsoft/api-extractor": "^7.52.5",
31
- "@types/node": "^20.17.27",
32
- "dotenv": "^16.4.7",
33
- "eslint": "^9.23.0",
34
- "tsup": "^8.4.0",
35
- "typescript": "^5.8.2",
36
- "vitest": "^3.1.2",
37
- "@internal/lint": "0.0.0-mastra-3338-mastra-memory-pinecone-20250507174328"
30
+ "@types/node": "22.13.17",
31
+ "@vitest/coverage-v8": "4.0.12",
32
+ "@vitest/ui": "4.0.12",
33
+ "dotenv": "^17.0.0",
34
+ "eslint": "^9.37.0",
35
+ "tsup": "^8.5.0",
36
+ "typescript": "^5.9.3",
37
+ "vitest": "4.0.16",
38
+ "@internal/lint": "0.0.0-mastra-auto-detect-server-20260108233416",
39
+ "@internal/types-builder": "0.0.0-mastra-auto-detect-server-20260108233416",
40
+ "@internal/storage-test-utils": "0.0.49",
41
+ "@mastra/core": "0.0.0-mastra-auto-detect-server-20260108233416"
42
+ },
43
+ "peerDependencies": {
44
+ "@mastra/core": "0.0.0-mastra-auto-detect-server-20260108233416"
45
+ },
46
+ "homepage": "https://mastra.ai",
47
+ "repository": {
48
+ "type": "git",
49
+ "url": "git+https://github.com/mastra-ai/mastra.git",
50
+ "directory": "stores/turbopuffer"
51
+ },
52
+ "bugs": {
53
+ "url": "https://github.com/mastra-ai/mastra/issues"
54
+ },
55
+ "engines": {
56
+ "node": ">=22.13.0"
38
57
  },
39
58
  "scripts": {
40
- "build": "tsup src/index.ts --format esm,cjs --experimental-dts --clean --treeshake=smallest --splitting",
41
- "build:watch": "pnpm build --watch",
59
+ "build:lib": "tsup --silent --config tsup.config.ts",
60
+ "build:docs": "pnpx tsx ../../scripts/generate-package-docs.ts stores/turbopuffer",
61
+ "build:watch": "tsup --watch --silent --config tsup.config.ts",
42
62
  "test": "vitest run",
43
63
  "lint": "eslint ."
44
64
  }
@@ -1,116 +0,0 @@
1
- import { BaseFilterTranslator } from '@mastra/core/vector/filter';
2
- import type { CreateIndexParams } from '@mastra/core/vector';
3
- import type { Filters } from '@turbopuffer/turbopuffer';
4
- import type { IndexStats } from '@mastra/core/vector';
5
- import { MastraVector } from '@mastra/core/vector';
6
- import type { OperatorSupport } from '@mastra/core/vector/filter';
7
- import type { QueryResult } from '@mastra/core/vector';
8
- import type { QueryVectorParams } from '@mastra/core/vector';
9
- import type { Schema } from '@turbopuffer/turbopuffer';
10
- import type { UpsertVectorParams } from '@mastra/core/vector';
11
- import type { VectorFilter } from '@mastra/core/vector/filter';
12
-
13
- /**
14
- * Translator for converting Mastra filters to Turbopuffer format
15
- *
16
- * Mastra filters: { field: { $gt: 10 } }
17
- * Turbopuffer filters: ["And", [["field", "Gt", 10]]]
18
- */
19
- export declare class TurbopufferFilterTranslator extends BaseFilterTranslator {
20
- protected getSupportedOperators(): OperatorSupport;
21
- /**
22
- * Map Mastra operators to Turbopuffer operators
23
- */
24
- private operatorMap;
25
- /**
26
- * Convert the Mastra filter to Turbopuffer format
27
- */
28
- translate(filter?: VectorFilter): Filters | undefined;
29
- /**
30
- * Recursively translate a filter node
31
- */
32
- private translateNode;
33
- /**
34
- * Translate a field condition
35
- */
36
- private translateFieldCondition;
37
- /**
38
- * Translate a logical operator
39
- */
40
- private translateLogical;
41
- /**
42
- * Translate a specific operator
43
- */
44
- private translateOperator;
45
- /**
46
- * Normalize a value for comparison operations
47
- */
48
- protected normalizeValue(value: any): any;
49
- /**
50
- * Normalize array values
51
- */
52
- protected normalizeArrayValues(values: any[]): any[];
53
- }
54
-
55
- declare class TurbopufferVector extends MastraVector {
56
- private client;
57
- private filterTranslator;
58
- private createIndexCache;
59
- private opts;
60
- constructor(opts: TurbopufferVectorOptions);
61
- createIndex({ indexName, dimension, metric }: CreateIndexParams): Promise<void>;
62
- upsert({ indexName, vectors, metadata, ids }: UpsertVectorParams): Promise<string[]>;
63
- query({ indexName, queryVector, topK, filter, includeVector }: QueryVectorParams): Promise<QueryResult[]>;
64
- listIndexes(): Promise<string[]>;
65
- describeIndex(indexName: string): Promise<IndexStats>;
66
- deleteIndex(indexName: string): Promise<void>;
67
- }
68
- export { TurbopufferVector }
69
- export { TurbopufferVector as TurbopufferVector_alias_1 }
70
-
71
- declare interface TurbopufferVectorOptions {
72
- /** The API key to authenticate with. */
73
- apiKey: string;
74
- /** The base URL. Default is https://api.turbopuffer.com. */
75
- baseUrl?: string;
76
- /** The timeout to establish a connection, in ms. Default is 10_000. Only applicable in Node and Deno.*/
77
- connectTimeout?: number;
78
- /** The socket idle timeout, in ms. Default is 60_000. Only applicable in Node and Deno.*/
79
- connectionIdleTimeout?: number;
80
- /** The number of connections to open initially when creating a new client. Default is 0. */
81
- warmConnections?: number;
82
- /** Whether to compress requests and accept compressed responses. Default is true. */
83
- compression?: boolean;
84
- /**
85
- * A callback function that takes an index name and returns a config object for that index.
86
- * This allows you to define explicit schemas per index.
87
- *
88
- * Example:
89
- * ```typescript
90
- * schemaConfigForIndex: (indexName: string) => {
91
- * // Mastra's default embedding model and index for memory messages:
92
- * if (indexName === "memory_messages_384") {
93
- * return {
94
- * dimensions: 384,
95
- * schema: {
96
- * thread_id: {
97
- * type: "string",
98
- * filterable: true,
99
- * },
100
- * },
101
- * };
102
- * } else {
103
- * throw new Error(`TODO: add schema for index: ${indexName}`);
104
- * }
105
- * },
106
- * ```
107
- */
108
- schemaConfigForIndex?: (indexName: string) => {
109
- dimensions: number;
110
- schema: Schema;
111
- };
112
- }
113
- export { TurbopufferVectorOptions }
114
- export { TurbopufferVectorOptions as TurbopufferVectorOptions_alias_1 }
115
-
116
- export { }
@@ -1,116 +0,0 @@
1
- import { BaseFilterTranslator } from '@mastra/core/vector/filter';
2
- import type { CreateIndexParams } from '@mastra/core/vector';
3
- import type { Filters } from '@turbopuffer/turbopuffer';
4
- import type { IndexStats } from '@mastra/core/vector';
5
- import { MastraVector } from '@mastra/core/vector';
6
- import type { OperatorSupport } from '@mastra/core/vector/filter';
7
- import type { QueryResult } from '@mastra/core/vector';
8
- import type { QueryVectorParams } from '@mastra/core/vector';
9
- import type { Schema } from '@turbopuffer/turbopuffer';
10
- import type { UpsertVectorParams } from '@mastra/core/vector';
11
- import type { VectorFilter } from '@mastra/core/vector/filter';
12
-
13
- /**
14
- * Translator for converting Mastra filters to Turbopuffer format
15
- *
16
- * Mastra filters: { field: { $gt: 10 } }
17
- * Turbopuffer filters: ["And", [["field", "Gt", 10]]]
18
- */
19
- export declare class TurbopufferFilterTranslator extends BaseFilterTranslator {
20
- protected getSupportedOperators(): OperatorSupport;
21
- /**
22
- * Map Mastra operators to Turbopuffer operators
23
- */
24
- private operatorMap;
25
- /**
26
- * Convert the Mastra filter to Turbopuffer format
27
- */
28
- translate(filter?: VectorFilter): Filters | undefined;
29
- /**
30
- * Recursively translate a filter node
31
- */
32
- private translateNode;
33
- /**
34
- * Translate a field condition
35
- */
36
- private translateFieldCondition;
37
- /**
38
- * Translate a logical operator
39
- */
40
- private translateLogical;
41
- /**
42
- * Translate a specific operator
43
- */
44
- private translateOperator;
45
- /**
46
- * Normalize a value for comparison operations
47
- */
48
- protected normalizeValue(value: any): any;
49
- /**
50
- * Normalize array values
51
- */
52
- protected normalizeArrayValues(values: any[]): any[];
53
- }
54
-
55
- declare class TurbopufferVector extends MastraVector {
56
- private client;
57
- private filterTranslator;
58
- private createIndexCache;
59
- private opts;
60
- constructor(opts: TurbopufferVectorOptions);
61
- createIndex({ indexName, dimension, metric }: CreateIndexParams): Promise<void>;
62
- upsert({ indexName, vectors, metadata, ids }: UpsertVectorParams): Promise<string[]>;
63
- query({ indexName, queryVector, topK, filter, includeVector }: QueryVectorParams): Promise<QueryResult[]>;
64
- listIndexes(): Promise<string[]>;
65
- describeIndex(indexName: string): Promise<IndexStats>;
66
- deleteIndex(indexName: string): Promise<void>;
67
- }
68
- export { TurbopufferVector }
69
- export { TurbopufferVector as TurbopufferVector_alias_1 }
70
-
71
- declare interface TurbopufferVectorOptions {
72
- /** The API key to authenticate with. */
73
- apiKey: string;
74
- /** The base URL. Default is https://api.turbopuffer.com. */
75
- baseUrl?: string;
76
- /** The timeout to establish a connection, in ms. Default is 10_000. Only applicable in Node and Deno.*/
77
- connectTimeout?: number;
78
- /** The socket idle timeout, in ms. Default is 60_000. Only applicable in Node and Deno.*/
79
- connectionIdleTimeout?: number;
80
- /** The number of connections to open initially when creating a new client. Default is 0. */
81
- warmConnections?: number;
82
- /** Whether to compress requests and accept compressed responses. Default is true. */
83
- compression?: boolean;
84
- /**
85
- * A callback function that takes an index name and returns a config object for that index.
86
- * This allows you to define explicit schemas per index.
87
- *
88
- * Example:
89
- * ```typescript
90
- * schemaConfigForIndex: (indexName: string) => {
91
- * // Mastra's default embedding model and index for memory messages:
92
- * if (indexName === "memory_messages_384") {
93
- * return {
94
- * dimensions: 384,
95
- * schema: {
96
- * thread_id: {
97
- * type: "string",
98
- * filterable: true,
99
- * },
100
- * },
101
- * };
102
- * } else {
103
- * throw new Error(`TODO: add schema for index: ${indexName}`);
104
- * }
105
- * },
106
- * ```
107
- */
108
- schemaConfigForIndex?: (indexName: string) => {
109
- dimensions: number;
110
- schema: Schema;
111
- };
112
- }
113
- export { TurbopufferVectorOptions }
114
- export { TurbopufferVectorOptions as TurbopufferVectorOptions_alias_1 }
115
-
116
- export { }
package/dist/index.d.cts DELETED
@@ -1,2 +0,0 @@
1
- export { TurbopufferVectorOptions } from './_tsup-dts-rollup.cjs';
2
- export { TurbopufferVector } from './_tsup-dts-rollup.cjs';