MCPcopy Index your code
hub / github.com/microsoft/poml

github.com/microsoft/poml @v0.0.8

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.0.8 ↗ · + Follow
990 symbols 2,764 edges 140 files 136 documented · 14% updated 5mo agov0.0.8 · 2025-08-25★ 4,86130 open issues
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

POML: Prompt Orchestration Markup Language

Documentation VSCode Extension PyPI npm (latest) Test Status License: MIT Discord

POML (Prompt Orchestration Markup Language) is a novel markup language designed to bring structure, maintainability, and versatility to advanced prompt engineering for Large Language Models (LLMs). It addresses common challenges in prompt development, such as lack of structure, complex data integration, format sensitivity, and inadequate tooling. POML provides a systematic way to organize prompt components, integrate diverse data types seamlessly, and manage presentation variations, empowering developers to create more sophisticated and reliable LLM applications.

Demo Video

The 5-minute guide to POML

Key Features

  • Structured Prompting Markup: Employs an HTML-like syntax with semantic components such as <role>, <task>, and <example> to encourage modular design, enhancing prompt readability, reusability, and maintainability.
  • Comprehensive Data Handling: Incorporates specialized data components (e.g., <document>, <table>, <img>) that seamlessly embed or reference external data sources like text files, spreadsheets, and images, with customizable formatting options.
  • Decoupled Presentation Styling: Features a CSS-like styling system that separates content from presentation. This allows developers to modify styling (e.g., verbosity, syntax format) via <stylesheet> definitions or inline attributes without altering core prompt logic, mitigating LLM format sensitivity.
  • Integrated Templating Engine: Includes a built-in templating engine with support for variables ({{ }}), loops (for), conditionals (if), and variable definitions (<let>) for dynamically generating complex, data-driven prompts.
  • Rich Development Toolkit:
    • IDE Extension (Visual Studio Code): Provides essential development aids like syntax highlighting, context-aware auto-completion, hover documentation, real-time previews, inline diagnostics for error checking, and integrated interactive testing.
    • Software Development Kits (SDKs): Offers SDKs for Node.js (JavaScript/TypeScript) and Python for seamless integration into various application workflows and popular LLM frameworks.

Quick Start

Here's a very simple POML example. Please put it in a file named example.poml. Make sure it resides in the same directory as the photosynthesis_diagram.png image file.

<poml>
  <role>You are a patient teacher explaining concepts to a 10-year-old.</role>
  <task>Explain the concept of photosynthesis using the provided image as a reference.</task>

  <img src="https://github.com/microsoft/poml/raw/v0.0.8/photosynthesis_diagram.png" alt="Diagram of photosynthesis" />

  <output-format>
    Keep the explanation simple, engaging, and under 100 words.
    Start with "Hey there, future scientist!".
  </output-format>
</poml>

This example defines a role and task for the LLM, includes an image for context, and specifies the desired output format. With the POML toolkit, the prompt can be easily rendered with a flexible format, and tested with a vision LLM.

Installation

Visual Studio Code Extension

Install from Visual Studio Code Marketplace.

You can also install the extension manually by downloading the .vsix file from our GitHub releases page and installing it in VS Code via the Extensions view.

Before testing prompts with the POML toolkit, make sure you have configured your preferred LLM model, API key, and endpoint. If these are not set, prompt testing will not work.

To configure in Visual Studio Code: - Open the extension settings (open "Settings" and search for "POML"). - Set your model provider (e.g., OpenAI, Azure, Google), API key, and endpoint URL in the POML section. - Alternatively, you can add these settings directly to your settings.json file.

Node.js (via npm)

npm install pomljs

Python (via pip)

pip install poml

For development or local installation, you might use pip install -e . from a cloned repository.

Refer to the documentation for more details on installing the nightly build.

Documentation

For detailed information on POML syntax, components, styling, templating, SDKs, and the VS Code extension, please refer to our documentation.

Learn More

Citation

