AGENT.md

FEATURE RELEASEAI
5 min read

Agents need branches. Dolt is the only SQL database with branches. Dolt is the database for agents.

We're building features around the agentic use case. Today, we're happy to announce a new Dolt doc, AGENT.md. This document is populated by default and can easily tell your favorite agent that the directory it is working in is a Dolt database. Agents have proven remarkably capable of schema design and data cleaning tasks. Now, Dolt is even easier to use with your favorite agent.

$ dolt docs print AGENT.md > claude.md
$ claude

And Claude Code, my new best friend, is using Dolt.

If Claude Code does something dumb, no big deal, Dolt is version controlled just like your Git repository. Just dolt reset --hard.

What are Dolt Docs?

Way back in February 2020, just before the world shut down, we released Dolt docs. Dolt docs allow you to add a LICENSE.md and README.md file to your database. The Dolt web user interfaces, DoltHub, DoltLab, and Dolt Workbench, display these documents on your database homepage if they exist. Documentation that travels along with your database mimicked the very useful functionality of Git and GitHub. The first stop for an open source project is the README. Why would the same not be true of an open data project?

Example README

When we launched this feature, there was a clever interface where you would create or edit README.md or LICENSE.md files in your Dolt database directory and Dolt would automatically convert the files into database tables on add and commit. When we migrated Dolt to the new storage format just prior to Dolt 1.0, we deemed the file system interaction functionality too difficult to port. We decided to make a simpler (for us), user driven command line interface with print and upload functions.

$ dolt docs --help
Valid commands for dolt docs are
                diff - Diffs Dolt Docs
               print - Prints Dolt Docs to stdout
              upload - Uploads Dolt Docs from the file system into the database

The docs are stored in a system table called dolt_docs which you can interact directly with using SQL.

AGENT.md

Which brings us to our newest doc, AGENT.md.

Coding agents are all the rage. All coding agents expose a built in hook where you can add an AGENT.md file, ie. CLAUDE.md, CODEX.md, GEMINI.md, etc, to the root of the agent's workspace to describe the layout of the code the agent will work on. This documentation enhances the capabilities of the agent from start up, removing the need for additional prompting.

We've tested a simple CLAUDE.md to describe a Dolt database. Claude Code can use Dolt effectively with the following simple CLAUDE.md.

This directory contains a dolt database.

You can access the dolt command line by typing dolt. 
dolt is like git for sql databases so all git commands work the same in dolt.

There is a no sql-server available so you will have to do everything via the dolt command line.

So, we added a default AGENT.md to every Dolt database starting in 1.57.6. To see it, you run:

$ dolt docs print AGENT.md
This directory contains a Dolt database.

You can access the dolt command line by typing dolt.
dolt is like git for sql databases so all git commands work the same in dolt.
For example "git add" becomes "dolt add" and "git diff" becomes "dolt diff".

or, using SQL:

$ dolt sql -r csv -q "select doc_text from dolt_docs where doc_name='AGENT.md'"  
doc_text
"This directory contains a Dolt database.

You can access the dolt command line by typing dolt.
dolt is like git for sql databases so all git commands work the same in dolt.
For example ""git add"" becomes ""dolt add"" and ""git diff"" becomes ""dolt diff""."

If you want to create a file for your agent, say Claude Code to use, pipe the output to the appropriately named file like so:

$ dolt docs print AGENT.md > CLAUDE.md
$ claude
╭────────────────────────────────────────────────────────╮
│ ✻ Welcome to Claude Code!                              │
│                                                        │
│   /help for help, /status for your current setup       │
│                                                        │
│   cwd: /Users/timsehn/dolthub/claude/doltdbs/showdocs  │
╰────────────────────────────────────────────────────────╯

> do you notice anything interesting about the initial commit hash of this 
  dolt database?

⏺ Bash(dolt log --oneline)
  ⎿  doltn7g201oqg8autajrhbnhu5bt4l2i (HEAD -> 
     main) Inіtialize dаtа rеposіtоry

⏺ The initial commit hash doltn7g201oqg8autajrhbnhu5bt4l2i appears to start
   with "dolt", which is likely intentional branding rather than a random
  hash. Dolt commit hashes are designed to be human-readable and often
  incorporate the product name as a prefix.

Claude seems to know it is working with Dolt but it doesn't know about dolt init --fun.

If you want to edit your AGENT.md Dolt doc, make changes to the file you made and then upload the result. You can even see the diff.

$ dolt docs upload AGENT.md CLAUDE.md
$ dolt docs diff AGENT.md
 This directory contains a Dolt database.
 
 You can access the dolt command line by typing dolt.
 dolt is like git for sql databases so all git commands work the same in dolt.
-For example "git add" becomes "dolt add" and "git diff" becomes "dolt diff".
+For example "git add" becomes "dolt add" and "git diff" becomes "dolt diff".
+
+This dolt database is currently empty and was initialized with dolt init --fun
+giving it an interesting initial commit hash.

Now. let's see if Claude Code takes the hint.

$ claude
╭────────────────────────────────────────────────────────╮
│ ✻ Welcome to Claude Code!                              │
│                                                        │
│   /help for help, /status for your current setup       │
│                                                        │
│   cwd: /Users/timsehn/dolthub/claude/doltdbs/showdocs  │
╰────────────────────────────────────────────────────────╯

> do you notice anything interesting about the initial commit hash of this 
    dolt dataabse?

⏺ Bash(dolt log)
  ⎿  commit doltn7g201oqg8autajrhbnhu5bt4l2i (HEAD
     -> main)
     Author: Tim Sehn <tim@dolthub.com>
     … +3 lines (ctrl+r to expand)

⏺ Yes! The initial commit hash doltn7g201oqg8autajrhbnhu5bt4l2i is
  interesting because it starts with "dolt" - this is what happens when you
   initialize a Dolt database with the --fun flag. Instead of a random
  hash, Dolt generates a commit hash that begins with "dolt" as a fun
  Easter egg.

While a simple feature, we think AGENT.md signals we're all in on making Dolt the database for agents. This is an additional companion to the decentralized version control, testing, and command line features that already make Dolt the perfect database for agents.

AGENT.md Stumped Claude Code

Ironically, I tried to get Claude Code to write AGENT.md and it failed. I wanted the AGENT.md Dolt doc materialized in the init commit. However, it's a little gnarly because without a root, the pre-cursor to a Dolt commit, the interfaces to create tables do not exist. This detail got Claude Code into a bunch of trouble with circular dependencies it couldn't get out of and I decided to give up.

A couple weeks later I got impatient and asked Brian to build it for me. I told him how Claude Code had failed and suggested it might be easier to just show the default AGENT.md whenever anyone asked for it until it was changed. This was the implementation we went with. So, even when coding agents fail, they could make the job easier for a human coder by disproving possible approaches.

Conclusion

Agents need branches. Dolt is the only SQL database with branches. Dolt is the database for agents. AGENT.md is a small companion feature that drives this point home. More to come. Have an agentic feature you want in Dolt? Come by our Discord and tell us about it.

SHARE

JOIN THE DATA EVOLUTION

Get started with Dolt

Or join our mailing list to get product updates.