<?xml version="1.0" encoding="utf-8"?>
<!-- 
     draft-rfcxml-general-template-standard-00
  
     This template includes examples of the most commonly used features of RFCXML with comments 
     explaining how to customise them. This template can be quickly turned into an I-D by editing 
     the examples provided. Look for [REPLACE], [REPLACE/DELETE], [CHECK] and edit accordingly.
     Note - 'DELETE' means delete the element or attribute, not just the contents.
     
     Documentation is at https://authors.ietf.org/en/templates-and-schemas
-->
<?xml-model href="rfc7991bis.rnc"?>  <!-- Required for schema validation and schema-aware editing -->
<!-- <?xml-stylesheet type="text/xsl" href="rfc2629.xslt" ?> -->
<!-- This third-party XSLT can be enabled for direct transformations in XML processors, including most browsers -->


<!DOCTYPE rfc [
  <!ENTITY nbsp    "&#160;">
  <!ENTITY zwsp   "&#8203;">
  <!ENTITY nbhy   "&#8209;">
  <!ENTITY wj     "&#8288;">
]>
<!-- If further character entities are required then they should be added to the DOCTYPE above.
     Use of an external entity file is not recommended. -->

<rfc
  xmlns:xi="http://www.w3.org/2001/XInclude"
  category="std"
  docName="draft-zhou-structured-data-schema-interaction-00"
  ipr="trust200902"
  obsoletes=""
  updates=""
  submissionType="IETF"
  consensus="true"
  xml:lang="en"
  version="3">
<!-- [REPLACE] 
       * docName with name of your draft
     [CHECK] 
       * category should be one of std, bcp, info, exp, historic
       * ipr should be one of trust200902, noModificationTrust200902, noDerivativesTrust200902, pre5378Trust200902
       * updates can be an RFC number as NNNN
       * obsoletes can be an RFC number as NNNN 
