Skip to content

Repository files navigation

AML — Agent Markup Language

A lightweight, XML-inspired markup language that enables agents to declaratively invoke modular, scoped, and nestable skills directly inside prompts.

Overview

AML provides two independent layers:

  • Runtime Layer: A high-performance parser and executor implemented in Rust + PyO3
  • Distribution & Knowledge Layer: An APM package for agent tooling ecosystems

Quick Start

pip install aml
from aml import parse, execute, AmlRegistry

doc = parse("""
<skill interface="code-review" language="python">
  <param name="file">src/auth.py</param>
  Review this module for security issues.
</skill>
""")

registry = AmlRegistry()
registry.register_interface("code-review", "Review code for issues")
registry.register_implementation(
    "python-review", "code-review",
    language="python"
)

result = execute(doc, registry)

AML Syntax

<!-- Invoke a skill -->
<skill interface="testing" language="python" retries="2">
  <param name="target">src/</param>
  Run all tests with coverage.
</skill>

<!-- Define an interface -->
<skill define="interface" name="testing">
  Execute automated tests and report results.
</skill>

<!-- Define an implementation -->
<skill define="implementation" name="pytest-runner" implements="testing" language="python">
  Run tests using pytest with coverage reporting.
</skill>

Key Features

  • Declarative: Skills are invoked via markup, not imperative code
  • Composable: Full nesting support with bottom-up execution
  • Scoped: Content inside tags is the skill's operating scope
  • Resolvable: Interface/implementation model with hint-based resolution
  • Safe: Results are escaped; no re-parsing attacks

Documentation

Architecture

┌─────────────────────────────────────────┐
│  Agent Prompt (contains AML tags)        │
└─────────────┬───────────────────────────┘
              │ parse()
              ▼
┌─────────────────────────────────────────┐
│  AST (Document → Nodes)                  │
└─────────────┬───────────────────────────┘
              │ resolve() + execute()
              ▼
┌─────────────────────────────────────────┐
│  SkillRegistry → Resolver → Executor     │
└─────────────┬───────────────────────────┘
              │ result injection
              ▼
┌─────────────────────────────────────────┐
│  Output (AML tags replaced by results)   │
└─────────────────────────────────────────┘

Licence

Apache 2.0 — see LICENSE for details.

About

A lightweight markup language for structuring agent behaviour — skills, tool governance, sessions, and sub-agent delegation — directly inside prompts

Resources

Contributing

Security policy

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages