letheClaw — Agent memory
You can use the letheClaw API to store and retrieve memories for the user or the current session. The API base URL is in the environment variable LETHECLAW_API_URL.
Environment patterns:
- Docker Compose with letheClaw API container:
http://api:8080
- Host machine from Docker Desktop (Windows/Mac):
http://host.docker.internal:51234
- Local testing (same machine):
http://localhost:51234
If LETHECLAW_API_URL is unset, try http://host.docker.internal:51234 first (Docker Desktop default), then ask the user.
⚠️ PROTOCOL (NON-NEGOTIABLE)
Retrieval Rule
When the user asks about history, decisions, prior work, "what did we do", or any past context:
ALWAYS query letheClaw API FIRST:
curl -s "{LETHECLAW_API_URL}/memory/search?q=<query>&limit=5"
Use the returned content field directly — search results include full text. No need for memory_get or flat file access.
NEVER use memory_search tool as the first step. That tool searches flat markdown files, which are backup/reference only.
Apply criticality filtering when appropriate:
- Security/config: add
&min_criticality=0.7
- General recall: add
&min_criticality=0.5
- Exploratory: no filter
Use tag pre-filtering when query domain is clear (e.g., tags=moltbook for Moltbook questions).
letheClaw is the authoritative memory system. Flat files may be stale or incomplete.
Storage Rule
When the user says "log this", "remember that", or you observe something worth recording:
- POST to letheClaw API (see "Store a memory" below)
- Assign appropriate criticality: 0.3 (transient) → 0.5 (useful) → 0.7 (important) → 0.9 (critical)
- Tag precisely: 2-5 specific tags (type + domain, e.g.
["episodic", "security", "moltbook"])
- Set source:
operator_input (user said it), direct_observation (you verified it), inferred (derived)
No exceptions. This is operator-mandated protocol.
Store a memory
- POST
{LETHECLAW_API_URL}/memory
- Body (JSON):
content (required), optional: source (e.g. operator_input, direct_observation, inferred), tags (array), operator, session_key, context
- Returns:
memory_id (UUID). Save it to update criticality or fetch provenance later.
Search memories (semantic)
- GET
{LETHECLAW_API_URL}/memory/search?q={query}&limit=5
- Optional:
min_criticality (0–1) to filter by importance.
- Optional:
tags (comma-separated) to pre-filter by tag before semantic search (e.g. tags=moltbook,security)
- Returns:
results array with id, content (full text), criticality, tags, source, created_at, access_count
Important: Search results include full content — you do NOT need to call memory_get afterward. Use the returned content directly.
Criticality filtering guidance:
- Security/config queries:
min_criticality=0.7 (critical knowledge only)
- General recall:
min_criticality=0.5 (useful and above)
- Exploratory search: no filter (all results)
Tag pre-filtering (performance optimization):
When query intent is clear, pre-filter by tags to reduce search space:
# "Latest Moltbook posts"
curl "{LETHECLAW_API_URL}/memory/search?q=posts&tags=moltbook,episodic&limit=5"
# "Security findings"
curl "{LETHECLAW_API_URL}/memory/search?q=findings&tags=security,semantic&min_criticality=0.7&limit=3"
Recent memories
- GET
{LETHECLAW_API_URL}/memory/recent
- Returns: Recently stored memories (from cache or DB).
Update criticality (manual)
- POST
{LETHECLAW_API_URL}/memory/{memory_id}/criticality
- Body (JSON):
criticality (0–1, required), optional reason
- Use when the user or you want to mark a memory as more or less important.
Mark operator correction
- POST
{LETHECLAW_API_URL}/memory/{memory_id}/correction
- No body. Call when the user corrects something about this memory; this boosts criticality and increments a correction counter so provenance shows how often it was corrected.
Get provenance
- GET
{LETHECLAW_API_URL}/memory/{memory_id}/provenance
- Returns: Full memory object plus
events (history of criticality changes: manual_boost, operator_correction, etc.) and correction_count.
Errors
- 400 — Invalid request or invalid memory ID format.
- 404 — Memory not found (wrong or deleted ID).
- 5xx — Server/upstream error; suggest checking if letheClaw is running and reachable.
When the user says they want to remember something, search memory, see why a memory is important, or correct a memory, use the appropriate endpoint above.
1---
2name: letheclaw
3version: 1.0.0
4description: Use letheClaw to store, search, and manage memories with criticality and provenance.
5trigger: "memory|letheclaw|remember|recall|criticality|provenance"
6tools: [network]
7metadata:
8 source: https://skillmd.com/skills/modbender/letheclaw
9---
10
11# letheClaw — Agent memory
12
13You can use the letheClaw API to store and retrieve memories for the user or the current session. The API base URL is in the environment variable **LETHECLAW_API_URL**.
14
15**Environment patterns:**
16- Docker Compose with letheClaw API container: `http://api:8080`
17- Host machine from Docker Desktop (Windows/Mac): `http://host.docker.internal:51234`
18- Local testing (same machine): `http://localhost:51234`
19
20If LETHECLAW_API_URL is unset, try `http://host.docker.internal:51234` first (Docker Desktop default), then ask the user.
21
22---
23
24## ⚠️ PROTOCOL (NON-NEGOTIABLE)
25
26### Retrieval Rule
27When the user asks about **history, decisions, prior work, "what did we do", or any past context:**
28
291. **ALWAYS query letheClaw API FIRST:**
30 ```bash
31 curl -s "{LETHECLAW_API_URL}/memory/search?q=<query>&limit=5"
32 ```
33
342. **Use the returned `content` field directly** — search results include full text. No need for `memory_get` or flat file access.
35
363. **NEVER use `memory_search` tool as the first step.** That tool searches flat markdown files, which are backup/reference only.
37
384. **Apply criticality filtering when appropriate:**
39 - Security/config: add `&min_criticality=0.7`
40 - General recall: add `&min_criticality=0.5`
41 - Exploratory: no filter
42
435. **Use tag pre-filtering when query domain is clear** (e.g., `tags=moltbook` for Moltbook questions).
44
456. **letheClaw is the authoritative memory system.** Flat files may be stale or incomplete.
46
47### Storage Rule
48When the user says "log this", "remember that", or you observe something worth recording:
49
501. **POST to letheClaw API** (see "Store a memory" below)
512. **Assign appropriate criticality:** 0.3 (transient) → 0.5 (useful) → 0.7 (important) → 0.9 (critical)
523. **Tag precisely:** 2-5 specific tags (type + domain, e.g. `["episodic", "security", "moltbook"]`)
534. **Set source:** `operator_input` (user said it), `direct_observation` (you verified it), `inferred` (derived)
54
55**No exceptions.** This is operator-mandated protocol.
56
57---
58
59## Store a memory
60
61- **POST** `{LETHECLAW_API_URL}/memory`
62- **Body (JSON):** `content` (required), optional: `source` (e.g. `operator_input`, `direct_observation`, `inferred`), `tags` (array), `operator`, `session_key`, `context`
63- **Returns:** `memory_id` (UUID). Save it to update criticality or fetch provenance later.
64
65## Search memories (semantic)
66
67- **GET** `{LETHECLAW_API_URL}/memory/search?q={query}&limit=5`
68- Optional: `min_criticality` (0–1) to filter by importance.
69- Optional: `tags` (comma-separated) to pre-filter by tag before semantic search (e.g. `tags=moltbook,security`)
70- **Returns:** `results` array with `id`, `content` (full text), `criticality`, `tags`, `source`, `created_at`, `access_count`
71
72**Important:** Search results include **full content** — you do NOT need to call memory_get afterward. Use the returned content directly.
73
74**Criticality filtering guidance:**
75- Security/config queries: `min_criticality=0.7` (critical knowledge only)
76- General recall: `min_criticality=0.5` (useful and above)
77- Exploratory search: no filter (all results)
78
79**Tag pre-filtering (performance optimization):**
80When query intent is clear, pre-filter by tags to reduce search space:
81```bash
82# "Latest Moltbook posts"
83curl "{LETHECLAW_API_URL}/memory/search?q=posts&tags=moltbook,episodic&limit=5"
84
85# "Security findings"
86curl "{LETHECLAW_API_URL}/memory/search?q=findings&tags=security,semantic&min_criticality=0.7&limit=3"
87```
88
89## Recent memories
90
91- **GET** `{LETHECLAW_API_URL}/memory/recent`
92- **Returns:** Recently stored memories (from cache or DB).
93
94## Update criticality (manual)
95
96- **POST** `{LETHECLAW_API_URL}/memory/{memory_id}/criticality`
97- **Body (JSON):** `criticality` (0–1, required), optional `reason`
98- Use when the user or you want to mark a memory as more or less important.
99
100## Mark operator correction
101
102- **POST** `{LETHECLAW_API_URL}/memory/{memory_id}/correction`
103- No body. Call when the user corrects something about this memory; this boosts criticality and increments a correction counter so provenance shows how often it was corrected.
104
105## Get provenance
106
107- **GET** `{LETHECLAW_API_URL}/memory/{memory_id}/provenance`
108- **Returns:** Full memory object plus `events` (history of criticality changes: manual_boost, operator_correction, etc.) and `correction_count`.
109
110## Errors
111
112- **400** — Invalid request or invalid memory ID format.
113- **404** — Memory not found (wrong or deleted ID).
114- **5xx** — Server/upstream error; suggest checking if letheClaw is running and reachable.
115
116When the user says they want to remember something, search memory, see why a memory is important, or correct a memory, use the appropriate endpoint above.