-->

  <front>
    <title abbrev="Structured Data Schema Interaction">Structured Data Schema Interaction Protocol for Multi-Agent Collaboration</title>
    <!--  [REPLACE/DELETE] abbrev. The abbreviated title is required if the full title is longer than 39 characters -->

    <seriesInfo name="Internet-Draft" value="draft-zhou-structured-data-schema-interaction-00"/>
   
    <author fullname="Fangtong Zhou" initials="F." surname="Zhou">
      <!-- [CHECK]
             * initials should not include an initial for the surname
             * role="editor" is optional -->
    <!-- Can have more than one author -->
      
    <!-- all of the following elements are optional -->
      <organization>Huawei Technologies</organization>
      <address>
        <postal>
          <!-- Reorder these if your country does things differently -->
          <street>Huawei Bld., No.156 Beiqing Rd.</street>
          <city>Beijing</city>
          <code>100095</code>
          <country>China</country>
          <!-- Uses two letter country code -->
        </postal>            
        <email>zhoufangtong@huawei.com</email>  
        <!-- Can have more than one <email> element -->
      </address>
    </author>

    <author fullname="Shuping Peng" initials="S." surname="Peng">
      <!-- [CHECK]
             * initials should not include an initial for the surname
             * role="editor" is optional -->
    <!-- Can have more than one author -->
      
    <!-- all of the following elements are optional -->
      <organization>Huawei Technologies</organization>
      <address>
        <postal>
          <!-- Reorder these if your country does things differently -->
          <street>Huawei Bld., No.156 Beiqing Rd.</street>
          <city>Beijing</city>
          <code>100095</code>
          <country>China</country>
          <!-- Uses two letter country code -->
        </postal>        
        <email>pengshuping@huawei.com</email>  
        <!-- Can have more than one <email> element -->
      </address>
    </author>

    <date day="22" month="June" year="2026"/> <!--TODO: check date before submission -->

    <!-- On draft submission:
         * If only the current year is specified, the current day and month will be used.
         * If the month and year are both specified and are the current ones, the current day will
           be used
         * If the year is not the current one, it is necessary to specify at least a month and day="1" will be used.
    -->

    <area>Applications and Real-Time</area>
    <workgroup>Working Group</workgroup>
    <!-- "Internet Engineering Task Force" is fine for individual submissions.  If this element is 
          not present, the default is "Network Working Group", which is used by the RFC Editor as 
          a nod to the history of the RFC Series. -->

    <keyword>AI Agent, Multi-Agent Collaboration, Structured Data, Schema</keyword>
    <!-- [REPLACE/DELETE]. Multiple allowed.  Keywords are incorporated into HTML output files for 
         use by search engines. -->

    <abstract>
      <t>This document defines a structured data schema interaction protocol for multi-agent collaboration. 
      As AI agents increasingly interoperate across heterogeneous platforms, natural-language-based communication suffers from semantic drift, high inference overhead, and ambiguous data flow. 
      This protocol introduces a standardized key-value schema with semantic annotations, enabling deterministic, efficient, and interoperable agent-to-agent communication. 
      A lightweight schema negotiation mechanism is provided for initial alignment at the beginning of communication, 
      while an optional key-value update mechanism allows agents to reflect evolving requirements without breaking existing structured data schema interaction protocol.</t>
    </abstract>
 
  </front>

  <middle>
    
    <section>
      <name>Introduction</name>
      <t>Recent advances in large language models (LLMs) enable AI agents to plan and execute multi-step workflows for complex tasks. Through agent communication protocols, AI agents can call third-party tools and delegate tasks to other AI agents. When an AI agent acts on behalf of a human user, these interoperations require structured, deterministic, and efficient information exchange.</t>
      <t>Today's agent ecosystems are characterized by rich, heterogeneous interaction information. Agents communicate through natural language text, structured data, and platform-specific documents. While natural language is expressive and flexible, it introduces three critical problems in multi-agent collaboration:</t>
      <ul>
        <li>Semantic drift: Without structured constraints, LLM-based parsing of natural language produces inconsistent semantic interpretations across heterogeneous agents with different LLMs, leading to semantic drift and causing miscommunication.</li>
        <li>High inference overhead: Processing free-form text requires substantial reasoning tokens and computational resources, increasing end-to-end latency and operational costs.</li>
        <li>Interoperability barriers: Heterogeneous agents (e.g., payment agents, lifestyle service agents) lack a unified model alignment mechanism, making cross-system communication fragile and integration-costly.</li>
      </ul>
      <t>This document introduces a structured data schema protocol, providing explicit semantic definitions with fixed data keys. The benefits of this approach are:</t>
      <ol>
        <li>Deterministic semantic alignment: By pre-defining key-value schemas with explicit semantic descriptions, client agents can parse user intent into structured payloads with minimal ambiguity, effectively suppressing semantic drift.</li>
        <li>Reduced token consumption and response latency: Structured communication eliminates the need for server-side agents to perform open-ended natural language understanding. </li>
        <li>Enhanced interoperability and decoupling: A standardized key-value format allows client agents to adapt dynamically to server agent interface changes, enabling massive heterogeneous agent onboarding without per-integration custom parsing logic.</li>
      </ol>
      <t>This protocol is designed to complement existing agent protocols (e.g., A2A <xref target="A2A"/>, MCP <xref target="MCP"/>) by defining the data-mode contract. It does not mandate transport and authorization mechanisms; those may be provided by underlying protocols. Existing structured data exchange protocols such as JMAP Sharing <xref target="RFC9670"/> demonstrate that standardized key-value data models with explicit sharing semantics can enable scalable cross-system interoperability, providing a design precedent for agent-to-agent schema negotiation.</t>

      <section>
        <name>Requirements Language</name>
        <t>The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in BCP 14 <xref target="RFC2119"/> <xref target="RFC8174"/> when, and only when, they appear in all capitals, as shown here.</t>
      </section>

    </section>
    
    <section>
      <name>Terminology</name>
      <dl newline="true">
        <dt>AI Agent</dt>
        <dd>An entity with built-in intelligence, which can perform actions to accomplish tasks, possibly on behalf of an end-user or another agent.</dd>
        <dt>Client Agent</dt>
        <dd>The agent that initiates a structured interaction request, typically acting on behalf of an end-user.</dd>
        <dt>Server Agent</dt>
        <dd>The agent that exposes structured capabilities and responds to client agent requests with key-value formatted data.</dd>
        <dt>Data Schema (Schema)</dt>
        <dd>An LLM-readable template that defines the set of keys, value types, and semantic descriptions required for a specific interaction scenario.</dd>
        <dt>Semantic Annotation</dt>
        <dd>A human/LLM-readable description associated with a schema key, explaining its meaning, expected value range, and key semantics.</dd>
        <dt>Structured Communication</dt>
        <dd>The practice of exchanging information strictly within the boundaries of an agreed-upon data schema, as opposed to free-form natural language.</dd>
        <dt>Schema Negotiation</dt>
        <dd>The process by which a client agent discovers and obtains the data schema and semantic annotations from a server agent prior to sending structured payload.</dd>
        <dt>Schema Update</dt>
        <dd>An OPTIONAL mechanism by which a server agent refines its published schema based on observed dynamic usage patterns, returning updated new key definitions to the client agent.</dd>
      </dl>
    </section>
    
    <section>
      <name>Protocol Overview</name>
      <t>The Structured Data Schema Interaction Protocol operates in three phases: Schema Negotiation, Structured Data Schema Exchange, and (optionally) Schema Update. The protocol assumes that transport-level connectivity (e.g., HTTP, JSON-RPC, or protocol-specific channels) has already been established by underlying agent communication frameworks.</t>
      <section>
        <name>Interaction Model</name>
        <t>The protocol adopts a client-server interaction model between two cooperating agents:</t>
        <dl newline="true">
          <dt>Client Agent (C)</dt>
          <dd>The agent that requires a service. It is responsible for (1) discovering the server agent's schema, (2) mapping user intent or upstream data into the negotiated key-value structure, and (3) transmitting the structured payload.</dd>
          <dt>Server Agent (S)</dt>
          <dd>The agent that exposes a capability. It is responsible for (1) publishing its key-value schema and semantic annotations, (2) validating incoming structured payloads against the schema, (3) executing the requested capability, and (4) optionally returning schema refinement suggestions.</dd>
        </dl>
        <t>The interaction is stateless from the protocol perspective; any session state MUST be managed by the application layer or underlying transport protocol.</t>
      </section>
      <section>
        <name>Message Flow</name>
        <t>Figure 1 illustrates the complete message flow of a structured key-value interaction.</t>
        <figure anchor="fig-message-flow">
          <name>Structured Key-Value Schema Interaction Message Flow</name>
          <artset>
            <artwork type="ascii-art" name="stream.txt">
            <![CDATA[
+--------+       +--------+       +----------------+
|End User|       | Client |       |     Server     |
|        |       | Agent  |       |     Agent      |
+---+----+       +---+----+       +-------+--------+
    |                |                    |        |
    | (1) Natural    |                    |        |
    |     language   |                    |        |
    |     request    |                    |        |
    | - - - - - - - >|                    |        |
    |                |                    |        |
    |                |----\               |        |
    |                |    | (2) Agent     |        |
    |                |    |     discovery |        |
    |                |    |     + scenario|        |
    |                |    |     id        |        |
    |                |<---/               |        |
    |                |                    |        |
    |                | (3) Get schema     |        |
    |                |     for scenario   |        |
    |                |------------------->|        |
    |                |                    |        |
    |                | (3) Schema +       |        |
    |                |     semantic desc. |        |
    |                |< - - - - - - - - - |        |
    |                |                    |        |
    |                |----\               |        |
    |                |    | (4) LLM-based |        |
    |                |    |     parsing   |        |
    |                |    |     + mapping |        |
    |                |<---/               |        |
    |                |                    |        |
    |                | (5) Structured     |        |
    |                |     payload        |        |
    |                |------------------->|        |
    |                |                    |        |
    |                | (6) Execution      |        |
    |                |     result         |        |
    |                |< - - - - - - - - - |        |
    |                |                    |        |
    |                | (7) Optional       |        |
    |                |     schema update  |        |
    |                |< - - - - - - - - - |        |
    |                |                    |        |
+---+----+       +---+----+       +-------+--------+
|End User|       | Client |       |     Server     |
|        |       | Agent  |       |     Agent      |
+--------+       +--------+       +----------------+
            ]]>
            </artwork>
          </artset>
        </figure>
        <t>Step (1) User Request: The end user provides a natural language request to the client agent (e.g., "Help me order a large iced latte" or "Retouch this photo with a vintage filter"). This request is unconstrained free-form text that expresses the user's intent but does not yet identify the target service or data structure.</t>
        <t>Step (2) Agent Discovery and Scenario Identification: The client agent analyzes the user's request using its internal LLM or intent-classification component to determine:</t>
        <ul>
          <li>Target Server Agent: Which remote agent can fulfill the request (e.g., an airline service agent).</li>
          <li>Interaction Scenario: The specific capability or workflow category within the target agent (e.g., "flight_booking", "photo_retouch").</li>
        </ul>
        <t>This step MAY leverage an agent registry, capability directory, or historical context to disambiguate between multiple candidate server agents. If no suitable server agent is found, the client agent SHOULD report the failure to the end user.</t>
        <t>Step (3) Schema Negotiation: The client agent requests the server agent's schema template and semantic descriptions for a given interaction scenario (e.g., flight booking, photo editing). The server agent returns a JSON object containing the schema keys, value types, and semantic annotations.</t>
        <t>Step (4) Structured Exchange: The client agent transmits the populated key-value payload to the server agent. All REQUIRED keys MUST be present; OPTIONAL keys MAY be omitted if not applicable.</t>
        <t>Step (5) Execution Result: The server agent validates the payload, executes the requested capability, and returns a result. The result itself SHOULD be structured according to a pre-negotiated response schema when applicable.</t>
        <t>Step (6) Optional Schema Update: If the server agent observes recurring patterns in the "other" key or receives explicit capability extension requests, it MAY return a schema update suggestion containing new keys or refined semantic descriptions. This step is OPTIONAL and serves as a lightweight feedback loop for long-term protocol refinement.</t>
      </section>
    </section>
    
    <section>
      <name>Structured Key-Value Format</name>
      <t>Structured data formats such as JSContact <xref target="RFC9610"/> demonstrate that explicitly typed keys with semantic annotations enable reliable machine parsing. This protocol applies the same principle to agent-to-agent communication: every key in the schema template carries a declared type and a semantic description that constrains the client agent's generation space.</t>
      <t>This section defines the syntax and semantics of the structured key-value interaction format.</t>
      <section>
        <name>Schema Template</name>
        <t>A schema template is a JSON object that declares the expected structure of an interaction payload. It MUST contain the following top-level members:</t>
        <dl newline="true">
          <dt>schema_id</dt>
          <dd>REQUIRED. A string that uniquely identifies the schema version within the server agent's namespace.</dd>
          <dt>scenario</dt>
          <dd>REQUIRED. A human-readable string describing the interaction scenario (e.g., "flight booking", "photo_retouch").</dd>
          <dt>keys</dt>
          <dd>REQUIRED. An array of key definition objects, each describing a single key expected in the payload.</dd>
        </dl>
        <t>Each key definition object MUST contain:</t>
        <dl newline="true">
          <dt>key_name</dt>
          <dd>REQUIRED. A string identifier for the key, using snake_case convention. Key names MUST be unique within the schema.</dd>
          <dt>key_type</dt>
          <dd>REQUIRED. A JSON Schema type identifier (e.g., "string", "integer", "boolean", "array", "object").</dd>
          <dt>semantic_description</dt>
          <dd>REQUIRED. A human-readable and machine-processable string explaining the business meaning of the key, acceptable value enumerations, and mapping examples from natural language. This description serves as a prompt-level anchor for the client agent's LLM, constraining the generation space and reducing hallucinated key mappings. Server agents SHOULD maintain semantic descriptions in the same language as the expected end-user queries, or provide multilingual annotations when serving cross-lingual client agents.</dd>
          <dt>required</dt>
          <dd>REQUIRED. A boolean indicating whether the key MUST be present in the payload.</dd>
          <dt>default_value</dt>
          <dd>OPTIONAL. A default value to be used when the key is omitted and not required. If absent and the key is optional, the server agent MUST apply its own default logic or ignore the key.</dd>
        </dl>
        <t>Figure 2 shows an example schema template for a flight booking purchase scenario.</t>
        <figure anchor="fig-schema-template">
          <name>Example Schema Template for Flight Booking</name>
          <sourcecode type="json">
