@mastra/lance 1.0.0-beta.1 → 1.0.0-beta.10
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.
- package/CHANGELOG.md +415 -0
- package/dist/docs/README.md +33 -0
- package/dist/docs/SKILL.md +34 -0
- package/dist/docs/SOURCE_MAP.json +6 -0
- package/dist/docs/rag/01-vector-databases.md +638 -0
- package/dist/docs/storage/01-reference.md +113 -0
- package/dist/docs/vectors/01-reference.md +149 -0
- package/dist/index.cjs +1384 -1217
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1383 -1219
- package/dist/index.js.map +1 -1
- package/dist/storage/{domains/operations → db}/index.d.ts +21 -2
- package/dist/storage/db/index.d.ts.map +1 -0
- package/dist/storage/db/utils.d.ts.map +1 -0
- package/dist/storage/domains/memory/index.d.ts +6 -7
- package/dist/storage/domains/memory/index.d.ts.map +1 -1
- package/dist/storage/domains/scores/index.d.ts +20 -23
- package/dist/storage/domains/scores/index.d.ts.map +1 -1
- package/dist/storage/domains/workflows/index.d.ts +16 -14
- package/dist/storage/domains/workflows/index.d.ts.map +1 -1
- package/dist/storage/index.d.ts +96 -178
- package/dist/storage/index.d.ts.map +1 -1
- package/dist/vector/filter.d.ts +5 -5
- package/dist/vector/index.d.ts +3 -2
- package/dist/vector/index.d.ts.map +1 -1
- package/package.json +10 -10
- package/dist/storage/domains/operations/index.d.ts.map +0 -1
- package/dist/storage/domains/utils.d.ts.map +0 -1
- /package/dist/storage/{domains → db}/utils.d.ts +0 -0
|
@@ -1,7 +1,26 @@
|
|
|
1
1
|
import type { Connection } from '@lancedb/lancedb';
|
|
2
|
-
import {
|
|
2
|
+
import { MastraBase } from '@mastra/core/base';
|
|
3
3
|
import type { TABLE_NAMES, StorageColumn } from '@mastra/core/storage';
|
|
4
|
-
|
|
4
|
+
/**
|
|
5
|
+
* Configuration for standalone domain usage.
|
|
6
|
+
* Accepts an existing LanceDB Connection.
|
|
7
|
+
*
|
|
8
|
+
* Note: Creating a new LanceDB connection requires async `connect()`,
|
|
9
|
+
* so for standalone domain usage, you must create the connection first
|
|
10
|
+
* and pass it to the domain constructor.
|
|
11
|
+
*/
|
|
12
|
+
export type LanceDomainConfig = LanceDomainClientConfig;
|
|
13
|
+
/**
|
|
14
|
+
* Pass an existing LanceDB connection
|
|
15
|
+
*/
|
|
16
|
+
export interface LanceDomainClientConfig {
|
|
17
|
+
client: Connection;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Resolves LanceDomainConfig to a LanceDB Connection.
|
|
21
|
+
*/
|
|
22
|
+
export declare function resolveLanceConfig(config: LanceDomainConfig): Connection;
|
|
23
|
+
export declare class LanceDB extends MastraBase {
|
|
5
24
|
client: Connection;
|
|
6
25
|
constructor({ client }: {
|
|
7
26
|
client: Connection;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/storage/db/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAG/C,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAKvE;;;;;;;GAOG;AACH,MAAM,MAAM,iBAAiB,GAAG,uBAAuB,CAAC;AAExD;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACtC,MAAM,EAAE,UAAU,CAAC;CACpB;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,iBAAiB,GAAG,UAAU,CAExE;AAED,qBAAa,OAAQ,SAAQ,UAAU;IACrC,MAAM,EAAE,UAAU,CAAC;gBACP,EAAE,MAAM,EAAE,EAAE;QAAE,MAAM,EAAE,UAAU,CAAA;KAAE;IAK9C,SAAS,CAAC,eAAe,CAAC,IAAI,EAAE,aAAa,CAAC,MAAM,CAAC,GAAG,MAAM;IAkBxD,SAAS,CA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CAAC,CAAA;KAAE,GAAG,OAAO,CAAC,GAAG,CAAC;CA8ErG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/storage/db/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAa,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAG1E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAExD,wBAAgB,cAAc,CAAC,SAAS,EAAE,WAAW,GAAG,MAAM,EAAE,CAO/D;AAED,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,WAAW,EAAE,UAAU,GAAG,IAAI,CA4BzF;AAED,wBAAgB,+BAA+B,CAC7C,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,EACtD,WAAW,EAAE,UAAU,GACtB,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,CAqD7C;AAED,wBAAsB,cAAc,CAAC,EACnC,SAAS,EACT,MAAM,GACP,EAAE;IACD,SAAS,EAAE,WAAW,CAAC;IACvB,MAAM,EAAE,UAAU,CAAC;CACpB,GAAG,OAAO,CAAC,UAAU,CAAC,CA6CtB"}
|
|
@@ -1,16 +1,15 @@
|
|
|
1
|
-
import type { Connection } from '@lancedb/lancedb';
|
|
2
1
|
import type { MastraMessageContentV2 } from '@mastra/core/agent';
|
|
3
2
|
import type { MastraDBMessage, StorageThreadType } from '@mastra/core/memory';
|
|
4
3
|
import { MemoryStorage } from '@mastra/core/storage';
|
|
5
4
|
import type { StorageResourceType, StorageListMessagesInput, StorageListMessagesOutput, StorageListThreadsByResourceIdInput, StorageListThreadsByResourceIdOutput } from '@mastra/core/storage';
|
|
6
|
-
import type {
|
|
5
|
+
import type { LanceDomainConfig } from '../../db/index.js';
|
|
7
6
|
export declare class StoreMemoryLance extends MemoryStorage {
|
|
7
|
+
#private;
|
|
8
8
|
private client;
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
});
|
|
9
|
+
constructor(config: LanceDomainConfig);
|
|
10
|
+
init(): Promise<void>;
|
|
11
|
+
dangerouslyClearAll(): Promise<void>;
|
|
12
|
+
deleteMessages(messageIds: string[]): Promise<void>;
|
|
14
13
|
private escapeSql;
|
|
15
14
|
getThreadById({ threadId }: {
|
|
16
15
|
threadId: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/storage/domains/memory/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/storage/domains/memory/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAEjE,OAAO,KAAK,EAAmB,eAAe,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAC/F,OAAO,EAEL,aAAa,EAOd,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EACV,mBAAmB,EACnB,wBAAwB,EACxB,yBAAyB,EACzB,mCAAmC,EACnC,oCAAoC,EACrC,MAAM,sBAAsB,CAAC;AAE9B,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAGlD,qBAAa,gBAAiB,SAAQ,aAAa;;IACjD,OAAO,CAAC,MAAM,CAAa;gBAGf,MAAM,EAAE,iBAAiB;IAO/B,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAYrB,mBAAmB,IAAI,OAAO,CAAC,IAAI,CAAC;IAMpC,cAAc,CAAC,UAAU,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAuDzD,OAAO,CAAC,SAAS;IAIX,aAAa,CAAC,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,CAAC,GACnD;YACE,EAAE,EAAE,MAAM,CAAC;YACX,OAAO,CAAC,EAAE;gBAAE,QAAQ,CAAC,EAAE,sBAAsB,CAAC,UAAU,CAAC,CAAC;gBAAC,OAAO,CAAC,EAAE,sBAAsB,CAAC,SAAS,CAAC,CAAA;aAAE,CAAC;SAC1G,EAAE,CAAC;KACP,GAAG,OAAO,CAAC,eAAe,EAAE,CAAC;IAgGxB,eAAe,CAAC,EAAE,UAAU,EAAE,EAAE;QAAE,UAAU,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,mBAAmB,GAAG,IAAI,CAAC;IAiG5F,YAAY,CAAC,EAAE,QAAQ,EAAE,EAAE;QAAE,QAAQ,EAAE,mBAAmB,CAAA;KAAE,GAAG,OAAO,CAAC,mBAAmB,CAAC;IAyB3F,cAAc,CAAC,EACnB,UAAU,EACV,aAAa,EACb,QAAQ,GACT,EAAE;QACD,UAAU,EAAE,MAAM,CAAC;QACnB,aAAa,CAAC,EAAE,MAAM,CAAC;QACvB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KACpC,GAAG,OAAO,CAAC,mBAAmB,CAAC;CA+DjC"}
|
|
@@ -1,50 +1,47 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type { ScoreRowData, ScoringSource } from '@mastra/core/evals';
|
|
1
|
+
import type { ListScoresResponse, SaveScorePayload, ScoreRowData, ScoringSource } from '@mastra/core/evals';
|
|
3
2
|
import { ScoresStorage } from '@mastra/core/storage';
|
|
4
|
-
import type {
|
|
3
|
+
import type { StoragePagination } from '@mastra/core/storage';
|
|
4
|
+
import type { LanceDomainConfig } from '../../db/index.js';
|
|
5
5
|
export declare class StoreScoresLance extends ScoresStorage {
|
|
6
|
+
#private;
|
|
6
7
|
private client;
|
|
7
|
-
constructor(
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
saveScore(score:
|
|
8
|
+
constructor(config: LanceDomainConfig);
|
|
9
|
+
init(): Promise<void>;
|
|
10
|
+
dangerouslyClearAll(): Promise<void>;
|
|
11
|
+
saveScore(score: SaveScorePayload): Promise<{
|
|
11
12
|
score: ScoreRowData;
|
|
12
13
|
}>;
|
|
13
14
|
getScoreById({ id }: {
|
|
14
15
|
id: string;
|
|
15
16
|
}): Promise<ScoreRowData | null>;
|
|
17
|
+
/**
|
|
18
|
+
* LanceDB-specific score row transformation.
|
|
19
|
+
*
|
|
20
|
+
* Note: This implementation does NOT use coreTransformScoreRow because:
|
|
21
|
+
* 1. LanceDB stores schema information in the table itself (requires async fetch)
|
|
22
|
+
* 2. Uses processResultWithTypeConversion utility for LanceDB-specific type handling
|
|
23
|
+
*/
|
|
24
|
+
private transformScoreRow;
|
|
16
25
|
listScoresByScorerId({ scorerId, pagination, entityId, entityType, source, }: {
|
|
17
26
|
scorerId: string;
|
|
18
27
|
pagination: StoragePagination;
|
|
19
28
|
entityId?: string;
|
|
20
29
|
entityType?: string;
|
|
21
30
|
source?: ScoringSource;
|
|
22
|
-
}): Promise<
|
|
23
|
-
pagination: PaginationInfo;
|
|
24
|
-
scores: ScoreRowData[];
|
|
25
|
-
}>;
|
|
31
|
+
}): Promise<ListScoresResponse>;
|
|
26
32
|
listScoresByRunId({ runId, pagination, }: {
|
|
27
33
|
runId: string;
|
|
28
34
|
pagination: StoragePagination;
|
|
29
|
-
}): Promise<
|
|
30
|
-
pagination: PaginationInfo;
|
|
31
|
-
scores: ScoreRowData[];
|
|
32
|
-
}>;
|
|
35
|
+
}): Promise<ListScoresResponse>;
|
|
33
36
|
listScoresByEntityId({ entityId, entityType, pagination, }: {
|
|
34
37
|
pagination: StoragePagination;
|
|
35
38
|
entityId: string;
|
|
36
39
|
entityType: string;
|
|
37
|
-
}): Promise<
|
|
38
|
-
pagination: PaginationInfo;
|
|
39
|
-
scores: ScoreRowData[];
|
|
40
|
-
}>;
|
|
40
|
+
}): Promise<ListScoresResponse>;
|
|
41
41
|
listScoresBySpan({ traceId, spanId, pagination, }: {
|
|
42
42
|
traceId: string;
|
|
43
43
|
spanId: string;
|
|
44
44
|
pagination: StoragePagination;
|
|
45
|
-
}): Promise<
|
|
46
|
-
pagination: PaginationInfo;
|
|
47
|
-
scores: ScoreRowData[];
|
|
48
|
-
}>;
|
|
45
|
+
}): Promise<ListScoresResponse>;
|
|
49
46
|
}
|
|
50
47
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/storage/domains/scores/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/storage/domains/scores/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAE5G,OAAO,EAEL,aAAa,EAKd,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAE9D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAGlD,qBAAa,gBAAiB,SAAQ,aAAa;;IACjD,OAAO,CAAC,MAAM,CAAa;gBAEf,MAAM,EAAE,iBAAiB;IAO/B,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAUrB,mBAAmB,IAAI,OAAO,CAAC,IAAI,CAAC;IAIpC,SAAS,CAAC,KAAK,EAAE,gBAAgB,GAAG,OAAO,CAAC;QAAE,KAAK,EAAE,YAAY,CAAA;KAAE,CAAC;IAoEpE,YAAY,CAAC,EAAE,EAAE,EAAE,EAAE;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,YAAY,GAAG,IAAI,CAAC;IAwBxE;;;;;;OAMG;YACW,iBAAiB;IAUzB,oBAAoB,CAAC,EACzB,QAAQ,EACR,UAAU,EACV,QAAQ,EACR,UAAU,EACV,MAAM,GACP,EAAE;QACD,QAAQ,EAAE,MAAM,CAAC;QACjB,UAAU,EAAE,iBAAiB,CAAC;QAC9B,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,MAAM,CAAC,EAAE,aAAa,CAAC;KACxB,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAqEzB,iBAAiB,CAAC,EACtB,KAAK,EACL,UAAU,GACX,EAAE;QACD,KAAK,EAAE,MAAM,CAAC;QACd,UAAU,EAAE,iBAAiB,CAAC;KAC/B,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAiDzB,oBAAoB,CAAC,EACzB,QAAQ,EACR,UAAU,EACV,UAAU,GACX,EAAE;QACD,UAAU,EAAE,iBAAiB,CAAC;QAC9B,QAAQ,EAAE,MAAM,CAAC;QACjB,UAAU,EAAE,MAAM,CAAC;KACpB,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAoDzB,gBAAgB,CAAC,EACrB,OAAO,EACP,MAAM,EACN,UAAU,GACX,EAAE;QACD,OAAO,EAAE,MAAM,CAAC;QAChB,MAAM,EAAE,MAAM,CAAC;QACf,UAAU,EAAE,iBAAiB,CAAC;KAC/B,GAAG,OAAO,CAAC,kBAAkB,CAAC;CAgDhC"}
|
|
@@ -1,35 +1,33 @@
|
|
|
1
1
|
import type { Connection } from '@lancedb/lancedb';
|
|
2
|
-
import type { StorageListWorkflowRunsInput, WorkflowRuns } from '@mastra/core/storage';
|
|
2
|
+
import type { StorageListWorkflowRunsInput, WorkflowRuns, UpdateWorkflowStateOptions } from '@mastra/core/storage';
|
|
3
3
|
import { WorkflowsStorage } from '@mastra/core/storage';
|
|
4
4
|
import type { StepResult, WorkflowRunState } from '@mastra/core/workflows';
|
|
5
|
+
import type { LanceDomainConfig } from '../../db/index.js';
|
|
5
6
|
export declare class StoreWorkflowsLance extends WorkflowsStorage {
|
|
7
|
+
#private;
|
|
6
8
|
client: Connection;
|
|
7
|
-
constructor(
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
updateWorkflowResults({}: {
|
|
9
|
+
constructor(config: LanceDomainConfig);
|
|
10
|
+
init(): Promise<void>;
|
|
11
|
+
dangerouslyClearAll(): Promise<void>;
|
|
12
|
+
updateWorkflowResults({ workflowName, runId, stepId, result, requestContext, }: {
|
|
11
13
|
workflowName: string;
|
|
12
14
|
runId: string;
|
|
13
15
|
stepId: string;
|
|
14
16
|
result: StepResult<any, any, any, any>;
|
|
15
17
|
requestContext: Record<string, any>;
|
|
16
18
|
}): Promise<Record<string, StepResult<any, any, any, any>>>;
|
|
17
|
-
updateWorkflowState({}: {
|
|
19
|
+
updateWorkflowState({ workflowName, runId, opts, }: {
|
|
18
20
|
workflowName: string;
|
|
19
21
|
runId: string;
|
|
20
|
-
opts:
|
|
21
|
-
status: string;
|
|
22
|
-
result?: StepResult<any, any, any, any>;
|
|
23
|
-
error?: string;
|
|
24
|
-
suspendedPaths?: Record<string, number[]>;
|
|
25
|
-
waitingPaths?: Record<string, number[]>;
|
|
26
|
-
};
|
|
22
|
+
opts: UpdateWorkflowStateOptions;
|
|
27
23
|
}): Promise<WorkflowRunState | undefined>;
|
|
28
|
-
persistWorkflowSnapshot({ workflowName, runId, resourceId, snapshot, }: {
|
|
24
|
+
persistWorkflowSnapshot({ workflowName, runId, resourceId, snapshot, createdAt, updatedAt, }: {
|
|
29
25
|
workflowName: string;
|
|
30
26
|
runId: string;
|
|
31
27
|
resourceId?: string;
|
|
32
28
|
snapshot: WorkflowRunState;
|
|
29
|
+
createdAt?: Date;
|
|
30
|
+
updatedAt?: Date;
|
|
33
31
|
}): Promise<void>;
|
|
34
32
|
loadWorkflowSnapshot({ workflowName, runId, }: {
|
|
35
33
|
workflowName: string;
|
|
@@ -45,6 +43,10 @@ export declare class StoreWorkflowsLance extends WorkflowsStorage {
|
|
|
45
43
|
createdAt: Date;
|
|
46
44
|
updatedAt: Date;
|
|
47
45
|
} | null>;
|
|
46
|
+
deleteWorkflowRunById({ runId, workflowName }: {
|
|
47
|
+
runId: string;
|
|
48
|
+
workflowName: string;
|
|
49
|
+
}): Promise<void>;
|
|
48
50
|
listWorkflowRuns(args?: StorageListWorkflowRunsInput): Promise<WorkflowRuns>;
|
|
49
51
|
}
|
|
50
52
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/storage/domains/workflows/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAEnD,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/storage/domains/workflows/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAEnD,OAAO,KAAK,EAEV,4BAA4B,EAC5B,YAAY,EACZ,0BAA0B,EAC3B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAML,gBAAgB,EACjB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE3E,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AA8BlD,qBAAa,mBAAoB,SAAQ,gBAAgB;;IACvD,MAAM,EAAE,UAAU,CAAC;gBAEP,MAAM,EAAE,iBAAiB;IAO/B,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAWrB,mBAAmB,IAAI,OAAO,CAAC,IAAI,CAAC;IAIpC,qBAAqB,CAAC,EAC1B,YAAY,EACZ,KAAK,EACL,MAAM,EACN,MAAM,EACN,cAAc,GACf,EAAE;QACD,YAAY,EAAE,MAAM,CAAC;QACrB,KAAK,EAAE,MAAM,CAAC;QACd,MAAM,EAAE,MAAM,CAAC;QACf,MAAM,EAAE,UAAU,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;QACv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AY,EAAE,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,YAAY,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAkBtG,gBAAgB,CAAC,IAAI,CAAC,EAAE,4BAA4B,GAAG,OAAO,CAAC,YAAY,CAAC;CAmFnF"}
|
package/dist/storage/index.d.ts
CHANGED
|
@@ -1,10 +1,69 @@
|
|
|
1
|
-
import type { ConnectionOptions } from '@lancedb/lancedb';
|
|
2
|
-
import type { MastraMessageContentV2 } from '@mastra/core/agent';
|
|
3
|
-
import type { ScoreRowData, ScoringSource } from '@mastra/core/evals';
|
|
4
|
-
import type { MastraDBMessage, StorageThreadType } from '@mastra/core/memory';
|
|
1
|
+
import type { Connection, ConnectionOptions } from '@lancedb/lancedb';
|
|
5
2
|
import { MastraStorage } from '@mastra/core/storage';
|
|
6
|
-
import type {
|
|
7
|
-
import
|
|
3
|
+
import type { StorageDomains } from '@mastra/core/storage';
|
|
4
|
+
import { StoreMemoryLance } from './domains/memory/index.js';
|
|
5
|
+
import { StoreScoresLance } from './domains/scores/index.js';
|
|
6
|
+
import { StoreWorkflowsLance } from './domains/workflows/index.js';
|
|
7
|
+
export { StoreMemoryLance, StoreScoresLance, StoreWorkflowsLance };
|
|
8
|
+
export type { LanceDomainConfig } from './db/index.js';
|
|
9
|
+
export interface LanceStorageOptions {
|
|
10
|
+
/**
|
|
11
|
+
* When true, automatic initialization (table creation/migrations) is disabled.
|
|
12
|
+
* This is useful for CI/CD pipelines where you want to:
|
|
13
|
+
* 1. Run migrations explicitly during deployment (not at runtime)
|
|
14
|
+
* 2. Use different credentials for schema changes vs runtime operations
|
|
15
|
+
*
|
|
16
|
+
* When disableInit is true:
|
|
17
|
+
* - The storage will not automatically create/alter tables on first use
|
|
18
|
+
* - You must call `storage.init()` explicitly in your CI/CD scripts
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* // In CI/CD script:
|
|
22
|
+
* const storage = await LanceStorage.create('id', 'name', '/path/to/db', undefined, { disableInit: false });
|
|
23
|
+
* await storage.init(); // Explicitly run migrations
|
|
24
|
+
*
|
|
25
|
+
* // In runtime application:
|
|
26
|
+
* const storage = await LanceStorage.create('id', 'name', '/path/to/db', undefined, { disableInit: true });
|
|
27
|
+
* // No auto-init, tables must already exist
|
|
28
|
+
*/
|
|
29
|
+
disableInit?: boolean;
|
|
30
|
+
}
|
|
31
|
+
export interface LanceStorageClientOptions extends LanceStorageOptions {
|
|
32
|
+
/**
|
|
33
|
+
* Pre-configured LanceDB connection.
|
|
34
|
+
* Use this when you need to configure the connection before initialization.
|
|
35
|
+
*
|
|
36
|
+
* @example
|
|
37
|
+
* ```typescript
|
|
38
|
+
* import { connect } from '@lancedb/lancedb';
|
|
39
|
+
*
|
|
40
|
+
* const client = await connect('/path/to/db', {
|
|
41
|
+
* // Custom connection options
|
|
42
|
+
* });
|
|
43
|
+
*
|
|
44
|
+
* const store = await LanceStorage.fromClient('my-id', 'MyStorage', client);
|
|
45
|
+
* ```
|
|
46
|
+
*/
|
|
47
|
+
client: Connection;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* LanceDB storage adapter for Mastra.
|
|
51
|
+
*
|
|
52
|
+
* Access domain-specific storage via `getStore()`:
|
|
53
|
+
*
|
|
54
|
+
* @example
|
|
55
|
+
* ```typescript
|
|
56
|
+
* const storage = await LanceStorage.create('my-id', 'MyStorage', '/path/to/db');
|
|
57
|
+
*
|
|
58
|
+
* // Access memory domain
|
|
59
|
+
* const memory = await storage.getStore('memory');
|
|
60
|
+
* await memory?.saveThread({ thread });
|
|
61
|
+
*
|
|
62
|
+
* // Access workflows domain
|
|
63
|
+
* const workflows = await storage.getStore('workflows');
|
|
64
|
+
* await workflows?.persistWorkflowSnapshot({ workflowName, runId, snapshot });
|
|
65
|
+
* ```
|
|
66
|
+
*/
|
|
8
67
|
export declare class LanceStorage extends MastraStorage {
|
|
9
68
|
stores: StorageDomains;
|
|
10
69
|
private lanceClient;
|
|
@@ -13,7 +72,8 @@ export declare class LanceStorage extends MastraStorage {
|
|
|
13
72
|
* @param id The unique identifier for this storage instance
|
|
14
73
|
* @param name The name for this storage instance
|
|
15
74
|
* @param uri The URI to connect to LanceDB
|
|
16
|
-
* @param
|
|
75
|
+
* @param connectionOptions connection options for LanceDB
|
|
76
|
+
* @param storageOptions storage options including disableInit
|
|
17
77
|
*
|
|
18
78
|
* Usage:
|
|
19
79
|
*
|
|
@@ -31,181 +91,39 @@ export declare class LanceStorage extends MastraStorage {
|
|
|
31
91
|
* ```ts
|
|
32
92
|
* const store = await LanceStorage.create('my-storage-id', 'MyStorage', 's3://bucket/db', { storageOptions: { timeout: '60s' } });
|
|
33
93
|
* ```
|
|
94
|
+
*
|
|
95
|
+
* Disable auto-init for runtime (after CI/CD has run migrations)
|
|
96
|
+
* ```ts
|
|
97
|
+
* const store = await LanceStorage.create('my-storage-id', 'MyStorage', '/path/to/db', undefined, { disableInit: true });
|
|
98
|
+
* ```
|
|
34
99
|
*/
|
|
35
|
-
static create(id: string, name: string, uri: string,
|
|
36
|
-
/**
|
|
37
|
-
* @internal
|
|
38
|
-
* Private constructor to enforce using the create factory method
|
|
39
|
-
*/
|
|
40
|
-
private constructor();
|
|
41
|
-
createTable({ tableName, schema, }: {
|
|
42
|
-
tableName: TABLE_NAMES;
|
|
43
|
-
schema: Record<string, StorageColumn>;
|
|
44
|
-
}): Promise<void>;
|
|
45
|
-
dropTable({ tableName }: {
|
|
46
|
-
tableName: TABLE_NAMES;
|
|
47
|
-
}): Promise<void>;
|
|
48
|
-
alterTable({ tableName, schema, ifNotExists, }: {
|
|
49
|
-
tableName: TABLE_NAMES;
|
|
50
|
-
schema: Record<string, StorageColumn>;
|
|
51
|
-
ifNotExists: string[];
|
|
52
|
-
}): Promise<void>;
|
|
53
|
-
clearTable({ tableName }: {
|
|
54
|
-
tableName: TABLE_NAMES;
|
|
55
|
-
}): Promise<void>;
|
|
56
|
-
insert({ tableName, record }: {
|
|
57
|
-
tableName: TABLE_NAMES;
|
|
58
|
-
record: Record<string, any>;
|
|
59
|
-
}): Promise<void>;
|
|
60
|
-
batchInsert({ tableName, records }: {
|
|
61
|
-
tableName: TABLE_NAMES;
|
|
62
|
-
records: Record<string, any>[];
|
|
63
|
-
}): Promise<void>;
|
|
64
|
-
load({ tableName, keys }: {
|
|
65
|
-
tableName: TABLE_NAMES;
|
|
66
|
-
keys: Record<string, any>;
|
|
67
|
-
}): Promise<any>;
|
|
68
|
-
getThreadById({ threadId }: {
|
|
69
|
-
threadId: string;
|
|
70
|
-
}): Promise<StorageThreadType | null>;
|
|
100
|
+
static create(id: string, name: string, uri: string, connectionOptions?: ConnectionOptions, storageOptions?: LanceStorageOptions): Promise<LanceStorage>;
|
|
71
101
|
/**
|
|
72
|
-
*
|
|
73
|
-
*
|
|
74
|
-
*
|
|
102
|
+
* Creates a new instance of LanceStorage from a pre-configured LanceDB connection.
|
|
103
|
+
* Use this when you need to configure the connection before initialization.
|
|
104
|
+
*
|
|
105
|
+
* @param id The unique identifier for this storage instance
|
|
106
|
+
* @param name The name for this storage instance
|
|
107
|
+
* @param client Pre-configured LanceDB connection
|
|
108
|
+
* @param options Storage options including disableInit
|
|
109
|
+
*
|
|
110
|
+
* @example
|
|
111
|
+
* ```typescript
|
|
112
|
+
* import { connect } from '@lancedb/lancedb';
|
|
113
|
+
*
|
|
114
|
+
* const client = await connect('/path/to/db', {
|
|
115
|
+
* // Custom connection options
|
|
116
|
+
* });
|
|
117
|
+
*
|
|
118
|
+
* const store = LanceStorage.fromClient('my-id', 'MyStorage', client);
|
|
119
|
+
* ```
|
|
75
120
|
*/
|
|
76
|
-
|
|
77
|
-
thread: StorageThreadType;
|
|
78
|
-
}): Promise<StorageThreadType>;
|
|
79
|
-
updateThread({ id, title, metadata, }: {
|
|
80
|
-
id: string;
|
|
81
|
-
title: string;
|
|
82
|
-
metadata: Record<string, unknown>;
|
|
83
|
-
}): Promise<StorageThreadType>;
|
|
84
|
-
deleteThread({ threadId }: {
|
|
85
|
-
threadId: string;
|
|
86
|
-
}): Promise<void>;
|
|
87
|
-
get supports(): {
|
|
88
|
-
selectByIncludeResourceScope: boolean;
|
|
89
|
-
resourceWorkingMemory: boolean;
|
|
90
|
-
hasColumn: boolean;
|
|
91
|
-
createTable: boolean;
|
|
92
|
-
deleteMessages: boolean;
|
|
93
|
-
listScoresBySpan: boolean;
|
|
94
|
-
};
|
|
95
|
-
getResourceById({ resourceId }: {
|
|
96
|
-
resourceId: string;
|
|
97
|
-
}): Promise<StorageResourceType | null>;
|
|
98
|
-
saveResource({ resource }: {
|
|
99
|
-
resource: StorageResourceType;
|
|
100
|
-
}): Promise<StorageResourceType>;
|
|
101
|
-
updateResource({ resourceId, workingMemory, metadata, }: {
|
|
102
|
-
resourceId: string;
|
|
103
|
-
workingMemory?: string;
|
|
104
|
-
metadata?: Record<string, unknown>;
|
|
105
|
-
}): Promise<StorageResourceType>;
|
|
121
|
+
static fromClient(id: string, name: string, client: Connection, options?: LanceStorageOptions): LanceStorage;
|
|
106
122
|
/**
|
|
107
|
-
*
|
|
108
|
-
*
|
|
109
|
-
*
|
|
110
|
-
* @returns The processed array with context messages included
|
|
123
|
+
* @internal
|
|
124
|
+
* Private constructor to enforce using the create factory method.
|
|
125
|
+
* Note: stores is initialized in create() after the lanceClient is connected.
|
|
111
126
|
*/
|
|
112
|
-
private
|
|
113
|
-
listMessagesById({ messageIds }: {
|
|
114
|
-
messageIds: string[];
|
|
115
|
-
}): Promise<{
|
|
116
|
-
messages: MastraDBMessage[];
|
|
117
|
-
}>;
|
|
118
|
-
saveMessages(args: {
|
|
119
|
-
messages: MastraDBMessage[];
|
|
120
|
-
}): Promise<{
|
|
121
|
-
messages: MastraDBMessage[];
|
|
122
|
-
}>;
|
|
123
|
-
updateMessages(_args: {
|
|
124
|
-
messages: (Partial<Omit<MastraDBMessage, 'createdAt'>> & {
|
|
125
|
-
id: string;
|
|
126
|
-
content?: {
|
|
127
|
-
metadata?: MastraMessageContentV2['metadata'];
|
|
128
|
-
content?: MastraMessageContentV2['content'];
|
|
129
|
-
};
|
|
130
|
-
})[];
|
|
131
|
-
}): Promise<MastraDBMessage[]>;
|
|
132
|
-
listWorkflowRuns(args?: StorageListWorkflowRunsInput): Promise<WorkflowRuns>;
|
|
133
|
-
getWorkflowRunById(args: {
|
|
134
|
-
runId: string;
|
|
135
|
-
workflowName?: string;
|
|
136
|
-
}): Promise<{
|
|
137
|
-
workflowName: string;
|
|
138
|
-
runId: string;
|
|
139
|
-
snapshot: any;
|
|
140
|
-
createdAt: Date;
|
|
141
|
-
updatedAt: Date;
|
|
142
|
-
} | null>;
|
|
143
|
-
updateWorkflowResults({ workflowName, runId, stepId, result, requestContext, }: {
|
|
144
|
-
workflowName: string;
|
|
145
|
-
runId: string;
|
|
146
|
-
stepId: string;
|
|
147
|
-
result: StepResult<any, any, any, any>;
|
|
148
|
-
requestContext: Record<string, any>;
|
|
149
|
-
}): Promise<Record<string, StepResult<any, any, any, any>>>;
|
|
150
|
-
updateWorkflowState({ workflowName, runId, opts, }: {
|
|
151
|
-
workflowName: string;
|
|
152
|
-
runId: string;
|
|
153
|
-
opts: {
|
|
154
|
-
status: string;
|
|
155
|
-
result?: StepResult<any, any, any, any>;
|
|
156
|
-
error?: string;
|
|
157
|
-
suspendedPaths?: Record<string, number[]>;
|
|
158
|
-
waitingPaths?: Record<string, number[]>;
|
|
159
|
-
};
|
|
160
|
-
}): Promise<WorkflowRunState | undefined>;
|
|
161
|
-
persistWorkflowSnapshot({ workflowName, runId, resourceId, snapshot, }: {
|
|
162
|
-
workflowName: string;
|
|
163
|
-
runId: string;
|
|
164
|
-
resourceId?: string;
|
|
165
|
-
snapshot: WorkflowRunState;
|
|
166
|
-
}): Promise<void>;
|
|
167
|
-
loadWorkflowSnapshot({ workflowName, runId, }: {
|
|
168
|
-
workflowName: string;
|
|
169
|
-
runId: string;
|
|
170
|
-
}): Promise<WorkflowRunState | null>;
|
|
171
|
-
getScoreById({ id: _id }: {
|
|
172
|
-
id: string;
|
|
173
|
-
}): Promise<ScoreRowData | null>;
|
|
174
|
-
listScoresByScorerId({ scorerId, source, entityId, entityType, pagination, }: {
|
|
175
|
-
scorerId: string;
|
|
176
|
-
pagination: StoragePagination;
|
|
177
|
-
source?: ScoringSource;
|
|
178
|
-
entityId?: string;
|
|
179
|
-
entityType?: string;
|
|
180
|
-
}): Promise<{
|
|
181
|
-
pagination: PaginationInfo;
|
|
182
|
-
scores: ScoreRowData[];
|
|
183
|
-
}>;
|
|
184
|
-
saveScore(_score: ScoreRowData): Promise<{
|
|
185
|
-
score: ScoreRowData;
|
|
186
|
-
}>;
|
|
187
|
-
listScoresByRunId({ runId, pagination, }: {
|
|
188
|
-
runId: string;
|
|
189
|
-
pagination: StoragePagination;
|
|
190
|
-
}): Promise<{
|
|
191
|
-
pagination: PaginationInfo;
|
|
192
|
-
scores: ScoreRowData[];
|
|
193
|
-
}>;
|
|
194
|
-
listScoresByEntityId({ entityId, entityType, pagination, }: {
|
|
195
|
-
pagination: StoragePagination;
|
|
196
|
-
entityId: string;
|
|
197
|
-
entityType: string;
|
|
198
|
-
}): Promise<{
|
|
199
|
-
pagination: PaginationInfo;
|
|
200
|
-
scores: ScoreRowData[];
|
|
201
|
-
}>;
|
|
202
|
-
listScoresBySpan({ traceId, spanId, pagination, }: {
|
|
203
|
-
traceId: string;
|
|
204
|
-
spanId: string;
|
|
205
|
-
pagination: StoragePagination;
|
|
206
|
-
}): Promise<{
|
|
207
|
-
pagination: PaginationInfo;
|
|
208
|
-
scores: ScoreRowData[];
|
|
209
|
-
}>;
|
|
127
|
+
private constructor();
|
|
210
128
|
}
|
|
211
129
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/storage/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/storage/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R"}
|
package/dist/vector/filter.d.ts
CHANGED
|
@@ -29,12 +29,12 @@ export declare class LanceFilterTranslator extends BaseFilterTranslator<LanceVec
|
|
|
29
29
|
*/
|
|
30
30
|
protected getSupportedOperators(): {
|
|
31
31
|
custom: string[];
|
|
32
|
-
logical: import("@mastra/core/vector
|
|
33
|
-
basic: import("@mastra/core/vector
|
|
34
|
-
numeric: import("@mastra/core/vector
|
|
35
|
-
array: import("@mastra/core/vector
|
|
32
|
+
logical: import("@mastra/core/vector").LogicalOperator[];
|
|
33
|
+
basic: import("@mastra/core/vector").BasicOperator[];
|
|
34
|
+
numeric: import("@mastra/core/vector").NumericOperator[];
|
|
35
|
+
array: import("@mastra/core/vector").ArrayOperator[];
|
|
36
36
|
element: "$exists"[];
|
|
37
|
-
regex: import("@mastra/core/vector
|
|
37
|
+
regex: import("@mastra/core/vector").RegexOperator[];
|
|
38
38
|
};
|
|
39
39
|
}
|
|
40
40
|
export {};
|
package/dist/vector/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ConnectionOptions, CreateTableOptions, Table, TableLike } from '@lancedb/lancedb';
|
|
2
|
-
import type { CreateIndexParams, DeleteIndexParams, DeleteVectorParams, DescribeIndexParams, IndexStats, QueryResult, QueryVectorParams, UpdateVectorParams, UpsertVectorParams } from '@mastra/core/vector';
|
|
2
|
+
import type { CreateIndexParams, DeleteIndexParams, DeleteVectorParams, DescribeIndexParams, IndexStats, QueryResult, QueryVectorParams, UpdateVectorParams, UpsertVectorParams, DeleteVectorsParams } from '@mastra/core/vector';
|
|
3
3
|
import { MastraVector } from '@mastra/core/vector';
|
|
4
4
|
import type { LanceVectorFilter } from './filter.js';
|
|
5
5
|
import type { IndexConfig } from './types.js';
|
|
@@ -75,13 +75,14 @@ export declare class LanceVectorStore extends MastraVector<LanceVectorFilter> {
|
|
|
75
75
|
*/
|
|
76
76
|
deleteAllTables(): Promise<void>;
|
|
77
77
|
deleteTable(tableName: string): Promise<void>;
|
|
78
|
-
updateVector(
|
|
78
|
+
updateVector(params: UpdateVectorParams<LanceVectorFilter>): Promise<void>;
|
|
79
79
|
deleteVector({ indexName, id }: DeleteVectorParams): Promise<void>;
|
|
80
80
|
/**
|
|
81
81
|
* Converts a flattened object with keys using underscore notation back to a nested object.
|
|
82
82
|
* Example: { name: 'test', details_text: 'test' } → { name: 'test', details: { text: 'test' } }
|
|
83
83
|
*/
|
|
84
84
|
private unflattenObject;
|
|
85
|
+
deleteVectors({ indexName, filter, ids }: DeleteVectorsParams<LanceVectorFilter>): Promise<void>;
|
|
85
86
|
}
|
|
86
87
|
export {};
|
|
87
88
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/vector/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAc,iBAAiB,EAAE,kBAAkB,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/vector/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAc,iBAAiB,EAAE,kBAAkB,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAI5G,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;AAE7B,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAElD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAE3C,UAAU,sBAAuB,SAAQ,iBAAiB;IACxD,WAAW,CAAC,EAAE,gBAAgB,CAAC;IAC/B,SAAS,CAAC,EAAE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