Generated banner for IWE: a Markdown knowledge base you and your AI agent work on together
Generated logo for IWE: a Markdown knowledge base you and your AI agent work on together

IWE: a Markdown knowledge base you and your AI agent work on together

Memory serverOfficial IWE project

Created by IWE

Published in iwe-org/iwe. Publisher page

1,821 GitHub stars

What it is

Markdown knowledge graph — LSP for your editor, CLI + MCP memory for your AI agents
— the description by IWE

AutoGineer overview, from the brain’s own files

IWE provides a shared workspace for humans and AI agents to collaborate on project documentation, specs, and decision logs. By treating a folder of Markdown files as a structured knowledge graph, it allows agents to read, write, and organize information that persists across sessions. It functions as a memory server via the Model Context Protocol (MCP), enabling compatibility with various AI agents while remaining accessible to users through a native Mac app, CLI, or standard text editors like Neovim and VS Code.

How it works

Memory model: Not stated

AutoGineer overview, from the brain’s own files

IWE organizes notes as a collection of Markdown files within a project folder. It uses a CLI and an MCP server to expose these files to AI agents, allowing them to perform operations like searching, creating, and updating notes. The system supports features such as backlinks, link autocomplete, and graph visualization, ensuring that both the user and the AI agent interact with the same underlying document structure.

Folders
FolderRoleFiles
.githubagent-config4
docsdocs70
.githooksfolder1
cratesfolder381
npmfolder15

Requirements

Runtimes: Rust

Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Google Antigravity, Kiro, OpenCode, Amp, Roo Code, Cline, JetBrains Junie, Devin (ex-Windsurf)

Set it up

  1. This brain runs code automatically: 1 script. Review .githooks/pre-commit before opening the folder in Claude Code. No step below turns a hook on for you.

    • .githooks/pre-commit: runs on git pre-commit
  2. Not scanned by AutoGineerAutoGineer could not scan everything it runs. https://www.npmjs.com/package/@iwe-org/mcp
  3. Created by IWE. Published in iwe-org/iwe. Licence: Apache License 2.0.

Usage

AutoGineer overview, from the brain’s own files

  • Connect an AI agent to your project notes using the MCP server.
  • Use the CLI to search, create, or reorganize notes from the terminal.
  • Write and browse notes in the native Mac app while an agent works alongside you.
  • Integrate note navigation and autocomplete into your preferred text editor.
  • Maintain a persistent record of project decisions and lessons learned that both you and your agent can access.
“Explore my IWE notes and summarize what's here.”
The agent reads the Markdown files in the designated folder and provides a summary of the project context, decisions, or documentation found.
“Save the decision we just made about the database schema.”
The agent creates or updates a Markdown note in the IWE folder containing the details of the decision for future reference.

Documentation by IWE

IWE: a Markdown knowledge base you and your AI agent work on together

English · 简体中文 · 한국어

Your notes are your agent’s memory. IWE is where you work on them together.

iwe.md · Download for Mac · Docs · Reddit

Image: Crates.io Image: License Image: Documentation

Too many AI conversations start from zero. You explain your project, your decisions, your reasoning — then find yourself explaining it all again next session. Your own notes live somewhere else, out of the agent's reach.

Or worse, the agent “remembers” something in its own internal memory, but you can't easily see what it saved or correct what it got wrong. And that memory doesn't travel with you to the other agents you work with.

IWE gives you and your AI agents one shared place to work, right inside your project: a folder of connected Markdown documents — specs, plans, decisions, and more. Keep your own ideas there, ask your agent to save what you learn together, and return to that context as your work grows. You can read, edit, and organize those documents yourself — and they stay yours.

<br/> <p align="center"> <a href="https://www.youtube.com/watch?v=D58bPkOvbxE"> <img src="https://iwe.md/images/video-thumbnail.jpg" alt="Watch the IWE intro video on YouTube" width="600"> </a> </p> <br/>

Choose how you work

There are four ways to work with IWE. Mix and match them to fit your day:

ToolHow you'll use it
iWe for MacWrite and browse in a native app, and connect your existing Claude/Codex agent.
Your own editorStay in Neovim, Helix, VS Code, or Zed, with note navigation, backlinks, and autocomplete.
CLISearch and manage your notes from the terminal or scripts.
Claude/CodexLet your agent read, write, and organize memory while you work through conversation.

