aifastdb 0.2.1

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 (53) hide show
  1. package/aidb.win32-x64-msvc.node +0 -0
  2. package/aifastdb.win32-x64-msvc.node +0 -0
  3. package/dist/client.d.ts +140 -0
  4. package/dist/client.d.ts.map +1 -0
  5. package/dist/client.js +270 -0
  6. package/dist/client.js.map +1 -0
  7. package/dist/connectme-adapter.d.ts +76 -0
  8. package/dist/connectme-adapter.d.ts.map +1 -0
  9. package/dist/connectme-adapter.js +456 -0
  10. package/dist/connectme-adapter.js.map +1 -0
  11. package/dist/family-tree.d.ts +482 -0
  12. package/dist/family-tree.d.ts.map +1 -0
  13. package/dist/family-tree.js +676 -0
  14. package/dist/family-tree.js.map +1 -0
  15. package/dist/family-types.d.ts +228 -0
  16. package/dist/family-types.d.ts.map +1 -0
  17. package/dist/family-types.js +108 -0
  18. package/dist/family-types.js.map +1 -0
  19. package/dist/index.d.ts +25 -0
  20. package/dist/index.d.ts.map +1 -0
  21. package/dist/index.js +70 -0
  22. package/dist/index.js.map +1 -0
  23. package/dist/memory-manager.d.ts +82 -0
  24. package/dist/memory-manager.d.ts.map +1 -0
  25. package/dist/memory-manager.js +273 -0
  26. package/dist/memory-manager.js.map +1 -0
  27. package/dist/native.d.ts +352 -0
  28. package/dist/native.d.ts.map +1 -0
  29. package/dist/native.js +35 -0
  30. package/dist/native.js.map +1 -0
  31. package/dist/query-builder.d.ts +143 -0
  32. package/dist/query-builder.d.ts.map +1 -0
  33. package/dist/query-builder.js +240 -0
  34. package/dist/query-builder.js.map +1 -0
  35. package/dist/social-graph.d.ts +392 -0
  36. package/dist/social-graph.d.ts.map +1 -0
  37. package/dist/social-graph.js +545 -0
  38. package/dist/social-graph.js.map +1 -0
  39. package/dist/social-types.d.ts +379 -0
  40. package/dist/social-types.d.ts.map +1 -0
  41. package/dist/social-types.js +34 -0
  42. package/dist/social-types.js.map +1 -0
  43. package/dist/types.d.ts +475 -0
  44. package/dist/types.d.ts.map +1 -0
  45. package/dist/types.js +161 -0
  46. package/dist/types.js.map +1 -0
  47. package/dist/vibe-synapse.d.ts +174 -0
  48. package/dist/vibe-synapse.d.ts.map +1 -0
  49. package/dist/vibe-synapse.js +509 -0
  50. package/dist/vibe-synapse.js.map +1 -0
  51. package/package.json +61 -0
  52. package/vibebase.node +0 -0
  53. package/vibebase.win32-x64-msvc.node +0 -0
