<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en"><generator uri="https://jekyllrb.com/" version="3.10.0">Jekyll</generator><link href="https://geml-spec.github.io/geml/blog/feed.xml" rel="self" type="application/atom+xml" /><link href="https://geml-spec.github.io/geml/" rel="alternate" type="text/html" hreflang="en" /><updated>2026-08-17T13:34:20+00:00</updated><id>https://geml-spec.github.io/geml/blog/feed.xml</id><title type="html">GEML</title><subtitle>GEML (General Expressive Markup Language) is a plain-text markup format built for the LLM era: block-level addressing, reference-based projection, build-time verification, and block-level revert — one syntax, human-clean and machine-precise.</subtitle><entry xml:lang="en"><title type="html">Why Do We Need a New Text Format in the Era of LLMs?</title><link href="https://geml-spec.github.io/geml/blog/2026/08/03/why-do-we-need-a-new-text-format-in-the-era-of-llms/" rel="alternate" type="text/html" title="Why Do We Need a New Text Format in the Era of LLMs?" /><published>2026-08-03T00:00:00+00:00</published><updated>2026-08-03T00:00:00+00:00</updated><id>https://geml-spec.github.io/geml/blog/2026/08/03/why-do-we-need-a-new-text-format-in-the-era-of-llms</id><content type="html" xml:base="https://geml-spec.github.io/geml/blog/2026/08/03/why-do-we-need-a-new-text-format-in-the-era-of-llms/"><![CDATA[<h1 id="why-do-we-need-a-new-text-format-in-the-era-of-llms">Why Do We Need a New Text Format in the Era of LLMs?</h1>

<blockquote>
  <p><strong>“In 2004 when Markdown was born, nobody needed a document that could be atomically rewritten by programs.”</strong></p>
</blockquote>

<hr />

<h2 id="1-two-readers-at-the-same-writing-desk">1. Two Readers at the Same Writing Desk</h2>

<p>For the past two decades, text formats have developed along a clear dichotomy:</p>

<ul>
  <li><strong>Markup designed for human visual consumption</strong> (e.g., Markdown, HTML): Prioritizes clean layout, effortless human readability, and seamless rendering into formatted pages.</li>
  <li><strong>Serialization formats designed for machine processing</strong> (e.g., JSON, YAML, XML): Prioritizes structural rigor, static typing, ease of AST traversal, and machine persistence.</li>
</ul>

<p>Under this division of labor, human engineers and computer programs operated in their respective domains without conflict.</p>

<p>However, with the rapid rise of Large Language Models (LLMs) and autonomous AI Agents embedded directly into software workflows and knowledge management, an irreversible shift has occurred: <strong>Documents are no longer authored solely by humans for human readers. They are co-authored, incrementally modified, and continuously maintained by humans and AI Agents together.</strong></p>

<p>The AI Agent has become the document’s <strong>second reader</strong>—and its frequent <strong>co-author</strong>.</p>

<p>When humans and machines sit down at the same writing desk, our traditional document infrastructure begins to fracture.</p>

<hr />

<h2 id="2-the-three-dilemmas-of-the-old-paradigms">2. The Three Dilemmas of the Old Paradigms</h2>

<h3 id="dilemma-1-markdowns-full-text-rewrite-tax-and-format-drift">Dilemma 1: Markdown’s “Full-Text Rewrite Tax” and Format Drift</h3>
<p>Markdown was created in 2004 by John Gruber with a singular goal: allowing writers to format plain text intuitively and convert it easily to HTML. It was never architected to support atomic, programmatic in-place mutations.</p>

<p>Because Markdown lacks deterministic block boundaries and machine-identifiable primary keys, an Agent attempting to modify a single parameter or clause is typically forced into one of two fragile paths:</p>
<ol>
  <li><strong>Prompt-based instructions (<em>“Please only output the modified paragraph”</em>)</strong>: Highly brittle. Over multi-turn interactions, it frequently leads to context misalignment and lost edits.</li>
  <li><strong>Full-Text Regeneration (Full-Text Rewrite)</strong>: To modify 10 words, the model is forced to ingest and regenerate 5,000 words.</li>
