- As of today, the term AI is overhyped, and 99% of content about AI is nothing more than marketing bullshit (the bubble).
- The backbone of what is called AI is just optimized statistical models.
- An LLM is a statistical model for generating templates, trained on large text datasets.
- You should review hard the output of any LLM before using it.
This project attempts to formalize the process of using LLMs as template generators in a reliable, reproducible, and reviewable way.
Author: Artem Kulyabin
GraphMD is a Literate Programming Environment (LPE) where the Markdown document is the primary artifact. It enables bidirectional integration between AI Agents and the Literate Programming Environment, transforming Markdown documents into executable specifications through a collaborative intelligence model where humans write prompts, AI Agents perform actions, GraphMD orchestrates, and knowledge emerges.
Humans write prompts → AI Agents perform actions → GraphMD orchestrates → Knowledge emerges
Markdown documents become executable — AI Agents read prompts and Markdown documents, perform actions (extract knowledge, generate new Markdown documents, execute fenced code blocks, etc.), and interpret results. GraphMD provides the environment to orchestrate these interactions.
- Don't Repeat Others and Don't Reinvent the Wheel
- Reuse standards, tools, and prior work; integrate and reference rather than duplicating or rebuilding without strong justification.
Definition: MBEKG are knowledge graphs whose canonical source is human-readable Markdown that's also machine-executable. Documents and sections encode entities and relations; fenced code blocks and commands define behaviors that can be executed by agents.
Core building blocks:
- Documents/sections as nodes — Typed sections represent entities, concepts, or processes
- Links as edges — Markdown links, anchors, and IDs connect entities and encode relations
- Metadata — Front matter and inline tags provide typing, provenance, and policy context
- Executable blocks — Code fences and commands perform checks, queries, generation, and transforms
- Artifacts as first-class — Results (logs, tables, files, etc.) are referenced back into the documents
Execution model: Agents interpret Markdown, execute declared actions, materialize results, and write findings back into the graph. GraphMD orchestrates execution, validation, and provenance so the graph remains consistent as it evolves.
Properties:
- Human-readable, machine-executable — A single source for understanding and automation
- Traceable and reproducible — Append-only evolution with provenance of prompts, actions, and outputs
- Policy-checked — Consistency and quality rules run as part of the loop
- Bidirectional collaboration — Humans describe and review; Agents execute and analyze
Literate Programming treats programs as literature for humans, interleaving narrative and code so that readers understand the why and how together. In GraphMD, the Markdown document is the primary artifact, and execution is driven from within the prose.
How GraphMD applies literate programming:
- Narrative-first documents — Prompts, rationale, and design live alongside executable fenced code blocks
- Executable code fences — Agents execute commands directly from Markdown
- Weave and tangle model — Publisher (planned) weaves human-friendly docs; Sandbox (planned) tangles and serves as a safe, provenance-aware execution environment for Agent actions and Markdown fenced code blocks
- Provenance-aware updates — Prompts, results, and decisions are recorded in-place for reproducibility
Links:
- “Literate Programming” (1984), The Computer Journal (PDF)
- Literate Programming (1992 book) — Knuth’s Stanford page
This guide will help you set up GraphMD and start using the workflow to guide AI-driven development. You'll learn how to begin collaborating with AI Agents through the structured phase-by-phase workflow.
- Bash - For running validation scripts
- Git - For version control
- Agent - Any AI coding assistant
Research phase:
- Copy workflow/before-research.md content
- Paste it into your Agent prompt to start the research phase
- Collaborate with the Agent to research the problem domain, requirements, and constraints
- Copy workflow/after-research.md content
- Paste it into your Agent prompt to review and commit the research
Design phase:
- Copy workflow/before-design.md content
- Paste it into your Agent prompt to start the design phase
- Collaborate with the Agent to create system architecture, data models, and technical decisions
- Copy workflow/after-design.md content
- Paste it into your Agent prompt to review and commit the design
Roadmap phase:
- Copy workflow/before-roadmap.md content
- Paste it into your Agent prompt to start the roadmap phase
- Collaborate with the Agent to define high-level phases, milestones, and dependencies
- Copy workflow/after-roadmap.md content
- Paste it into your Agent prompt to review and commit the roadmap
Planning phase:
- Copy workflow/before-plan.md content
- Paste it into a new Agent session to start the planning phase
- Collaborate with the Agent as it creates a planning branch and develops a detailed plan
- Copy workflow/after-plan.md content
- Paste it into your Agent prompt to validate, commit, and merge the planning branch
Development phase:
- Copy workflow/before-development.md content
- Paste it into a new Agent session to start the development phase
- Collaborate with the Agent as it creates a development branch and implements your plan
- Copy workflow/after-development.md content
- Paste it into your Agent prompt to review, document, and merge the development branch
The GraphMD workflow consists of 6 phases, each with its own purpose:
- Research - Understand the problem space deeply
- Design - Create system architecture and technical decisions
- Roadmap - Define high-level phases and milestones
- Plan - Create detailed, validated implementation plans
- Development - Generate a codebase
- Review - Retrospective and process improvements. Compare plan vs. implementation
Each phase uses before/after prompt templates that you copy and paste into your Agent session as self-contained prompts.
Prompt Safety: All workflow prompts end with "Stand by for further instructions." to prevent unintended actions and ensure the Agent waits for your next explicit instruction.
- Use independent Agent sessions for Plan and Development phases
- This ensures a fresh LLM context and prevents confusion between planning and development
- Favor slow models with thinking enabled for deeper analysis
- Keep outputs focused and concise
- Quality of understanding matters more than speed
- Review GLOSSARY.md for definitions of key terms and concepts
- Review ECOSYSTEM.md for an end-to-end view of components and integrations
- Review MVP-WORKFLOW.md for detailed phase-by-phase guidance
- Check PROJECT-STRUCTURE.md for detailed project file layout and organization
- Review TEMPLATES.md for templates
- Review RESEARCH-PHASE.md for detailed research phase guidance
- Review DESIGN-PHASE.md for detailed design phase guidance
- Review ROADMAP-PHASE.md for detailed roadmap phase guidance
- Review PLANNING-PHASE.md for detailed planning phase guidance, including best practices and the plan validation state machine for LLM context tracking (context forgetting prevention)
- Review DEVELOPMENT-PHASE.md for detailed guidance on the development phase, including the three-layer LLM context tracking approach and context forgetting prevention strategies
- Review MVP-DEVELOPMENT.md for MVP development best practices
- Review CONTRIBUTING.md for development commands and contribution guidelines
See example projects built with the GraphMD workflow:
- examples/elixir-webservice/ - Complete web service implementation in Elixir demonstrating the full workflow from research to deployment
- examples/rust-wasm-benchmarks/ - Rust WebAssembly performance benchmarking project showcasing technical research and systematic optimization
Each example includes complete workflow artifacts (research notes, design documents, plans, and working codebase) showing how GraphMD guides AI-driven development.
Complete workflow: Research → Design → Roadmap → Plan → Development → Review
This workflow is specifically designed for efficient MVP development.
For detailed guidance on each phase, including recommendations, what to focus on, and how to use the before/after prompt templates, see MVP-WORKFLOW.md.
For detailed guidance on using this workflow for MVP development, including best practices, common pitfalls to avoid, and success metrics, see MVP-DEVELOPMENT.md.
- Pre-commit Hook: Install templates/scripts/pre-commit hook to automatically validate plans before committing
- Conventional Commits: Use the format research:, design:, roadmap:, plan:, dev: for phase commits
- Validation Checkpoints: Commit after passing validation in each phase
- Incremental Development: Commit after each meaningful subtask completion
This is Version v0.1 of GraphMD — the foundational implementation of the Markdown‑Based Executable Knowledge Graph (MBEKG) concept.
🔬 Active development: Research and design for GraphMD v0.2 are underway, incorporating lessons learned from v0.1 and exploring advanced features.
🌐 GraphMD ecosystem vision (planned): See ECOSYSTEM.md for details.
- Markdown toolkit
- Markdown validation
- Markdown generation
- Markdown quality assurance
- Markdown refactoring
- Markdown encyclopedia
- Documentation toolkit
- Documentation generation
- Documentation publishing
- Sandbox for executing Agent actions and Markdown fenced code blocks
- Domain-specific language for prompts
- Artifact analysis toolkit
- Agent workflow orchestration toolkit
- Agent crew management and orchestration toolkit
- Knowledge graph toolkit (RDF, OWL, etc.)
- Enhanced literate programming tools
The current version serves as a solid foundation for AI-driven development workflows while building toward a comprehensive ecosystem for executable knowledge graphs.
If the primary GitHub repository becomes unavailable, use the emergency restore script for a complete repository restore from bundle backup available at: https://mirror.git.artbin.me/graphmd-lpe/graphmd.bundle
See scripts/emergency/RESTORE.md for detailed usage instructions.
Note: This mirror should only be used as a fallback when the primary GitHub repository is inaccessible. For normal usage, always use the main repository.
- Artem Kulyabin (@artbin)
This project is licensed under the MIT-0 and CC0-1.0 licenses - see the LICENSE file for details.
.png)


