TL;DR
When your AI opens this URL:
https://markdown.law/de/de/federal/gg/22
it will get the Grundgesetz
(Basic Law), article 22:
### Art 22
(1) Die Hauptstadt der Bundesrepublik Deutschland ist Berlin. Die Repräsentation des Gesamtstaates in der Hauptstadt ist Aufgabe des Bundes. Das Nähere wird durch Bundesgesetz geregelt.
(2) Die Bundesflagge ist schwarz-rot-gold.
The purpose of this service
The markdown.law service provides legislative documents in Markdown format, so that they can be easily digested by LLMs and agentic AI systems.
Currently supported: German federal law. Coming soon: EU law.
The service is designed to support multiple jurisdictions including the European Union. German law is sourced from Gesetze im Internet, ensuring you always get the most recent documents.
Autonomous and contextual law retrieval
Frontier AI models are trained on a large corpus of documents, including German law, therefore they can already provide paralegal expertise. There are still certain challenges to be addressed:
- recalling exact phrasing during LLM inference is error-prone
- results are subject to hallucinations, leading to nonfactual statements
- regulations may have been updated since the model's knowledge cutoff
For these reasons, it is desirable to always provide the actual copy of the processed law in the LLM's context window. Even better results can be achieved when an LLM can autonomously retrieve the precise documents needed in the context of a task.
Why Markdown instead of XML?
The German law is published on the Gesetze im Internet service. Documents are provided in multiple formats, including human-readable HTML and PDF, and machine processable source of these documents published as XML documents with associated specialized XML schema.
The XML format, well-suited for algorithmic processing, falls short with the probabilistic nature of an LLM. Expressing structured natural language as Markdown proved to be an optimal LLM input for conveying meanings to the machine.
About markdown.law
This service is provided by Rulemapping Group in collaboration with Xemantic.
Hint: You can add /number to the URL to obtain particular section (Paragraph)
AI Skill for markdown.law
Add this skill to your AI agent's system prompt or instructions to enable autonomous legal document retrieval.
How to use this skill
Skills follow the Agent Skills Format specification.
- Download the
SKILL.mdfile - Create a skill directory:
markdown-law/SKILL.md - Add it to your AI agent's skill directory
For Claude Code, place in .claude/skills/markdown-law/SKILL.md