memory: add staleness indicator to recall, remove body length limit

This commit is contained in:
Levi Neely 2026-05-27 12:49:27 +02:00
parent 31b1e73f45
commit 1b73b22064
2 changed files with 11 additions and 2 deletions

View File

@ -20,7 +20,7 @@ call_tool: calls=[{tool: "memory_remember", args: ["<title>", "<tags_csv>", "<bo
- One memory per distinct fact.
- Before writing, recall on the same topic to avoid duplicates. If a closely related memory exists, update it rather than creating a new one.
- Do not store stale facts. If you learn that a previously stored fact is wrong or outdated, update or replace it.
- Keep bodies concise — a memory should be a fact, not a narrative. If you find yourself writing more than 3-4 sentences, split it into multiple focused memories.
- There is no length limit on memory bodies. Store as much detail as needed for the fact to be useful in a future session.
- **Act autonomously.** Do not ask the user whether to remember something — if the trigger condition is met, remember it.
---

View File

@ -31,6 +31,7 @@ fi
max_files=10
max_lines_per_file=50
stale_days=14
count=0
while IFS= read -r file; do
@ -39,7 +40,15 @@ while IFS= read -r file; do
echo "(showing $max_files of $(echo "$matches" | wc -l) matched files)"
break
fi
echo "=== $(basename "$file") ==="
mtime=$(stat -c %Y "$file" 2>/dev/null)
now=$(date +%s)
age_days=$(( (now - mtime) / 86400 ))
if [ $age_days -ge $stale_days ]; then
status="STALE (${age_days}d — verify or forget)"
else
status="fresh"
fi
echo "=== $(basename "$file") [$status] ==="
head -n $max_lines_per_file "$file" || echo "error: could not read $file"
lines=$(wc -l < "$file" 2>/dev/null)
if [ "$lines" -gt $max_lines_per_file ] 2>/dev/null; then