Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions openclaw.plugin.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,20 @@
{
"id": "memory-powermem",
"kind": "memory",
"contracts": {
"tools": [
"memory_recall",
"memory_store",
"memory_forget",
"experience_store",
"experience_recall",
"agent_memory_add",
"agent_memory_share",
"cross_scope_share",
"agent_memory_list",
"agent_memory_shared"
]
},
"uiHints": {
"mode": {
"label": "Backend mode",
Expand Down
5 changes: 1 addition & 4 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2214,8 +2214,6 @@ const memoryPlugin = {
for (const msg of messages) {
if (!msg || typeof msg !== "object") continue;
const msgObj = msg as Record<string, unknown>;
const role = msgObj.role;
if (role !== "user" && role !== "assistant") continue;
const content = msgObj.content;
if (typeof content === "string") {
texts.push(content);
Expand All @@ -2237,11 +2235,10 @@ const memoryPlugin = {
}
}

const MIN_LEN = 10;
const MAX_CHUNK_LEN = 6000;
const MAX_CHUNKS_PER_SESSION = 3;
const sanitized = texts
.filter((t): t is string => typeof t === "string" && t.trim().length >= MIN_LEN)
.filter((t): t is string => typeof t === "string" && t.trim().length > 0)
.map((t) => t.trim())
.filter(
(t) =>
Expand Down
2 changes: 0 additions & 2 deletions src/wal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,6 @@ export async function walCapture(
session: WalSession,
deps: WalDeps,
): Promise<Array<string | number>> {
if (!detectKeySignals(prompt)) return [];

const reply = await deps.callLlm(prompt, {
systemPrompt: WAL_EXTRACT_PROMPT,
maxTokens: 512,
Expand Down
Loading