@@ -0,0 +1,273 @@
1
+ "use strict";
2
+ /**
3
+ * Memory Manager for AI Agent long-term memory
4
+ *
5
+ * Provides higher-level memory management including:
6
+ * - Automatic importance decay
7
+ * - Memory consolidation
8
+ * - Context preparation for LLMs
9
+ */
10
+ Object.defineProperty(exports, "__esModule", { value: true });
11
+ exports.MemoryManager = void 0;
12
+ /**
13
+ * Memory Manager for AI Agent applications
14
+ */
15
+ class MemoryManager {
16
+ constructor(db, config = {}) {
17
+ this.db = db;
18
+ this.config = {
19
+ defaultDecayRate: config.defaultDecayRate ?? 0.0001,
20
+ defaultImportance: config.defaultImportance ?? 0.5,
21
+ maxMemories: config.maxMemories ?? 100000,
22
+ pruneThreshold: config.pruneThreshold ?? 0.01,
23
+ embeddingProvider: config.embeddingProvider,
24
+ };
25
+ }
26
+ /**
27
+ * Set embedding provider
28
+ */
29
+ setEmbeddingProvider(provider) {
30
+ this.config.embeddingProvider = provider;
31
+ }
32
+ /**
33
+ * Store a memory with automatic embedding
34
+ */
35
+ async remember(content, options = {}) {
36
+ const input = {
37
+ content,
38
+ importance: options.importance ?? this.config.defaultImportance,
39
+ ...options,
40
+ };
41
+ // Generate embedding if provider is available and no embedding provided
42
+ if (this.config.embeddingProvider && !input.embedding) {
43
+ input.embedding = await this.config.embeddingProvider.embed(content);
44
+ }
45
+ return this.db.remember(input);
46
+ }
47
+ /**
48
+ * Store multiple memories with automatic embedding
49
+ */
50
+ async rememberMany(items) {
51
+ const inputs = [];
52
+ // Batch embed if possible
53
+ if (this.config.embeddingProvider?.embedBatch) {
54
+ const textsToEmbed = [];
55
+ const indices = [];
56
+ items.forEach((item, i) => {
57
+ if (!item.options?.embedding) {
58
+ textsToEmbed.push(item.content);
59
+ indices.push(i);
60
+ }
61
+ });
62
+ if (textsToEmbed.length > 0) {
63
+ const embeddings = await this.config.embeddingProvider.embedBatch(textsToEmbed);
64
+ indices.forEach((idx, i) => {
65
+ items[idx].options = items[idx].options || {};
66
+ items[idx].options.embedding = embeddings[i];
67
+ });
68
+ }
69
+ }
70
+ // Build inputs
71
+ for (const item of items) {
72
+ const input = {
73
+ content: item.content,
74
+ importance: item.options?.importance ?? this.config.defaultImportance,
75
+ ...item.options,
76
+ };
77
+ // Embed individually if no batch embedding
78
+ if (this.config.embeddingProvider && !input.embedding) {
79
+ input.embedding = await this.config.embeddingProvider.embed(item.content);
80
+ }
81
+ inputs.push(input);
82
+ }
83
+ return this.db.rememberMany(inputs);
84
+ }
85
+ /**
86
+ * Ingest a document with chunking
87
+ */
88
+ async ingestDocument(doc, options = {}) {
89
+ const chunks = this.chunkText(doc.content, options);
90
+ const chunkIds = [];
91
+ // Create parent document memory
92
+ const parentInput = {
93
+ content: doc.content.substring(0, 500) + (doc.content.length > 500 ? '...' : ''),
94
+ metadata: {
95
+ ...doc.metadata,
96
+ isDocument: true,
97
+ fullLength: doc.content.length,
98
+ chunkCount: chunks.length,
99
+ },
100
+ importance: 0.8,
101
+ };
102
+ const parent = await this.remember(parentInput.content, parentInput);
103
+ // Create chunk memories
104
+ for (let i = 0; i < chunks.length; i++) {
105
+ const chunkInput = {
106
+ content: chunks[i],
107
+ parentId: parent.id,
108
+ metadata: {
109
+ ...doc.metadata,
110
+ isChunk: true,
111
+ chunkIndex: i,
112
+ totalChunks: chunks.length,
113
+ },
114
+ importance: 0.5,
115
+ };
116
+ const chunk = await this.remember(chunkInput.content, chunkInput);
117
+ chunkIds.push(chunk.id);
118
+ }
119
+ return {
120
+ documentId: parent.id,
121
+ chunkIds,
122
+ chunkCount: chunks.length,
123
+ };
124
+ }
125
+ /**
126
+ * Chunk text into smaller pieces
127
+ */
128
+ chunkText(text, options) {
129
+ const maxSize = options.maxChunkSize ?? 1000;
130
+ const overlap = options.overlap ?? 100;
131
+ const strategy = options.strategy ?? 'paragraph';
132
+ const chunks = [];
133
+ switch (strategy) {
134
+ case 'paragraph': {
135
+ const paragraphs = text.split(/\n\n+/);
136
+ let current = '';
137
+ for (const para of paragraphs) {
138
+ if (current.length + para.length > maxSize && current.length > 0) {
139
+ chunks.push(current.trim());
140
+ // Keep overlap from end of current
141
+ current = current.slice(-overlap) + '\n\n' + para;
142
+ }
143
+ else {
144
+ current += (current ? '\n\n' : '') + para;
145
+ }
146
+ }
147
+ if (current.trim()) {
148
+ chunks.push(current.trim());
149
+ }
150
+ break;
151
+ }
152
+ case 'sentence': {
153
+ const sentences = text.match(/[^.!?]+[.!?]+/g) || [text];
154
+ let current = '';
155
+ for (const sentence of sentences) {
156
+ if (current.length + sentence.length > maxSize && current.length > 0) {
157
+ chunks.push(current.trim());
158
+ current = current.slice(-overlap) + ' ' + sentence;
159
+ }
160
+ else {
161
+ current += sentence;
162
+ }
163
+ }
164
+ if (current.trim()) {
165
+ chunks.push(current.trim());
166
+ }
167
+ break;
168
+ }
169
+ case 'fixed':
170
+ default: {
171
+ for (let i = 0; i < text.length; i += maxSize - overlap) {
172
+ chunks.push(text.slice(i, i + maxSize));
173
+ }
174
+ break;
175
+ }
176
+ }
177
+ return chunks.filter(c => c.length > 0);
178
+ }
179
+ /**
180
+ * Recall memories with automatic query embedding
181
+ */
182
+ async recall(query, limit = 10) {
183
+ const options = {
184
+ query,
185
+ limit,
186
+ };
187
+ if (this.config.embeddingProvider) {
188
+ options.vector = await this.config.embeddingProvider.embed(query);
189
+ }
190
+ const results = this.db.recall(options);
191
+ // Touch accessed memories to update access statistics
192
+ for (const result of results) {
193
+ this.db.touch(result.node.id);
194
+ }
195
+ return results.map((r) => r.node);
196
+ }
197
+ /**
198
+ * Get context for LLM with automatic embedding
199
+ */
200
+ async getContext(query, maxTokens = 4000) {
201
+ return this.db.prepareContext({
202
+ query,
203
+ maxTokens,
204
+ strategy: 'hybrid',
205
+ });
206
+ }
207
+ /**
208
+ * Prune old/unimportant memories
209
+ */
210
+ prune() {
211
+ const allIds = this.db.ids();
212
+ let pruned = 0;
213
+ // Check if over capacity
214
+ if (allIds.length <= this.config.maxMemories) {
215
+ return 0;
216
+ }
217
+ // Get all memories and sort by importance
218
+ const memories = [];
219
+ for (const id of allIds) {
220
+ const node = this.db.get(id);
221
+ if (node) {
222
+ // Calculate current importance with decay
223
+ const ageHours = (Date.now() - node.lastAccessedAt) / (1000 * 60 * 60);
224
+ const decayedImportance = node.importance * Math.exp(-node.decayRate * ageHours);
225
+ memories.push({ id, importance: decayedImportance });
226
+ }
227
+ }
228
+ // Sort by importance (ascending - least important first)
229
+ memories.sort((a, b) => a.importance - b.importance);
230
+ // Prune least important until under capacity
231
+ const toPrune = memories.length - this.config.maxMemories;
232
+ for (let i = 0; i < toPrune && i < memories.length; i++) {
233
+ if (memories[i].importance < this.config.pruneThreshold) {
234
+ this.db.forget(memories[i].id);
235
+ pruned++;
236
+ }
237
+ }
238
+ return pruned;
239
+ }
240
+ /**
241
+ * Consolidate similar memories
242
+ */
243
+ async consolidate() {
244
+ // This is a placeholder for future implementation
245
+ // Would involve finding similar memories and merging them
246
+ return 0;
247
+ }
248
+ /**
249
+ * Get memory statistics
250
+ */
251
+ stats() {
252
+ const allIds = this.db.ids();
253
+ let totalImportance = 0;
254
+ let oldest = Date.now();
255
+ let newest = 0;
256
+ for (const id of allIds) {
257
+ const node = this.db.get(id);
258
+ if (node) {
259
+ totalImportance += node.importance;
260
+ oldest = Math.min(oldest, node.createdAt);
261
+ newest = Math.max(newest, node.createdAt);
262
+ }
263
+ }
264
+ return {
265
+ totalMemories: allIds.length,
266
+ avgImportance: allIds.length > 0 ? totalImportance / allIds.length : 0,
267
+ oldestMemory: oldest,
268
+ newestMemory: newest,
269
+ };
270
+ }
271
+ }
272
+ exports.MemoryManager = MemoryManager;
273
+ //# sourceMappingURL=memory-manager.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"memory-manager.js","sourceRoot":"","sources":["../ts/memory-manager.ts"],"names":[],"mappings":";AAAA;;;;;;;GAOG;;;AA4BH;;GAEG;AACH,MAAa,aAAa;IAMxB,YAAY,EAAa,EAAE,SAA8B,EAAE;QACzD,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC;QACb,IAAI,CAAC,MAAM,GAAG;YACZ,gBAAgB,EAAE,MAAM,CAAC,gBAAgB,IAAI,MAAM;YACnD,iBAAiB,EAAE,MAAM,CAAC,iBAAiB,IAAI,GAAG;YAClD,WAAW,EAAE,MAAM,CAAC,WAAW,IAAI,MAAM;YACzC,cAAc,EAAE,MAAM,CAAC,cAAc,IAAI,IAAI;YAC7C,iBAAiB,EAAE,MAAM,CAAC,iBAAiB;SAC5C,CAAC;IACJ,CAAC;IAED;;OAEG;IACH,oBAAoB,CAAC,QAA2B;QAC9C,IAAI,CAAC,MAAM,CAAC,iBAAiB,GAAG,QAAQ,CAAC;IAC3C,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,QAAQ,CAAC,OAAe,EAAE,UAAgC,EAAE;QAChE,MAAM,KAAK,GAAgB;YACzB,OAAO;YACP,UAAU,EAAE,OAAO,CAAC,UAAU,IAAI,IAAI,CAAC,MAAM,CAAC,iBAAiB;YAC/D,GAAG,OAAO;SACX,CAAC;QAEF,wEAAwE;QACxE,IAAI,IAAI,CAAC,MAAM,CAAC,iBAAiB,IAAI,CAAC,KAAK,CAAC,SAAS,EAAE,CAAC;YACtD,KAAK,CAAC,SAAS,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,iBAAiB,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QACvE,CAAC;QAED,OAAO,IAAI,CAAC,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IACjC,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,YAAY,C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4
+ * This file re-exports the native Rust bindings generated by napi-rs.
5
+ * After building with `napi build`, the actual bindings will be available.
6
+ */
7
+ declare const native: NativeBindings;
8
+ export interface AiFastDbConfig {
9
+ /** Storage path */
10
+ path: string;
11
+ /** Vector dimension */
12
+ dimension: number;
13
+ /** HNSW configuration (optional) */
14
+ hnsw?: HNSWConfig;
15
+ }
16
+ /** Extended AiFastDb configuration with perception support */
17
+ export interface AiFastDbConfigExtended extends AiFastDbConfig {
18
+ /** Perception engine configuration */
19
+ perception?: PerceptionConfigNative;
20
+ /** Reasoning engine configuration */
21
+ reasoning?: ReasoningConfigNative;
22
+ }
23
+ /** Native perception configuration */
24
+ export interface PerceptionConfigNative {
25
+ engineType?: string;
26
+ modelId?: string;
27
+ dimension?: number;
28
+ device?: string;
29
+ autoDownload?: boolean;
30
+ cacheDir?: string;
31
+ }
32
+ /** Native reasoning configuration */
33
+ export interface ReasoningConfigNative {
34
+ provider: string;
35
+ endpoint: string;
36
+ model: string;
37
+ apiKey?: string;
38
+ timeoutSecs?: number;
39
+ maxTokens?: number;
40
+ temperature?: number;
41
+ }
42
+ export interface HNSWConfig {
43
+ /** Maximum number of connections per node (default: 16) */
44
+ m?: number;
45
+ /** Construction ef parameter (default: 200) */
46
+ efConstruction?: number;
47
+ /** Search ef parameter (default: 50) */
48
+ efSearch?: number;
49
+ /** Vector dimension */
50
+ dimension?: number;
51
+ /** Maximum number of elements */
52
+ maxElements?: number;
53
+ }
54
+ export interface StorageConfig {
55
+ /** Base path for database files */
56
+ path: string;
57
+ /** Whether to use memory-mapped files */
58
+ useMmap?: boolean;
59
+ /** Whether to sync writes immediately */
60
+ syncOnWrite?: boolean;
61
+ }
62
+ export interface MemoryInput {
63
+ /** Content text */
64
+ content: string;
65
+ /** Vector embedding (optional) */
66
+ embedding?: number[];
67
+ /** Content type */
68
+ contentType?: ContentType;
69
+ /** Metadata key-value pairs */
70
+ metadata?: Record<string, unknown>;
71
+ /** Tags */
72
+ tags?: string[];
73
+ /** Importance score (0-1) */
74
+ importance?: number;
75
+ /** Parent memory ID */
76
+ parentId?: string;
77
+ }
78
+ export interface MemoryNode {
79
+ id: string;
80
+ content: string;
81
+ contentType: ContentType;
82
+ parentId?: string;
83
+ children: string[];
84
+ depth: number;
85
+ metadata: Record<string, unknown>;
86
+ tags: string[];
87
+ createdAt: number;
88
+ lastAccessedAt: number;
89
+ accessCount: number;
90
+ importance: number;
91
+ decayRate: number;
92
+ }
93
+ export interface SearchResult {
94
+ node: MemoryNode;
95
+ score: number;
96
+ }
97
+ export interface QueryOptions {
98
+ /** Text query */
99
+ query?: string;
100
+ /** Vector embedding to search for */
101
+ vector?: number[];
102
+ /** Weight for vector search (0-1) */
103
+ vectorWeight?: number;
104
+ /** Weight for text search (0-1) */
105
+ textWeight?: number;
106
+ /** Metadata filters */
107
+ filters?: FilterCondition[];
108
+ /** Time range start (Unix ms) */
109
+ timeStart?: number;
110
+ /** Time range end (Unix ms) */
111
+ timeEnd?: number;
112
+ /** Minimum importance threshold */
113
+ minImportance?: number;
114
+ /** Maximum number of results */
115
+ limit?: number;
116
+ /** Result offset */
117
+ offset?: number;
118
+ /** Collections to search in (empty/undefined = default collection only) */
119
+ collections?: string[];
120
+ }
121
+ export interface FilterCondition {
122
+ /** Field name */
123
+ field: string;
124
+ /** Operator: eq, ne, gt, gte, lt, lte, contains, in, not_in */
125
+ op: string;
126
+ /** Value to compare */
127
+ value: unknown;
128
+ }
129
+ export interface ContextOptions {
130
+ /** Query to find relevant context */
131
+ query: string;
132
+ /** Maximum tokens to include */
133
+ maxTokens?: number;
134
+ /** Strategy: importance-weighted, recent-first, hybrid */
135
+ strategy?: 'importance-weighted' | 'recent-first' | 'hybrid';
136
+ }
137
+ export interface PreparedContext {
138
+ /** Combined context text */
139
+ text: string;
140
+ /** Source memory IDs */
141
+ sourceIds: string[];
142
+ /** Estimated token count */
143
+ tokenCount: number;
144
+ }
145
+ export declare enum ContentType {
146
+ Text = "Text",
147
+ Image = "Image",
148
+ Code = "Code",
149
+ Conversation = "Conversation",
150
+ Document = "Document",
151
+ Other = "Other"
152
+ }
153
+ /**
154
+ * Collection interface - represents a single collection within the database
155
+ */
156
+ export interface Collection {
157
+ /** Collection name */
158
+ readonly name: string;
159
+ /** Vector dimension */
160
+ readonly dimension: number;
161
+ /** Number of documents in collection */
162
+ readonly size: number;
163
+ /** Store a new memory in this collection */
164
+ remember(input: MemoryInput): MemoryNode;
165
+ /** Store multiple memories */
166
+ rememberMany(inputs: MemoryInput[]): MemoryNode[];
167
+ /** Recall memories from this collection */
168
+ recall(options: QueryOptions): SearchResult[];
169
+ /** Recall using RRF */
170
+ recallRrf(options: QueryOptions, k?: number): SearchResult[];
171
+ /** Get a memory by ID */
172
+ get(id: string): MemoryNode | null;
173
+ /** Delete a memory by ID */
174
+ forget(id: string): boolean;
175
+ /** Update access statistics */
176
+ touch(id: string): boolean;
177
+ /** Get all memory IDs */
178
+ ids(): string[];
179
+ /** Check if a memory exists */
180
+ has(id: string): boolean;
181
+ /** Find memories by tag */
182
+ findByTag(tag: string): MemoryNode[];
183
+ /** Find memories by minimum importance */
184
+ findImportant(minImportance: number): MemoryNode[];
185
+ /** Flush changes to disk */
186
+ flush(): void;
187
+ }
188
+ /**
189
+ * Collection statistics
190
+ */
191
+ export interface CollectionStats {
192
+ /** Collection name */
193
+ name: string;
194
+ /** Vector dimension */
195
+ dimension: number;
196
+ /** Optional description */
197
+ description?: string;
198
+ /** Number of documents */
199
+ documentCount: number;
200
+ /** Number of vectors */
201
+ vectorCount: number;
202
+ /** Creation timestamp (Unix ms) */
203
+ createdAt: number;
204
+ /** Last update timestamp (Unix ms) */
205
+ updatedAt: number;
206
+ }
207
+ /** Perception engine configuration */
208
+ export interface PerceptionConfigNative {
209
+ /** Engine type: "candle" | "none" */
210
+ engineType?: string;
211
+ /** Model ID (HuggingFace model ID or local path) */
212
+ modelId?: string;
213
+ /** Output embedding dimension */
214
+ dimension?: number;
215
+ /** Device: "cpu" | "cuda" | "metal" */
216
+ device?: string;
217
+ /** Whether to auto-download model */
218
+ autoDownload?: boolean;
219
+ /** Local cache directory for models */
220
+ cacheDir?: string;
221
+ }
222
+ /** Reasoning engine configuration */
223
+ export interface ReasoningConfigNative {
224
+ /** Provider: "ollama" | "openai" | "azure" */
225
+ provider: string;
226
+ /** API endpoint URL */
227
+ endpoint: string;
228
+ /** Model name */
229
+ model: string;
230
+ /** API key (optional for local providers) */
231
+ apiKey?: string;
232
+ /** Request timeout in seconds */
233
+ timeoutSecs?: number;
234
+ /** Maximum tokens for generation */
235
+ maxTokens?: number;
236
+ /** Temperature (0.0 - 2.0) */
237
+ temperature?: number;
238
+ }
239
+ /** Extended AiFastDb configuration with perception support */
240
+ export interface AiFastDbConfigExtended {
241
+ /** Storage path */
242
+ path: string;
243
+ /** Vector dimension */
244
+ dimension: number;
245
+ /** HNSW configuration (optional) */
246
+ hnsw?: HNSWConfig;
247
+ /** Perception engine configuration (optional) */
248
+ perception?: PerceptionConfigNative;
249
+ /** Reasoning engine configuration (optional) */
250
+ reasoning?: ReasoningConfigNative;
251
+ }
252
+ /**
253
+ * AiFastDb class interface - AI-friendly Database
254
+ */
255
+ export interface IAiFastDbClass {
256
+ new (config: AiFastDbConfig): IAiFastDb;
257
+ /** Create with perception support */
258
+ withPerception(config: AiFastDbConfigExtended): IAiFastDb;
259
+ }
260
+ /**
261
+ * AiFastDb instance interface
262
+ */
263
+ export interface IAiFastDb {
264
+ /** Get database path */
265
+ readonly path: string;
266
+ /** Get vector dimension */
267
+ readonly dimension: number;
268
+ /** Get number of memories in default collection */
269
+ readonly size: number;
270
+ /** Get or create a collection by name */
271
+ collection(name: string): Collection;
272
+ /** List all collection names */
273
+ listCollections(): string[];
274
+ /** Check if a collection exists */
275
+ hasCollection(name: string): boolean;
276
+ /** Delete a collection (cannot delete 'default') */
277
+ deleteCollection(name: string): boolean;
278
+ /** Get collection statistics */
279
+ collectionStats(name: string): CollectionStats | null;
280
+ /** Store a new memory */
281
+ remember(input: MemoryInput): MemoryNode;
282
+ /** Store multiple memories */
283
+ rememberMany(inputs: MemoryInput[]): MemoryNode[];
284
+ /** Recall memories (search/query) - supports collections option */
285
+ recall(options: QueryOptions): SearchResult[];
286
+ /** Recall using RRF (Reciprocal Rank Fusion) - supports collections option */
287
+ recallRrf(options: QueryOptions, k?: number): SearchResult[];
288
+ /** Recall from ALL collections */
289
+ recallAll(options: QueryOptions): SearchResult[];
290
+ /** Get a memory by ID */
291
+ get(id: string): MemoryNode | null;
292
+ /** Delete a memory by ID */
293
+ forget(id: string): boolean;
294
+ /** Update access statistics for a memory */
295
+ touch(id: string): boolean;
296
+ /** Get all memory IDs */
297
+ ids(): string[];
298
+ /** Check if a memory exists */
299
+ has(id: string): boolean;
300
+ /** Find memories by tag */
301
+ findByTag(tag: string): MemoryNode[];
302
+ /** Find memories by minimum importance */
303
+ findImportant(minImportance: number): MemoryNode[];
304
+ /** Prepare context for LLM */
305
+ prepareContext(options: ContextOptions): PreparedContext;
306
+ /** Flush all changes to disk */
307
+ flush(): void;
308
+ /** Close the database */
309
+ close(): void;
310
+ /** Add an entity to the knowledge graph */
311
+ addEntity(name: string, entityType: string, properties?: Record<string, unknown>): string;
312
+ /** Add a relation between entities */
313
+ addRelation(sourceId: string, targetId: string, relationType: string, weight?: number): string;
314
+ /** Get entity by ID */
315
+ getEntity(id: string): Record<string, unknown> | null;
316
+ /** Get neighboring entities */
317
+ getNeighbors(entityId: string): Record<string, unknown>[];
318
+ /** Traverse graph from entity */
319
+ explore(startEntityId: string, maxHops?: number, relationTypes?: string[]): Record<string, unknown>[];
320
+ /** Check if perception engine is available */
321
+ hasPerception(): boolean;
322
+ /** Check if reasoning engine is available */
323
+ hasReasoning(): boolean;
324
+ /** Get perception engine dimension */
325
+ perceptionDimension(): number | null;
326
+ /** Get perception engine model name */
327
+ perceptionModel(): string | null;
328
+ /** Generate embedding using built-in perception engine */
329
+ embed(text: string): number[];
330
+ /** Generate embeddings for multiple texts */
331
+ embedBatch(texts: string[]): number[][];
332
+ /** Generate embedding for multimodal data (image, audio) */
333
+ embedMultimodal(data: Buffer, mimeType: string): number[];
334
+ /** Remember content with automatic embedding generation */
335
+ rememberWithEmbedding(input: MemoryInput): MemoryNode;
336
+ /** Check logical consistency between two statements */
337
+ checkLogic(factA: string, factB: string): boolean;
338
+ /** Understand the intent behind a query */
339
+ understandIntent(query: string): string;
340
+ /** Generate a summary of content */
341
+ summarize(content: string, maxTokens?: number): string;
342
+ }
343
+ export interface NativeBindings {
344
+ Aifastdb: IAiFastDbClass;
345
+ version(): string;
346
+ ContentType: typeof ContentType;
347
+ }
348
+ export declare const AiFastDb: IAiFastDbClass;
349
+ export declare const version: () => string;
350
+ export declare const ContentTypeEnum: typeof ContentType;
351
+ export { native };
352
+ //# sourceMappingURL=native.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"native.d.ts","sourceRoot":"","sources":["../ts/native.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAWH,QAAA,MAAM,MAAM,EAAE,cAIb,CAAC;AAEF,MAAM,WAAW,cAAc;IAC7B,mBAAmB;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,uBAAuB;IACvB,SAAS,EAAE,MAAM,CAAC;IAClB,oCAAoC;IACpC,IAAI,CAAC,EAAE,UAAU,CAAC;CACnB;AAED,8DAA8D;AAC9D,MAAM,WAAW,sBAAuB,SAAQ,cAAc;IAC5D,sCAAsC;IACtC,UAAU,CAAC,EAAE,sBAAsB,CAAC;IACpC,qCAAqC;IACrC,SAAS,CAAC,EAAE,qBAAqB,CAAC;CACnC;AAED,sCAAsC;AACtC,MAAM,WAAW,sBAAsB;IACrC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,QAAQ,CAAC,EAAE,MAAM,CAAC;CAC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