Georgios Bouchouras

Georgios Bouchouras, PhD

Senior Lecturer in Biomechanics

Metropolitan College, in collaboration with University of East London

Biomechanics | Gait Analysis | Ontology Engineer | Prompt Engineer | AI | Recurrent Neural Networks

POML (Prompt Orchestration Markup Language): Bringing Modularity and Scalability to LLM Prompts

Posted on August 15, 2025

What is POML?

  • ► Is Microsoft’s new XML/HTML-like language designed to bring structure and clarity to prompt engineering for Large Language Models (LLMs).
  • ► It organizes prompts into modular, reusable components, making them easier to maintain and adapt at scale

What’s Novel About It?

  • ► Structured Syntax: Semantic tags like role, task, and example allow developers to break down complex prompts into well-defined sections.
  • ► Data embedding: Direct support for including documents, tables, and images (document, table, img), enabling richer multimodal prompts.
  • ► Separation of Content and Style: CSS-like styling lets you adjust tone, verbosity, or formatting without rewriting the core prompt.
  • ► Templating Logic: Built-in support for variables (let), loops (for), and conditionals (if) provides dynamic prompt generation.
  • ► Tooling Ecosystem: VS Code Extension: syntax highlighting, auto-completion, previews, and diagnostics. SDKs for Node.js and Python: easy integration into real applications.

A Structured Language for Prompt Engineering

While XML and JSON are widely used for representing structured data in a general sense, they lack a standardized way to capture the unique needs of prompt engineering. POML builds on the familiar XML style but introduces prompt-specific semantics, templating logic, styling separation, and dedicated tooling. The table below illustrates how POML differs from traditional formats by focusing specifically on the requirements of LLM workflows.

Why this is different from plain xml or json?

POML helps teams manage large prompt libraries with clearer structure, reuse, and multimodal support, while tooling like IDE extensions and SDKs speeds up development. Many see it as a step toward treating prompt engineering more like software engineering, even if models themselves don’t inherently “understand” it—the real benefit lies in helping developers stay organized and scale their work. More than just markup, POML represents an effort to standardize and professionalize prompt design, and in a modest way, it may also shape the future of education by making AI interactions more structured, transparent, and accessible to learners and teachers alike

XML vs JSON vs POML

Aspect XML JSON POML
Structure Generic hierarchical tags Key–value pairs, lightweight XML-like syntax tailored for prompts
Semantics No fixed semantics, user-defined No fixed semantics, user-defined Predefined prompt tags (<role>, <task>, etc.)
Templating & Logic Possible via external frameworks Possible via external frameworks Built-in support for variables, loops, conditionals
Styling Not built-in (can be layered) Not built-in (can be layered) CSS-like system for tone/verbosity (optional)
Multimodal Support Custom tags for media/links Custom fields for media/links Standard tags (<img>, <document>, etc.)
Tooling Generic XML parsers/editors Generic JSON parsers/editors VS Code extension, SDKs, live preview, diagnostics
Use Case Any structured data APIs, configs, data exchange Prompt engineering & LLM workflows

XML and JSON can already represent structured data and even prompts, but POML standardizes a schema and provides dedicated tooling aimed specifically at Large Language Model workflows.

Example: POML in Action

Below is a simple .poml (basically an xml) file describing a prompt from my domain about Parkinson’s Disease, and a Python script that loads it, renders it into a prompt string, and sends it to OpenAI’s API.


        
          role: You are a medical expert explaining Parkinson’s Disease.
          task: Explain the main symptoms of Parkinson’s Disease to a first-year medical student.
          output-format: Use clear language. Provide 4 bullet points. End with one short sentence about why early diagnosis matters.
        
            

run_poml.py


import os
import xml.etree.ElementTree as ET
from openai import OpenAI

# Path to your POML (XML) file
POML_PATH = "/home/ilab/test.pml/pd_poml.xml"

# --- Parse POML (XML) ---
root = ET.parse(POML_PATH).getroot()

def text(tag):
    el = root.find(tag)
    return (el.text if el is not None and el.text else "").strip()

role = text("role")
task = text("task")
outfmt = text("output-format")