All four work with the same Markdown documents. Draft a spec in your editor, develop it with Claude/Codex, browse it in the iWe app, or search it from the CLI. Use any combination you like; each tool also works independently.

Bring your own AI. Neither the IWE CLI nor the iWe Mac app includes an AI model. Both work on their own as tools for your notes. When you want AI help, use your existing Claude/Codex agent — in terminal or directly in the Mac app.

<a href="https://iwe.md/?ref=readme-shot"><img src="https://iwe.md/images/app/GH-screen-1.1.png" alt="iWe for Mac showing project plans and connected documents" width="820"></a>

<p> <a href="https://iwe.md/?ref=readme-shot"><img src="https://iwe.md/images/app/GH-screen-2.png" alt="Bug tracking with charts" width="32%"></a> <a href="https://iwe.md/?ref=readme-shot"><img src="https://iwe.md/images/app/GH-screen-3.png" alt="Technical documents with code" width="32%"></a> <a href="https://iwe.md/?ref=readme-shot"><img src="https://iwe.md/images/app/GH-screen-4.png" alt="Release documents" width="32%"></a> </p>

Plans · Charts · Technical documents · Releases — click a screenshot to see the iWe app in action on iwe.md.

Why IWE

  • Shared context. Your agent can use the same notes you write for yourself. Notes link to each other, and one note can belong to several topics, so you can follow an idea wherever it connects.

  • Memory you can read. Decisions and lessons saved by your agent are ordinary notes you can browse, correct, or delete.

  • Your notes stay yours. Everything is Markdown in a folder on your machine. Back it up, sync it, or keep it in git. You don't need an IWE cloud account to keep your notes; connecting an AI agent involves that agent's own setup and account requirements.

See it working on iwe.md →

iWe for Mac

If you'd like a dedicated space for your notes, use the native Mac app. Open a folder of notes and you get a fast, keyboard-friendly space to write and browse. You can also connect your existing Claude/Codex agent to work alongside you.

  • Works with your Claude/Codex agent. Connect the agent you already use, ask questions about your notes, and have it draft or reorganize them. Watch its edits appear in the document as it works.

  • Room to experiment. Each agent run is one undo step — try an idea, and roll it back if you don't like it.

  • Follow your ideas. Jump between related notes, search in a few keystrokes, and view Mermaid diagrams right in your documents. Your editor and other tools can keep working on the same files.

See iWe for Mac on iwe.md →

Open a notes folder and start with a note about something you're working on. Once Claude/Codex is connected, try asking it to summarize that note or help you develop an idea.

Your Own Editor

Keep writing in Neovim, Helix, VS Code, or Zed. IWE adds link autocomplete, backlinks, search, and safe renaming across your notes.

Follow the guide for your editor, open your notes folder, and try linking two notes with autocomplete. You can use IWE for your own writing without connecting an AI agent.

CLI

Prefer the terminal? Use IWE to search, create, and reorganize notes, or work it into your scripts. The CLI has no AI built in: these commands work on their own. Your existing Claude/Codex agent can use IWE's tools too.

Install with Homebrew, or choose another option from the installation guide:

brew install iwe-org/iwe/iwe

Then run these commands inside your notes folder:

iwe init
iwe find
iwe find --lexical "project decisions"

iwe find lists your notes; --lexical searches their content. Explore more in the CLI reference and workflow examples.

Claude/Codex

You can use IWE entirely through your agent. Ask Claude/Codex to save decisions, look up past work, and organize what you've learned. The agent works with your notes through IWE, and you can open those files yourself whenever you want.

IWE isn't tied to one AI. The same notes work with Claude Code, Claude Desktop, Codex, Gemini, Cursor, and any tool that supports the Model Context Protocol.

Give Claude/Codex a memory — for Claude Code, install the plugin, then run /iwe:init in any project you want remembered. For Codex, follow the agent connection steps below.

/plugin marketplace add iwe-org/skills
/plugin install iwe@iwe-org
/iwe:init

Then ask it to save a decision from your current work, and open the note it creates in your project.

Connect another agent — with Homebrew installed, install IWE:

brew install iwe-org/iwe/iwe

Run iwe init in your notes folder, then follow the agent connection guide to add the iwec MCP server with that folder as its working directory. For other installation options, see the installation guide.

Once connected, ask your agent: “Explore my IWE notes and summarize what's here.”

Or let the agent set itself up — paste this into any agent that can run commands:

Set up IWE for my notes: install it (brew install iwe-org/iwe/iwe,
npm install -g @iwe-org/iwe, or cargo install iwe iwes iwec), run `iwe init`
in my notes directory, then add the `iwec` MCP server with its working
directory set to that folder.
Docs: https://iwe.md/docs/agentic/

Learn More

Ready-made workspaces: dev-workspace — project memory for a coding agent · marketing-workspace — campaign memory for a marketing agent.

Get Involved

Trying IWE with your own notes? Tell us what felt useful and where you got stuck. Questions, rough edges, and examples of how you use it are all welcome in Discussions.

IWE is open source. You can also report a bug or help improve the documentation.

Community: Twitter/X · Reddit · Discussions

Building on IWE? The CLI and MCP server are the supported ways to integrate today. Tell us what you depend on so we know what not to break.

License

Apache License 2.0

docs/document-schema.md

Document Schema

A document schema declares the required shape of a page: which frontmatter fields it carries, which sections it contains and in what order, how headers are written, how deep the heading tree may nest, and how large each part may grow. Schemas are checked by iwe schema validate, so a store's conventions become machine-checked policy in the loop write → validate → fix.

The language is JSON-Schema-aligned. Frontmatter is validated by literal JSON Schema (draft 2020-12). The body schema mirrors the document's own structure — a document has sections, a section has a header and its own nested sections — and keyword names and semantics come from JSON Schema wherever the concept maps: pattern, const, enum, minLength, maxLength, minContains, maxContains, additionalSections (after additionalProperties), description.

A complete schema:

$schema: https://document-schema.org/draft/2026-06/schema
frontmatter:
  type: object
  required: [status]
  properties:
    status: { enum: [draft, published] }
maxTokens: 1200
sections:
  - header: { pattern: "^[A-Z]", maxTokens: 12 }
    maxContains: 1
    sections:
      - header: { const: Summary }
        maxContains: 1
        description: every note opens with a summary
      - header: { const: Tasks }
        maxContains: 1
additionalSections: false

This reads: the frontmatter declares a status; the page body stays under 1200 tokens; there is exactly one top-level section, its header capitalized and at most 12 tokens; it contains a Summary section and then a Tasks section, in that order; no other top-level sections are allowed.

1. Schema documents

Schemas live in .iwe/schemas/<name>.yaml, one schema per file. Files are YAML 1.2, so JSON content is equally valid. The optional $schema key names the dialect; only https://document-schema.org/draft/2026-06/schema is accepted.

A schema binds to documents through the [schemas] section of .iwe/config.toml (see Configuration):

[schemas.note]
match = "notes/**"

[schemas.session]
match = ["journal/*", "meetings/**"]

The entry name is the schema name — [schemas.note] resolves to .iwe/schemas/note.yaml. match is a glob, or a list of globs, matched against the document key: * stays within a path segment, ** crosses segments, and a leading / is optional. A ! prefix negates a pattern — within one list patterns apply in order and the last matching one decides, gitignore-style, so ["notes/**", "!notes/index"] binds everything under notes/ except the index. Bindings compose order-free — a document is validated against every schema whose match hits, so overlapping bindings compose (as JSON Schema allOf does). A document matching no entry is unvalidated.

Every keyword in a schema is optional, and an absent keyword constrains nothing. An empty schema ({}) passes every document.

