memories-lite 0.9.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.
Files changed (101) hide show
  1. package/MEMORIES.md +39 -0
  2. package/README.md +221 -0
  3. package/TECHNICAL.md +135 -0
  4. package/dist/config/defaults.d.ts +2 -0
  5. package/dist/config/defaults.js +61 -0
  6. package/dist/config/manager.d.ts +4 -0
  7. package/dist/config/manager.js +121 -0
  8. package/dist/embeddings/base.d.ts +4 -0
  9. package/dist/embeddings/base.js +2 -0
  10. package/dist/embeddings/google.d.ts +10 -0
  11. package/dist/embeddings/google.js +28 -0
  12. package/dist/embeddings/openai.d.ts +10 -0
  13. package/dist/embeddings/openai.js +31 -0
  14. package/dist/graphs/configs.d.ts +14 -0
  15. package/dist/graphs/configs.js +19 -0
  16. package/dist/graphs/tools.d.ts +271 -0
  17. package/dist/graphs/tools.js +220 -0
  18. package/dist/graphs/utils.d.ts +9 -0
  19. package/dist/graphs/utils.js +105 -0
  20. package/dist/index.d.ts +14 -0
  21. package/dist/index.js +30 -0
  22. package/dist/llms/base.d.ts +16 -0
  23. package/dist/llms/base.js +2 -0
  24. package/dist/llms/google.d.ts +11 -0
  25. package/dist/llms/google.js +44 -0
  26. package/dist/llms/openai.d.ts +9 -0
  27. package/dist/llms/openai.js +73 -0
  28. package/dist/llms/openai_structured.d.ts +11 -0
  29. package/dist/llms/openai_structured.js +72 -0
  30. package/dist/memory/index.d.ts +42 -0
  31. package/dist/memory/index.js +499 -0
  32. package/dist/memory/memory.types.d.ts +23 -0
  33. package/dist/memory/memory.types.js +2 -0
  34. package/dist/prompts/index.d.ts +102 -0
  35. package/dist/prompts/index.js +233 -0
  36. package/dist/storage/DummyHistoryManager.d.ts +7 -0
  37. package/dist/storage/DummyHistoryManager.js +19 -0
  38. package/dist/storage/MemoryHistoryManager.d.ts +8 -0
  39. package/dist/storage/MemoryHistoryManager.js +36 -0
  40. package/dist/storage/base.d.ts +6 -0
  41. package/dist/storage/base.js +2 -0
  42. package/dist/storage/index.d.ts +3 -0
  43. package/dist/storage/index.js +19 -0
  44. package/dist/types/index.d.ts +1071 -0
  45. package/dist/types/index.js +100 -0
  46. package/dist/utils/bm25.d.ts +13 -0
  47. package/dist/utils/bm25.js +51 -0
  48. package/dist/utils/factory.d.ts +13 -0
  49. package/dist/utils/factory.js +49 -0
  50. package/dist/utils/logger.d.ts +7 -0
  51. package/dist/utils/logger.js +9 -0
  52. package/dist/utils/memory.d.ts +3 -0
  53. package/dist/utils/memory.js +44 -0
  54. package/dist/utils/telemetry.d.ts +11 -0
  55. package/dist/utils/telemetry.js +74 -0
  56. package/dist/utils/telemetry.types.d.ts +27 -0
  57. package/dist/utils/telemetry.types.js +2 -0
  58. package/dist/vectorstores/base.d.ts +11 -0
  59. package/dist/vectorstores/base.js +2 -0
  60. package/dist/vectorstores/lite.d.ts +40 -0
  61. package/dist/vectorstores/lite.js +319 -0
  62. package/dist/vectorstores/llm.d.ts +31 -0
  63. package/dist/vectorstores/llm.js +88 -0
  64. package/jest.config.js +22 -0
  65. package/memories-lite.db +0 -0
  66. package/package.json +38 -0
  67. package/src/config/defaults.ts +61 -0
  68. package/src/config/manager.ts +132 -0
  69. package/src/embeddings/base.ts +4 -0
  70. package/src/embeddings/google.ts +32 -0
  71. package/src/embeddings/openai.ts +33 -0
  72. package/src/graphs/configs.ts +30 -0
  73. package/src/graphs/tools.ts +267 -0
  74. package/src/graphs/utils.ts +114 -0
  75. package/src/index.ts +14 -0
  76. package/src/llms/base.ts +20 -0
  77. package/src/llms/google.ts +56 -0
  78. package/src/llms/openai.ts +85 -0
  79. package/src/llms/openai_structured.ts +82 -0
  80. package/src/memory/index.ts +723 -0
  81. package/src/memory/memory.types.ts +27 -0
  82. package/src/prompts/index.ts +268 -0
  83. package/src/storage/DummyHistoryManager.ts +27 -0
  84. package/src/storage/MemoryHistoryManager.ts +58 -0
  85. package/src/storage/base.ts +14 -0
  86. package/src/storage/index.ts +3 -0
  87. package/src/types/index.ts +243 -0
  88. package/src/utils/bm25.ts +64 -0
  89. package/src/utils/factory.ts +59 -0
  90. package/src/utils/logger.ts +13 -0
  91. package/src/utils/memory.ts +48 -0
  92. package/src/utils/telemetry.ts +98 -0
  93. package/src/utils/telemetry.types.ts +34 -0
  94. package/src/vectorstores/base.ts +27 -0
  95. package/src/vectorstores/lite.ts +402 -0
  96. package/src/vectorstores/llm.ts +126 -0
  97. package/tests/lite.spec.ts +158 -0
  98. package/tests/memory.facts.test.ts +211 -0
  99. package/tests/memory.test.ts +406 -0
  100. package/tsconfig.json +16 -0
  101. package/tsconfig.tsbuildinfo +1 -0
