write
Create and index memory entries in a shared knowledge base, organized into shared or personal layers with author provenance.
Instructions
Write a memory file (also indexes it). Returns {ok, path}.
There are exactly two layers. `path` is store-relative and starts with one:
- `shared/...` — the cross-agent knowledge base (skills/tools/lessons/rules)
- `personal/...` — the owner's personal space (free-form)
`layer` is OPTIONAL — leave it out and it's inferred from the path. If you do
pass it, the only valid keys are "shared" and "personal".
Layers are SHARED spaces, not per-author: every connected agent reads and
writes the same paths. `author_agent` only records who wrote an entry
(provenance); it does not partition or hide anything. So `personal/` is "the
owner's personal layer", visible to all connected agents — NOT "this agent's
private space". Truly secret material should not be put in this store at all.
`type` is one of skill|tool|lesson|rule|conversation|note (inferred from the
path if omitted). An explicit type="skill" must include the 5 template
sections, each headed in Chinese OR English: 目标/Goal, 何时用/When to use,
前置/Preconditions, 步骤/Steps, 验证/Verify.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | ||
| tags | No | ||
| type | No | ||
| layer | No | ||
| reason | No | ||
| source | No | ||
| content | Yes | ||
| author_agent | Yes |