πŸ“ MAGI

Markdown for Agent Guidance & Instruction

🎯 Motivation & Introduction

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.

🧩 Core Components

MAGI enhances standard Markdown by incorporating three key, optional components:

MAGI: Three Major Components YAML Front Matter --- doc-id: "38f5a922..." title: "Document" description: "..." tags: ["magi", "doc"] created-date: "..." updated-date: "..." --- AI Script Blocks \`\`\`ai-script { "script-id": "..." "prompt": "..." "priority": "high" "auto-run": true } \`\`\` Doc Relationships Reference [^ref1] [^ref1]: { "rel-type": "parent" "doc-id": "..." "rel-desc": "..." } Standard Markdown Content [Human-readable text, headings, styles] (text, lists, headings, links, etc.)

Key Principle: All MAGI components are optional. Use only what you need, offering flexibility.

πŸ•ΈοΈ Knowledge Graph Construction

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.

MAGI: Knowledge Graph Construction Research Paper doc-id: "research-001" Data Set doc-id: "data-123" Methods doc-id: "methods-456" Prior Study doc-id: "prior-789" Follow-up doc-id: "follow-012" Contradicts doc-id: "contra-345" Extends doc-id: "extend-678" Citation 1 doc-id: "cite-901" Citation 2 doc-id: "cite-234" uses-data uses-methods builds-on leads-to contradicts extends cites cites Relationship Types uses temporal logical citation

Benefits: Human-readable syntax combines with machine-processable structured data, enabling explicit connections and graph-ready content.

πŸš€ Use Cases

MAGI is designed to solve real-world problems at the intersection of human and AI content processing:

πŸͺ„ Try MAGI Instantly!

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!

Convert URL to MAGI Now