</ol>

<p>In an Agent’s iterative execution loop, full-text rewrites introduce severe penalties:</p>
<ul>
  <li><strong>Context Budget Dilution</strong>: The precious context window is consumed by unchanged characters, leaving less room for reasoning.</li>
  <li><strong>Format Drift and Hallucination</strong>: Every full-text rewrite introduces another roll of the dice—risking broken formatting, omitted sections, or unintentional alterations to unrelated content.</li>
</ul>

<h3 id="dilemma-2-json--xmls-syntactical-noise-and-the-loss-of-human-readability">Dilemma 2: JSON / XML’s “Syntactical Noise” and the Loss of Human Readability</h3>
<p>If Markdown is too loose, why not store everything in JSON or XML?</p>

<p>The answer is obvious: <strong>Syntactical wrapping is too heavy, and human cognitive load is too high.</strong><br />
Deeply nested braces, quotes, closing tags, and escape sequences deter human reading and direct editing, while consuming an unnecessarily high percentage of token budget.</p>

<h3 id="dilemma-3-state-fragmentation-and-copy-drift">Dilemma 3: State Fragmentation and “Copy Drift”</h3>
<p>In current Agent architectures, knowledge is scattered across disjointed stores: some in vector databases, some in short-term runtime memory, some in ad-hoc prompt templates, and some in copied-and-pasted Markdown snippets.</p>

<p>Software engineering holds an undeniable truth: <strong>Copies begin drifting the moment they are born.</strong><br />
When redundant copies lack a single source of truth to anchor them, Agents inevitably operate on conflicting versions and fragmented data.</p>

<hr />

<h2 id="3-the-lesson-of-history-documents-need-verbs-not-just-formatting">3. The Lesson of History: Documents Need Verbs, Not Just Formatting</h2>

<p>In 2000, Roy Fielding introduced the <strong>REST</strong> architectural style in his doctoral dissertation. REST did not invent new networking hardware; its breakthrough was conceptual: <strong>giving every scattered resource on the web a unique name (URI) and a uniform set of operational verbs (GET / POST / PUT / DELETE).</strong> This simple convention laid the groundwork for modern web collaboration.</p>

<p>Today, facing countless paragraphs, rule definitions, system parameters, and conclusions scattered across documents, we encounter the exact same problem.</p>

<p>The solution to human-agent co-authoring is not another complex rich-text editor. It is bringing the philosophy of REST into plain text:</p>

<blockquote>
  <p><strong>Doc-as-a-Base (Base of Truth)</strong>:<br />
Assign every logical block inside a document a unique name (<code class="language-plaintext highlighter-rouge">#id</code>), accompanied by standard operational verbs (<code class="language-plaintext highlighter-rouge">get</code> / <code class="language-plaintext highlighter-rouge">set</code> / <code class="language-plaintext highlighter-rouge">add</code> / <code class="language-plaintext highlighter-rouge">delete</code>).</p>
</blockquote>

<hr />

<h2 id="4-the-geml-solution-four-laws-and-physical-isolation">4. The GEML Solution: Four Laws and Physical Isolation</h2>

<p>To turn <strong>Doc-as-a-Base</strong> from a design philosophy into deterministic engineering, <a href="https://github.com/geml-spec/geml">GEML (geml-spec)</a> establishes four foundational laws:</p>

<h3 id="1-addressing-law-寻址律">1. Addressing Law (寻址律)</h3>
<blockquote>
  <p><strong>Every structural block must have a stable machine key, readable and replaceable in isolation.</strong></p>
</blockquote>

<p>GEML organizes plain text into Typed Blocks, each with an explicit <code class="language-plaintext highlighter-rouge">#id</code>.<br />
<code class="language-plaintext highlighter-rouge">get(id)</code> reads only that specific block; <code class="language-plaintext highlighter-rouge">set(id)</code> updates only that specific block. When an Agent modifies a section, the rest of the document is not only untouched—it is <strong>not even loaded into the prompt context</strong>.</p>

<blockquote>
  <p><strong>“What isn’t loaded cannot be broken — isolation, not discipline.”</strong><br />
Physical context isolation eliminates the token waste and hallucinations caused by full-text rewrites.</p>
</blockquote>

<h3 id="2-projection-law-投射律">2. Projection Law (投射律)</h3>
<blockquote>
  <p><strong>Inclusion must be dynamic evaluation at the view layer, not static duplication.</strong></p>
</blockquote>

<p>GEML natively supports modular embedding across blocks and documents. Defined once at the source, resolved dynamically upon consumption. This eliminates the maintenance burden of keeping duplicate copies in sync.</p>

<h3 id="3-validation-law-校验律">3. Validation Law (校验律)</h3>
<blockquote>
  <p><strong>Cross-block references must be verified at build time; bad writes are rejected before hitting disk.</strong></p>
</blockquote>

<p>Write-time defense. If an Agent produces broken syntax or a dangling reference, the GEML parser rejects the write before it lands on disk, without waiting for manual human review.</p>

<h3 id="4-rollback-law-回退律">4. Rollback Law (回退律)</h3>
<blockquote>
  <p><strong>When errors occur, roll back only the faulty block.</strong></p>
</blockquote>

<p>With its companion <code class="language-plaintext highlighter-rouge">.gemlhistory</code> sidecar, GEML tracks block-level modification history. If an Agent introduces a bad edit, that specific block can be rolled back atomically without reverting the entire document.</p>

<blockquote>
  <p><strong>“It’s not that Git is bad; it’s just not operating at this layer.”</strong><br />
Git governs file- and commit-level version control; GEML governs fine-grained, intra-document block rollbacks.</p>
</blockquote>

<hr />

<h2 id="5-boundary-declaration-what-geml-is-not">5. Boundary Declaration: What GEML Is NOT</h2>

<p>The credibility of any rigorous specification rests on clearly stating what it does not claim:</p>

<ol>
  <li><strong>It is not a database</strong>: Queries are O(N) stream scans without indexes; concurrent writes rely at most on file-level locks. GEML adopts database operational semantics (addressing, mutation, validation, rollback), not its runtime database properties.</li>
  <li><strong>It does not replace vector stores or Agent runtime memory</strong>: Vector databases handle semantic similarity search, and short-term memory manages conversational flow. GEML serves strictly as a <strong>persistent, auditable, precisely addressable document base of truth</strong>.</li>
  <li><strong>It does not claim magical “Zero-Token Overhead”</strong>: The <code class="language-plaintext highlighter-rouge">=== type {#id ...}</code> syntax carries lightweight structural cost. GEML practices <strong>Syntax Austerity</strong>—spending zero tokens on unnecessary styling or wrappers, reserving maximum context for actual content.</li>
  <li><strong>Validation cannot fix poor writing</strong>: It prevents structural corruption and broken references. If an Agent writes poor prose, the parser will not object.</li>
</ol>

<hr />

<h2 id="6-closing-thoughts">6. Closing Thoughts</h2>

<p>Addressing, projection, validation, and reversibility—each of these four capabilities is mature in its own domain: databases have primary keys, XML has XInclude, schemas provide validation, and Git tracks history.</p>

<p><strong>What is unusual is not any single one of these capabilities, but packing all four into human-readable plain text.</strong></p>

<p>Doc-as-a-Base is not about introducing a heavy runtime system. It is about establishing simple conventions that bring order to human-agent collaboration.</p>

<p>Give every paragraph a name. Give every modification a boundary.</p>

<hr />

<ul>
  <li>Repository: <a href="https://github.com/geml-spec/geml">github.com/geml-spec/geml</a></li>
  <li>Full Specification &amp; Manifesto: <a href="https://github.com/geml-spec/geml/blob/main/docs/MANIFESTO.md">The GEML Manifesto</a></li>
</ul>]]></content><author><name></name></author><category term="architecture" /><category term="ai-agents" /><category term="geml" /><category term="llm" /><category term="doc-as-a-base" /><category term="context-engineering" /><summary type="html"><![CDATA[Everyone asks this question: we already have Markdown, AsciiDoc, JSON, and XML. Why invent a new format? Because the reader has changed — humans and agents now co-author the same document, and the old formats were never built for that.]]></summary></entry><entry xml:lang="zh"><title type="html">为什么大模型时代需要一种全新的文本格式？</title><link href="https://geml-spec.github.io/geml/blog/2026/08/03/why-do-we-need-a-new-text-format-in-the-era-of-llms_cn/" rel="alternate" type="text/html" title="为什么大模型时代需要一种全新的文本格式？" /><published>2026-08-03T00:00:00+00:00</published><updated>2026-08-03T00:00:00+00:00</updated><id>https://geml-spec.github.io/geml/blog/2026/08/03/why-do-we-need-a-new-text-format-in-the-era-of-llms_CN</id><content type="html" xml:base="https://geml-spec.github.io/geml/blog/2026/08/03/why-do-we-need-a-new-text-format-in-the-era-of-llms_cn/"><![CDATA[<h1 id="为什么大模型时代需要一种全新的文本格式">为什么大模型时代需要一种全新的文本格式？</h1>