If you find POML useful or related to your research, please cite the following paper:

@misc{zhang2025promptorchestrationmarkuplanguage,
      title={Prompt Orchestration Markup Language}, 
      author={Yuge Zhang and Nan Chen and Jiahang Xu and Yuqing Yang},
      year={2025},
      eprint={2508.13948},
      archivePrefix={arXiv},
      primaryClass={cs.HC},
      url={https://arxiv.org/abs/2508.13948}, 
}

Ecosystem & Community Projects

  • mini-poml-rs – Experimental Rust-based POML renderer for environments without JavaScript or Python interpreters.
  • poml-ruby – Ruby gem implementation of POML for Ruby applications.

Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.

When you submit a pull request, a CLA bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.

Trademarks

This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft trademarks or logos is subject to and must follow Microsoft's Trademark & Brand Guidelines. Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. Any use of third-party trademarks or logos are subject to those third-party's policies.

Responsible AI

This project has been evaluated and certified to comply with the Microsoft Responsible AI Standard. The team will continue to monitor and maintain the repository, addressing any severe issues, including potential harms, if they arise. For more details, refer to the Responsible AI Readme.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Extension points exported contracts — how you extend this code

Command (Interface)
(no doc) [30 implementers]
packages/poml-vscode/util/commandManager.ts
Range (Interface)
* Temporarily used for document range and positional range.
packages/poml/file.tsx
MessagePoster (Interface)
(no doc) [1 implementers]
packages/poml-vscode-webview/util.ts
Lazy (Interface)
(no doc) [1 implementers]
packages/poml-vscode/util/logger.ts
PomlErrorOptions (Interface)
* Error type.
packages/poml/base.tsx
CodeLineElement (Interface)
(no doc)
packages/poml-vscode-webview/scrollSync.ts
LanguageModelSetting (Interface)
(no doc)
packages/poml-vscode/settings.ts
MarkdownBox (Interface)
* A box-like structure simualtes HTML-like box model in markdown rendering. * The before and after are considered as th
packages/poml/writer.ts

Core symbols most depended-on inside this repo

map
called by 126
packages/poml-vscode/util/logger.ts
read
called by 94
packages/poml/index.ts
poml
called by 83
packages/poml/index.ts
component
called by 77
packages/poml/base.tsx
get
called by 75
packages/poml/base.tsx
clear
called by 75
packages/poml/util/schema.ts
empty
called by 71
packages/poml/base.tsx
write
called by 54
packages/poml/writer.ts

Shape

Method 436
Function 290
Class 158
Interface 102
Enum 3
Route 1

Languages

TypeScript80%
Python20%

Modules by API surface

packages/poml/writer.ts121 symbols
packages/poml/base.tsx86 symbols
packages/poml/file.tsx48 symbols
packages/poml-vscode/command/testCommand.ts45 symbols
python/poml/_tags.py42 symbols
packages/poml-vscode/panel/panel.ts34 symbols
packages/poml-vscode/lsp/server.ts24 symbols
packages/poml/util/xmlContentAssist.js23 symbols
packages/poml/util/schema.ts21 symbols
packages/poml-vscode/util/logger.ts20 symbols
packages/poml/presentation.tsx19 symbols
python/poml/api.py18 symbols

Dependencies from manifests, versioned

@ai-sdk/anthropic2.0.2 · 1×
@ai-sdk/azure2.0.11 · 1×
@ai-sdk/google2.0.5 · 1×
@ai-sdk/openai2.0.11 · 1×
@azure-rest/ai-inference1.0.0-beta.5 · 1×
@azure/core-sse2.1.3 · 1×
@rollup/plugin-commonjs28.0.6 · 1×
@rollup/plugin-json6.1.0 · 1×
@types/d3-dsv2.0.0 · 1×
@types/jquery3.5.32 · 1×
@types/js-yaml4.0.9 · 1×
@types/lodash.throttle4.1.9 · 1×

For agents

$ claude mcp add poml \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact