Markdown for Agent Guidance & Instruction
Large Language Models (LLMs) and AI agents increasingly rely on processing diverse content, but standard formats often lack the necessary structure and context for optimal performance. Converting complex web pages or documents into LLM-friendly plain text can be imprecise, losing valuable metadata and structural information.
MAGI (Markdown for Agent Guidance & Instruction) addresses this challenge by extending standard Markdown with optional, structured components designed specifically for AI consumption. It enhances content for Retrieval-Augmented Generation (RAG), seamless integration with LLM agents, and robust knowledge graph construction. MAGI elegantly combines Markdown's readability with enhanced data for AI systems.
MAGI enhances standard Markdown by incorporating three key, optional components:
doc-id
, title
, tags
, purpose
).ai-script
Code Blocks): Embeds structured JSON instructions for LLM processing directly within the content.parent
, child
, cites
).Key Principle: All MAGI components are optional. Use only what you need, offering flexibility.
Leverage standard Markdown footnotes [^ref-id]
with embedded JSON to define explicit, typed relationships
between documents (identified by their unique doc-id
in the Front Matter).
This is essential for building robust knowledge graphs automatically.
Relationship types include parent
, child
, related
, cites
, supports
, contradicts
, and more.
Benefits: Human-readable syntax combines with machine-processable structured data, enabling explicit connections and graph-ready content.
MAGI is designed to solve real-world problems at the intersection of human and AI content processing:
ai-script
instructions.Want to see MAGI in action right away? Convert any public web page into MAGI format using the hosted url2mda service. Just paste a URL and get a MAGI .mda
fileβno installation required!