<blockquote>
  <p><strong>“Markdown 诞生的 2004 年，还没有人需要一份能被程序原子化改写的文档。”</strong></p>
</blockquote>

<hr />

<h2 id="1-两个读者坐到了同一张写字台前">1. 两个读者坐到了同一张写字台前</h2>

<p>在过去的二十多年里，文本格式的演进遵循着一条清晰的分水岭：</p>

<ul>
  <li>一类是<strong>给人看的排版标记</strong>（以 Markdown、HTML 为代表）：核心诉求是排版简洁、肉眼可读、方便渲染成富文本页面；</li>
  <li>另一类是<strong>给程序读的数据序列化格式</strong>（以 JSON、YAML、XML 为代表）：核心诉求是结构严谨、强类型、易于 AST 遍历与机器持久化。</li>
</ul>

<p>在这两套体系下，人类工程师与计算机各司其职，相安无事。</p>

<p>然而，随着大语言模型（LLM）与自动化 AI Agent 深入软件研发与知识协作的一线，一个不可逆的历史性转折发生了：<strong>文档不再仅由人类编写、供人类阅读，而是由人类与 AI Agent 共同创作、实时修改与持续维护。</strong></p>

<p>AI Agent 成了文档的<strong>第二个读者</strong>，同时也是高频介入的<strong>共同写作者</strong>。</p>

<p>当人机坐到同一张写字台前时，我们今天习以为常的文档基础设施开始全面瓦解。</p>

<hr />

<h2 id="2-老范式的三大困境">2. 老范式的三大困境</h2>

<h3 id="困境一markdown-的全量重写税与格式漂移">困境一：Markdown 的“全量重写税”与格式漂移</h3>
<p>Markdown 诞生于 2004 年，John Gruber 当初设计它的初衷极其纯粹——让写作者能够用直观的纯文本快速排版并转换成 HTML。它从来没有被设计用来承载“程序的原子级局部改写”。</p>

<p>因为缺乏确定性的区块边界与机器可识别的唯一标识，当 Agent 需要修改 Markdown 文档中的某一个参数或某一段逻辑时，常见的做法只有两种：</p>
<ol>
  <li><strong>靠 Prompt 约束（“请只输出需要修改的段落”）</strong>：极其脆弱，多轮之后极易出现上下文断层与定位失误；</li>
  <li><strong>全文重新生成（Full-Text Rewrite）</strong>：为了修改 10 个字，让模型重新读入并吐出 5000 字。</li>
</ol>

<p>在 Agent 的多轮执行循环里，全文重写带来了可怕的恶果：</p>
<ul>
  <li><strong>注意力被白白稀释</strong>：昂贵的上下文窗口被大量未变更的字符吞噬；</li>
  <li><strong>格式漂移与幻觉</strong>：每一次全文重写，都为模型引入了一次破坏排版、遗漏段落、甚至篡改非相关逻辑的随机性风险。</li>
