mem0ai 2.1.17-beta.2 → 2.1.17
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/dist/oss/index.d.mts +113 -40
- package/dist/oss/index.d.ts +113 -40
- package/dist/oss/index.js +774 -273
- package/dist/oss/index.js.map +1 -1
- package/dist/oss/index.mjs +774 -273
- package/dist/oss/index.mjs.map +1 -1
- package/package.json +4 -3
package/dist/oss/index.d.mts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { QdrantClient } from '@qdrant/js-client-rest';
|
|
3
|
+
import { VectorStore as VectorStore$1 } from '@langchain/core/vectorstores';
|
|
3
4
|
|
|
4
5
|
interface MultiModalMessages {
|
|
5
6
|
type: "image_url";
|
|
@@ -13,13 +14,15 @@ interface Message {
|
|
|
13
14
|
}
|
|
14
15
|
interface EmbeddingConfig {
|
|
15
16
|
apiKey?: string;
|
|
16
|
-
model?: string;
|
|
17
|
+
model?: string | any;
|
|
17
18
|
url?: string;
|
|
18
19
|
modelProperties?: Record<string, any>;
|
|
19
20
|
}
|
|
20
21
|
interface VectorStoreConfig {
|
|
21
|
-
collectionName
|
|
22
|
+
collectionName?: string;
|
|
22
23
|
dimension?: number;
|
|
24
|
+
client?: any;
|
|
25
|
+
instance?: any;
|
|
23
26
|
[key: string]: any;
|
|
24
27
|
}
|
|
25
28
|
interface HistoryStoreConfig {
|
|
@@ -35,7 +38,7 @@ interface LLMConfig {
|
|
|
35
38
|
provider?: string;
|
|
36
39
|
config?: Record<string, any>;
|
|
37
40
|
apiKey?: string;
|
|
38
|
-
model?: string;
|
|
41
|
+
model?: string | any;
|
|
39
42
|
modelProperties?: Record<string, any>;
|
|
40
43
|
}
|
|
41
44
|
interface Neo4jConfig {
|
|
@@ -99,58 +102,63 @@ declare const MemoryConfigSchema: z.ZodObject<{
|
|
|
99
102
|
embedder: z.ZodObject<{
|
|
100
103
|
provider: z.ZodString;
|
|
101
104
|
config: z.ZodObject<{
|
|
102
|
-
apiKey: z.ZodString;
|
|
103
|
-
model: z.ZodOptional<z.ZodString>;
|
|
104
105
|
modelProperties: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
106
|
+
apiKey: z.ZodOptional<z.ZodString>;
|
|
107
|
+
model: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodAny]>>;
|
|
105
108
|
}, "strip", z.ZodTypeAny, {
|
|
106
|
-
apiKey: string;
|
|
107
|
-
model?: string | undefined;
|
|
108
109
|
modelProperties?: Record<string, any> | undefined;
|
|
110
|
+
apiKey?: string | undefined;
|
|
111
|
+
model?: any;
|
|
109
112
|
}, {
|
|
110
|
-
apiKey: string;
|
|
111
|
-
model?: string | undefined;
|
|
112
113
|
modelProperties?: Record<string, any> | undefined;
|
|
114
|
+
apiKey?: string | undefined;
|
|
115
|
+
model?: any;
|
|
113
116
|
}>;
|
|
114
117
|
}, "strip", z.ZodTypeAny, {
|
|
115
118
|
provider: string;
|
|
116
119
|
config: {
|
|
117
|
-
apiKey: string;
|
|
118
|
-
model?: string | undefined;
|
|
119
120
|
modelProperties?: Record<string, any> | undefined;
|
|
121
|
+
apiKey?: string | undefined;
|
|
122
|
+
model?: any;
|
|
120
123
|
};
|
|
121
124
|
}, {
|
|
122
125
|
provider: string;
|
|
123
126
|
config: {
|
|
124
|
-
apiKey: string;
|
|
125
|
-
model?: string | undefined;
|
|
126
127
|
modelProperties?: Record<string, any> | undefined;
|
|
128
|
+
apiKey?: string | undefined;
|
|
129
|
+
model?: any;
|
|
127
130
|
};
|
|
128
131
|
}>;
|
|
129
132
|
vectorStore: z.ZodObject<{
|
|
130
133
|
provider: z.ZodString;
|
|
131
134
|
config: z.ZodObject<{
|
|
132
|
-
collectionName: z.ZodString
|
|
135
|
+
collectionName: z.ZodOptional<z.ZodString>;
|
|
133
136
|
dimension: z.ZodOptional<z.ZodNumber>;
|
|
137
|
+
client: z.ZodOptional<z.ZodAny>;
|
|
134
138
|
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
135
|
-
collectionName: z.ZodString
|
|
139
|
+
collectionName: z.ZodOptional<z.ZodString>;
|
|
136
140
|
dimension: z.ZodOptional<z.ZodNumber>;
|
|
141
|
+
client: z.ZodOptional<z.ZodAny>;
|
|
137
142
|
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
138
|
-
collectionName: z.ZodString
|
|
143
|
+
collectionName: z.ZodOptional<z.ZodString>;
|
|
139
144
|
dimension: z.ZodOptional<z.ZodNumber>;
|
|
145
|
+
client: z.ZodOptional<z.ZodAny>;
|
|
140
146
|
}, z.ZodTypeAny, "passthrough">>;
|
|
141
147
|
}, "strip", z.ZodTypeAny, {
|
|
142
148
|
provider: string;
|
|
143
149
|
config: {
|
|
144
|
-
collectionName
|
|
150
|
+
collectionName?: string | undefined;
|
|
145
151
|
dimension?: number | undefined;
|
|
152
|
+
client?: any;
|
|
146
153
|
} & {
|
|
147
154
|
[k: string]: unknown;
|
|
148
155
|
};
|
|
149
156
|
}, {
|
|
150
157
|
provider: string;
|
|
151
158
|
config: {
|
|
152
|
-
collectionName
|
|
159
|
+
collectionName?: string | undefined;
|
|
153
160
|
dimension?: number | undefined;
|
|
161
|
+
client?: any;
|
|
154
162
|
} & {
|
|
155
163
|
[k: string]: unknown;
|
|
156
164
|
};
|
|
@@ -158,31 +166,31 @@ declare const MemoryConfigSchema: z.ZodObject<{
|
|
|
158
166
|
llm: z.ZodObject<{
|
|
159
167
|
provider: z.ZodString;
|
|
160
168
|
config: z.ZodObject<{
|
|
161
|
-
apiKey: z.ZodString
|
|
162
|
-
model: z.ZodOptional<z.ZodString
|
|
169
|
+
apiKey: z.ZodOptional<z.ZodString>;
|
|
170
|
+
model: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodAny]>>;
|
|
163
171
|
modelProperties: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
164
172
|
}, "strip", z.ZodTypeAny, {
|
|
165
|
-
apiKey: string;
|
|
166
|
-
model?: string | undefined;
|
|
167
173
|
modelProperties?: Record<string, any> | undefined;
|
|
174
|
+
apiKey?: string | undefined;
|
|
175
|
+
model?: any;
|
|
168
176
|
}, {
|
|
169
|
-
apiKey: string;
|
|
170
|
-
model?: string | undefined;
|
|
171
177
|
modelProperties?: Record<string, any> | undefined;
|
|
178
|
+
apiKey?: string | undefined;
|
|
179
|
+
model?: any;
|
|
172
180
|
}>;
|
|
173
181
|
}, "strip", z.ZodTypeAny, {
|
|
174
182
|
provider: string;
|
|
175
183
|
config: {
|
|
176
|
-
apiKey: string;
|
|
177
|
-
model?: string | undefined;
|
|
178
184
|
modelProperties?: Record<string, any> | undefined;
|
|
185
|
+
apiKey?: string | undefined;
|
|
186
|
+
model?: any;
|
|
179
187
|
};
|
|
180
188
|
}, {
|
|
181
189
|
provider: string;
|
|
182
190
|
config: {
|
|
183
|
-
apiKey: string;
|
|
184
|
-
model?: string | undefined;
|
|
185
191
|
modelProperties?: Record<string, any> | undefined;
|
|
192
|
+
apiKey?: string | undefined;
|
|
193
|
+
model?: any;
|
|
186
194
|
};
|
|
187
195
|
}>;
|
|
188
196
|
historyDbPath: z.ZodOptional<z.ZodString>;
|
|
@@ -254,16 +262,17 @@ declare const MemoryConfigSchema: z.ZodObject<{
|
|
|
254
262
|
embedder: {
|
|
255
263
|
provider: string;
|
|
256
264
|
config: {
|
|
257
|
-
apiKey: string;
|
|
258
|
-
model?: string | undefined;
|
|
259
265
|
modelProperties?: Record<string, any> | undefined;
|
|
266
|
+
apiKey?: string | undefined;
|
|
267
|
+
model?: any;
|
|
260
268
|
};
|
|
261
269
|
};
|
|
262
270
|
vectorStore: {
|
|
263
271
|
provider: string;
|
|
264
272
|
config: {
|
|
265
|
-
collectionName
|
|
273
|
+
collectionName?: string | undefined;
|
|
266
274
|
dimension?: number | undefined;
|
|
275
|
+
client?: any;
|
|
267
276
|
} & {
|
|
268
277
|
[k: string]: unknown;
|
|
269
278
|
};
|
|
@@ -271,9 +280,9 @@ declare const MemoryConfigSchema: z.ZodObject<{
|
|
|
271
280
|
llm: {
|
|
272
281
|
provider: string;
|
|
273
282
|
config: {
|
|
274
|
-
apiKey: string;
|
|
275
|
-
model?: string | undefined;
|
|
276
283
|
modelProperties?: Record<string, any> | undefined;
|
|
284
|
+
apiKey?: string | undefined;
|
|
285
|
+
model?: any;
|
|
277
286
|
};
|
|
278
287
|
};
|
|
279
288
|
version?: string | undefined;
|
|
@@ -302,16 +311,17 @@ declare const MemoryConfigSchema: z.ZodObject<{
|
|
|
302
311
|
embedder: {
|
|
303
312
|
provider: string;
|
|
304
313
|
config: {
|
|
305
|
-
apiKey: string;
|
|
306
|
-
model?: string | undefined;
|
|
307
314
|
modelProperties?: Record<string, any> | undefined;
|
|
315
|
+
apiKey?: string | undefined;
|
|
316
|
+
model?: any;
|
|
308
317
|
};
|
|
309
318
|
};
|
|
310
319
|
vectorStore: {
|
|
311
320
|
provider: string;
|
|
312
321
|
config: {
|
|
313
|
-
collectionName
|
|
322
|
+
collectionName?: string | undefined;
|
|
314
323
|
dimension?: number | undefined;
|
|
324
|
+
client?: any;
|
|
315
325
|
} & {
|
|
316
326
|
[k: string]: unknown;
|
|
317
327
|
};
|
|
@@ -319,9 +329,9 @@ declare const MemoryConfigSchema: z.ZodObject<{
|
|
|
319
329
|
llm: {
|
|
320
330
|
provider: string;
|
|
321
331
|
config: {
|
|
322
|
-
apiKey: string;
|
|
323
|
-
model?: string | undefined;
|
|
324
332
|
modelProperties?: Record<string, any> | undefined;
|
|
333
|
+
apiKey?: string | undefined;
|
|
334
|
+
model?: any;
|
|
325
335
|
};
|
|
326
336
|
};
|
|
327
337
|
version?: string | undefined;
|
|
@@ -445,6 +455,14 @@ declare class AzureOpenAIEmbedder implements Embedder {
|
|
|
445
455
|
embedBatch(texts: string[]): Promise<number[][]>;
|
|
446
456
|
}
|
|
447
457
|
|
|
458
|
+
declare class LangchainEmbedder implements Embedder {
|
|
459
|
+
private embedderInstance;
|
|
460
|
+
private batchSize?;
|
|
461
|
+
constructor(config: EmbeddingConfig);
|
|
462
|
+
embed(text: string): Promise<number[]>;
|
|
463
|
+
embedBatch(texts: string[]): Promise<number[][]>;
|
|
464
|
+
}
|
|
465
|
+
|
|
448
466
|
interface LLMResponse {
|
|
449
467
|
content: string;
|
|
450
468
|
role: string;
|
|
@@ -457,7 +475,7 @@ interface LLM {
|
|
|
457
475
|
generateResponse(messages: Array<{
|
|
458
476
|
role: string;
|
|
459
477
|
content: string;
|
|
460
|
-
}>, response_format
|
|
478
|
+
}>, response_format?: {
|
|
461
479
|
type: string;
|
|
462
480
|
}, tools?: any[]): Promise<any>;
|
|
463
481
|
generateChat(messages: Message[]): Promise<LLMResponse>;
|
|
@@ -536,6 +554,16 @@ declare class MistralLLM implements LLM {
|
|
|
536
554
|
generateChat(messages: Message[]): Promise<LLMResponse>;
|
|
537
555
|
}
|
|
538
556
|
|
|
557
|
+
declare class LangchainLLM implements LLM {
|
|
558
|
+
private llmInstance;
|
|
559
|
+
private modelName;
|
|
560
|
+
constructor(config: LLMConfig);
|
|
561
|
+
generateResponse(messages: Message[], response_format?: {
|
|
562
|
+
type: string;
|
|
563
|
+
}, tools?: any[]): Promise<string | LLMResponse>;
|
|
564
|
+
generateChat(messages: Message[]): Promise<LLMResponse>;
|
|
565
|
+
}
|
|
566
|
+
|
|
539
567
|
interface VectorStore {
|
|
540
568
|
insert(vectors: number[][], ids: string[], payloads: Record<string, any>[]): Promise<void>;
|
|
541
569
|
search(query: number[], limit?: number, filters?: SearchFilters): Promise<VectorStoreResult[]>;
|
|
@@ -630,6 +658,51 @@ declare class RedisDB implements VectorStore {
|
|
|
630
658
|
setUserId(userId: string): Promise<void>;
|
|
631
659
|
}
|
|
632
660
|
|
|
661
|
+
interface SupabaseConfig extends VectorStoreConfig {
|
|
662
|
+
supabaseUrl: string;
|
|
663
|
+
supabaseKey: string;
|
|
664
|
+
tableName: string;
|
|
665
|
+
embeddingColumnName?: string;
|
|
666
|
+
metadataColumnName?: string;
|
|
667
|
+
}
|
|
668
|
+
declare class SupabaseDB implements VectorStore {
|
|
669
|
+
private client;
|
|
670
|
+
private readonly tableName;
|
|
671
|
+
private readonly embeddingColumnName;
|
|
672
|
+
private readonly metadataColumnName;
|
|
673
|
+
constructor(config: SupabaseConfig);
|
|
674
|
+
initialize(): Promise<void>;
|
|
675
|
+
insert(vectors: number[][], ids: string[], payloads: Record<string, any>[]): Promise<void>;
|
|
676
|
+
search(query: number[], limit?: number, filters?: SearchFilters): Promise<VectorStoreResult[]>;
|
|
677
|
+
get(vectorId: string): Promise<VectorStoreResult | null>;
|
|
678
|
+
update(vectorId: string, vector: number[], payload: Record<string, any>): Promise<void>;
|
|
679
|
+
delete(vectorId: string): Promise<void>;
|
|
680
|
+
deleteCol(): Promise<void>;
|
|
681
|
+
list(filters?: SearchFilters, limit?: number): Promise<[VectorStoreResult[], number]>;
|
|
682
|
+
getUserId(): Promise<string>;
|
|
683
|
+
setUserId(userId: string): Promise<void>;
|
|
684
|
+
}
|
|
685
|
+
|
|
686
|
+
interface LangchainStoreConfig extends VectorStoreConfig {
|
|
687
|
+
client: VectorStore$1;
|
|
688
|
+
}
|
|
689
|
+
declare class LangchainVectorStore implements VectorStore {
|
|
690
|
+
private lcStore;
|
|
691
|
+
private dimension?;
|
|
692
|
+
private storeUserId;
|
|
693
|
+
constructor(config: LangchainStoreConfig);
|
|
694
|
+
insert(vectors: number[][], ids: string[], payloads: Record<string, any>[]): Promise<void>;
|
|
695
|
+
search(query: number[], limit?: number, filters?: SearchFilters): Promise<VectorStoreResult[]>;
|
|
696
|
+
get(vectorId: string): Promise<VectorStoreResult | null>;
|
|
697
|
+
update(vectorId: string, vector: number[], payload: Record<string, any>): Promise<void>;
|
|
698
|
+
delete(vectorId: string): Promise<void>;
|
|
699
|
+
list(filters?: SearchFilters, limit?: number): Promise<[VectorStoreResult[], number]>;
|
|
700
|
+
deleteCol(): Promise<void>;
|
|
701
|
+
getUserId(): Promise<string>;
|
|
702
|
+
setUserId(userId: string): Promise<void>;
|
|
703
|
+
initialize(): Promise<void>;
|
|
704
|
+
}
|
|
705
|
+
|
|
633
706
|
interface HistoryManager {
|
|
634
707
|
addHistory(memoryId: string, previousValue: string | null, newValue: string | null, action: string, createdAt?: string, updatedAt?: string, isDeleted?: number): Promise<void>;
|
|
635
708
|
getHistory(memoryId: string): Promise<any[]>;
|
|
@@ -650,4 +723,4 @@ declare class HistoryManagerFactory {
|
|
|
650
723
|
static create(provider: string, config: HistoryStoreConfig): HistoryManager;
|
|
651
724
|
}
|
|
652
725
|
|
|
653
|
-
export { type AddMemoryOptions, AnthropicLLM, AzureOpenAIEmbedder, type DeleteAllMemoryOptions, type Embedder, EmbedderFactory, type EmbeddingConfig, type Entity, type GetAllMemoryOptions, GoogleEmbedder, GoogleLLM, type GraphStoreConfig, GroqLLM, HistoryManagerFactory, type HistoryStoreConfig, type LLM, type LLMConfig, LLMFactory, type LLMResponse, Memory, type MemoryConfig, MemoryConfigSchema, type MemoryItem, MemoryVectorStore, type Message, MistralLLM, type MultiModalMessages, type Neo4jConfig, OllamaEmbedder, OllamaLLM, OpenAIEmbedder, OpenAILLM, OpenAIStructuredLLM, Qdrant, RedisDB, type SearchFilters, type SearchMemoryOptions, type SearchResult, type VectorStore, type VectorStoreConfig, VectorStoreFactory, type VectorStoreResult };
|
|
726
|
+
export { type AddMemoryOptions, AnthropicLLM, AzureOpenAIEmbedder, type DeleteAllMemoryOptions, type Embedder, EmbedderFactory, type EmbeddingConfig, type Entity, type GetAllMemoryOptions, GoogleEmbedder, GoogleLLM, type GraphStoreConfig, GroqLLM, HistoryManagerFactory, type HistoryStoreConfig, type LLM, type LLMConfig, LLMFactory, type LLMResponse, LangchainEmbedder, LangchainLLM, LangchainVectorStore, Memory, type MemoryConfig, MemoryConfigSchema, type MemoryItem, MemoryVectorStore, type Message, MistralLLM, type MultiModalMessages, type Neo4jConfig, OllamaEmbedder, OllamaLLM, OpenAIEmbedder, OpenAILLM, OpenAIStructuredLLM, Qdrant, RedisDB, type SearchFilters, type SearchMemoryOptions, type SearchResult, SupabaseDB, type VectorStore, type VectorStoreConfig, VectorStoreFactory, type VectorStoreResult };
|
package/dist/oss/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { QdrantClient } from '@qdrant/js-client-rest';
|
|
3
|
+
import { VectorStore as VectorStore$1 } from '@langchain/core/vectorstores';
|
|
3
4
|
|
|
4
5
|
interface MultiModalMessages {
|
|
5
6
|
type: "image_url";
|
|
@@ -13,13 +14,15 @@ interface Message {
|
|
|
13
14
|
}
|
|
14
15
|
interface EmbeddingConfig {
|
|
15
16
|
apiKey?: string;
|
|
16
|
-
model?: string;
|
|
17
|
+
model?: string | any;
|
|
17
18
|
url?: string;
|
|
18
19
|
modelProperties?: Record<string, any>;
|
|
19
20
|
}
|
|
20
21
|
interface VectorStoreConfig {
|
|
21
|
-
collectionName
|
|
22
|
+
collectionName?: string;
|
|
22
23
|
dimension?: number;
|
|
24
|
+
client?: any;
|
|
25
|
+
instance?: any;
|
|
23
26
|
[key: string]: any;
|
|
24
27
|
}
|
|
25
28
|
interface HistoryStoreConfig {
|
|
@@ -35,7 +38,7 @@ interface LLMConfig {
|
|
|
35
38
|
provider?: string;
|
|
36
39
|
config?: Record<string, any>;
|
|
37
40
|
apiKey?: string;
|
|
38
|
-
model?: string;
|
|
41
|
+
model?: string | any;
|
|
39
42
|
modelProperties?: Record<string, any>;
|
|
40
43
|
}
|
|
41
44
|
interface Neo4jConfig {
|
|
@@ -99,58 +102,63 @@ declare const MemoryConfigSchema: z.ZodObject<{
|
|
|
99
102
|
embedder: z.ZodObject<{
|
|
100
103
|
provider: z.ZodString;
|
|
101
104
|
config: z.ZodObject<{
|
|
102
|
-
apiKey: z.ZodString;
|
|
103
|
-
model: z.ZodOptional<z.ZodString>;
|
|
104
105
|
modelProperties: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
106
|
+
apiKey: z.ZodOptional<z.ZodString>;
|
|
107
|
+
model: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodAny]>>;
|
|
105
108
|
}, "strip", z.ZodTypeAny, {
|
|
106
|
-
apiKey: string;
|
|
107
|
-
model?: string | undefined;
|
|
108
109
|
modelProperties?: Record<string, any> | undefined;
|
|
110
|
+
apiKey?: string | undefined;
|
|
111
|
+
model?: any;
|
|
109
112
|
}, {
|
|
110
|
-
apiKey: string;
|
|
111
|
-
model?: string | undefined;
|
|
112
113
|
modelProperties?: Record<string, any> | undefined;
|
|
114
|
+
apiKey?: string | undefined;
|
|
115
|
+
model?: any;
|
|
113
116
|
}>;
|
|
114
117
|
}, "strip", z.ZodTypeAny, {
|
|
115
118
|
provider: string;
|
|
116
119
|
config: {
|
|
117
|
-
apiKey: string;
|
|
118
|
-
model?: string | undefined;
|
|
119
120
|
modelProperties?: Record<string, any> | undefined;
|
|
121
|
+
apiKey?: string | undefined;
|
|
122
|
+
model?: any;
|
|
120
123
|
};
|
|
121
124
|
}, {
|
|
122
125
|
provider: string;
|
|
123
126
|
config: {
|
|
124
|
-
apiKey: string;
|
|
125
|
-
model?: string | undefined;
|
|
126
127
|
modelProperties?: Record<string, any> | undefined;
|
|
128
|
+
apiKey?: string | undefined;
|
|
129
|
+
model?: any;
|
|
127
130
|
};
|
|
128
131
|
}>;
|
|
129
132
|
vectorStore: z.ZodObject<{
|
|
130
133
|
provider: z.ZodString;
|
|
131
134
|
config: z.ZodObject<{
|
|
132
|
-
collectionName: z.ZodString
|
|
135
|
+
collectionName: z.ZodOptional<z.ZodString>;
|
|
133
136
|
dimension: z.ZodOptional<z.ZodNumber>;
|
|
137
|
+
client: z.ZodOptional<z.ZodAny>;
|
|
134
138
|
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
135
|
-
collectionName: z.ZodString
|
|
139
|
+
collectionName: z.ZodOptional<z.ZodString>;
|
|
136
140
|
dimension: z.ZodOptional<z.ZodNumber>;
|
|
141
|
+
client: z.ZodOptional<z.ZodAny>;
|
|
137
142
|
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
138
|
-
collectionName: z.ZodString
|
|
143
|
+
collectionName: z.ZodOptional<z.ZodString>;
|
|
139
144
|
dimension: z.ZodOptional<z.ZodNumber>;
|
|
145
|
+
client: z.ZodOptional<z.ZodAny>;
|
|
140
146
|
}, z.ZodTypeAny, "passthrough">>;
|
|
141
147
|
}, "strip", z.ZodTypeAny, {
|
|
142
148
|
provider: string;
|
|
143
149
|
config: {
|
|
144
|
-
collectionName
|
|
150
|
+
collectionName?: string | undefined;
|
|
145
151
|
dimension?: number | undefined;
|
|
152
|
+
client?: any;
|
|
146
153
|
} & {
|
|
147
154
|
[k: string]: unknown;
|
|
148
155
|
};
|
|
149
156
|
}, {
|
|
150
157
|
provider: string;
|
|
151
158
|
config: {
|
|
152
|
-
collectionName
|
|
159
|
+
collectionName?: string | undefined;
|
|
153
160
|
dimension?: number | undefined;
|
|
161
|
+
client?: any;
|
|
154
162
|
} & {
|
|
155
163
|
[k: string]: unknown;
|
|
156
164
|
};
|
|
@@ -158,31 +166,31 @@ declare const MemoryConfigSchema: z.ZodObject<{
|
|
|
158
166
|
llm: z.ZodObject<{
|
|
159
167
|
provider: z.ZodString;
|
|
160
168
|
config: z.ZodObject<{
|
|
161
|
-
apiKey: z.ZodString
|
|
162
|
-
model: z.ZodOptional<z.ZodString
|
|
169
|
+
apiKey: z.ZodOptional<z.ZodString>;
|
|
170
|
+
model: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodAny]>>;
|
|
163
171
|
modelProperties: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
164
172
|
}, "strip", z.ZodTypeAny, {
|
|
165
|
-
apiKey: string;
|
|
166
|
-
model?: string | undefined;
|
|
167
173
|
modelProperties?: Record<string, any> | undefined;
|
|
174
|
+
apiKey?: string | undefined;
|
|
175
|
+
model?: any;
|
|
168
176
|
}, {
|
|
169
|
-
apiKey: string;
|
|
170
|
-
model?: string | undefined;
|
|
171
177
|
modelProperties?: Record<string, any> | undefined;
|
|
178
|
+
apiKey?: string | undefined;
|
|
179
|
+
model?: any;
|
|
172
180
|
}>;
|
|
173
181
|
}, "strip", z.ZodTypeAny, {
|
|
174
182
|
provider: string;
|
|
175
183
|
config: {
|
|
176
|
-
apiKey: string;
|
|
177
|
-
model?: string | undefined;
|
|
178
184
|
modelProperties?: Record<string, any> | undefined;
|
|
185
|
+
apiKey?: string | undefined;
|
|
186
|
+
model?: any;
|
|
179
187
|
};
|
|
180
188
|
}, {
|
|
181
189
|
provider: string;
|
|
182
190
|
config: {
|
|
183
|
-
apiKey: string;
|
|
184
|
-
model?: string | undefined;
|
|
185
191
|
modelProperties?: Record<string, any> | undefined;
|
|
192
|
+
apiKey?: string | undefined;
|
|
193
|
+
model?: any;
|
|
186
194
|
};
|
|
187
195
|
}>;
|
|
188
196
|
historyDbPath: z.ZodOptional<z.ZodString>;
|
|
@@ -254,16 +262,17 @@ declare const MemoryConfigSchema: z.ZodObject<{
|
|
|
254
262
|
embedder: {
|
|
255
263
|
provider: string;
|
|
256
264
|
config: {
|
|
257
|
-
apiKey: string;
|
|
258
|
-
model?: string | undefined;
|
|
259
265
|
modelProperties?: Record<string, any> | undefined;
|
|
266
|
+
apiKey?: string | undefined;
|
|
267
|
+
model?: any;
|
|
260
268
|
};
|
|
261
269
|
};
|
|
262
270
|
vectorStore: {
|
|
263
271
|
provider: string;
|
|
264
272
|
config: {
|
|
265
|
-
collectionName
|
|
273
|
+
collectionName?: string | undefined;
|
|
266
274
|
dimension?: number | undefined;
|
|
275
|
+
client?: any;
|
|
267
276
|
} & {
|
|
268
277
|
[k: string]: unknown;
|
|
269
278
|
};
|
|
@@ -271,9 +280,9 @@ declare const MemoryConfigSchema: z.ZodObject<{
|
|
|
271
280
|
llm: {
|
|
272
281
|
provider: string;
|
|
273
282
|
config: {
|
|
274
|
-
apiKey: string;
|
|
275
|
-
model?: string | undefined;
|
|
276
283
|
modelProperties?: Record<string, any> | undefined;
|
|
284
|
+
apiKey?: string | undefined;
|
|
285
|
+
model?: any;
|
|
277
286
|
};
|
|
278
287
|
};
|
|
279
288
|
version?: string | undefined;
|
|
@@ -302,16 +311,17 @@ declare const MemoryConfigSchema: z.ZodObject<{
|
|
|
302
311
|
embedder: {
|
|
303
312
|
provider: string;
|
|
304
313
|
config: {
|
|
305
|
-
apiKey: string;
|
|
306
|
-
model?: string | undefined;
|
|
307
314
|
modelProperties?: Record<string, any> | undefined;
|
|
315
|
+
apiKey?: string | undefined;
|
|
316
|
+
model?: any;
|
|
308
317
|
};
|
|
309
318
|
};
|
|
310
319
|
vectorStore: {
|
|
311
320
|
provider: string;
|
|
312
321
|
config: {
|
|
313
|
-
collectionName
|
|
322
|
+
collectionName?: string | undefined;
|
|
314
323
|
dimension?: number | undefined;
|
|
324
|
+
client?: any;
|
|
315
325
|
} & {
|
|
316
326
|
[k: string]: unknown;
|
|
317
327
|
};
|
|
@@ -319,9 +329,9 @@ declare const MemoryConfigSchema: z.ZodObject<{
|
|
|
319
329
|
llm: {
|
|
320
330
|
provider: string;
|
|
321
331
|
config: {
|
|
322
|
-
apiKey: string;
|
|
323
|
-
model?: string | undefined;
|
|
324
332
|
modelProperties?: Record<string, any> | undefined;
|
|
333
|
+
apiKey?: string | undefined;
|
|
334
|
+
model?: any;
|
|
325
335
|
};
|
|
326
336
|
};
|
|
327
337
|
version?: string | undefined;
|
|
@@ -445,6 +455,14 @@ declare class AzureOpenAIEmbedder implements Embedder {
|
|
|
445
455
|
embedBatch(texts: string[]): Promise<number[][]>;
|
|
446
456
|
}
|
|
447
457
|
|
|
458
|
+
declare class LangchainEmbedder implements Embedder {
|
|
459
|
+
private embedderInstance;
|
|
460
|
+
private batchSize?;
|
|
461
|
+
constructor(config: EmbeddingConfig);
|
|
462
|
+
embed(text: string): Promise<number[]>;
|
|
463
|
+
embedBatch(texts: string[]): Promise<number[][]>;
|
|
464
|
+
}
|
|
465
|
+
|
|
448
466
|
interface LLMResponse {
|
|
449
467
|
content: string;
|
|
450
468
|
role: string;
|
|
@@ -457,7 +475,7 @@ interface LLM {
|
|
|
457
475
|
generateResponse(messages: Array<{
|
|
458
476
|
role: string;
|
|
459
477
|
content: string;
|
|
460
|
-
}>, response_format
|
|
478
|
+
}>, response_format?: {
|
|
461
479
|
type: string;
|
|
462
480
|
}, tools?: any[]): Promise<any>;
|
|
463
481
|
generateChat(messages: Message[]): Promise<LLMResponse>;
|
|
@@ -536,6 +554,16 @@ declare class MistralLLM implements LLM {
|
|
|
536
554
|
generateChat(messages: Message[]): Promise<LLMResponse>;
|
|
537
555
|
}
|
|
538
556
|
|
|
557
|
+
declare class LangchainLLM implements LLM {
|
|
558
|
+
private llmInstance;
|
|
559
|
+
private modelName;
|
|
560
|
+
constructor(config: LLMConfig);
|
|
561
|
+
generateResponse(messages: Message[], response_format?: {
|
|
562
|
+
type: string;
|
|
563
|
+
}, tools?: any[]): Promise<string | LLMResponse>;
|
|
564
|
+
generateChat(messages: Message[]): Promise<LLMResponse>;
|
|
565
|
+
}
|
|
566
|
+
|
|
539
567
|
interface VectorStore {
|
|
540
568
|
insert(vectors: number[][], ids: string[], payloads: Record<string, any>[]): Promise<void>;
|
|
541
569
|
search(query: number[], limit?: number, filters?: SearchFilters): Promise<VectorStoreResult[]>;
|
|
@@ -630,6 +658,51 @@ declare class RedisDB implements VectorStore {
|
|
|
630
658
|
setUserId(userId: string): Promise<void>;
|
|
631
659
|
}
|
|
632
660
|
|
|
661
|
+
interface SupabaseConfig extends VectorStoreConfig {
|
|
662
|
+
supabaseUrl: string;
|
|
663
|
+
supabaseKey: string;
|
|
664
|
+
tableName: string;
|
|
665
|
+
embeddingColumnName?: string;
|
|
666
|
+
metadataColumnName?: string;
|
|
667
|
+
}
|
|
668
|
+
declare class SupabaseDB implements VectorStore {
|
|
669
|
+
private client;
|
|
670
|
+
private readonly tableName;
|
|
671
|
+
private readonly embeddingColumnName;
|
|
672
|
+
private readonly metadataColumnName;
|
|
673
|
+
constructor(config: SupabaseConfig);
|
|
674
|
+
initialize(): Promise<void>;
|
|
675
|
+
insert(vectors: number[][], ids: string[], payloads: Record<string, any>[]): Promise<void>;
|
|
676
|
+
search(query: number[], limit?: number, filters?: SearchFilters): Promise<VectorStoreResult[]>;
|
|
677
|
+
get(vectorId: string): Promise<VectorStoreResult | null>;
|
|
678
|
+
update(vectorId: string, vector: number[], payload: Record<string, any>): Promise<void>;
|
|
679
|
+
delete(vectorId: string): Promise<void>;
|
|
680
|
+
deleteCol(): Promise<void>;
|
|
681
|
+
list(filters?: SearchFilters, limit?: number): Promise<[VectorStoreResult[], number]>;
|
|
682
|
+
getUserId(): Promise<string>;
|
|
683
|
+
setUserId(userId: string): Promise<void>;
|
|
684
|
+
}
|
|
685
|
+
|
|
686
|
+
interface LangchainStoreConfig extends VectorStoreConfig {
|
|
687
|
+
client: VectorStore$1;
|
|
688
|
+
}
|
|
689
|
+
declare class LangchainVectorStore implements VectorStore {
|
|
690
|
+
private lcStore;
|
|
691
|
+
private dimension?;
|
|
692
|
+
private storeUserId;
|
|
693
|
+
constructor(config: LangchainStoreConfig);
|
|
694
|
+
insert(vectors: number[][], ids: string[], payloads: Record<string, any>[]): Promise<void>;
|
|
695
|
+
search(query: number[], limit?: number, filters?: SearchFilters): Promise<VectorStoreResult[]>;
|
|
696
|
+
get(vectorId: string): Promise<VectorStoreResult | null>;
|
|
697
|
+
update(vectorId: string, vector: number[], payload: Record<string, any>): Promise<void>;
|
|
698
|
+
delete(vectorId: string): Promise<void>;
|
|
699
|
+
list(filters?: SearchFilters, limit?: number): Promise<[VectorStoreResult[], number]>;
|
|
700
|
+
deleteCol(): Promise<void>;
|
|
701
|
+
getUserId(): Promise<string>;
|
|
702
|
+
setUserId(userId: string): Promise<void>;
|
|
703
|
+
initialize(): Promise<void>;
|
|
704
|
+
}
|
|
705
|
+
|
|
633
706
|
interface HistoryManager {
|
|
634
707
|
addHistory(memoryId: string, previousValue: string | null, newValue: string | null, action: string, createdAt?: string, updatedAt?: string, isDeleted?: number): Promise<void>;
|
|
635
708
|
getHistory(memoryId: string): Promise<any[]>;
|
|
@@ -650,4 +723,4 @@ declare class HistoryManagerFactory {
|
|
|
650
723
|
static create(provider: string, config: HistoryStoreConfig): HistoryManager;
|
|
651
724
|
}
|
|
652
725
|
|
|
653
|
-
export { type AddMemoryOptions, AnthropicLLM, AzureOpenAIEmbedder, type DeleteAllMemoryOptions, type Embedder, EmbedderFactory, type EmbeddingConfig, type Entity, type GetAllMemoryOptions, GoogleEmbedder, GoogleLLM, type GraphStoreConfig, GroqLLM, HistoryManagerFactory, type HistoryStoreConfig, type LLM, type LLMConfig, LLMFactory, type LLMResponse, Memory, type MemoryConfig, MemoryConfigSchema, type MemoryItem, MemoryVectorStore, type Message, MistralLLM, type MultiModalMessages, type Neo4jConfig, OllamaEmbedder, OllamaLLM, OpenAIEmbedder, OpenAILLM, OpenAIStructuredLLM, Qdrant, RedisDB, type SearchFilters, type SearchMemoryOptions, type SearchResult, type VectorStore, type VectorStoreConfig, VectorStoreFactory, type VectorStoreResult };
|
|
726
|
+
export { type AddMemoryOptions, AnthropicLLM, AzureOpenAIEmbedder, type DeleteAllMemoryOptions, type Embedder, EmbedderFactory, type EmbeddingConfig, type Entity, type GetAllMemoryOptions, GoogleEmbedder, GoogleLLM, type GraphStoreConfig, GroqLLM, HistoryManagerFactory, type HistoryStoreConfig, type LLM, type LLMConfig, LLMFactory, type LLMResponse, LangchainEmbedder, LangchainLLM, LangchainVectorStore, Memory, type MemoryConfig, MemoryConfigSchema, type MemoryItem, MemoryVectorStore, type Message, MistralLLM, type MultiModalMessages, type Neo4jConfig, OllamaEmbedder, OllamaLLM, OpenAIEmbedder, OpenAILLM, OpenAIStructuredLLM, Qdrant, RedisDB, type SearchFilters, type SearchMemoryOptions, type SearchResult, SupabaseDB, type VectorStore, type VectorStoreConfig, VectorStoreFactory, type VectorStoreResult };
|