@tencentdb-agent-memory/memory-tencentdb
Version:
Four-layer local memory system plugin for OpenClaw — auto-captures, structures, and profiles conversational knowledge using local LLM + SQLite vector search (L0→L1→L2→L3 pipeline)
53 lines (52 loc) • 1.89 kB
JavaScript
//#region src/core/storage/types.ts
/**
* Storage path conventions.
*
* COS full path: {pathPrefix}/{key}
*
* key directory structure:
* conversations/{YYYY-MM-DD}.jsonl — L0 conversation records
* records/{YYYY-MM-DD}.jsonl — L1 memory records
* scene_blocks/{name}.md — L2 scene blocks
* persona.md — L3 user persona
* .metadata/scene_index.json — scene index
* .metadata/checkpoint.json — pipeline checkpoint
* .metadata/manifest.json — metadata manifest
* .metadata/instance_id — instance ID
* .backup/persona/ — persona backups
* .backup/scene_blocks/ — scene block backups
*/
const StoragePaths = {
/** L3 user persona */
persona: "persona.md",
/** L2 scene blocks directory */
sceneBlocksDir: "scene_blocks/",
/** L0 conversations directory */
conversationsDir: "conversations/",
/** L1 memory records directory */
recordsDir: "records/",
/** Metadata directory */
metadataDir: ".metadata/",
/** Scene index */
sceneIndex: ".metadata/scene_index.json",
/** Pipeline checkpoint */
checkpoint: ".metadata/checkpoint.json",
/** Metadata manifest */
manifest: ".metadata/manifest.json",
/** Instance ID */
instanceId: ".metadata/instance_id",
/** Backup directory */
backupDir: ".backup/",
/** Build scene block path */
sceneBlock: (name) => `scene_blocks/${name}.md`,
/** Build conversation JSONL path */
conversation: (date) => `conversations/${date}.jsonl`,
/** Build memory record JSONL path */
record: (date) => `records/${date}.jsonl`,
/** Build persona backup path */
personaBackup: (index) => `.backup/persona/persona.${index}.md`,
/** Build scene block backup path */
sceneBlockBackup: (index, name) => `.backup/scene_blocks/${index}/${name}.md`
};
//#endregion
export { StoragePaths as t };