@@ -0,0 +1,100 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MemoryConfigSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ exports.MemoryConfigSchema = zod_1.z.object({
6
+ version: zod_1.z.string().optional(),
7
+ embedder: zod_1.z.object({
8
+ provider: zod_1.z.string(),
9
+ config: zod_1.z.object({
10
+ dimension: zod_1.z.number().optional(),
11
+ modelProperties: zod_1.z.record(zod_1.z.string(), zod_1.z.any()).optional(),
12
+ apiKey: zod_1.z.string().optional(),
13
+ model: zod_1.z.union([zod_1.z.string(), zod_1.z.any()]).optional(),
14
+ }),
15
+ }),
16
+ vectorStore: zod_1.z.object({
17
+ provider: zod_1.z.string(),
18
+ config: zod_1.z
19
+ .object({
20
+ collectionName: zod_1.z.string().optional(),
21
+ dimension: zod_1.z.number().optional(),
22
+ client: zod_1.z.any().optional(),
23
+ scoring: zod_1.z.object({
24
+ procedural: zod_1.z.object({
25
+ alpha: zod_1.z.number(),
26
+ beta: zod_1.z.number(),
27
+ gamma: zod_1.z.number(),
28
+ halfLifeDays: zod_1.z.number(),
29
+ }),
30
+ episodic: zod_1.z.object({
31
+ alpha: zod_1.z.number(),
32
+ beta: zod_1.z.number(),
33
+ gamma: zod_1.z.number(),
34
+ halfLifeDays: zod_1.z.number(),
35
+ }),
36
+ factual: zod_1.z.object({
37
+ alpha: zod_1.z.number(),
38
+ beta: zod_1.z.number(),
39
+ gamma: zod_1.z.number(),
40
+ halfLifeDays: zod_1.z.number(),
41
+ }),
42
+ semantic: zod_1.z.object({
43
+ alpha: zod_1.z.number(),
44
+ beta: zod_1.z.number(),
45
+ gamma: zod_1.z.number(),
46
+ halfLifeDays: zod_1.z.number(),
47
+ }),
48
+ assistant_preference: zod_1.z.object({
49
+ alpha: zod_1.z.number(),
50
+ beta: zod_1.z.number(),
51
+ gamma: zod_1.z.number(),
52
+ halfLifeDays: zod_1.z.number(),
53
+ }),
54
+ default: zod_1.z.object({
55
+ alpha: zod_1.z.number(),
56
+ beta: zod_1.z.number(),
57
+ gamma: zod_1.z.number(),
58
+ halfLifeDays: zod_1.z.number(),
59
+ }),
60
+ }).optional(),
61
+ recencyCleanupThreshold: zod_1.z.number().min(0).max(1).optional(),
62
+ })
63
+ .passthrough(),
64
+ }),
65
+ llm: zod_1.z.object({
66
+ provider: zod_1.z.string(),
67
+ config: zod_1.z.object({
68
+ apiKey: zod_1.z.string().optional(),
69
+ model: zod_1.z.union([zod_1.z.string(), zod_1.z.any()]).optional(),
70
+ modelProperties: zod_1.z.record(zod_1.z.string(), zod_1.z.any()).optional(),
71
+ }),
72
+ }),
73
+ historyDbPath: zod_1.z.string().optional(),
74
+ customPrompt: zod_1.z.string().optional(),
75
+ enableGraph: zod_1.z.boolean().optional(),
76
+ graphStore: zod_1.z
77
+ .object({
78
+ provider: zod_1.z.string(),
79
+ config: zod_1.z.object({
80
+ url: zod_1.z.string(),
81
+ username: zod_1.z.string(),
82
+ password: zod_1.z.string(),
83
+ }),
84
+ llm: zod_1.z
85
+ .object({
86
+ provider: zod_1.z.string(),
87
+ config: zod_1.z.record(zod_1.z.string(), zod_1.z.any()),
88
+ })
89
+ .optional(),
90
+ customPrompt: zod_1.z.string().optional(),
91
+ })
92
+ .optional(),
93
+ historyStore: zod_1.z
94
+ .object({
95
+ provider: zod_1.z.string(),
96
+ config: zod_1.z.record(zod_1.z.string(), zod_1.z.any()),
97
+ })
98
+ .optional(),
99
+ disableHistory: zod_1.z.boolean().optional(),
100
+ });
@@ -0,0 +1,13 @@
1
+ export declare class BM25 {
2
+ private documents;
3
+ private k1;
4
+ private b;
5
+ private avgDocLength;
6
+ private docFreq;
7
+ private docLengths;
8
+ private idf;
9
+ constructor(documents: string[][], k1?: number, b?: number);
10
+ private computeIdf;
11
+ private score;
12
+ search(query: string[]): string[][];
13
+ }
@@ -0,0 +1,51 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BM25 = void 0;
4
+ class BM25 {
5
+ constructor(documents, k1 = 1.5, b = 0.75) {
6
+ this.documents = documents;
7
+ this.k1 = k1;
8
+ this.b = b;
9
+ this.docLengths = documents.map((doc) => doc.length);
10
+ this.avgDocLength =
11
+ this.docLengths.reduce((a, b) => a + b, 0) / documents.length;
12
+ this.docFreq = new Map();
13
+ this.idf = new Map();
14
+ this.computeIdf();
15
+ }
16
+ computeIdf() {
17
+ const N = this.documents.length;
18
+ // Count document frequency for each term
19
+ for (const doc of this.documents) {
20
+ const terms = new Set(doc);
21
+ for (const term of terms) {
22
+ this.docFreq.set(term, (this.docFreq.get(term) || 0) + 1);
23
+ }
24
+ }
25
+ // Compute IDF for each term
26
+ for (const [term, freq] of this.docFreq) {
27
+ this.idf.set(term, Math.log((N - freq + 0.5) / (freq + 0.5) + 1));
28
+ }
29
+ }
30
+ score(query, doc, index) {
31
+ let score = 0;
32
+ const docLength = this.docLengths[index];
33
+ for (const term of query) {
34
+ const tf = doc.filter((t) => t === term).length;
35
+ const idf = this.idf.get(term) || 0;
36
+ score +=
37
+ (idf * tf * (this.k1 + 1)) /
38
+ (tf +
39
+ this.k1 * (1 - this.b + (this.b * docLength) / this.avgDocLength));
40
+ }
41
+ return score;
42
+ }
43
+ search(query) {
44
+ const scores = this.documents.map((doc, idx) => ({
45
+ doc,
46
+ score: this.score(query, doc, idx),
47
+ }));
48
+ return scores.sort((a, b) => b.score - a.score).map((item) => item.doc);
49
+ }
50
+ }
51
+ exports.BM25 = BM25;
@@ -0,0 +1,13 @@
1
+ import { EmbeddingConfig, HistoryStoreConfig, LLMConfig } from "../types";
2
+ import { Embedder } from "../embeddings/base";
3
+ import { LLM } from "../llms/base";
4
+ import { HistoryManager } from "../storage/base";
5
+ export declare class EmbedderFactory {
6
+ static create(provider: string, config: EmbeddingConfig): Embedder;
7
+ }
8
+ export declare class LLMFactory {
9
+ static create(provider: string, config: LLMConfig): LLM;
10
+ }
11
+ export declare class HistoryManagerFactory {
12
+ static create(provider: string, config: HistoryStoreConfig): HistoryManager;
13
+ }
@@ -0,0 +1,49 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.HistoryManagerFactory = exports.LLMFactory = exports.EmbedderFactory = void 0;
4
+ const openai_1 = require("../embeddings/openai");
5
+ const openai_2 = require("../llms/openai");
6
+ const openai_structured_1 = require("../llms/openai_structured");
7
+ const MemoryHistoryManager_1 = require("../storage/MemoryHistoryManager");
8
+ const google_1 = require("../embeddings/google");
9
+ const google_2 = require("../llms/google");
10
+ class EmbedderFactory {
11
+ static create(provider, config) {
12
+ switch (provider.toLowerCase()) {
13
+ case "openai":
14
+ return new openai_1.OpenAIEmbedder(config);
15
+ case "google":
16
+ return new google_1.GoogleEmbedder(config);
17
+ default:
18
+ throw new Error(`Unsupported embedder provider: ${provider}`);
19
+ }
20
+ }
21
+ }
22
+ exports.EmbedderFactory = EmbedderFactory;
23
+ class LLMFactory {
24
+ static create(provider, config) {
25
+ switch (provider.toLowerCase()) {
26
+ case "openai":
27
+ return new openai_2.OpenAILLM(config);
28
+ case "openai_structured":
29
+ return new openai_structured_1.OpenAIStructuredLLM(config);
30
+ case "google":
31
+ return new google_2.GoogleLLM(config);
32
+ default:
33
+ throw new Error(`Unsupported LLM provider: ${provider}`);
34
+ }
35
+ }
36
+ }
37
+ exports.LLMFactory = LLMFactory;
38
+ class HistoryManagerFactory {
39
+ static create(provider, config) {
40
+ switch (provider.toLowerCase()) {
41
+ case "sqlite":
42
+ case "memory":
43
+ return new MemoryHistoryManager_1.MemoryHistoryManager();
44
+ default:
45
+ throw new Error(`Unsupported history store provider: ${provider}`);
46
+ }
47
+ }
48
+ }
49
+ exports.HistoryManagerFactory = HistoryManagerFactory;
@@ -0,0 +1,7 @@
1
+ export interface Logger {
2
+ info: (message: string) => void;
3
+ error: (message: string) => void;
4
+ debug: (message: string) => void;
5
+ warn: (message: string) => void;
6
+ }
7
+ export declare const logger: Logger;
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.logger = void 0;
4
+ exports.logger = {
5
+ info: (message) => console.log(`[INFO] ${message}`),
6
+ error: (message) => console.error(`[ERROR] ${message}`),
7
+ debug: (message) => console.debug(`[DEBUG] ${message}`),
8
+ warn: (message) => console.warn(`[WARN] ${message}`),
9
+ };
@@ -0,0 +1,3 @@
1
+ import { Message } from "../types";
2
+ declare const parse_vision_messages: (messages: Message[]) => Promise<Message[]>;
3
+ export { parse_vision_messages };
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.parse_vision_messages = void 0;
4
+ const openai_1 = require("../llms/openai");
5
+ const get_image_description = async (image_url) => {
6
+ const llm = new openai_1.OpenAILLM({
7
+ apiKey: process.env.OPENAI_API_KEY,
8
+ });
9
+ const response = await llm.generateResponse([
10
+ {
11
+ role: "user",
12
+ content: "Provide a description of the image and do not include any additional text.",
13
+ },
14
+ {
15
+ role: "user",
16
+ content: { type: "image_url", image_url: { url: image_url } },
17
+ },
18
+ ]);
19
+ return response;
20
+ };
21
+ const parse_vision_messages = async (messages) => {
22
+ const parsed_messages = [];
23
+ for (const message of messages) {
24
+ let new_message = {
25
+ role: message.role,
26
+ content: "",
27
+ };
28
+ if (message.role !== "system") {
29
+ if (typeof message.content === "object" &&
30
+ message.content.type === "image_url") {
31
+ const description = await get_image_description(message.content.image_url.url);
32
+ new_message.content =
33
+ typeof description === "string"
34
+ ? description
35
+ : JSON.stringify(description);
36
+ parsed_messages.push(new_message);
37
+ }
38
+ else
39
+ parsed_messages.push(message);
40
+ }
41
+ }
42
+ return parsed_messages;
43
+ };
44
+ exports.parse_vision_messages = parse_vision_messages;
@@ -0,0 +1,11 @@
1
+ import type { TelemetryClient, TelemetryInstance } from "./telemetry.types";
2
+ declare class UnifiedTelemetry implements TelemetryClient {
3
+ private apiKey;
4
+ private host;
5
+ constructor(projectApiKey: string, host: string);
6
+ captureEvent(distinctId: string, eventName: string, properties?: {}): Promise<void>;
7
+ shutdown(): Promise<void>;
8
+ }
9
+ declare const telemetry: UnifiedTelemetry;
10
+ declare function captureClientEvent(eventName: string, instance: TelemetryInstance, additionalData?: Record<string, any>): Promise<void>;
11
+ export { telemetry, captureClientEvent };
@@ -0,0 +1,74 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.telemetry = void 0;
4
+ exports.captureClientEvent = captureClientEvent;
5
+ let version = "2.1.16";
6
+ // Safely check for process.env in different environments
7
+ let MEM0_TELEMETRY = true;
8
+ try {
9
+ MEM0_TELEMETRY = process?.env?.MEM0_TELEMETRY === "false" ? false : true;
10
+ }
11
+ catch (error) { }
12
+ const POSTHOG_API_KEY = "phc_hgJkUVJFYtmaJqrvf6CYN67TIQ8yhXAkWzUn9AMU4yX";
13
+ const POSTHOG_HOST = "https://us.i.posthog.com/i/v0/e/";
14
+ class UnifiedTelemetry {
15
+ constructor(projectApiKey, host) {
16
+ this.apiKey = projectApiKey;
17
+ this.host = host;
18
+ }
19
+ async captureEvent(distinctId, eventName, properties = {}) {
20
+ if (!MEM0_TELEMETRY)
21
+ return;
22
+ const eventProperties = {
23
+ client_version: version,
24
+ timestamp: new Date().toISOString(),
25
+ ...properties,
26
+ $process_person_profile: distinctId === "anonymous" || distinctId === "anonymous-supabase"
27
+ ? false
28
+ : true,
29
+ $lib: "posthog-node",
30
+ };
31
+ const payload = {
32
+ api_key: this.apiKey,
33
+ distinct_id: distinctId,
34
+ event: eventName,
35
+ properties: eventProperties,
36
+ };
37
+ try {
38
+ const response = await fetch(this.host, {
39
+ method: "POST",
40
+ headers: {
41
+ "Content-Type": "application/json",
42
+ },
43
+ body: JSON.stringify(payload),
44
+ });
45
+ if (!response.ok) {
46
+ console.error("Telemetry event capture failed:", await response.text());
47
+ }
48
+ }
49
+ catch (error) {
50
+ console.error("Telemetry event capture failed:", error);
51
+ }
52
+ }
53
+ async shutdown() {
54
+ // No shutdown needed for direct API calls
55
+ }
56
+ }
57
+ const telemetry = new UnifiedTelemetry(POSTHOG_API_KEY, POSTHOG_HOST);
58
+ exports.telemetry = telemetry;
59
+ async function captureClientEvent(eventName, instance, additionalData = {}) {
60
+ if (!instance.telemetryId) {
61
+ console.warn("No telemetry ID found for instance");
62
+ return;
63
+ }
64
+ const eventData = {
65
+ function: `${instance.constructor.name}`,
66
+ method: eventName,
67
+ api_host: instance.host,
68
+ timestamp: new Date().toISOString(),
69
+ client_version: version,
70
+ client_source: "nodejs",
71
+ ...additionalData,
72
+ };
73
+ await telemetry.captureEvent(instance.telemetryId, `mem0.${eventName}`, eventData);
74
+ }
@@ -0,0 +1,27 @@
1
+ export interface TelemetryClient {
2
+ captureEvent(distinctId: string, eventName: string, properties?: Record<string, any>): Promise<void>;
3
+ shutdown(): Promise<void>;
4
+ }
5
+ export interface TelemetryInstance {
6
+ telemetryId: string;
7
+ constructor: {
8
+ name: string;
9
+ };
10
+ host?: string;
11
+ apiKey?: string;
12
+ }
13
+ export interface TelemetryEventData {
14
+ function: string;
15
+ method: string;
16
+ api_host?: string;
17
+ timestamp?: string;
18
+ client_source: "browser" | "nodejs";
19
+ client_version: string;
20
+ [key: string]: any;
21
+ }
22
+ export interface TelemetryOptions {
23
+ enabled?: boolean;
24
+ apiKey?: string;
25
+ host?: string;
26
+ version?: string;
27
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,11 @@
1
+ import { SearchFilters, VectorStoreResult } from "../types";
2
+ export interface VectorStore {
3
+ insert(vectors: number[][], ids: string[], payloads: Record<string, any>[]): Promise<void>;
4
+ search(query: number[], limit?: number, filters?: SearchFilters): Promise<VectorStoreResult[]>;
5
+ get(vectorId: string): Promise<VectorStoreResult | null>;
6
+ update(vectorId: string, vector: number[], payload: Record<string, any>): Promise<void>;
7
+ delete(vectorId: string): Promise<void>;
8
+ deleteCol(): Promise<void>;
9
+ list(filters?: SearchFilters, limit?: number): Promise<[VectorStoreResult[], number]>;
10
+ getInstanceId(): string;
11
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,40 @@
1
+ import { VectorStore } from "./base";
2
+ import { SearchFilters, VectorStoreConfig, VectorStoreResult } from "../types";
3
+ /**
4
+ * LiteVectorStore provides a simple vector storage implementation.
5
+ *
6
+ * This class manages user-sensitive vector data, with each instance tied to a specific user.
7
+ * Data is stored in a local SQLite database with appropriate isolation between users.
8
+ * The user's identity is hashed for privacy and security purposes.
9
+ * ⚠️ User memories are typically small (usually <1000 vectors), therefore database optimization is not a priority.
10
+ *
11
+ * @implements {VectorStore}
12
+ */
13
+ export declare class LiteVectorStore implements VectorStore {
14
+ private db;
15
+ private isSecure;
16
+ private dimension;
17
+ private currentUserId;
18
+ private scoringConfig;
19
+ private cleanupThreshold?;
20
+ private static cache;
21
+ constructor(config: VectorStoreConfig, currentUserId: string);
22
+ private init;
23
+ private run;
24
+ private all;
25
+ private getOne;
26
+ private cosineSimilarity;
27
+ private filterVector;
28
+ getInstanceId(): string;
29
+ static from(userId: string, config: VectorStoreConfig): Promise<LiteVectorStore>;
30
+ insert(vectors: number[][], ids: string[], payloads: Record<string, any>[]): Promise<void>;
31
+ search(query: number[], limit?: number, filters?: SearchFilters): Promise<VectorStoreResult[]>;
32
+ get(vectorId: string): Promise<VectorStoreResult | null>;
33
+ update(vectorId: string, vector: number[], payload: Record<string, any>): Promise<void>;
34
+ delete(vectorId: string): Promise<void>;
35
+ deleteCol(): Promise<void>;
36
+ list(filters?: SearchFilters, limit?: number): Promise<[VectorStoreResult[], number]>;
37
+ private calculateRecencyScore;
38
+ private calculateHybridScore;
39
+ private _cleanupByRecency;
40
+ }