# Memory Scripts This directory exposes a project-agnostic interface for canonical project knowledge. The current implementation uses Markdown files under `project-knowledge/` and can optionally delegate to the Obsidian CLI when it is available. The agent should depend on this memory interface, not on Obsidian-specific behavior, so the backing tool can be replaced later. ## Backend Model - `AIW_PROJECT_KNOWLEDGE_DIR` points to the canonical Markdown project knowledge directory. - `AIW_MEMORY_VAULT_DIR` and `AIW_OBSIDIAN_VAULT_DIR` are transition aliases. - `AIW_MEMORY_BACKEND` defaults to `auto`. - `auto` uses Obsidian CLI when it is useful and available, then falls back to direct Markdown operations. - `files` forces direct Markdown operations. - `obsidian` requires the Obsidian CLI for supported operations. ## Commands ```bash bash scripts/memory/memory.sh root bash scripts/memory/memory.sh read 01-current/current-work.md bash scripts/memory/memory.sh search "PDIAP-15765" bash scripts/memory/memory.sh create work-item pdiap-15999 "Example title" bash scripts/memory/memory.sh base-query work-items bash scripts/memory/memory.sh health ``` ## Note Creation `create` maps note types to canonical folders and templates: - `daily` -> `06-daily/` - `work-item` -> `02-work-items/` - `person` -> `04-people/` - `decision` -> `05-decisions/` - `system` -> `03-context/systems/` - `workstream` -> `03-context/workstreams/` - `meeting-note` -> `06-daily/` The template is resolved from `09-templates/.md`. When Obsidian CLI is available, the script uses `obsidian create path=... template=...`. Otherwise it creates the file directly from the template and resolves the basic `{{title}}`, `{{date}}`, and `{{time}}` variables. ## Agent Rule Use these scripts for project-knowledge operations such as creating notes, querying Bases, validating navigation health, and searching memory. For precise content edits, agents should still edit Markdown files directly so diffs remain auditable.