</ul>

<h3 id="困境二json--xml-的语法噪点与人类可读性剥夺">困境二：JSON / XML 的“语法噪点”与人类可读性剥夺</h3>
<p>如果说 Markdown 太过松散，那为什么不直接用 JSON 或 XML 存储一切？</p>

<p>答案同样显而易见：<strong>包裹语法太沉重，且人类心智无法直接承受。</strong><br />
大段嵌套的括号、引号、闭合标签与转义符，不仅让程序员失去直接阅读与沉浸编辑的欲望，更在长上下文中占据了相当比例的无效 Token。</p>

<h3 id="困境三状态碎片化与副本漂移">困境三：状态碎片化与“副本漂移”</h3>
<p>在现有的 Agent 架构中，知识往往被拆碎：一部分在向量数据库里，一部分在短期记忆里，一部分在临时 Prompt 模板里，还有一部分散落在各种复制粘贴的 Markdown 副本中。</p>

<p>软件工程有一条朴素的真理：<strong>副本自诞生起就在漂移。</strong><br />
当多处副本无法通过单一源头自动同步时，Agent 面对的就是充斥着版本分歧与事实冲突的混沌状态。</p>

<hr />

<h2 id="3-历史的启示文档需要的不仅是格式而是一组动词">3. 历史的启示：文档需要的不仅是格式，而是一组动词</h2>

<p>2000 年，Roy Fielding 在其博士论文中提出了 <strong>REST</strong> 架构风格。REST 并没有发明任何新的网络硬件，它的核心创见在于：<strong>为互联网上散落的所有资源赋予唯一的名字（URI），并为它们定义了一组标准的操作动词（GET / POST / PUT / DELETE）。</strong> 这一极简约定奠定了现代互联网协作的基石。</p>

<p>今天，面对文档内部散落的无数逻辑块、规则定义、系统参数与任务结论，我们遇到了完全相同的问题。</p>

<p>解决人机共写冲突的答案，不是发明一个更加复杂的富文本编辑器，而是将 REST 的思想引入纯文本：</p>

<blockquote>
  <p><strong>Doc-as-a-Base（文档即真相之源）</strong>：<br />
为文档内的每一个逻辑块赋予唯一的名字（<code class="language-plaintext highlighter-rouge">#id</code>），并赋予标准的操作动词（<code class="language-plaintext highlighter-rouge">get</code> / <code class="language-plaintext highlighter-rouge">set</code> / <code class="language-plaintext highlighter-rouge">add</code> / <code class="language-plaintext highlighter-rouge">delete</code>）。</p>
</blockquote>

<hr />

<h2 id="4-geml-的解法四大定律与物理隔离">4. GEML 的解法：四大定律与物理隔离</h2>

<p>为了让 <strong>Doc-as-a-Base</strong> 从哲学变成确定性的工程实践，<a href="https://github.com/geml-spec/geml">GEML (geml-spec)</a> 确立了四项不可分割的运行定律：</p>

<h3 id="1-寻址律-addressing">1. 寻址律 (Addressing)</h3>
<blockquote>
  <p><strong>每个结构块必须有稳定的机器主键，脱离上下文即可被单独读取与替换。</strong></p>
</blockquote>

<p>GEML 将纯文本划分为类型化区块（Typed Blocks），每个块拥有明确的 <code class="language-plaintext highlighter-rouge">#id</code>。<br />
<code class="language-plaintext highlighter-rouge">get(id)</code> 只读取那一块，<code class="language-plaintext highlighter-rouge">set(id)</code> 只写入那一块。在 Agent 操作局部内容时，其余部分不仅不修改，在 Prompt 中甚至<strong>根本不加载</strong>。</p>

<blockquote>
  <p><strong>“没被加载的东西不可能被改坏——要隔离，不要自律。”</strong><br />
依靠物理级的上下文隔离，彻底消灭全量重写带来的幻觉与 Token 浪费。</p>
</blockquote>

<h3 id="2-投射律-projection">2. 投射律 (Projection)</h3>
<blockquote>
  <p><strong>引用必须是视图端的动态取值，而非静态复制。</strong></p>
