@mastra/duckdb 0.0.0

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 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/vector/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,KAAK,EACV,UAAU,EACV,WAAW,EACX,iBAAiB,EACjB,iBAAiB,EACjB,kBAAkB,EAClB,mBAAmB,EACnB,iBAAiB,EACjB,kBAAkB,EAClB,kBAAkB,EAClB,mBAAmB,EACpB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,KAAK,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAEzE;;;;;;;;;;;GAWG;AACH,qBAAa,YAAa,SAAQ,YAAY,CAAC,kBAAkB,CAAC;IAChE,OAAO,CAAC,MAAM,CAAqB;IACnC,OAAO,CAAC,QAAQ,CAA+B;IAC/C,OAAO,CAAC,WAAW,CAAkB;IACrC,OAAO,CAAC,WAAW,CAA8B;gBAErC,MAAM,EAAE,kBAAkB;IAUtC;;OAEG;YACW,UAAU;IAgDxB;;OAEG;YACW,aAAa;IAQ3B;;OAEG;YACW,QAAQ;IA2BtB;;OAEG;YACW,YAAY;IAoB1B;;OAEG;IACH,OAAO,CAAC,gBAAgB;IAQxB;;OAEG;IACH,OAAO,CAAC,mBAAmB;IAarB,KAAK,CAAC,MAAM,EAAE,iBAAiB,CAAC,kBAAkB,CAAC,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC;IAqE5E,MAAM,CAAC,MAAM,EAAE,kBAAkB,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;IA8BrD,WAAW,CAAC,MAAM,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC;IAuCrD,WAAW,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;IAehC,aAAa,CAAC,MAAM,EAAE,mBAAmB,GAAG,OAAO,CAAC,UAAU,CAAC;IAsC/D,WAAW,CAAC,MAAM,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC;IAUrD,YAAY,CAAC,MAAM,EAAE,kBAAkB,CAAC,kBAAkB,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAkD3E,YAAY,CAAC,MAAM,EAAE,kBAAkB,GAAG,OAAO,CAAC,IAAI,CAAC;IAWvD,aAAa,CAAC,MAAM,EAAE,mBAAmB,CAAC,kBAAkB,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAmCnF;;;OAGG;IACG,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;CAS7B"}
@@ -0,0 +1,118 @@
1
+ import type { VectorFilter } from '@mastra/core/vector/filter';
2
+ /**
3
+ * Configuration options for DuckDBVector.
4
+ */
5
+ export interface DuckDBVectorConfig {
6
+ /**
7
+ * Unique identifier for this vector store instance.
8
+ */
9
+ id: string;
10
+ /**
11
+ * Path to the DuckDB database file.
12
+ * Use ':memory:' for an in-memory database.
13
+ * @default ':memory:'
14
+ */
15
+ path?: string;
16
+ /**
17
+ * Default dimension for vector embeddings.
18
+ * @default 1536
19
+ */
20
+ dimensions?: number;
21
+ /**
22
+ * Default distance metric for similarity search.
23
+ * @default 'cosine'
24
+ */
25
+ metric?: 'cosine' | 'euclidean' | 'dotproduct';
26
+ /**
27
+ * Memory limit for DuckDB operations.
28
+ * @example '512MB', '2GB'
29
+ */
30
+ memoryLimit?: string;
31
+ /**
32
+ * Number of threads for DuckDB operations.
33
+ * @default Number of CPU cores
34
+ */
35
+ threads?: number;
36
+ /**
37
+ * Maximum number of connections in the pool.
38
+ * @default 5
39
+ */
40
+ maxPoolSize?: number;
41
+ }
42
+ /**
43
+ * HNSW index configuration options.
44
+ */
45
+ export interface HNSWConfig {
46
+ /**
47
+ * Maximum number of connections per layer.
48
+ * Higher values improve recall but increase memory usage.
49
+ * @default 16
50
+ */
51
+ M?: number;
52
+ /**
53
+ * Size of the dynamic candidate list during construction.
54
+ * Higher values improve quality but slow down indexing.
55
+ * @default 200
56
+ */
57
+ efConstruction?: number;
58
+ /**
59
+ * Size of the dynamic candidate list during search.
60
+ * Higher values improve recall but slow down queries.
61
+ * @default 40
62
+ */
63
+ efSearch?: number;
64
+ }
65
+ /**
66
+ * Filter type for DuckDB vector queries.
67
+ * Supports MongoDB-style query operators.
68
+ */
69
+ export type DuckDBVectorFilter = VectorFilter;
70
+ /**
71
+ * Query options specific to DuckDB vector store.
72
+ */
73
+ export interface DuckDBQueryOptions {
74
+ /**
75
+ * Maximum number of results to return.
76
+ * @default 10
77
+ */
78
+ topK?: number;
79
+ /**
80
+ * Minimum similarity score threshold (0-1 for cosine).
81
+ */
82
+ minScore?: number;
83
+ /**
84
+ * Whether to include the vector in results.
85
+ * @default false
86
+ */
87
+ includeVector?: boolean;
88
+ /**
89
+ * Text search query for hybrid search.
90
+ */
91
+ textQuery?: string;
92
+ /**
93
+ * Weight for vector similarity in hybrid search (0-1).
94
+ * @default 0.7
95
+ */
96
+ vectorWeight?: number;
97
+ }
98
+ /**
99
+ * Options for importing data from Parquet files.
100
+ */
101
+ export interface ParquetImportOptions {
102
+ /**
103
+ * Column name containing the vector embeddings.
104
+ * @default 'embedding'
105
+ */
106
+ vectorColumn?: string;
107
+ /**
108
+ * Column name containing the vector IDs.
109
+ * @default 'id'
110
+ */
111
+ idColumn?: string;
112
+ /**
113
+ * Column names to include as metadata.
114
+ * If not specified, all non-vector columns are included.
115
+ */
116
+ metadataColumns?: string[];
117
+ }
118
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/vector/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAE/D;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;;;OAIG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;;OAGG;IACH,MAAM,CAAC,EAAE,QAAQ,GAAG,WAAW,GAAG,YAAY,CAAC;IAE/C;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB;;;;OAIG;IACH,CAAC,CAAC,EAAE,MAAM,CAAC;IAEX;;;;OAIG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;;GAGG;AACH,MAAM,MAAM,kBAAkB,GAAG,YAAY,CAAC;AAE9C;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IAExB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;CAC5B"}
package/package.json ADDED
@@ -0,0 +1,66 @@
1
+ {
2
+ "name": "@mastra/duckdb",
3
+ "version": "0.0.0",
4
+ "description": "DuckDB vector store provider for Mastra - embedded high-performance vector storage with HNSW indexing",
5
+ "type": "module",
6
+ "main": "dist/index.js",
7
+ "types": "dist/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "import": {
11
+ "types": "./dist/index.d.ts",
12
+ "default": "./dist/index.js"
13
+ },
14
+ "require": {
15
+ "types": "./dist/index.d.ts",
16
+ "default": "./dist/index.cjs"
17
+ }
18
+ },
19
+ "./package.json": "./package.json"
20
+ },
21
+ "scripts": {
22
+ "build": "tsup --silent --config tsup.config.ts",
23
+ "build:watch": "tsup --watch --silent --config tsup.config.ts",
24
+ "test": "vitest run",
25
+ "lint": "eslint .",
26
+ "typecheck": "tsc --noEmit"
27
+ },
28
+ "license": "Apache-2.0",
29
+ "dependencies": {
30
+ "@duckdb/node-api": "1.4.2-r.1"
31
+ },
32
+ "devDependencies": {
33
+ "@internal/lint": "workspace:*",
34
+ "@internal/storage-test-utils": "workspace:*",
35
+ "@internal/types-builder": "workspace:*",
36
+ "@mastra/core": "workspace:*",
37
+ "@microsoft/api-extractor": "^7.52.8",
38
+ "@types/node": "22.13.17",
39
+ "@vitest/coverage-v8": "catalog:",
40
+ "@vitest/ui": "catalog:",
41
+ "eslint": "^9.37.0",
42
+ "rimraf": "^5.0.7",
43
+ "tsup": "^8.5.0",
44
+ "typescript": "^5.8.3",
45
+ "vitest": "catalog:"
46
+ },
47
+ "peerDependencies": {
48
+ "@mastra/core": ">=1.0.0-0 <2.0.0-0"
49
+ },
50
+ "files": [
51
+ "dist",
52
+ "CHANGELOG.md"
53
+ ],
54
+ "homepage": "https://mastra.ai",
55
+ "repository": {
56
+ "type": "git",
57
+ "url": "git+https://github.com/mastra-ai/mastra.git",
58
+ "directory": "stores/duckdb"
59
+ },
60
+ "bugs": {
61
+ "url": "https://github.com/mastra-ai/mastra/issues"
62
+ },
63
+ "engines": {
64
+ "node": ">=22.13.0"
65
+ }
66
+ }