2. What is validated

  • The section tree. Sections at their structural depth after normalization (1 for #, 2 for ##). A section's subsections are its sections, in document order. Non-section content — paragraphs, lists, code blocks, tables — is invisible to the schema: it is never matched and never violates.

  • Header text. The rendered plain text of a heading, inline markup stripped.

  • Token counts. The same counting as the retrieve budgets, over rendered text, frontmatter excluded.

  • The frontmatter mapping. {} when the page has no frontmatter. Every field is presented to the validator, at every depth, whatever its name starts with — a stored query keyed on $includedBy validates like any other mapping. YAML dates and datetimes are presented to the validator as ISO-8601 / RFC 3339 strings.

3. Document schema

The top level of a schema file:

KeywordValueMeaning
$schemastringoptional dialect id
descriptionstringdefault hint for document-level violations
frontmatterJSON Schemavalidates the frontmatter mapping
maxTokensintegerbudget for the whole rendered body
maxDepthintegermaximum heading nesting (3 allows ###, forbids ####)
allSectionsreduced section schema (§6)applies to every section at every depth
sectionsarray of section schemasordered shapes for the top-level sections
additionalSectionsbool or reduced section schemapolicy for top-level sections matching no entry; default true (open)
blocksarray of block schemas (§8)ordered shapes for the content above the first heading
additionalBlocksbool or reduced block schemapolicy for that content matching no entry; default true
allBlocksreduced block schema (§8)applies to every block at every depth

The frontmatter value is standard JSON Schema, draft 2020-12, with format assertions enabled. Only in-document references (#/...) are allowed; external and remote $ref are rejected.

4. Section schema

An item in a sections array is always a section.

KeywordValueMeaning
headerheader schema (§5)constrains the header text; also decides binding (§7)
maxTokensintegerbudget for this section's subtree, header included
maxDepthintegermaximum nesting below this section (1 allows children, forbids deeper)
minContainsinteger, default 1minimum occurrences of this shape; 0 makes it optional
maxContainsinteger, default unboundedmaximum occurrences
descriptionstringthe violation hint for anything failing in this entry
allSectionsreduced section schemaapplies to every section below this one
sectionsarray of section schemasordered shapes for the subsections
additionalSectionsbool or reduced section schemapolicy for subsections matching no entry; default true
blocksarray of block schemas (§8)ordered shapes for this section's content blocks
additionalBlocksbool or reduced block schemapolicy for content blocks matching no entry; default true
allBlocksreduced block schema (§8)applies to every block below this section

The occurrence defaults are JSON Schema's contains defaults: a listed shape is required at least once and unbounded above. The recipes:

IntentSpelling
one or more (default)nothing
optionalminContains: 0
exactly onemaxContains: 1
at most oneminContains: 0, maxContains: 1
n or moreminContains: n
exactly nminContains: n, maxContains: n

5. Header schema

Applies to the header's plain text. The string keywords carry JSON Schema semantics exactly; maxTokens is the one extension.

KeywordMeaning
patternregex the text must match; unanchored, as in JSON Schema — write ^...$ for a full match
constthe text equals this string
enumthe text equals one of these strings
minLengthminimum length in characters
maxLengthmaximum length in characters
maxTokensmaximum tokens in the header text
descriptionhint override for header violations

const is in principle an anchored, regex-escaped pattern (const: Tasks ≡ pattern: "^Tasks$" with metacharacters escaped), but it is a distinct keyword for three reasons: JSON Schema alignment; escaping safety for literal headers containing regex metacharacters (a header like C++ (Draft) needs no escaping under const); and error naming — a missing-section message takes the section's name from const directly. Mind the asymmetry: pattern is unanchored, so pattern: Tasks matches any header containing "Tasks", while const: Tasks matches exactly. enum is a disjunction of consts. enum and const cannot be combined.

Quoting regexes in YAML. A backslash class like \d is an invalid escape inside a YAML double-quoted string. Write patterns in single quotes — pattern: '^\d{4}$' — or double the backslashes.

6. Reduced section schemas

allSections and a schema-valued additionalSections take a reduced section schema: header, maxTokens, maxDepth, and description only. Occurrence keywords are meaningless there — allSections applies to every section, additionalSections applies per leftover section — and structural keywords (sections, additionalSections, allSections) are not allowed inside them. When several allSections are in scope (the document's plus enclosing sections'), all of them apply.

additionalSections is boolean or schema, matching JSON Schema's own value form for array extras (items after prefixItems, draft-07's additionalItems, unevaluatedItems — all schema-or-boolean, all open by default). true allows leftover sections unconstrained, a schema validates each leftover against it, false makes each leftover a violation. Semantically it is closest to unevaluatedItems: it governs the sections no listed shape claimed.

7. Matching semantics

For each node — the document, then each bound section, recursively — the node's sections are matched against its sections entries. Matching is ordered, sequential, and greedy, without backtracking:

  1. Walk the instance sections in document order, holding a pointer into the entry list, starting at the first entry.

  2. For each section, find the first entry — at the pointer or later — whose header schema the section's header text satisfies (an entry with no header matches any section). Bind the section to that entry and advance the pointer to it. Entries before the pointer are closed and never bind again.

  3. A section that satisfies no entry at or after the pointer — including one that would only match an already-closed entry, i.e. out of order — is additional and is handled by additionalSections.

  4. After the walk, every entry's bound count is checked against minContains and maxContains. An entry bound fewer than minContains times reports a missing required section, named by its const, else enum, else pattern, else its position.

  5. Each bound section is then validated against the rest of its entry: maxTokens, maxDepth, allSections, and the nested sections matching, recursively.

Consequences:

  • Binding is decided by header alone. A Tasks section missing its required subsections still binds to the Tasks entry and reports the missing pieces — it does not fall through to additionalSections.

  • Occurrences are counted in total, not per consecutive run. A repeated entry stays open and keeps binding matching sections until the pointer advances past it — which happens only when a section binds to a later entry. An additional section (one matching no open entry) does not advance the pointer, so a matching section after it rejoins the same entry. Hence date, date, other, date counts as three dates: it satisfies minContains: 3 and violates maxContains: 2. minContains / maxContains bound the total, not the length of an unbroken run.

  • A headerless (wildcard) entry greedily absorbs every remaining section, so any entry after it can never bind — a wildcard must be the last entry. Placing one earlier is rejected as a schema error (§10); maxContains does not rescue it, since the wildcard still binds every match first.

  • There is no backtracking: matching is deterministic and errors are explainable. Order entries specific-first.

8. Blocks

The schema also reaches below the section, to a section's content — paragraphs, lists, code, quotes, tables, rules. The vocabulary mirrors the section level one step down: where a section has sections, it also has blocks; where a header constrains a section's title, text constrains a block's content; the all* / additional* / occurrence machinery and the matching algorithm are reused verbatim.

8.1 What a block is

Every piece of non-section content is a block: a type, plain text (empty for containers), a token count, and — for containers — child blocks. The seven types map onto the document model:

typecontentits texttype-only keywords
paragrapha paragraphthe paragraph text—
bullet-lista -/*/+ list(empty)items, minItems, maxItems
ordered-lista 1./1) list(empty)items, minItems, maxItems
codea fenced / raw code blockthe code bodylang
quotea block quote(empty)blocks, additionalBlocks, allBlocks
tablea tablethe cell text—
rulea horizontal rule(empty)—

An inclusion link (a lone reference to another document) is not a distinct type; it is matched as a paragraph whose text is the link text.

Bullet and ordered lists are distinct types — there is no ordered flag. A list's elements are its items; an item is itself a container (its own text plus nested blocks), shaped through items (§8.4).

A section's children are its content blocks followed by its subsections — subsections never interleave. The two arrays partition the children cleanly: blocks matches the leading content, sections matches the subsections. The document's top level works the same way — blocks there is the content above the first heading.

8.2 Block keywords on the document and every section
KeywordValueMeaning
blocksarray of block schemasordered shapes for this node's content blocks
additionalBlocksbool or reduced block schemapolicy for content blocks matching no entry; default true
allBlocksreduced block schemaapplies to every block at every depth below this node

allBlocks is to blocks what allSections is to sections; when several are in scope (document, enclosing sections, enclosing containers) all apply.

8.3 Block schema — an entry in a blocks array
KeywordValueMeaningTypes
typeone of the seven, or a listthe block kind(s); part of the binding identity (§8.5)all
texttext schema (§5)constrains the block's plain text; part of the binding identityall
maxTokensintegerbudget for this block's whole subtreeall
minContainsinteger, default 1minimum occurrences of this shapeall
maxContainsinteger, default unboundedmaximum occurrencesall
descriptionstringviolation hint for anything failing in this entryall
langtext schema (§5)constrains the code language; part of the binding identitycode
itemsitem schema (§8.4)schema applied to every list itemlists
minItemsintegerminimum number of list itemslists
maxItemsintegermaximum number of list itemslists
blocksarray of block schemasordered shapes for the quote's child blocksquote
additionalBlocksbool or reduced block schemapolicy for the quote's child blocks matching no entryquote
allBlocksreduced block schemaapplies to every block inside the quotequote

text and lang reuse the header schema shape: pattern, const, enum, minLength, maxLength, maxTokens, description. A keyword used on the wrong type — lang on a paragraph, items on a code, blocks on a table — is a load error (§10), as is an unknown type value.

type may also be a list of type names — type: [bullet-list, ordered-list] binds a block whose kind is any one of them, the block analogue of a header enum. A type-specific keyword is then allowed only when every listed type accepts it (items on [bullet-list, ordered-list] is fine; items on [bullet-list, code] is a load error).

Two token budgets, mirroring header.maxTokens vs a section's maxTokens: text: { maxTokens } bounds the block's own text, block maxTokens bounds its whole subtree. For a paragraph they coincide; for a list or quote the subtree includes the children.

8.4 Lists and items

A list (bullet-list / ordered-list) bounds its length with minItems / maxItems and shapes each item with items — one schema applied to every item. Repetition uses this pair, not repeated entries: one-to-ten items is { type: bullet-list, minItems: 1, maxItems: 10 }.

minItems is not minContains. Both minItems and maxItems default to unbounded — omitting minItems means no minimum (an empty list passes). This differs from minContains, which defaults to 1. So a bullet-list entry with nothing set is required to appear (via minContains: 1) but may itself be empty until you add minItems.

An item schema is a container without type or occurrence: text (the item's own text), maxTokens (the item's subtree), description, and its own blocks / additionalBlocks / allBlocks for the item's nested content. Containers nest without limit — a quote holding a list whose items hold paragraphs is fully expressible, and an allBlocks in scope at any container reaches every block beneath it.

8.5 Block matching

Within a node, its content blocks are matched against its blocks entries by the same ordered, greedy, no-backtracking algorithm as sections (§7) — the only difference is the binding identity. A block binds to the first entry at or after the pointer whose type matches (an entry with no type matches any block; a list type matches any of its kinds) and whose text / lang identity (const, enum, pattern), if present, the block satisfies. Blocks matching no open entry are additional, governed by additionalBlocks. After the walk, minContains / maxContains are tallied, each bound block is validated against the rest of its entry, and every allBlocks in scope applies to every block throughout. A missing required block is named by its text const / enum when present, else its type, else its position.

Every §7 consequence carries over — in particular, two entries with the same identity are rejected at load (§10): the second could never bind. Write "two to four lead paragraphs" as { type: paragraph, minContains: 2, maxContains: 4 }, never as repeated { type: paragraph } entries.

8.6 Reduced block schema

allBlocks and a schema-valued additionalBlocks take a reduced block schema — text, maxTokens, description only. Type-specific keywords (type, lang, items), structural keywords (blocks, additionalBlocks, allBlocks), and occurrence keywords (minContains, maxContains, minItems, maxItems) are rejected there, mirroring the reduced section schema.

8.7 Examples

Every line short — no paragraph, list item, table cell, or code body over 40 tokens, anywhere. text is the block's own text, so this never trips on a long list's total:

allBlocks:
  text: { maxTokens: 40 }

A hub page — one lead paragraph, then a bulleted index of short links, nothing else:

sections:
  - header: { pattern: ".+" }
    blocks:
      - type: paragraph
        maxContains: 1
      - type: bullet-list
        minItems: 1
        items:
          text: { maxTokens: 40 }
    additionalBlocks: false

A code-sample section — exactly one fenced block in an allowed language:

blocks:
  - type: code
    lang: { enum: [rust, toml, bash] }
    maxContains: 1

9. Violations

iwe schema validate reports one line per violation, <key> › <breadcrumb>: <message> (or <key>: <message> when the breadcrumb is empty). The breadcrumb is built from the matched header texts — a position like sections[2] where no header text is available, blocks[1] / items[3] for content blocks and list items, a frontmatter path like frontmatter › status. A hint: line follows when a hint is present:

journal/2026-01-05 › Tasks: header is 18 tokens (limit 12)
  hint: keep section headers short
notes/intro: required section 'Summary' missing
  hint: every note opens with a summary
notes/intro › frontmatter › status: not one of 'draft', 'published'

The hint is the nearest description walking outward from the failing keyword — header schema, then entry, then enclosing entries, then the document schema. Without one, no hint line is shown.

-f json output is an array of { key, schema, violations } objects; each violation additionally carries the machine paths schemaPath (a JSON Pointer into the schema file, e.g. /sections/0/sections/1/header) and the failing keyword. A document bound to several schemas yields one report per schema. The command exits 1 when any document has a violation, 0 when the store is clean.

10. Schema errors

These are configuration errors — iwe schema validate prints them to stderr and exits 2 before validating any document, rather than reporting them as violations:

  • a [schemas] entry naming a schema file that does not exist;

  • an invalid glob in a [schemas] entry's match;

  • a frontmatter subschema that fails the 2020-12 meta-schema, or contains an external or remote $ref;

  • an unknown keyword anywhere outside frontmatter — unlike JSON Schema, unknown keywords are rejected, so a typo cannot silently validate nothing (ordered is not a keyword, so it reports as unknown);

  • an unknown block type, an empty type list, or a type-specific block keyword on the wrong type (lang off code, items off a list, blocks off quote — for a list type, every listed type must accept the keyword);

  • an invalid pattern regex, a negative count, minContains greater than maxContains, minItems greater than maxItems, or enum and const together;

  • occurrence or structural keywords inside a reduced section or block schema;

  • an unreachable entry in a sections or blocks array — a wildcard entry (one with no identity constraint) that is not last, since it absorbs every match and starves the entries after it; or an entry whose identity exactly duplicates an earlier one, since the earlier always binds first.

11. Examples

Header discipline for a whole store — every header capitalized and short, every section within budget, nothing deeper than ###:

maxDepth: 3
allSections:
  header: { pattern: "^[A-Z]", maxLength: 60 }
  maxTokens: 400

A log page — at least three dated entries, each small, extra sections allowed but budgeted:

sections:
  - header: { pattern: '^\d{4}-\d{2}-\d{2}$' }
    minContains: 3
    maxTokens: 150
additionalSections:
  maxTokens: 300

A docs page — Installation and Usage required in order, Configuration optional:

sections:
  - header: { pattern: ".+" }
    maxContains: 1
    sections:
      - header: { const: Installation }
      - header: { const: Usage }
      - header: { const: Configuration }
        minContains: 0

Frontmatter only — the body left free:

frontmatter:
  type: object
  required: [type, date]
  properties:
    type: { const: post }
    date: { type: string, format: date }
    tags:
      type: array
      items: { type: string, pattern: "^[a-z][a-z0-9-]*$" }

See also

485 files · 414 not served here

Advantages

  • Shared context allows agents to access and build upon the same notes written by the user. evidence: README.md
  • Memory is stored as human-readable Markdown files that can be easily browsed, corrected, or deleted. evidence: README.md
  • Data remains under user control in local folders, avoiding dependency on proprietary cloud storage. evidence: README.md

Limitations

  • Requires manual setup of the MCP server or CLI tools to enable agent connectivity. evidence: README.md
  • The system does not include an AI model, requiring the user to bring their own agent. evidence: README.md

Security

Risk level: Low risk

This brain runs

Git hooks (1)

  • .githooks/pre-commit (pre-commit): runs on git pre-commit
  • Low risk: scripts-present (.githooks/pre-commit)

Attribution and licence

Created by
IWE
Publisher
IWE (Official IWE project)
Source
iwe-org/iwe · commit b733afe
Licence
Apache License 2.0 (files served here)
  • ATTRIBUTION.md (written by AutoGineer)
Synced

AutoGineer is not affiliated with or endorsed by IWE.

Install from source

414 of its files are not served here, so there is no ZIP. iwe-org/iwe at b733afe