cd /news/ai-agents/markdown-is-perfect-for-small-databa… · home › topics › ai-agents › article
[ARTICLE · art-177475] src=dev.to ↗ pub= topic=ai-agents verified=true sentiment=↑ positive

Markdown is perfect for (small) databases. Here's how ...

A developer outlined the "Markdown Database Pattern," in which a folder of markdown files with YAML frontmatter serves as a lightweight database: each file is a record, each frontmatter field a column, and the folder a table. The approach requires no server or schema, can be queried with a short Python list comprehension or grep, and is editable by AI coding agents like Claude Code and Cursor, which can read the files and add new records in plain English. The developer recommends it for hundreds to a few thousand records, pointing to Postgres for millions of rows or concurrent writes.

recommendation

Store small datasets as markdown files with YAML frontmatter so coding agents can read and edit records directly, and keep the folder in git to review each change.

more in playbook: Designing agent systems
by read3 min views3 publishedNov 27, 2026

Here's a database: five markdown files about Harry Potter characters, sitting in a folder. No server, no schema. Obsidian shows it as a table I can sort and edit, ten lines of Python query it, and when I ask Claude Code in plain English to add Ron, it does.

The folder:

characters/
  harry-potter.md
  hermione.md
  malfoy.md
  dumbledore.md
  luna.md

And each file looks like this:

---
name: Harry Potter
house: Gryffindor
status: Alive
creature: Hedwig (Owl)
---


The boy who lived. Notes go here, as long as you like.

Characters without a pet get creature: -.

The bit between the --- lines is frontmatter: plain YAML at the top of a markdown file. Almost every markdown tool understands it already.

That's it. You've made a database:

markdown file      →  record
frontmatter field  →  column
folder             →  table

No install, no schema. Want a new column? Add a field to a file.

Open the folder in Obsidian, add a Base, and there it is:

Sort by house, filter to the living, edit a cell and it writes straight back to the file. This is the thing Notion is good at, structured fields plus free text in one place. Except here every record is a text file on your own disk, in git if you like, editable in any editor, and still there if Obsidian disappears tomorrow.

You don't need a database engine either. Frontmatter is so simple that a query is a list comprehension:

import pathlib

def records(folder):
    for f in sorted(pathlib.Path(folder).glob("*.md")):
        head = f.read_text().split("---")[1]
        yield dict(line.split(": ", 1) for line in head.strip().splitlines())

alive_with_pets = [r for r in records("characters")
                   if r["status"] == "Alive" and r["creature"] != "-"]

for r in alive_with_pets:
    print(f'{r["name"]:<18} {r["house"]:<11} {r["creature"]}')
Harry Potter       Gryffindor  Hedwig (Owl)
Hermione Granger   Gryffindor  Crookshanks (Cat)

No libraries. (That little parser only handles simple key: value lines and assumes every file has every field; for real YAML use a YAML library. You get the idea.) And for quick questions plain grep works fine:

$ grep -l "house: Gryffindor" characters/*.md
characters/dumbledore.md
characters/harry-potter.md
characters/hermione.md

This is why I think the pattern has gone from "neat trick" to "obviously the right way" in the last year.

AI agents are brilliant at plain files. Point Claude Code or Cursor at the folder and the query language is English:

Which characters are dead? Add Ron Weasley with the same fields.

It reads the files, tells you Dumbledore, and writes characters/ron.md:

---
name: Ron Weasley
house: Gryffindor
status: Alive
creature: Scabbers (Rat)
---


Harry's best friend. Sixth of seven Weasley children.

Run the Python again and Ron shows up. You and the agent are working on the same files, and git shows you exactly what it changed. With Notion you'd be wiring up an API integration before you got this far.

Hundreds of records, a few thousand, great. Millions of rows, lots of joins, many people writing at once: use Postgres.

But a surprising amount of life fits in a few thousand records: books you've read, recipes, people you've met, projects, a team's decisions, a product catalog, a blog.

I call this the Markdown Database Pattern. The full write-up, plus a step-by-step guide to building one from an empty folder, is on The Way of Markdown: wayofmarkdown.com/markdown-database

What have you got in markdown that's secretly a database? 😎

── more in #ai-agents 4 stories · sorted by recency
── more on @claude code 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
→ Live at https://your-agent.zahid.host ✓
Get free account → Pricing
from €0/mo · no card required
LIVE [news/markdown-is-perfect-…] indexed:0 read:3min 2026-11-27 · —