- SQLite is the source of truth.
- Cache stores only derived or hot state.
- JSONL logs remain useful for audit trails, but are not the primary query model.
This model exists to support a user-facing effect: after an interruption, the assistant can return to the earlier line of work without replaying the whole chat.
Stores raw conversational and tool events.
Suggested fields:
idsession_idturn_idparent_turn_idroleevent_typetexttsraw_json
Stores logical conversation threads within a session.
Suggested fields:
idsession_idtitlestatusparent_topic_idsummary_shortsummary_longopen_loops_jsonlabels_jsoncreated_atlast_active_at
Maps messages to one or more conversation threads.
Suggested fields:
message_idtopic_idscoreis_primaryreasoncreated_at
Stores stable, recallable knowledge that should survive conversation drift.
Suggested fields:
idscopecategorykeyvaluesensitivityrecall_policyconfidencesource_message_idsource_topic_idupdated_at
Normalizes labels for fact recall.
Suggested fields:
fact_idtag
Stores reusable prompt-ready snapshots.
Suggested fields:
idsession_idtopic_idkindcontentcreated_at
Stores current session routing state.
Suggested fields:
session_idactive_topic_idlast_compacted_atlast_turn_idupdated_at
backgroundenvironmentaccountsecuritypreferenceprojectdecisionconstraint
normalsensitivesecret_ref
secret_ref means the memory can mention where the secret lives, but should not inline the secret value into prompt context.
alwaystopic_boundon_demand
Topic summaries are not enough on their own.
Topics should also have labels such as:
openclawmemory-v2feishuinfraaccountsecurity
Labels are used to:
- improve routing
- pull relevant pinned facts
- recover older branches accurately
On process start:
- Load active sessions from persistent metadata.
- Restore
active_topic_idfromsession_state. - Warm the local cache lazily on first access.
The first implementation pass includes a concrete SQLite schema at:
bamdra-openclaw-memory/packages/memory-sqlite/src/schema.sql
This schema covers:
messagestopicstopic_membershipfactsfact_tagscontext_snapshotssession_stateschema_migrations
The schema is intentionally minimal and does not yet include:
- embeddings
- classifier feature tables
- topic edge graphs beyond
parent_topic_id