# Build prompt string
parts = []
if role:   parts.append(role)
if task:   parts.append(f"\nTASK:\n{task}")
if outfmt: parts.append(f"\nOUTPUT FORMAT:\n{outfmt}")
prompt = "\n".join(parts).strip()

# --- OpenAI API ---
api_key = os.getenv("OPENAI_API_KEY", "").strip()
if not api_key:
    raise RuntimeError("OPENAI_API_KEY is not set. Run: export OPENAI_API_KEY='sk-...'")
if any(ord(c) > 127 for c in api_key):
    raise ValueError("OPENAI_API_KEY is not valid")

client = OpenAI(api_key=api_key)

resp = client.chat.completions.create(
    model="gpt-4o-mini",
    messages=[{"role": "user", "content": prompt}],
)

print("=== POML Prompt Output ===")
print(resp.choices[0].message.content)
    

=== POML Prompt Output ===

  • Tremors: One of the most recognizable symptoms, tremors typically start in the hands, often when they're at rest. This shaking can also affect the legs, chin, and other body parts.
  • Bradykinesia: This refers to a gradual reduction in movement speed and difficulty initiating movement. Patients may experience a noticeable slowing in their daily activities, such as walking or getting up from a chair.
  • Rigidity: Muscles can become stiff and tense, making it difficult for individuals to move freely. This rigidity can also lead to discomfort and pain in the affected muscles.
  • Postural Instability: Many individuals with Parkinson’s disease experience balance problems, which may increase the risk of falls. This is often due to a change in how the body maintains posture and balance.

Early diagnosis matters because it allows for timely intervention, which can help manage symptoms and improve the quality of life for patients.

Note: From my experience so far, while a Python library (pip install poml) exists, it is not yet as mature or fully featured as the official Node.js package (pomljs). At this stage, I found the Node.js SDK to be more complete for practical use, whereas in Python I had to rely on XML parsing as a workaround.

Educational Example: Using POML in a University Program

Imagine a university department specializing in Rehabilitation Sciences with a focus on neurodegenerative diseases and PD. The program is taught by several professors, each responsible for a different thematic area (e.g., motor control, neurobiology, clinical interventions, assistive technology).

With POML, the faculty can design a shared prompt library that reflects the curriculum structure. For instance:

  • A neurology professor contributes a lesson prompt that explains the neuropathology of PD.
  • A biomechanics professor adds prompts that generate gait analysis case studies.
  • A clinical instructor supplies interactive prompts simulating patient–therapist dialogues for training in assessment and rehabilitation strategies.

Because POML supports templating and modularization, these contributions can be combined into a coherent workflow where students interact with AI tutors. Depending on the student’s level (e.g., undergraduate vs. postgraduate) or focus area (e.g., diagnostics vs. therapy), the system can automatically adjust the depth, style, and complexity of the teaching material.

In this way, POML enables multi-professor collaboration while maintaining a standardized format, ensuring that the educational experience is consistent, scalable, and adaptive. This illustrates how structured prompt engineering can become a foundation for personalized, AI-enhanced education.

Most importantly, the human tutor remains in full control, guiding and validating the AI-generated content at every step. This control is reinforced because the tutor can reproduce the outputs of the prompts at will or rely on a Retrieval-Augmented Generation (RAG) system, where the AI draws its information directly from specific course documents and materials, ensuring accuracy and alignment with the official curriculum (see image 2).



  PD gait assessment
  postgraduate
  rehabilitation student

  You are a faculty tutor guiding a {{level}} {{audience}}.
  
    Explain how Parkinson’s Disease affects gait and outline a basic assessment protocol.
    Include red flags that warrant referral and 2 short case-study prompts for practice.
    Emphasize {{topic}} and clinical reasoning.
  
  
    - Short overview (3–4 sentences)
    - Bullet list: assessment steps (5–6 items)
    - Red flags (3 items)
    - Two case-study prompts (1–2 sentences each)
  

      

Some informations adapted from MarkTechPost.

The examples, implementations and comparisons in this article are created by me and reflect my opinion only.

Special thanks to Associate Professor Dr. Kotis for bringing this to my attention.