<![CDATA[
{
  "schema_id": "flight_booking_v1",
  "scenario": "flight_booking",
  "keys": [
    {
      "key_name": "origin",
      "key_type": "string",
      "required": true,
      "default_value": null,
      "semantic_description": "Departure city or airport code. Acceptable values: IATA airport codes (e.g., PEK, SHA, JFK) or city names in English or local language. Example mapping: 'from Beijing' -> 'PEK'."
    },
    {
      "key_name": "destination",
      "key_type": "string",
      "required": true,
      "default_value": null,
      "semantic_description": "Arrival city or airport code. Acceptable values: IATA airport codes or city names. Example mapping: 'to Shanghai' -> 'SHA'."
    },
    {
      "key_name": "departure_date",
      "key_type": "string",
      "required": true,
      "default_value": null,
      "semantic_description": "Date of departure in ISO 8601 format (YYYY-MM-DD). Example mapping: 'next Monday' -> '2026-05-04'."
    },
    {
      "key_name": "cabin_class",
      "key_type": "string",
      "required": false,
      "default_value": "economy",
      "semantic_description": "Cabin class preference. Acceptable values: economy, premium_economy, business, first. Example mapping: 'business class' -> 'business'."
    },
    {
      "key_name": "passenger_count",
      "key_type": "integer",
      "required": false,
      "default_value": 1,
      "semantic_description": "Number of passengers. Range: 1-9. Example mapping: 'two people' -> 2."
    },
    {
      "key_name": "other",
      "key_type": "string",
      "required": false,
      "default_value": null,
      "semantic_description": "Escape valve for unstructured semantic fragments that cannot be mapped to existing keys. Example mapping: 'window seat please' -> 'window seat'."
    }
  ]
}
]]>
          </sourcecode>
        </figure>
      </section>
      <section>
        <name>Semantic Annotation</name>
        <t>Semantic annotations provide the contextual anchor that enables client agent LLMs to perform accurate intent-to-key mapping. Each key definition in the schema template MUST be augmented with a "semantic_description" field, as required in Section 4.1.</t>
        <t>The semantic description serves as a prompt-level anchor for the client agent's LLM, constraining the generation space and reducing hallucinated key mappings. Figure 3 extends the flight booking example with a focused semantic annotation.</t>
        <figure anchor="fig-semantic-annotation">
          <name>Semantic Annotation Example</name>
          <sourcecode type="json">
<![CDATA[
{
  "key_name": "cabin_class",
  "key_type": "string",
  "required": false,
  "default_value": "economy",
  "semantic_description": "Cabin class preference. Acceptable values: economy, premium_economy, business, first. Example mapping: 'business class' -> 'business'."
}
]]>
          </sourcecode>
        </figure>
        <t>Server agents SHOULD maintain semantic descriptions in the same language as the expected end-user queries, or provide multilingual annotations when serving cross-lingual client agents.</t>
      </section>
      <section>
        <name>The "other" Key</name>
        <t>The key named "other" is reserved within every schema template as an escape valve for unstructured semantic fragments that cannot be mapped to existing keys. Its usage is subject to the following rules:</t>
        <ul>
          <li>The "other" key MUST be defined as OPTIONAL (required: false).</li>
          <li>The value of the "other" key MUST be a string or an array of strings containing natural language descriptions of unmapped user intent.</li>
          <li>Server agents MUST accept payloads containing the "other" key without rejecting the request, even if the key contains information outside the current schema scope.</li>
          <li>Client agents SHOULD minimize the use of the "other" key by leveraging LLM-based parsing to exhaust existing keys before falling back to "other".</li>
        </ul>
        <t>The presence of meaningful content in the "other" key signals a potential schema coverage gap. Server agents MAY use this signal as input to the OPTIONAL schema update mechanism described in Section 6.2.</t>
      </section>
    </section>
    
    <section>
      <name>Illustrations of the protocol</name>
      <t>This section illustrates the application of the structured key-value interaction protocol.</t>
      <section>
        <name>Flight Booking</name>
        <t>Scenario: An end user asks a personal AI assistant (client agent) to book a flight through an airline service agent (server agent).</t>
        <t>User utterance: "Book me a flight from Beijing to Shanghai next Monday, business class, and I prefer a window seat."</t>
        <t>Schema negotiation: The client agent requests the flight booking schema from the server agent. The server agent returns the schema template shown in <xref target="fig-schema-template"/>, augmented with semantic annotations.</t>
        <t>Intent parsing and mapping:</t>
        <ul>
          <li>"Beijing" -> origin: "PEK"</li>
          <li>"Shanghai" -> destination: "SHA"</li>
          <li>"next Monday" -> departure_date: "2026-05-04"</li>
          <li>"business class" -> cabin_class: "business"</li>
          <li>(implicit) -> passenger_count: 1</li>
          <li>"window seat" -> other: "window seat"</li>
        </ul>
        <t>Structured payload:</t>
        <figure anchor="fig-flight-payload">
          <name>Structured Payload for Flight Booking</name>
          <sourcecode type="json">
