@launchapp-dev/ao-memory-mcp 2.0.0 → 2.0.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.
- package/dist/db.d.ts +25 -0
- package/dist/db.js +90 -0
- package/dist/embeddings.d.ts +14 -0
- package/dist/embeddings.js +72 -0
- package/dist/schema.sql +194 -0
- package/dist/server.d.ts +2 -0
- package/dist/server.js +56 -0
- package/dist/tools/context.d.ts +29 -0
- package/dist/tools/context.js +88 -0
- package/dist/tools/documents.d.ts +142 -0
- package/dist/tools/documents.js +201 -0
- package/dist/tools/episodes.d.ts +112 -0
- package/dist/tools/episodes.js +98 -0
- package/dist/tools/knowledge.d.ts +177 -0
- package/dist/tools/knowledge.js +235 -0
- package/dist/tools/recall.d.ts +153 -0
- package/dist/tools/recall.js +180 -0
- package/dist/tools/stats.d.ts +24 -0
- package/dist/tools/stats.js +50 -0
- package/dist/tools/store.d.ts +180 -0
- package/dist/tools/store.js +176 -0
- package/dist/tools/summarize.d.ts +74 -0
- package/dist/tools/summarize.js +92 -0
- package/package.json +9 -5
- package/migrate.ts +0 -250
- package/src/db.ts +0 -106
- package/src/embeddings.ts +0 -97
- package/src/server.ts +0 -70
- package/src/tools/context.ts +0 -106
- package/src/tools/documents.ts +0 -215
- package/src/tools/episodes.ts +0 -112
- package/src/tools/knowledge.ts +0 -248
- package/src/tools/recall.ts +0 -167
- package/src/tools/stats.ts +0 -51
- package/src/tools/store.ts +0 -168
- package/src/tools/summarize.ts +0 -114
- package/tsconfig.json +0 -12
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
import type Database from "better-sqlite3";
|
|
2
|
+
export declare const knowledgeTools: ({
|
|
3
|
+
name: string;
|
|
4
|
+
description: string;
|
|
5
|
+
inputSchema: {
|
|
6
|
+
type: "object";
|
|
7
|
+
properties: {
|
|
8
|
+
name: {
|
|
9
|
+
type: string;
|
|
10
|
+
description: string;
|
|
11
|
+
};
|
|
12
|
+
entity_type: {
|
|
13
|
+
type: string;
|
|
14
|
+
description: string;
|
|
15
|
+
};
|
|
16
|
+
namespace: {
|
|
17
|
+
type: string;
|
|
18
|
+
description: string;
|
|
19
|
+
};
|
|
20
|
+
description: {
|
|
21
|
+
type: string;
|
|
22
|
+
description: string;
|
|
23
|
+
};
|
|
24
|
+
metadata: {
|
|
25
|
+
type: string;
|
|
26
|
+
description: string;
|
|
27
|
+
};
|
|
28
|
+
source?: undefined;
|
|
29
|
+
source_type?: undefined;
|
|
30
|
+
relation?: undefined;
|
|
31
|
+
target?: undefined;
|
|
32
|
+
target_type?: undefined;
|
|
33
|
+
weight?: undefined;
|
|
34
|
+
memory_id?: undefined;
|
|
35
|
+
direction?: undefined;
|
|
36
|
+
depth?: undefined;
|
|
37
|
+
limit?: undefined;
|
|
38
|
+
};
|
|
39
|
+
required: string[];
|
|
40
|
+
};
|
|
41
|
+
} | {
|
|
42
|
+
name: string;
|
|
43
|
+
description: string;
|
|
44
|
+
inputSchema: {
|
|
45
|
+
type: "object";
|
|
46
|
+
properties: {
|
|
47
|
+
source: {
|
|
48
|
+
type: string;
|
|
49
|
+
description: string;
|
|
50
|
+
};
|
|
51
|
+
source_type: {
|
|
52
|
+
type: string;
|
|
53
|
+
description: string;
|
|
54
|
+
};
|
|
55
|
+
relation: {
|
|
56
|
+
type: string;
|
|
57
|
+
description: string;
|
|
58
|
+
};
|
|
59
|
+
target: {
|
|
60
|
+
type: string;
|
|
61
|
+
description: string;
|
|
62
|
+
};
|
|
63
|
+
target_type: {
|
|
64
|
+
type: string;
|
|
65
|
+
description: string;
|
|
66
|
+
};
|
|
67
|
+
weight: {
|
|
68
|
+
type: string;
|
|
69
|
+
description: string;
|
|
70
|
+
};
|
|
71
|
+
memory_id: {
|
|
72
|
+
type: string;
|
|
73
|
+
description: string;
|
|
74
|
+
};
|
|
75
|
+
namespace: {
|
|
76
|
+
type: string;
|
|
77
|
+
description: string;
|
|
78
|
+
};
|
|
79
|
+
metadata: {
|
|
80
|
+
type: string;
|
|
81
|
+
description: string;
|
|
82
|
+
};
|
|
83
|
+
name?: undefined;
|
|
84
|
+
entity_type?: undefined;
|
|
85
|
+
description?: undefined;
|
|
86
|
+
direction?: undefined;
|
|
87
|
+
depth?: undefined;
|
|
88
|
+
limit?: undefined;
|
|
89
|
+
};
|
|
90
|
+
required: string[];
|
|
91
|
+
};
|
|
92
|
+
} | {
|
|
93
|
+
name: string;
|
|
94
|
+
description: string;
|
|
95
|
+
inputSchema: {
|
|
96
|
+
type: "object";
|
|
97
|
+
properties: {
|
|
98
|
+
name: {
|
|
99
|
+
type: string;
|
|
100
|
+
description: string;
|
|
101
|
+
};
|
|
102
|
+
entity_type: {
|
|
103
|
+
type: string;
|
|
104
|
+
description: string;
|
|
105
|
+
};
|
|
106
|
+
relation: {
|
|
107
|
+
type: string;
|
|
108
|
+
description: string;
|
|
109
|
+
};
|
|
110
|
+
direction: {
|
|
111
|
+
type: string;
|
|
112
|
+
enum: string[];
|
|
113
|
+
description: string;
|
|
114
|
+
};
|
|
115
|
+
depth: {
|
|
116
|
+
type: string;
|
|
117
|
+
description: string;
|
|
118
|
+
};
|
|
119
|
+
namespace: {
|
|
120
|
+
type: string;
|
|
121
|
+
description: string;
|
|
122
|
+
};
|
|
123
|
+
limit: {
|
|
124
|
+
type: string;
|
|
125
|
+
description: string;
|
|
126
|
+
};
|
|
127
|
+
description?: undefined;
|
|
128
|
+
metadata?: undefined;
|
|
129
|
+
source?: undefined;
|
|
130
|
+
source_type?: undefined;
|
|
131
|
+
target?: undefined;
|
|
132
|
+
target_type?: undefined;
|
|
133
|
+
weight?: undefined;
|
|
134
|
+
memory_id?: undefined;
|
|
135
|
+
};
|
|
136
|
+
required?: undefined;
|
|
137
|
+
};
|
|
138
|
+
} | {
|
|
139
|
+
name: string;
|
|
140
|
+
description: string;
|
|
141
|
+
inputSchema: {
|
|
142
|
+
type: "object";
|
|
143
|
+
properties: {
|
|
144
|
+
entity_type: {
|
|
145
|
+
type: string;
|
|
146
|
+
description: string;
|
|
147
|
+
};
|
|
148
|
+
namespace: {
|
|
149
|
+
type: string;
|
|
150
|
+
description: string;
|
|
151
|
+
};
|
|
152
|
+
limit: {
|
|
153
|
+
type: string;
|
|
154
|
+
description: string;
|
|
155
|
+
};
|
|
156
|
+
name?: undefined;
|
|
157
|
+
description?: undefined;
|
|
158
|
+
metadata?: undefined;
|
|
159
|
+
source?: undefined;
|
|
160
|
+
source_type?: undefined;
|
|
161
|
+
relation?: undefined;
|
|
162
|
+
target?: undefined;
|
|
163
|
+
target_type?: undefined;
|
|
164
|
+
weight?: undefined;
|
|
165
|
+
memory_id?: undefined;
|
|
166
|
+
direction?: undefined;
|
|
167
|
+
depth?: undefined;
|
|
168
|
+
};
|
|
169
|
+
required?: undefined;
|
|
170
|
+
};
|
|
171
|
+
})[];
|
|
172
|
+
export declare function handleKnowledge(db: Database.Database, name: string, args: any): {
|
|
173
|
+
content: {
|
|
174
|
+
type: "text";
|
|
175
|
+
text: string;
|
|
176
|
+
}[];
|
|
177
|
+
};
|
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
import { now, jsonResult, errorResult } from "../db.js";
|
|
2
|
+
export const knowledgeTools = [
|
|
3
|
+
{
|
|
4
|
+
name: "memory.entity.add",
|
|
5
|
+
description: "Add an entity to the knowledge graph. Entities represent projects, people, technologies, concepts, files, or any named thing.",
|
|
6
|
+
inputSchema: {
|
|
7
|
+
type: "object",
|
|
8
|
+
properties: {
|
|
9
|
+
name: { type: "string", description: "Entity name (e.g. 'ao-cli', 'React', 'Sami')" },
|
|
10
|
+
entity_type: { type: "string", description: "Type (e.g. project, person, technology, concept, file, service)" },
|
|
11
|
+
namespace: { type: "string", description: "Scope" },
|
|
12
|
+
description: { type: "string", description: "Brief description" },
|
|
13
|
+
metadata: { type: "object", description: "Custom metadata" },
|
|
14
|
+
},
|
|
15
|
+
required: ["name", "entity_type"],
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
name: "memory.entity.link",
|
|
20
|
+
description: "Create a relationship between two entities. E.g. 'ao-cli uses Rust', 'invoicer depends_on Drizzle'.",
|
|
21
|
+
inputSchema: {
|
|
22
|
+
type: "object",
|
|
23
|
+
properties: {
|
|
24
|
+
source: { type: "string", description: "Source entity name" },
|
|
25
|
+
source_type: { type: "string", description: "Source entity type (for disambiguation)" },
|
|
26
|
+
relation: { type: "string", description: "Relation type (e.g. uses, depends_on, created_by, part_of, related_to)" },
|
|
27
|
+
target: { type: "string", description: "Target entity name" },
|
|
28
|
+
target_type: { type: "string", description: "Target entity type" },
|
|
29
|
+
weight: { type: "number", description: "Relation strength 0.0-1.0 (default 1.0)" },
|
|
30
|
+
memory_id: { type: "number", description: "Link to a memory entry as evidence" },
|
|
31
|
+
namespace: { type: "string", description: "Scope for auto-creating entities" },
|
|
32
|
+
metadata: { type: "object", description: "Custom metadata" },
|
|
33
|
+
},
|
|
34
|
+
required: ["source", "source_type", "relation", "target", "target_type"],
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
name: "memory.entity.query",
|
|
39
|
+
description: "Query the knowledge graph. Find entities and traverse relationships. Supports multi-hop traversal.",
|
|
40
|
+
inputSchema: {
|
|
41
|
+
type: "object",
|
|
42
|
+
properties: {
|
|
43
|
+
name: { type: "string", description: "Entity name to start from" },
|
|
44
|
+
entity_type: { type: "string", description: "Filter by entity type" },
|
|
45
|
+
relation: { type: "string", description: "Filter by relation type" },
|
|
46
|
+
direction: { type: "string", enum: ["outgoing", "incoming", "both"], description: "Traversal direction (default: both)" },
|
|
47
|
+
depth: { type: "number", description: "Max traversal depth (default 1, max 3)" },
|
|
48
|
+
namespace: { type: "string", description: "Filter by namespace" },
|
|
49
|
+
limit: { type: "number", description: "Max results (default 50)" },
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
name: "memory.entity.list",
|
|
55
|
+
description: "List entities in the knowledge graph.",
|
|
56
|
+
inputSchema: {
|
|
57
|
+
type: "object",
|
|
58
|
+
properties: {
|
|
59
|
+
entity_type: { type: "string", description: "Filter by type" },
|
|
60
|
+
namespace: { type: "string", description: "Filter by namespace" },
|
|
61
|
+
limit: { type: "number", description: "Max results (default 50)" },
|
|
62
|
+
},
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
];
|
|
66
|
+
export function handleKnowledge(db, name, args) {
|
|
67
|
+
if (name === "memory.entity.add")
|
|
68
|
+
return entityAdd(db, args);
|
|
69
|
+
if (name === "memory.entity.link")
|
|
70
|
+
return entityLink(db, args);
|
|
71
|
+
if (name === "memory.entity.query")
|
|
72
|
+
return entityQuery(db, args);
|
|
73
|
+
if (name === "memory.entity.list")
|
|
74
|
+
return entityList(db, args);
|
|
75
|
+
return null;
|
|
76
|
+
}
|
|
77
|
+
function getOrCreateEntity(db, name, entityType, namespace) {
|
|
78
|
+
const existing = db.prepare("SELECT id FROM entities WHERE name = ? AND entity_type = ? AND namespace IS ?").get(name, entityType, namespace || null);
|
|
79
|
+
if (existing)
|
|
80
|
+
return existing.id;
|
|
81
|
+
const ts = now();
|
|
82
|
+
const result = db.prepare(`
|
|
83
|
+
INSERT INTO entities (name, entity_type, namespace, metadata, created_at, updated_at)
|
|
84
|
+
VALUES (?, ?, ?, '{}', ?, ?)
|
|
85
|
+
`).run(name, entityType, namespace || null, ts, ts);
|
|
86
|
+
return Number(result.lastInsertRowid);
|
|
87
|
+
}
|
|
88
|
+
function entityAdd(db, args) {
|
|
89
|
+
const ts = now();
|
|
90
|
+
const existing = db.prepare("SELECT id FROM entities WHERE name = ? AND entity_type = ? AND namespace IS ?").get(args.name, args.entity_type, args.namespace || null);
|
|
91
|
+
if (existing) {
|
|
92
|
+
// Update existing
|
|
93
|
+
const sets = ["updated_at = ?"];
|
|
94
|
+
const vals = [ts];
|
|
95
|
+
if (args.description) {
|
|
96
|
+
sets.push("description = ?");
|
|
97
|
+
vals.push(args.description);
|
|
98
|
+
}
|
|
99
|
+
if (args.metadata) {
|
|
100
|
+
sets.push("metadata = ?");
|
|
101
|
+
vals.push(JSON.stringify(args.metadata));
|
|
102
|
+
}
|
|
103
|
+
vals.push(existing.id);
|
|
104
|
+
db.prepare(`UPDATE entities SET ${sets.join(", ")} WHERE id = ?`).run(...vals);
|
|
105
|
+
return jsonResult({ id: existing.id, updated: true });
|
|
106
|
+
}
|
|
107
|
+
const result = db.prepare(`
|
|
108
|
+
INSERT INTO entities (name, entity_type, namespace, description, metadata, created_at, updated_at)
|
|
109
|
+
VALUES (?, ?, ?, ?, ?, ?, ?)
|
|
110
|
+
`).run(args.name, args.entity_type, args.namespace || null, args.description || null, JSON.stringify(args.metadata || {}), ts, ts);
|
|
111
|
+
return jsonResult({ id: Number(result.lastInsertRowid), created: true });
|
|
112
|
+
}
|
|
113
|
+
function entityLink(db, args) {
|
|
114
|
+
const sourceId = getOrCreateEntity(db, args.source, args.source_type, args.namespace);
|
|
115
|
+
const targetId = getOrCreateEntity(db, args.target, args.target_type, args.namespace);
|
|
116
|
+
const existing = db.prepare("SELECT id FROM relations WHERE source_entity_id = ? AND relation_type = ? AND target_entity_id = ?").get(sourceId, args.relation, targetId);
|
|
117
|
+
if (existing) {
|
|
118
|
+
// Update weight/metadata
|
|
119
|
+
const sets = [];
|
|
120
|
+
const vals = [];
|
|
121
|
+
if (args.weight !== undefined) {
|
|
122
|
+
sets.push("weight = ?");
|
|
123
|
+
vals.push(args.weight);
|
|
124
|
+
}
|
|
125
|
+
if (args.memory_id) {
|
|
126
|
+
sets.push("memory_id = ?");
|
|
127
|
+
vals.push(args.memory_id);
|
|
128
|
+
}
|
|
129
|
+
if (args.metadata) {
|
|
130
|
+
sets.push("metadata = ?");
|
|
131
|
+
vals.push(JSON.stringify(args.metadata));
|
|
132
|
+
}
|
|
133
|
+
if (sets.length > 0) {
|
|
134
|
+
vals.push(existing.id);
|
|
135
|
+
db.prepare(`UPDATE relations SET ${sets.join(", ")} WHERE id = ?`).run(...vals);
|
|
136
|
+
}
|
|
137
|
+
return jsonResult({ id: existing.id, updated: true });
|
|
138
|
+
}
|
|
139
|
+
const ts = now();
|
|
140
|
+
const result = db.prepare(`
|
|
141
|
+
INSERT INTO relations (source_entity_id, relation_type, target_entity_id, weight, memory_id, metadata, created_at)
|
|
142
|
+
VALUES (?, ?, ?, ?, ?, ?, ?)
|
|
143
|
+
`).run(sourceId, args.relation, targetId, args.weight ?? 1.0, args.memory_id || null, JSON.stringify(args.metadata || {}), ts);
|
|
144
|
+
return jsonResult({ id: Number(result.lastInsertRowid), created: true, source_id: sourceId, target_id: targetId });
|
|
145
|
+
}
|
|
146
|
+
function entityQuery(db, args) {
|
|
147
|
+
const depth = Math.min(args.depth || 1, 3);
|
|
148
|
+
const limit = args.limit || 50;
|
|
149
|
+
const direction = args.direction || "both";
|
|
150
|
+
// Find starting entities
|
|
151
|
+
const startConditions = [];
|
|
152
|
+
const startVals = [];
|
|
153
|
+
if (args.name) {
|
|
154
|
+
startConditions.push("name = ?");
|
|
155
|
+
startVals.push(args.name);
|
|
156
|
+
}
|
|
157
|
+
if (args.entity_type) {
|
|
158
|
+
startConditions.push("entity_type = ?");
|
|
159
|
+
startVals.push(args.entity_type);
|
|
160
|
+
}
|
|
161
|
+
if (args.namespace) {
|
|
162
|
+
startConditions.push("namespace = ?");
|
|
163
|
+
startVals.push(args.namespace);
|
|
164
|
+
}
|
|
165
|
+
if (startConditions.length === 0) {
|
|
166
|
+
return errorResult("At least one of: name, entity_type, or namespace required");
|
|
167
|
+
}
|
|
168
|
+
const startEntities = db.prepare(`SELECT * FROM entities WHERE ${startConditions.join(" AND ")} LIMIT ?`).all(...startVals, limit);
|
|
169
|
+
if (startEntities.length === 0)
|
|
170
|
+
return jsonResult({ entities: [], relations: [] });
|
|
171
|
+
// Traverse relations
|
|
172
|
+
const visited = new Set();
|
|
173
|
+
const allEntities = [...startEntities];
|
|
174
|
+
const allRelations = [];
|
|
175
|
+
let currentIds = startEntities.map(e => e.id);
|
|
176
|
+
startEntities.forEach(e => visited.add(e.id));
|
|
177
|
+
for (let d = 0; d < depth; d++) {
|
|
178
|
+
if (currentIds.length === 0)
|
|
179
|
+
break;
|
|
180
|
+
const placeholders = currentIds.map(() => "?").join(",");
|
|
181
|
+
const relConditions = [];
|
|
182
|
+
if (direction === "outgoing" || direction === "both") {
|
|
183
|
+
relConditions.push(`source_entity_id IN (${placeholders})`);
|
|
184
|
+
}
|
|
185
|
+
if (direction === "incoming" || direction === "both") {
|
|
186
|
+
relConditions.push(`target_entity_id IN (${placeholders})`);
|
|
187
|
+
}
|
|
188
|
+
const relFilter = args.relation ? ` AND relation_type = ?` : "";
|
|
189
|
+
const relVals = args.relation
|
|
190
|
+
? [...currentIds, ...(direction === "both" ? currentIds : []), args.relation]
|
|
191
|
+
: [...currentIds, ...(direction === "both" ? currentIds : [])];
|
|
192
|
+
const rels = db.prepare(`
|
|
193
|
+
SELECT r.*,
|
|
194
|
+
se.name as source_name, se.entity_type as source_type,
|
|
195
|
+
te.name as target_name, te.entity_type as target_type
|
|
196
|
+
FROM relations r
|
|
197
|
+
JOIN entities se ON se.id = r.source_entity_id
|
|
198
|
+
JOIN entities te ON te.id = r.target_entity_id
|
|
199
|
+
WHERE (${relConditions.join(" OR ")})${relFilter}
|
|
200
|
+
LIMIT ?
|
|
201
|
+
`).all(...relVals, limit);
|
|
202
|
+
allRelations.push(...rels);
|
|
203
|
+
const nextIds = [];
|
|
204
|
+
for (const rel of rels) {
|
|
205
|
+
for (const id of [rel.source_entity_id, rel.target_entity_id]) {
|
|
206
|
+
if (!visited.has(id)) {
|
|
207
|
+
visited.add(id);
|
|
208
|
+
nextIds.push(id);
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
if (nextIds.length > 0) {
|
|
213
|
+
const ents = db.prepare(`SELECT * FROM entities WHERE id IN (${nextIds.map(() => "?").join(",")})`).all(...nextIds);
|
|
214
|
+
allEntities.push(...ents);
|
|
215
|
+
}
|
|
216
|
+
currentIds = nextIds;
|
|
217
|
+
}
|
|
218
|
+
return jsonResult({ entities: allEntities, relations: allRelations });
|
|
219
|
+
}
|
|
220
|
+
function entityList(db, args) {
|
|
221
|
+
const conditions = [];
|
|
222
|
+
const vals = [];
|
|
223
|
+
if (args.entity_type) {
|
|
224
|
+
conditions.push("entity_type = ?");
|
|
225
|
+
vals.push(args.entity_type);
|
|
226
|
+
}
|
|
227
|
+
if (args.namespace) {
|
|
228
|
+
conditions.push("namespace = ?");
|
|
229
|
+
vals.push(args.namespace);
|
|
230
|
+
}
|
|
231
|
+
const where = conditions.length ? `WHERE ${conditions.join(" AND ")}` : "";
|
|
232
|
+
const limit = args.limit || 50;
|
|
233
|
+
const rows = db.prepare(`SELECT * FROM entities ${where} ORDER BY name LIMIT ?`).all(...vals, limit);
|
|
234
|
+
return jsonResult({ entities: rows, count: rows.length });
|
|
235
|
+
}
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
import type Database from "better-sqlite3";
|
|
2
|
+
export declare const recallTools: ({
|
|
3
|
+
name: string;
|
|
4
|
+
description: string;
|
|
5
|
+
inputSchema: {
|
|
6
|
+
type: "object";
|
|
7
|
+
properties: {
|
|
8
|
+
memory_type: {
|
|
9
|
+
type: string;
|
|
10
|
+
enum: string[];
|
|
11
|
+
description: string;
|
|
12
|
+
};
|
|
13
|
+
scope: {
|
|
14
|
+
type: string;
|
|
15
|
+
description: string;
|
|
16
|
+
};
|
|
17
|
+
namespace: {
|
|
18
|
+
type: string;
|
|
19
|
+
description: string;
|
|
20
|
+
};
|
|
21
|
+
agent_role: {
|
|
22
|
+
type: string;
|
|
23
|
+
description: string;
|
|
24
|
+
};
|
|
25
|
+
task_id: {
|
|
26
|
+
type: string;
|
|
27
|
+
description: string;
|
|
28
|
+
};
|
|
29
|
+
status: {
|
|
30
|
+
type: string;
|
|
31
|
+
enum: string[];
|
|
32
|
+
description: string;
|
|
33
|
+
};
|
|
34
|
+
date_from: {
|
|
35
|
+
type: string;
|
|
36
|
+
description: string;
|
|
37
|
+
};
|
|
38
|
+
date_to: {
|
|
39
|
+
type: string;
|
|
40
|
+
description: string;
|
|
41
|
+
};
|
|
42
|
+
tags: {
|
|
43
|
+
type: string;
|
|
44
|
+
items: {
|
|
45
|
+
type: string;
|
|
46
|
+
};
|
|
47
|
+
description: string;
|
|
48
|
+
};
|
|
49
|
+
limit: {
|
|
50
|
+
type: string;
|
|
51
|
+
description: string;
|
|
52
|
+
};
|
|
53
|
+
offset: {
|
|
54
|
+
type: string;
|
|
55
|
+
description: string;
|
|
56
|
+
};
|
|
57
|
+
order: {
|
|
58
|
+
type: string;
|
|
59
|
+
enum: string[];
|
|
60
|
+
description: string;
|
|
61
|
+
};
|
|
62
|
+
query?: undefined;
|
|
63
|
+
alpha?: undefined;
|
|
64
|
+
id?: undefined;
|
|
65
|
+
};
|
|
66
|
+
required?: undefined;
|
|
67
|
+
};
|
|
68
|
+
} | {
|
|
69
|
+
name: string;
|
|
70
|
+
description: string;
|
|
71
|
+
inputSchema: {
|
|
72
|
+
type: "object";
|
|
73
|
+
properties: {
|
|
74
|
+
query: {
|
|
75
|
+
type: string;
|
|
76
|
+
description: string;
|
|
77
|
+
};
|
|
78
|
+
memory_type: {
|
|
79
|
+
type: string;
|
|
80
|
+
description: string;
|
|
81
|
+
enum?: undefined;
|
|
82
|
+
};
|
|
83
|
+
namespace: {
|
|
84
|
+
type: string;
|
|
85
|
+
description: string;
|
|
86
|
+
};
|
|
87
|
+
agent_role: {
|
|
88
|
+
type: string;
|
|
89
|
+
description: string;
|
|
90
|
+
};
|
|
91
|
+
status: {
|
|
92
|
+
type: string;
|
|
93
|
+
description: string;
|
|
94
|
+
enum?: undefined;
|
|
95
|
+
};
|
|
96
|
+
limit: {
|
|
97
|
+
type: string;
|
|
98
|
+
description: string;
|
|
99
|
+
};
|
|
100
|
+
alpha: {
|
|
101
|
+
type: string;
|
|
102
|
+
description: string;
|
|
103
|
+
};
|
|
104
|
+
scope?: undefined;
|
|
105
|
+
task_id?: undefined;
|
|
106
|
+
date_from?: undefined;
|
|
107
|
+
date_to?: undefined;
|
|
108
|
+
tags?: undefined;
|
|
109
|
+
offset?: undefined;
|
|
110
|
+
order?: undefined;
|
|
111
|
+
id?: undefined;
|
|
112
|
+
};
|
|
113
|
+
required: string[];
|
|
114
|
+
};
|
|
115
|
+
} | {
|
|
116
|
+
name: string;
|
|
117
|
+
description: string;
|
|
118
|
+
inputSchema: {
|
|
119
|
+
type: "object";
|
|
120
|
+
properties: {
|
|
121
|
+
id: {
|
|
122
|
+
type: string;
|
|
123
|
+
description: string;
|
|
124
|
+
};
|
|
125
|
+
memory_type?: undefined;
|
|
126
|
+
scope?: undefined;
|
|
127
|
+
namespace?: undefined;
|
|
128
|
+
agent_role?: undefined;
|
|
129
|
+
task_id?: undefined;
|
|
130
|
+
status?: undefined;
|
|
131
|
+
date_from?: undefined;
|
|
132
|
+
date_to?: undefined;
|
|
133
|
+
tags?: undefined;
|
|
134
|
+
limit?: undefined;
|
|
135
|
+
offset?: undefined;
|
|
136
|
+
order?: undefined;
|
|
137
|
+
query?: undefined;
|
|
138
|
+
alpha?: undefined;
|
|
139
|
+
};
|
|
140
|
+
required: string[];
|
|
141
|
+
};
|
|
142
|
+
})[];
|
|
143
|
+
export declare function handleRecall(db: Database.Database, name: string, args: any): {
|
|
144
|
+
content: {
|
|
145
|
+
type: "text";
|
|
146
|
+
text: string;
|
|
147
|
+
}[];
|
|
148
|
+
} | Promise<{
|
|
149
|
+
content: {
|
|
150
|
+
type: "text";
|
|
151
|
+
text: string;
|
|
152
|
+
}[];
|
|
153
|
+
}>;
|