mirror of
https://github.com/Jeuners/agenttwo-tools.git
synced 2026-09-09 15:02:31 +02:00
- memory_events als append-only Log (nur INSERT), daraus Zustand deterministisch rekonstruierbar (fold/rebuild) - Traumphase konsolidiert Log in Ankerpunkte: LLM-Extraktion mit Heuristik-Fallback, Dedupe über Wort-Ähnlichkeit, Decay auf ungepinnten Ankern - einstellbares Gedächtnis-Fenster (Default 10 Schritte) statt hartkodiertem slice(-24) - wichtigste Ankerpunkte werden als System-Kontext eingespielt - neue Werkzeuge remember (schreibend, gepinnt) und recall - Gedächtnis-Panel im Frontend: Ankerliste, Pinnen, Traumphase manuell auslösen, Rekonstruktion - Eval-Skript: npm run memory:eval --workspace server
31 lines
937 B
TypeScript
31 lines
937 B
TypeScript
import { queryAnchors } from "../memory.js";
|
|
import { ToolError } from "./types.js";
|
|
import type { Tool } from "./types.js";
|
|
|
|
export const recallTool: Tool = {
|
|
name: "recall",
|
|
description:
|
|
"Durchsucht das Gedächtnis (Ankerpunkte) des aktuellen Chats, z. B. um frühere Fakten, Entscheidungen oder Präferenzen abzurufen.",
|
|
parameters: {
|
|
type: "object",
|
|
properties: {
|
|
query: {
|
|
type: "string",
|
|
description: "Optionaler Suchbegriff; ohne Query kommen die wichtigsten Ankerpunkte.",
|
|
},
|
|
},
|
|
},
|
|
async run(args, ctx) {
|
|
if (!ctx.sessionId) throw new ToolError("Keine Sitzung für das Gedächtnis bekannt");
|
|
const anchors = queryAnchors(ctx.sessionId, String(args.query ?? ""));
|
|
return {
|
|
count: anchors.length,
|
|
anchors: anchors.map((a) => ({
|
|
text: a.text,
|
|
kind: a.kind,
|
|
importance: a.importance,
|
|
hits: a.hits,
|
|
})),
|
|
};
|
|
},
|
|
};
|