<![CDATA[
{
  "schema_id": "flight_booking_v1",
  "payload": {
    "origin": "PEK",
    "destination": "SHA",
    "departure_date": "2026-05-04",
    "cabin_class": "business",
    "passenger_count": 1,
    "other": "window seat"
  }
}
]]>
          </sourcecode>
        </figure>
        <t>Execution: The server agent validates the payload, queries the flight inventory, and returns a booking confirmation with flight number, departure time, and seat assignment.</t>
        <t>Optional schema update: If the server agent observes frequent "other" entries mentioning seat preferences, it MAY return a schema update suggestion adding a "seat_preference" key with acceptable values "window", "aisle", or "none".</t>
      </section>
      <section>
        <name>Photo Editing</name>
        <t>Scenario: An end user asks a personal AI assistant to retouch a photo through a cloud-based image editing agent.</t>
        <t>User utterance: "Please retouch this photo: smooth the skin, whiten teeth, make the background blurry, and add a vintage filter. Also, I want my eyes to look bigger."</t>
        <t>Schema negotiation: The client agent discovers the photo editing schema from the server agent. Example keys include: skin_smoothing (integer 0-10), teeth_whitening (boolean), background_blur (boolean), filter_style (string), eye_enlargement (boolean).</t>
        <t>Intent parsing and mapping:</t>
        <ul>
          <li>"smooth the skin" -> skin_smoothing: 7</li>
          <li>"whiten teeth" -> teeth_whitening: true</li>
          <li>"make the background blurry" -> background_blur: true</li>
          <li>"add a vintage filter" -> filter_style: "vintage"</li>
          <li>"eyes to look bigger" -> other: "increase eye size proportionally"</li>
        </ul>
        <t>Structured payload:</t>
        <figure anchor="fig-photo-payload">
          <name>Structured Payload for Photo Editing</name>
          <sourcecode type="json">
