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:
http://api:8080http://host.docker.internal:51234http://localhost:51234If LETHECLAW_API_URL is unset, try http://host.docker.internal:51234 first (Docker Desktop default), then ask the user.
When the user asks about history, decisions, prior work, "what did we do", or any past context:
```bash
curl -s "{LETHECLAW_API_URL}/memory/search?q=
```
content field directly — search results include full text. No need for memory_get or flat file access.memory_search tool as the first step. That tool searches flat markdown files, which are backup/reference only.&min_criticality=0.7&min_criticality=0.5tags=moltbook for Moltbook questions).When the user says "log this", "remember that", or you observe something worth recording:
["episodic", "security", "moltbook"])operator_input (user said it), direct_observation (you verified it), inferred (derived)No exceptions. This is operator-mandated protocol.
{LETHECLAW_API_URL}/memorycontent (required), optional: source (e.g. operator_input, direct_observation, inferred), tags (array), operator, session_key, contextmemory_id (UUID). Save it to update criticality or fetch provenance later.{LETHECLAW_API_URL}/memory/search?q={query}&limit=5min_criticality (0–1) to filter by importance.tags (comma-separated) to pre-filter by tag before semantic search (e.g. tags=moltbook,security)results array with id, content (full text), criticality, tags, source, created_at, access_countImportant: Search results include full content — you do NOT need to call memory_get afterward. Use the returned content directly.
Criticality filtering guidance:
min_criticality=0.7 (critical knowledge only)min_criticality=0.5 (useful and above)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"
{LETHECLAW_API_URL}/memory/recent{LETHECLAW_API_URL}/memory/{memory_id}/criticalitycriticality (0–1, required), optional reason{LETHECLAW_API_URL}/memory/{memory_id}/correction{LETHECLAW_API_URL}/memory/{memory_id}/provenanceevents (history of criticality changes: manual_boost, operator_correction, etc.) and correction_count.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 个版本