Reference implementations for Agent-Flavored Markdown (AFM).
A Ballerina-based AFM interpreter.
- Source:
ballerina-interpreter/ - Docker Image:
ghcr.io/wso2/afm-ballerina-interpreter - Getting Started →
A Python-based AFM interpreter using LangChain for agent execution.
- Source:
python-interpreter/packages/afm-langchain - PyPI:
afm-langchain - Docker Image:
ghcr.io/wso2/afm-langchain-interpreter - Getting Started →
Note
Python-based implementations are available via a single CLI tool (pip install afm-cli). LangChain is currently the supported backend, with additional frameworks planned.
reference-implementations-afm/
├── ballerina-interpreter/ # Ballerina-based AFM interpreter
├── python-interpreter/ # Python-based AFM interpreters (plugin-based)
│ └── packages/afm-langchain/ # LangChain execution backend
└── .github/workflows/ # CI/CD
Contributions are welcome!
To add an interpreter in a new language or framework:
- Create a new directory:
{language/framework}-{type}/(e.g.,go-interpreter/) - Add a path-filtered workflow in
.github/workflows/ - Include a README with setup and usage instructions
- Follow the AFM Specification for compatibility
The Python interpreter uses a plugin-based architecture. New execution backends should be contributed as packages inside python-interpreter/packages/.
To add a new Python backend:
- Create a new package under
python-interpreter/packages/and add it to theuvworkspace - Implement the
AgentRunnerprotocol fromafm-core - Register your backend via the
afm.runnerentry point in yourpyproject.toml:[project.entry-points."afm.runner"] your-backend = "your_package.module:YourRunnerClass"
- Use
afm-langchainas a reference implementation - Include a README and tests for your package
Apache License 2.0