<![CDATA[
{
  "schema_id": "photo_retouch_v2",
  "payload": {
    "skin_smoothing": 7,
    "teeth_whitening": true,
    "background_blur": true,
    "filter_style": "vintage",
    "eye_enlargement": false,
    "other": "increase eye size proportionally"
  }
}
]]>
          </sourcecode>
        </figure>
        <t>Note: The client agent mapped "eyes to look bigger" to the "other" key because the current schema does not define a granular eye_size adjustment key (only a boolean eye_enlargement). The server agent MAY later propose a schema update introducing "eye_size_scale" (float, 1.0-1.5) based on aggregated "other" patterns.</t>
      </section>
    </section>
    
    <section>
      <name>Capability Enhancement</name>
      <t>This section describes OPTIONAL mechanisms that enhance the core structured interaction protocol. Implementations MAY support none, some, or all of these capabilities. They are designed to be transparent to agents that do not implement them.</t>
      <section>
        <name>LLM-based Semantic Parsing</name>
        <t>The protocol assumes that client agents employ an internal LLM to perform natural language understanding (NLU) and map user intent to schema keys. The quality of this mapping directly affects the correctness of the structured payload.</t>
        <t>Recommended practices for LLM-based semantic parsing include:</t>
        <ul>
          <li>In-context learning: Provide the LLM with the schema template and semantic descriptions as part of the prompt context, enabling few-shot or zero-shot key extraction.</li>
          <li>Constrained decoding: Where supported, use constrained generation or grammar-based decoding to ensure that the LLM output conforms to the expected key-value JSON structure.</li>
          <li>Confidence thresholding: If the LLM's confidence in mapping a semantic fragment to a specific key falls below a configurable threshold, the fragment SHOULD be routed to the "other" key rather than risk a hallucinated mapping.</li>
        </ul>
        <t>Server agents are NOT REQUIRED to perform NLU; their role is to validate and execute structured payloads. This separation of concerns reduces server-side inference costs and ensures deterministic execution.</t>
      </section>
      <section>
        <name>Key-Value Schema Self-Evolution</name>
        <t>The schema self-evolution mechanism provides a dynamic, backward-compatible path for server agents to refine their published schemas based on operational feedback and differential semantics extracted from the "other" key. It is OPTIONAL and does not alter the core structured exchange semantics.</t>
        <t>The mechanism consists of three coordinated components: (1) a trigger mechanism based on a differential semantic pool, (2) a schema self-evolution algorithm that generates dynamic patches, and (3) a long-term evaluation framework that ensures convergence and prevents schema bloat.</t>
        <section>
          <name>Differential Semantic Pool and Trigger Mechanism</name>
          <t>To avoid erroneous evolution caused by sporadic anomalies and to ensure that genuine common or personalized needs are not missed, server agents MAY maintain a Differential Semantic Pool (DSP).</t>
          <t>The DSP collects natural-language fragments from the "other" key that could not be mapped to existing schema keys. Its operation follows three stages:</t>
          <dl newline="true">
            <dt>Semantic Vector Clustering</dt>
            <dd>Each fragment extracted from the "other" key MUST be encoded into a semantic vector. Server agents SHOULD use dense vector embeddings (e.g., sentence-transformer-based) to represent semantic meaning. Vectors are clustered using similarity thresholds (e.g., cosine similarity &gt;= 0.85). Each cluster represents a distinct, recurring semantic intent that is not covered by the current schema.</dd>
            <dt>Heat Decay Counting</dt>
            <dd>Each cluster maintains a heat score that reflects the intensity of the corresponding semantic demand. When a new fragment joins a cluster, its heat score increases by a fixed increment. The heat score MUST decay over time (e.g., exponential decay with a half-life of 24 hours) to prevent obsolete or transient patterns from accumulating undue weight.</dd>
            <dt>Threshold-Based Triggering</dt>
            <dd>A schema evolution trigger fires when a cluster's heat score exceeds a configurable evolution threshold (e.g., 50 accumulated heat units) AND the cluster contains a minimum number of distinct source requests (e.g., &gt;= 5 unique client agents or &gt;= 10 total occurrences within a 7-day window). This dual-gate design ensures that evolution is triggered only when the same semantic appeal has gathered sufficient strength across multiple interactions, filtering out accidental outliers while capturing genuine collective needs.</dd>
          </dl>
          <t>Server agents MAY maintain separate DSP instances per scenario or per client-agent cohort, enabling both global schema evolution and personalized schema branching.</t>
        </section>
        <section>
          <name>Schema Self-Evolution Algorithm</name>
          <t>Once the trigger mechanism identifies a mature semantic cluster, the server agent executes a self-evolution algorithm to synthesize a schema patch from the cluster's natural-language content.</t>
          <dl newline="true">
            <dt>Base Schema</dt>
            <dd>The immutable, versioned schema template (see Section 4.1) that defines the stable contract. Base schema keys MUST NOT be removed or have their types changed by dynamic patches; only additive or semantic-description refinements are permitted in the patch layer.</dd>
            <dt>Dynamic Patch Generation</dt>
            <dd>For each triggered semantic cluster, the server agent MUST perform intent induction, conflict detection, and patch packaging.</dd>
            <dt>Online Update Delivery</dt>
            <dd>The server agent MAY deliver active patches through inline suggestions in the schema_update_suggestion field of the execution result response or through a dedicated schema polling endpoint.</dd>
            <dt>Personalized Adaptation</dt>
            <dd>Server agents MAY maintain per-client patch stacks. When a specific client agent repeatedly submits personalized requests that fall into a unique semantic cluster (e.g., a frequent business traveller who always requests "extra legroom" and "quiet cabin"), the server agent MAY generate a client-specific patch that adds keys such as "seat_preference" and "cabin_zone" only for that client. This transforms standardized task flows into privately customized service responses without polluting the global schema.</dd>
          </dl>
          <ul>
            <li>Intent Induction: Use an internal LLM or rule-based extractor to summarize the cluster's natural-language fragments into a candidate key_name, key_type, required flag, default_value, and semantic_description. The semantic_description MUST include mapping examples derived from real fragments in the cluster.</li>
            <li>Conflict Detection: Before finalizing the patch, the server agent MUST check that the candidate key_name does not collide with existing keys in the base schema or active patches. If a collision occurs, the server agent SHOULD merge the candidate into the existing key by refining its semantic_description rather than creating a duplicate.</li>
            <li>Patch Packaging: The approved candidate is packaged as a schema patch containing new_keys, modified_keys, or both. The patch MUST carry a patch_id, a parent_schema_id, a timestamp, and an expiration date.</li>
          </ul>
        </section>
        <section>
          <name>Long-Term Evaluation Mechanism</name>
          <t>To prevent schema bloat and the accumulation of erroneous keys, server agents that implement self-evolution MUST employ a long-term evaluation mechanism that continuously assesses the quality and necessity of every patch key.</t>
          <t>Evaluation Metrics: For each key introduced through a dynamic patch, the server agent SHOULD track at minimum the following metrics over a configurable observation window (default 30 days):</t>
          <ul>
            <li>usage_frequency: The ratio of payloads in which the key is present to total payloads for the scenario.</li>
            <li>semantic_alignment_accuracy: The ratio of payloads where the key's value matches the intent expressed in the original natural-language request, as judged by an internal LLM or manual audit sampler.</li>
            <li>value_type_correctness: The ratio of payloads where the received value conforms to the declared key_type.</li>
            <li>client_adoption_rate: The ratio of distinct client agents that have successfully adopted the key to those that received the patch.</li>
          </ul>
          <t>Two-Phase Lifecycle: All new keys introduced via dynamic patches MUST begin in an experimental state and transition through two phases.</t>
          <dl newline="true">
            <dt>Trial Period and Stabilization Decision</dt>
            <dd>The key remains experimental for a configurable duration (default 7 days). During this period, the server agent collects the metrics above. The key MUST be advertised with an "experimental: true" flag in the patch so that client agents know the key is provisional. Upon completion of the trial period, the server agent evaluates the aggregated metrics.</dd>
            <dt>Schema Convergence Guard</dt>
            <dd>The server agent MUST enforce a maximum limit on the number of active experimental keys per scenario (e.g., no more than 10). When the limit is reached, new triggers MUST be queued until existing experimental keys are either promoted or deprecated. This guard prevents runaway schema bloat and ensures that the protocol converges to a stable, high-signal key set over time.</dd>
          </dl>
          <ul>
            <li>Promotion: If usage_frequency &gt;= 15%, semantic_alignment_accuracy &gt;= 80%, and value_type_correctness &gt;= 90%, the key is promoted to stable. The "experimental" flag is removed, and the key becomes part of the long-term supported schema.</li>
            <li>Deprecation: If usage_frequency &lt; 5% OR semantic_alignment_accuracy &lt; 60% OR value_type_correctness &lt; 70%, the key is marked deprecated. Deprecated keys remain in the schema for a grace period (default 14 days) with a "deprecated: true" flag, after which they MAY be moved to a withdrawn state.</li>
            <li>Withdrawal: A withdrawn key is removed from active patches. Server agents MUST still accept the key in incoming payloads for an additional backward-compatibility window (default 30 days) to avoid breaking legacy client agents, but SHOULD log a warning.</li>
          </ul>
        </section>
      </section>
    </section>
    
    <section anchor="Security">
      <!-- All drafts are required to have a security considerations section. See RFC 3552 for a guide. -->
      <name>Security Considerations</name>
      <t>Structured key-value payloads may contain sensitive personal information (e.g., dietary preferences, biometric retouching parameters, location data). Implementations MUST protect this data in transit and at rest using mechanisms appropriate to their threat model.</t>
      <t>Schema negotiation and update messages MUST be integrity-protected to prevent man-in-the-middle attacks that could inject malicious keys or semantic descriptions designed to exfiltrate data or trigger unauthorized actions.</t>
      <t>When the "other" key contains free-form natural language, server agents MUST apply the same input validation and sanitization practices as they would for any natural language input, preventing prompt injection or command injection attacks.</t>
      <t>The OPTIONAL schema update mechanism MUST require authentication and authorization if it exposes new capabilities or modifies security-relevant keys (e.g., keys related to payment, identity, or access control).</t>
    </section>

    <section anchor="IANA">
    <!-- All drafts are required to have an IANA considerations section. See RFC 8126 for a guide.-->
      <name>IANA Considerations</name>
      <t>This document has no IANA actions.</t>
    </section>

  </middle>


  <back>
    <references>
      <name>References</name>
      <references>
        <name>Normative References</name>
        
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.9670.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.9610.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.2119.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8174.xml"/>
        <!-- The recommended and simplest way to include a well known reference -->
        
      </references>
 
      <references>
        <name>Informative References</name>
       
        <reference anchor="A2A" target="https://a2a-protocol.org/latest">
        <!-- [REPLACE/DELETE] Example reference written by an organization not a person -->
          <front>
            <title>Agent2Agent(A2A) Protocol</title>
            <author>
              <organization>Google</organization>
            </author>
            <date year="2025"/>
            <!-- [CHECK] -->
          </front>
        </reference>       

        <reference anchor="MCP" target="https://modelcontextprotocol.io/docs/getting-started/intro">
        <!-- [REPLACE/DELETE] Example reference written by an organization not a person -->
          <front>
            <title>Model Context Protocol (MCP)</title>
            <author>
              <organization>Anthropic</organization>
            </author>
            <date year="2025"/>
            <!-- [CHECK] -->
          </front>
        </reference>
       
      </references>
    </references>
    
    
    <section>
      <name>Example Messages</name>
      <t>This appendix provides complete, non-normative examples of schema negotiation, structured payload exchange, and optional schema update messages.</t>
      <section>
        <name>Schema Negotiation Request and Response</name>
        <t>Client agent request:</t>
        <figure anchor="fig-schema-negotiation-request">
          <name>Schema Negotiation Request</name>
          <sourcecode type="json">
