feat: Obsidian integration via cli scripts
This commit is contained in:
@@ -64,3 +64,5 @@ See `core/integrations/communication-model.md` for the reusable connector contra
|
||||
Optional navigation layers such as Obsidian should read the same Markdown files instead of copying memory into a second store.
|
||||
|
||||
See `core/integrations/obsidian-model.md` for the recommended vault model.
|
||||
|
||||
The project-agnostic memory interface lives in `scripts/memory/` and is documented in `core/integrations/memory-vault-model.md`. Agents should use that interface for note creation, vault search, Base queries, and health checks, while still editing Markdown directly for precise curation.
|
||||
|
||||
92
core/integrations/memory-vault-model.md
Normal file
92
core/integrations/memory-vault-model.md
Normal file
@@ -0,0 +1,92 @@
|
||||
# Memory Vault Integration Model
|
||||
|
||||
## Purpose
|
||||
|
||||
Define a project-agnostic interface for reading, creating, searching, and validating the canonical Markdown memory.
|
||||
|
||||
Obsidian is the current human-facing implementation, but the workspace should not depend on Obsidian-specific behavior for core memory maintenance.
|
||||
|
||||
---
|
||||
|
||||
## Layers
|
||||
|
||||
### Canonical Memory
|
||||
|
||||
The source of truth is plain Markdown under `vault/`.
|
||||
|
||||
Agents should edit canonical notes directly when precision matters because direct edits produce auditable diffs.
|
||||
|
||||
### Memory Interface
|
||||
|
||||
Use `scripts/memory/memory.sh` for vault-level operations:
|
||||
|
||||
- `root` prints the configured memory root
|
||||
- `read <path>` reads a vault-relative note
|
||||
- `search <query> [folder]` searches memory
|
||||
- `create <type> <slug> [title]` creates a note in the canonical folder from the matching template
|
||||
- `base-query <base-name> [format]` queries a structured view when supported
|
||||
- `health` checks required files and optional navigation health
|
||||
|
||||
### Tool Adapter
|
||||
|
||||
The current adapter is Obsidian CLI through `scripts/obsidian/cli.sh`.
|
||||
|
||||
If Obsidian CLI is unavailable or fails, `scripts/memory/memory.sh` falls back to direct Markdown operations unless `AIW_MEMORY_BACKEND=obsidian` is explicitly set.
|
||||
|
||||
---
|
||||
|
||||
## Configuration
|
||||
|
||||
- `AIW_MEMORY_VAULT_DIR`: canonical memory directory. Defaults to `<workspace-root>/vault`.
|
||||
- `AIW_MEMORY_BACKEND`: `auto`, `files`, or `obsidian`. Defaults to `auto`.
|
||||
- `AIW_OBSIDIAN_VAULT_DIR`: Obsidian-specific vault override, still supported by the adapter.
|
||||
- `AIW_OBSIDIAN_VAULT_NAME`: Obsidian URI vault name override for URI wrappers.
|
||||
|
||||
Backend meanings:
|
||||
|
||||
- `auto`: use Obsidian CLI when useful and available; otherwise use direct Markdown.
|
||||
- `files`: force direct Markdown behavior.
|
||||
- `obsidian`: require Obsidian CLI for supported operations and fail if unavailable.
|
||||
|
||||
---
|
||||
|
||||
## Note Type Routing
|
||||
|
||||
The memory interface owns type-to-folder routing:
|
||||
|
||||
- `daily` -> `vault/06-daily/`
|
||||
- `work-item` -> `vault/02-work-items/`
|
||||
- `person` -> `vault/04-people/`
|
||||
- `decision` -> `vault/05-decisions/`
|
||||
- `system` -> `vault/03-context/systems/`
|
||||
- `workstream` -> `vault/03-context/workstreams/`
|
||||
- `meeting-note` -> `vault/06-daily/`
|
||||
|
||||
Templates live in `vault/09-templates/`.
|
||||
|
||||
This gives agents an automatic destination for new notes without coupling the rule to Obsidian.
|
||||
|
||||
---
|
||||
|
||||
## Agent Rules
|
||||
|
||||
- Use the memory interface when creating new canonical notes from a known type.
|
||||
- Use the memory interface for broad search, Base queries, and vault health checks.
|
||||
- Edit Markdown directly for precise memory curation, corrections, and content updates.
|
||||
- Do not treat Obsidian CLI failure as project context.
|
||||
- Do not require Obsidian to be running for core workspace operation.
|
||||
- Keep raw evidence outside `vault/`; promote only curated memory.
|
||||
|
||||
---
|
||||
|
||||
## Useful Obsidian CLI Operations
|
||||
|
||||
When available, Obsidian CLI improves human-facing memory workflows:
|
||||
|
||||
- `search:context` gives Obsidian-aware search context.
|
||||
- `create path=... template=...` creates notes from templates.
|
||||
- `base:query` reads Bases as structured views.
|
||||
- `properties` and `property:*` inspect or update metadata.
|
||||
- `unresolved`, `orphans`, `links`, `backlinks`, and `tags` support vault health checks.
|
||||
|
||||
These are optional enhancements. The canonical memory remains Markdown.
|
||||
@@ -126,11 +126,23 @@ Do not use Bases for raw inboxes, generated evidence, scripts, or runtime logs.
|
||||
|
||||
## CLI Wrappers
|
||||
|
||||
Use `scripts/obsidian/` for non-interactive Obsidian URI helpers:
|
||||
Use `scripts/memory/` as the project-agnostic memory interface.
|
||||
|
||||
Use `scripts/obsidian/` only as the current Obsidian adapter:
|
||||
|
||||
- `cli.sh` runs the official Obsidian CLI from the configured vault directory.
|
||||
- `uri.sh` generates encoded Obsidian URIs.
|
||||
- `open.sh <vault-relative-path>` opens a note.
|
||||
- `daily.sh` opens the configured daily note.
|
||||
- `search.sh <query>` opens Obsidian search.
|
||||
- `open.sh <vault-relative-path>` opens a note through Obsidian URI.
|
||||
- `daily.sh` opens the configured daily note through Obsidian URI.
|
||||
- `search.sh <query>` opens Obsidian search through Obsidian URI.
|
||||
|
||||
The wrappers default to `vault/` and can be overridden with `AIW_OBSIDIAN_VAULT_DIR` and `AIW_OBSIDIAN_VAULT_NAME`.
|
||||
The memory interface can use Obsidian CLI when available and fall back to direct Markdown operations when it is not.
|
||||
|
||||
The agent should depend on `scripts/memory/memory.sh` for portable operations:
|
||||
|
||||
- `create <type> <slug> [title]`
|
||||
- `search <query> [folder]`
|
||||
- `base-query <base-name> [format]`
|
||||
- `health`
|
||||
|
||||
This keeps Obsidian replaceable while still making the current vault easier to use.
|
||||
|
||||
@@ -58,6 +58,8 @@ Use generic variables first:
|
||||
|
||||
```text
|
||||
AIW_PROJECT_PROFILE=<project>
|
||||
AIW_MEMORY_VAULT_DIR=<optional custom vault path>
|
||||
AIW_MEMORY_BACKEND=auto
|
||||
AIW_CHANNEL_PREFIX=<project-or-team-prefix>
|
||||
AIW_MATTERMOST_SYNC_CMD=<optional custom command>
|
||||
AIW_SLACK_EXPORT_PATH=<optional archive path>
|
||||
@@ -72,6 +74,8 @@ Connector secrets belong in ignored `.env` files, not in profile files.
|
||||
Start with generic commands:
|
||||
|
||||
- `/workspace-context`
|
||||
- `/memory-health`
|
||||
- `/memory-create`
|
||||
- `/communication-sync`
|
||||
- `/archive-import`
|
||||
- `/standup`
|
||||
@@ -92,6 +96,7 @@ Before using the workspace for real work:
|
||||
- run a communication sync with test channels or a dry sample
|
||||
- generate one standup from sample context
|
||||
- verify that imported evidence and promoted memory stay separate
|
||||
- run `bash scripts/memory/memory.sh health`
|
||||
|
||||
---
|
||||
|
||||
@@ -99,6 +104,8 @@ Before using the workspace for real work:
|
||||
|
||||
Open `vault/` as the Obsidian vault.
|
||||
|
||||
Use `scripts/memory/` as the project-agnostic memory interface. Obsidian is the default visual and CLI-backed adapter, but profile logic should not depend on Obsidian.
|
||||
|
||||
Recommended rules:
|
||||
|
||||
- keep `vault/` as the clean canonical human/AI memory
|
||||
|
||||
Reference in New Issue
Block a user