Function: ensureMemoryDir()
ensureMemoryDir(
workspaceDir):string
Defined in: packages/agentos/src/cognition/substrate/memory/wiki/migrateMemoryMd.ts:19
Guarantee a memory/ directory exists in the workspace and return its path.
- If
memory/already exists, return it untouched (idempotent). - Else if
MEMORY.mdexists, seedmemory/index.mdfrom it.MEMORY.mdis left on disk as a fallback. - Else create an empty
memory/with a stubindex.md.
Always creates .meta/index.json if absent. Never modifies or deletes
MEMORY.md.
Parameters
workspaceDir
string
The per-agent workspace directory.
Returns
string
Absolute path to the memory/ directory.