<![CDATA[
{
  "method": "get_schema_template",
  "params": {
    "scenario": "flight_booking",
    "preferred_language": "en-US"
  }
}
]]>
          </sourcecode>
        </figure>
        <t>Server agent response:</t>
        <figure anchor="fig-schema-negotiation-response">
          <name>Schema Negotiation Response</name>
          <sourcecode type="json">
<![CDATA[
{
  "schema_id": "flight_booking_v1",
  "scenario": "flight_booking",
  "keys": [
    {"key_name": "origin", "key_type": "string", "required": true, "semantic_description": "Departure city or airport code. Acceptable values: IATA airport codes (e.g., PEK, SHA, JFK) or city names. Example: 'from Beijing' -> 'PEK'."},
    {"key_name": "destination", "key_type": "string", "required": true, "semantic_description": "Arrival city or airport code. Example: 'to Shanghai' -> 'SHA'."},
    {"key_name": "departure_date", "key_type": "string", "required": true, "semantic_description": "Departure date in ISO 8601 format (YYYY-MM-DD). Example: 'next Monday' -> '2026-05-04'."},
    {"key_name": "cabin_class", "key_type": "string", "required": false, "default_value": "economy", "semantic_description": "Cabin class. Acceptable values: economy, premium_economy, business, first. Example: 'business class' -> 'business'."},
    {"key_name": "passenger_count", "key_type": "integer", "required": false, "default_value": 1, "semantic_description": "Number of passengers. Range: 1-9. Example: 'two people' -> 2."},
    {"key_name": "other", "key_type": "string", "required": false, "semantic_description": "Natural-language descriptions that cannot be mapped to existing keys. Example: 'window seat' -> 'window seat'."}
  ]
}
]]>
          </sourcecode>
        </figure>
      </section>
      <section>
        <name>Structured Payload Exchange</name>
        <t>Client agent request payload:</t>
        <figure anchor="fig-app-flight-payload">
          <name>Client Agent Request Payload</name>
          <sourcecode type="json">
