IWE (iwe.md)
v0.37.0Markdown knowledge base as agent memory.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
iwe_attach
Attach a document as a block reference in one or more target documents determined by configured attach actions. Each target key is derived from the action's key_template (e.g. daily/{{today}}). The `to` field accepts a list of action names; the source is attached under each resolved target. Targets that already contain the source are silently skipped. Use list mode to discover available attach actions.
| Parameter | Type | Description |
|---|---|---|
dry_run | boolean | null | Preview changes without applying. Default: false |
key | string | null | Document key to attach as a block reference in the target(s) |
list | boolean | null | List available attach actions instead of executing. Default: false |
to | array | Configured attach action(s) to attach to (e.g. 'today'). Pass one or more action names; the source is attached under each resolved target. |
iwe_create
Create a document at an explicit `key` from the complete markdown in `content` — frontmatter block first (when there is one), then the title heading and the body. The content is written verbatim; the server adds nothing and moves nothing. Derive the key from stable metadata (entity name, session date), not the title wording. Pass if_exists: "skip" to make retries idempotent. Stats warnings (dangling links, orphans, similar pages) may ride the result; resolve them before ending the session.
| Parameter | Type | Description |
|---|---|---|
content * | string | The complete document, written verbatim: the YAML frontmatter block first (when there is one), then the markdown, normally starting with a `# Title` heading. Nothing is added or moved. |
key * | string | Document key — the created document's stable identity. Derive it from stable metadata (entity name, session date), not the title wording. Subdirectory keys allowed (e.g. people/ada); do not include… |
if_exists | Behavior when the key already exists: "fail" (default) reports an error, "skip" leaves the existing document untouched and returns created: false, which makes retries idempotent. |
iwe_delete
Delete a document from the knowledge graph. All block references and inline links to this document in other documents are cleaned up. Stats warnings (dangling links, orphans, similar pages) may ride the result; resolve them before ending the session.
| Parameter | Type | Description |
|---|---|---|
key * | string | Document key to delete |
dry_run | boolean | null | Preview changes without applying. Default: false |
iwe_extract
Extract a section from a document into a new standalone document. The original section is replaced with a block reference. Use list mode to discover sections first
| Parameter | Type | Description |
|---|---|---|
key * | string | Source document key |
block | integer | null | Block number to extract (1-indexed, use list mode to discover) |
dry_run | boolean | null | Preview changes without applying. Default: false |
list | boolean | null | List all sections with block numbers instead of extracting. Default: false |
section | string | null | Section title to extract (case-insensitive partial match) |
iwe_find
Search and discover documents in the knowledge graph. Supports fuzzy match on title and key (`fuzzy`), full-text match on title and body (`lexical`, fused with `fuzzy` when both are given), direct-reference filters (`refs_to`, `refs_from`), the structural set selector (`in` / `in_any` / `not_in` / `max_depth`) for transitive sub-document AND/OR/NOT queries with configurable depth, result and token caps (`limit`, `max_tokens`, `max_document_tokens`), and projections (`project`, `add_fields`).
| Parameter | Type | Description |
|---|---|---|
add_fields | string | null | Additive projection: same grammar as project (bare names are frontmatter fields, `$`-selectors are the document's own), extends defaults rather than replacing. Mutually exclusive with project. |
fuzzy | string | null | Fuzzy match on document title and key |
in | array | Restrict to candidates that are sub-documents of EVERY listed key (AND). Each entry is either a bare KEY or {key, depth}. |
in_any | array | Restrict to candidates that are sub-documents of AT LEAST ONE listed key (OR). |
lexical | string | null | Lexical (BM25) full-text match on title and body |
limit | integer | null | Maximum number of results to return. Unlimited if omitted (0 also = unlimited). |
max_depth | integer | null | Default depth for in / in_any / not_in entries that don't specify their own depth. Omit for unbounded. |
max_document_tokens | integer | null | Cap projected `$content` tokens per result. Unlimited if omitted (0 also = unlimited). |
max_tokens | integer | null | Cap total projected `$content` tokens across all results. Unlimited if omitted (0 also = unlimited). |
not_in | array | Exclude candidates that are sub-documents of ANY listed key (NOT). |
project | string | null | Replacement projection (e.g. '$title,priority' or 'body=$content,parents=$includedBy'). Bare names are frontmatter fields, and project null when the document has no such field; document fields are `$`… |
refs_from | string | null | Only return documents referenced by this key |
refs_to | string | null | Only return documents that reference this key |
iwe_inline
Replace a block reference with the actual content of the referenced document. Use list mode to discover block references first
| Parameter | Type | Description |
|---|---|---|
key * | string | Document key containing the block reference |
as_quote | boolean | null | Inline as blockquote instead of section. Default: false |
block | integer | null | Block number to inline (1-indexed, use list mode to discover) |
dry_run | boolean | null | Preview changes without applying. Default: false |
keep_target | boolean | null | Keep the target document after inlining. Default: false |
list | boolean | null | List all block references instead of inlining. Default: false |
reference | string | null | Reference key or title to inline (partial match) |
iwe_normalize
Normalize all document formatting across the knowledge graph. Re-parses and re-writes all documents to ensure consistent formatting
iwe_query
Run an IWE query/block-selection operation document. `find` and `count` read; `update` mutates frontmatter and blocks (operators $replace, $replaceText, $insertBefore, $insertAfter, $append, $delete); `delete` removes documents. Membership uses the `$content` filter operator; reads project `$content` narrowing, `$blocks`, and `$matches`. Always strict: every mutating application must carry an `expect` guard (document-level `expect` plus one per block operator). Use `find` with `$blocks`/`$matches` to locate targets and learn counts before mutating. Update/delete results may carry stats warning…
| Parameter | Type | Description |
|---|---|---|
document * | string | The operation document as YAML. Uses the IWE query + block-selection language: `filter` (with $content block membership), `project`/`addFields` ($content narrowing, $blocks, $matches), `sort` (`field:… |
operation * | Operation kind: find (read documents), count (count documents), update (mutate frontmatter and/or blocks), or delete (remove documents). | |
dry_run | boolean | null | Preview mutations without writing to disk (update/delete only). Default: false. |
iwe_rename
Rename a document key. All block references and inline links across the entire graph are updated to point to the new key
| Parameter | Type | Description |
|---|---|---|
new_key * | string | New document key |
old_key * | string | Current document key |
dry_run | boolean | null | Preview changes without applying. Default: false |
iwe_retrieve
Retrieve documents from the knowledge graph. Reads the given `keys` (or search seeds) and expands the graph around them via `expand` (includes / includedBy / references / referencedBy). With `search`/`fuzzy`, seeds are found by relevance within the candidate set (keys + selector); `limit` caps the seeds before expansion and `max_documents` caps the documents returned after expansion.
| Parameter | Type | Description |
|---|---|---|
backlinks | boolean | null | Include incoming inline references. Default: true |
children | boolean | null | Populate the `includes` array with child document edges. Default: false |
context | integer | null | DEPRECATED: use `expand: { includedBy: N }`. |
depth | integer | null | DEPRECATED: use `expand: { includes: N }`. |
exclude | array | null | Document keys to exclude from results |
expand | Expansion directions to follow out from each seed: object over includes / includedBy / references / referencedBy → integer depths (0 = unbounded, omitted = not followed). Expansion is doc-only when… | |
frontmatter | boolean | null | Include each document's frontmatter as a `frontmatter` object, omitted when the document has none. Default: true |
fuzzy | string | null | Seed search: fuzzy query over title and key. Fuses with `search` (RRF). |
in | array | Restrict to candidates that are sub-documents of EVERY listed key (AND). Each entry is either a bare KEY or {key, depth}. |
in_any | array | Restrict to candidates that are sub-documents of AT LEAST ONE listed key (OR). |
keys | array | Document keys to retrieve, or the candidate set searched within when `search`/`fuzzy` is present. Unknown keys are an error unless searching, where they match nothing. Can be empty when a structural s… |
limit | integer | null | Cap the number of seed documents kept before expansion — top-N by relevance when searching, the first N of the selection otherwise. Unlimited if omitted (0 also = unlimited). |
links | boolean | null | DEPRECATED: use `expand: { references: 1 }`. |
max_depth | integer | null | Default depth for in / in_any / not_in entries that don't specify their own depth. Omit for unbounded. |
max_document_tokens | integer | null | Cap content tokens per document. Unlimited if omitted (0 also = unlimited). |
max_documents | integer | null | Cap the number of documents returned after expansion, trimming periphery documents first. Unlimited if omitted (0 also = unlimited). |
max_tokens | integer | null | Cap total content tokens across all documents. Unlimited if omitted (0 also = unlimited). |
not_in | array | Exclude candidates that are sub-documents of ANY listed key (NOT). |
search | string | null | Seed search: BM25 full-text query over title and body. Present → the tool searches the candidate set and reads the ordered seeds. |
iwe_squash
Expand all block references into a single flat markdown document. Useful for export or generating a complete view of a document tree
| Parameter | Type | Description |
|---|---|---|
key * | string | Root document key to expand |
depth | integer | null | Levels of references to expand. Default: 2 |
iwe_stats
Get comprehensive statistics about the knowledge graph including document counts, reference patterns, broken links, and most connected documents
| Parameter | Type | Description |
|---|---|---|
key | string | null | Document key for per-document stats. Omit for aggregate graph statistics |
iwe_tree
View the hierarchical tree structure of the knowledge graph showing how documents are connected via block references. Supports the structural set selector (in / in_any / not_in / max_depth) — when provided, the tree roots are restricted to (or selected from) that set.
| Parameter | Type | Description |
|---|---|---|
depth | integer | null | Maximum traversal depth. Default: 4 |
in | array | Restrict to candidates that are sub-documents of EVERY listed key (AND). Each entry is either a bare KEY or {key, depth}. |
in_any | array | Restrict to candidates that are sub-documents of AT LEAST ONE listed key (OR). |
keys | array | null | Starting document keys. Unknown keys are an error. If empty and no selector, shows all root documents. |
max_depth | integer | null | Default depth for in / in_any / not_in entries that don't specify their own depth. Omit for unbounded. |
not_in | array | Exclude candidates that are sub-documents of ANY listed key (NOT). |
iwe_update
Update the full markdown content of an existing document. Stats warnings (dangling links, orphans, similar pages) may ride the result; resolve them before ending the session.
| Parameter | Type | Description |
|---|---|---|
content * | string | New full markdown content |
key * | string | Document key to update |