</blockquote>

<p>GEML 原生支持跨文档与跨区块的嵌入引用。源头单一定义，渲染与消费时动态求值。彻底终结跨文档复制粘贴导致的“副本碎片化”噩梦。</p>

<h3 id="3-校验律-validation">3. 校验律 (Validation)</h3>
<blockquote>
  <p><strong>块间引用必须在构建期受核验，坏写入挡在落盘之前。</strong></p>
</blockquote>

<p>写入即防御。当 Agent 产生破坏性的语法结构或产生悬空断引用时，GEML 解析器在落盘前直接拦截报错，不等人工 Review 介入。</p>

<h3 id="4-回退律-rollback">4. 回退律 (Rollback)</h3>
<blockquote>
  <p><strong>出错时必须能只回滚出错的那一块。</strong></p>
</blockquote>

<p>GEML 借助伴生的 <code class="language-plaintext highlighter-rouge">.gemlhistory</code> 文件，记录每次 Block 的变更历史。Agent 哪怕改错了一处参数，也支持单块原子回退，不影响整篇文档的其他内容。</p>

<blockquote>
  <p><strong>“不是 Git 不好，是它不在这一层。”</strong><br />
Git 负责文件与 Commit 级别的版本管理，GEML 负责文本内部细粒度的块级撤销。</p>
</blockquote>

<hr />

<h2 id="5-边界声明它不是什么">5. 边界声明：它不是什么？</h2>

<p>任何成熟的工程规范，其信誉都建立在“主动讲清自己不主张什么”之上：</p>

<ol>
  <li><strong>它不是数据库</strong>：查询是 O(N) 的字符流遍历，没有索引，并发写至多依赖整文件锁。GEML 借用的是数据库的操作语义（寻址、读写、校验、回退），而非它的运行时属性。</li>
  <li><strong>它不取代向量库与 Agent 运行时记忆</strong>：向量库管语义相似度，短期记忆管会话窗口；GEML 的定位始终是<strong>可持久化、可审计、可精确读写的文档真相底座</strong>。</li>
  <li><strong>它不承诺虚无的“零开销”</strong>：<code class="language-plaintext highlighter-rouge">=== type {#id ...}</code> 语法本身具备轻量结构开销，GEML 主张的是<strong>语法克制（Syntax Austerity）</strong>——不为排版浪费一个多余的 Token，把宝贵的上下文留给内容。</li>
  <li><strong>校验拦不住内容写得烂</strong>：它拦的是结构破坏与断引用。Agent 把一段话写得很蠢，校验器一个字都不会说。</li>
</ol>

<hr />

<h2 id="6-写在最后">6. 写在最后</h2>

<p>寻址、投射、校验、可逆——这四种能力在各自领域都有极其成熟的对应物：数据库有主键，XML 有 XInclude，Schema 能校验，Git 管历史。</p>

<p><strong>不寻常的不是其中任何一项，而是将这四样能力，同时装进了一种人类肉眼可读的纯文本之中。</strong></p>

<p>Doc-as-a-Base 不是要创造一个沉重的系统，而是用极简的约定，给混沌的人机协作带来秩序。</p>

<p>让每段文字拥有名字，让每次修改拥有边界。</p>

<hr />

<ul>
  <li>项目仓库：<a href="https://github.com/geml-spec/geml">github.com/geml-spec/geml</a></li>
  <li>规范与宣言全文：<a href="https://github.com/geml-spec/geml/blob/main/docs/MANIFESTO.md">The GEML Manifesto</a></li>
</ul>]]></content><author><name></name></author><category term="architecture" /><category term="ai-agents" /><category term="geml" /><category term="llm" /><category term="doc-as-a-base" /><category term="context-engineering" /><summary type="html"><![CDATA[我们已经有了 Markdown、AsciiDoc，也有 JSON、XML，为什么还需要发明一种新的格式？因为读者变了——人和 Agent 第一次同时坐在同一份文本的两端，而旧的格式从未为此设计。]]></summary></entry></feed>