<![CDATA[
{
  "schema_id": "flight_booking_v1",
  "payload": {
    "origin": "PEK",
    "destination": "SHA",
    "departure_date": "2026-05-04",
    "cabin_class": "business",
    "passenger_count": 1,
    "other": "window seat"
  }
}
]]>
          </sourcecode>
        </figure>
        <t>Server agent response:</t>
        <figure anchor="fig-server-response">
          <name>Server Agent Response</name>
          <sourcecode type="json">
<![CDATA[
{
  "booking_id": "BK-20260430-001",
  "status": "confirmed",
  "flight_number": "CA1234",
  "departure_time": "2026-05-04T09:00:00+08:00",
  "arrival_time": "2026-05-04T11:20:00+08:00",
  "seat": "12A",
  "total_amount": "CNY 2,450.00",
  "schema_update_suggestion": {
    "new_keys": [
      {
        "key_name": "seat_preference",
        "key_type": "string",
        "required": false,
        "default_value": "none",
        "semantic_description": "Seat preference. Acceptable values: window, aisle, none."
      }
    ]
  }
}
]]>
          </sourcecode>
        </figure>
      </section>
      <section>
        <name>Photo Editing Schema Example</name>
        <figure anchor="fig-photo-schema">
          <name>Photo Editing Schema Example</name>
          <sourcecode type="json">
<![CDATA[
{
  "schema_id": "photo_retouch_v2",
  "scenario": "photo_retouch",
  "keys": [
    {"key_name": "skin_smoothing", "key_type": "integer", "required": false, "default_value": 0, "semantic_description": "Skin smoothing intensity. Range: 0-10, where 0 means off. Example: 'light skin smoothing' -> 3."},
    {"key_name": "teeth_whitening", "key_type": "boolean", "required": false, "default_value": false, "semantic_description": "Whether teeth whitening is enabled. Example: 'make the teeth whiter' -> true."},
    {"key_name": "background_blur", "key_type": "boolean", "required": false, "default_value": false, "semantic_description": "Whether background blur is enabled. Example: 'blur the background' -> true."},
    {"key_name": "filter_style", "key_type": "string", "required": false, "default_value": "none", "semantic_description": "Filter style. Acceptable values: none, vintage, cinematic, warm, cool. Example: 'vintage style' -> 'vintage'."},
    {"key_name": "eye_enlargement", "key_type": "boolean", "required": false, "default_value": false, "semantic_description": "Whether eye enlargement is enabled. Note: this key is a boolean switch; use other for fine-grained adjustment requests."},
    {"key_name": "other", "key_type": "string", "required": false, "semantic_description": "Photo-editing requirements that cannot be mapped to existing keys. Example: 'make the eyes a little bigger' -> 'increase eye size proportionally'."}
  ]
}
]]>
          </sourcecode>
        </figure>
      </section>
    </section>

  </back>
</rfc>
