@elizaos/core 1.0.0-alpha.57 → 1.0.0-alpha.59
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/bootstrap.d.ts +12 -1
- package/dist/database.d.ts +21 -4
- package/dist/index.d.ts +0 -1
- package/dist/index.js +543 -591
- package/dist/logger.d.ts +2 -1
- package/dist/prompts.d.ts +1 -0
- package/dist/runtime.d.ts +31 -16
- package/dist/services/task.d.ts +3 -3
- package/dist/types.d.ts +337 -116
- package/package.json +2 -2
- package/dist/index.js.map +0 -1
- package/dist/memory.d.ts +0 -114
package/dist/memory.d.ts
DELETED
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
import { type IAgentRuntime, type IMemoryManager, type Memory, type UUID } from "./types";
|
|
2
|
-
/**
|
|
3
|
-
* Manage memories in the database.
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* The AgentRuntime instance associated with this manager.
|
|
7
|
-
*/
|
|
8
|
-
export declare class MemoryManager implements IMemoryManager {
|
|
9
|
-
/**
|
|
10
|
-
* The AgentRuntime instance associated with this manager.
|
|
11
|
-
*/
|
|
12
|
-
runtime: IAgentRuntime;
|
|
13
|
-
/**
|
|
14
|
-
* The name of the database table this manager operates on.
|
|
15
|
-
*/
|
|
16
|
-
tableName: string;
|
|
17
|
-
/**
|
|
18
|
-
* Constructs a new MemoryManager instance.
|
|
19
|
-
* @param opts Options for the manager.
|
|
20
|
-
* @param opts.tableName The name of the table this manager will operate on.
|
|
21
|
-
* @param opts.runtime The AgentRuntime instance associated with this manager.
|
|
22
|
-
*/
|
|
23
|
-
constructor(opts: {
|
|
24
|
-
tableName: string;
|
|
25
|
-
runtime: IAgentRuntime;
|
|
26
|
-
});
|
|
27
|
-
private validateMetadata;
|
|
28
|
-
/**
|
|
29
|
-
* Adds an embedding vector to a memory object. If the memory already has an embedding, it is returned as is.
|
|
30
|
-
* @param memory The memory object to add an embedding to.
|
|
31
|
-
* @returns A Promise resolving to the memory object, potentially updated with an embedding vector.
|
|
32
|
-
*/
|
|
33
|
-
/**
|
|
34
|
-
* Adds an embedding vector to a memory object if one doesn't already exist.
|
|
35
|
-
* The embedding is generated from the memory's text content using the runtime's
|
|
36
|
-
* embedding model. If the memory has no text content, an error is thrown.
|
|
37
|
-
*
|
|
38
|
-
* @param memory The memory object to add an embedding to
|
|
39
|
-
* @returns The memory object with an embedding vector added
|
|
40
|
-
* @throws Error if the memory content is empty
|
|
41
|
-
*/
|
|
42
|
-
addEmbeddingToMemory(memory: Memory): Promise<Memory>;
|
|
43
|
-
/**
|
|
44
|
-
* Retrieves a list of memories by user IDs, with optional deduplication.
|
|
45
|
-
* @param opts Options including user IDs, count, and uniqueness.
|
|
46
|
-
* @param opts.roomId The room ID to retrieve memories for.
|
|
47
|
-
* @param opts.count The number of memories to retrieve.
|
|
48
|
-
* @param opts.unique Whether to retrieve unique memories only.
|
|
49
|
-
* @returns A Promise resolving to an array of Memory objects.
|
|
50
|
-
*/
|
|
51
|
-
getMemories(opts: {
|
|
52
|
-
roomId: UUID;
|
|
53
|
-
count?: number;
|
|
54
|
-
unique?: boolean;
|
|
55
|
-
start?: number;
|
|
56
|
-
end?: number;
|
|
57
|
-
agentId?: UUID;
|
|
58
|
-
}): Promise<Memory[]>;
|
|
59
|
-
getCachedEmbeddings(content: string): Promise<{
|
|
60
|
-
embedding: number[];
|
|
61
|
-
levenshtein_score: number;
|
|
62
|
-
}[]>;
|
|
63
|
-
/**
|
|
64
|
-
* Searches for memories similar to a given embedding vector.
|
|
65
|
-
* @param opts Options for the memory search
|
|
66
|
-
* @param opts.match_threshold The similarity threshold for matching memories.
|
|
67
|
-
* @param opts.count The maximum number of memories to retrieve.
|
|
68
|
-
* @param opts.roomId The room ID to retrieve memories for.
|
|
69
|
-
* @param opts.agentId The agent ID to retrieve memories for.
|
|
70
|
-
* @param opts.unique Whether to retrieve unique memories only.
|
|
71
|
-
* @returns A Promise resolving to an array of Memory objects that match the embedding.
|
|
72
|
-
*/
|
|
73
|
-
searchMemories(opts: {
|
|
74
|
-
embedding: number[];
|
|
75
|
-
match_threshold?: number;
|
|
76
|
-
count?: number;
|
|
77
|
-
roomId: UUID;
|
|
78
|
-
agentId?: UUID;
|
|
79
|
-
unique?: boolean;
|
|
80
|
-
}): Promise<Memory[]>;
|
|
81
|
-
/**
|
|
82
|
-
* Creates a new memory in the database, with an option to check for similarity before insertion.
|
|
83
|
-
* @param memory The memory object to create.
|
|
84
|
-
* @param unique Whether to check for similarity before insertion.
|
|
85
|
-
* @returns A Promise that resolves when the operation completes.
|
|
86
|
-
*/
|
|
87
|
-
createMemory(memory: Memory, unique?: boolean): Promise<UUID>;
|
|
88
|
-
getMemoriesByRoomIds(params: {
|
|
89
|
-
roomIds: UUID[];
|
|
90
|
-
limit?: number;
|
|
91
|
-
agentId?: UUID;
|
|
92
|
-
}): Promise<Memory[]>;
|
|
93
|
-
getMemoryById(id: UUID): Promise<Memory | null>;
|
|
94
|
-
/**
|
|
95
|
-
* Removes a memory from the database by its ID.
|
|
96
|
-
* @param memoryId The ID of the memory to remove.
|
|
97
|
-
* @returns A Promise that resolves when the operation completes.
|
|
98
|
-
*/
|
|
99
|
-
removeMemory(memoryId: UUID): Promise<void>;
|
|
100
|
-
/**
|
|
101
|
-
* Removes all memories associated with a set of user IDs.
|
|
102
|
-
* @param roomId The room ID to remove memories for.
|
|
103
|
-
* @returns A Promise that resolves when the operation completes.
|
|
104
|
-
*/
|
|
105
|
-
removeAllMemories(roomId: UUID): Promise<void>;
|
|
106
|
-
/**
|
|
107
|
-
* Counts the number of memories associated with a set of user IDs, with an option for uniqueness.
|
|
108
|
-
* @param roomId The room ID to count memories for.
|
|
109
|
-
* @param unique Whether to count unique memories only.
|
|
110
|
-
* @returns A Promise resolving to the count of memories.
|
|
111
|
-
*/
|
|
112
|
-
countMemories(roomId: UUID, unique?: boolean): Promise<number>;
|
|
113
|
-
private validateMetadataRequirements;
|
|
114
|
-
}
|