Skip to content

Memory

ClawDB provides 5 memory types for agents, queried via AQL (Agent Query Language).

TypePurposePersistence
WORKINGCurrent turn scratchpadPer-turn
EPISODICPast interactions indexed by timeLong-term
PROCEDURALLearned procedures and action patternsLong-term
SEMANTICFacts, knowledge, structured dataLong-term
TOOLSTool usage history and preferencesLong-term
STORE INTO EPISODIC (key = "incident-42", content = "Server restarted at 3am") SCOPE private NAMESPACE "agent"
RECALL FROM EPISODIC WHERE content = "server restart" LIMIT 5
FORGET FROM WORKING WHERE key = "temp-data"
LINK "incident-42" TO "runbook-restart" AS "resolved_by"

Use call:clawdb to query memory directly, or configure the agent resource with memory to enable automatic context loading via the on_before_turn and on_complete AQL hooks.

- name: recall-context
type: call:clawdb
resource: agent-memory
config:
query: 'RECALL FROM SEMANTIC WHERE key = "user_preferences" LIMIT 1'