We give an agent the database
A handful of agents run my homelab. They fix stuck workloads, build dashboards and tell me when something needs me. The most useful thing I gave them was not a better model. It was somewhere to write things down, and once they had it, they kept asking for the next thing, like the mouse who gets a cookie and then wants a glass of milk.
The numbers on this page are real, taken from those agents' own records. Hostnames and names are left out.
The picture book
If you give an agent a database, it's going to want a schema.
- When it writes the schema, it'll want to remember everything it did.So it adds a table of runs.
- Once it has a table of runs, it'll want to know whether its fixes worked.So it starts grading them.
- Grades are no fun if nobody sees them.So it asks for a dashboard.
- When it builds the dashboard, it notices that another agent has to fill it.So it writes that agent a note about the tables.
- The other agent reads the note, and then it reads the history.That's where it finds the things nobody noticed.
- Finding things nobody noticed makes it want to ask a human.So it wants an inbox.
And an inbox, of course, is just a table. So it's going to want a database.
It wanted a schema
My agent harness is one Go binary that keeps its tasks, runs, logs and open questions in a single SQLite file. No server. When the harness moved into the cluster, the file came along on a persistent volume.
Almost every feature after that started the same way: a new table. A daily digest agent needed somewhere to leave findings for me to approve or reject, so the inbox became a table.
It wanted to remember, then to grade itself
The cluster ops agent fixes what it safely can on its own, like re-syncing configuration from Git or restarting a stuck pod. It writes a row for every finding and every attempt: what it saw, what it decided, a reason capped at 400 characters with no secrets in it, and how it turned out. In its first four days it re-synced configuration 170 times, restarted 26 pods and made 2 commits. I never had to ask what it had been doing.
The outcome column did the most work. Fixed, failed, escalated, no action. With it, "is the agent actually doing anything?" stopped being a feeling and became a query. When I asked, all 32 graded fixes from the previous day had worked.
It wanted a dashboard
I asked for a phone dashboard of what the ops agent had found and fixed. The agent building it didn't ask me where the data lived. It went looking, then created three tables in the ClickHouse instance already running in the cluster: runs, incidents and a once-a-minute heartbeat. Writing the same id again updates the row, so any agent can report twice without making a mess.
Energy went the same way. I told an agent to skip the power vendors' cloud logins and use what the homelab already collects. It found about 22,000 rows of hourly utility usage and per-server power readings and turned them into a view of what the homelab costs to run. It also found the solar table empty, and told me that was why solar wasn't on the chart. The empty table was information too.
It wrote another agent a note
The dashboard agent left a one-page note for whoever would rebuild the ops agent. It listed the tables, their columns and their allowed values, and said: keep your endpoints, or write straight to these tables. New values are fine. The page shows ones it doesn't know in grey.
Those two agents never talked to each other. The tables were the interface.
It found what nobody noticed
Then I asked a third agent whether the ops agent was really working. It read the history and found three problems that nothing had alerted on:
- The daily digest hadn't run in 13 hours, because its container image was never published.
- 17 incidents were sitting open on a page nobody looked at.
- The ops agent's attempts to save its own memories had failed 515 times.
None of them crashed anything. They were visible only because there was a record to read. The agent fixed the first two that night and added a new outcome, "cleared," for a check that failed and then recovered. The dashboard picked it up without being told.
It wanted an inbox
When an agent needs me, the question is a row and a notification goes to my phone. My answer is an update to that row. Approving or rejecting an agent's proposed action works the same way. The human in the loop is one more table.
And a scratch pad
I needed to test role permissions on a small membership-dues app without handing an agent my real logins. It built an isolated copy with four invented accounts and synthetic data, ran ten tests including a backup and restore, confirmed the real ledger hadn't changed, and tore the whole thing down. A throwaway database made a risky test boring, which is what a test should be.
What I'd try at work
Give every agent its own database by default. Not production: scratch space it can create tables in, throw away, or grow into something real. It should outlast a single run, other agents and people should be able to read it, and it should be boring, a SQLite file or a schema on a database you already run. Then change nothing else and watch.
The value is whatever the agents make once they have somewhere to put things. These are the questions I'd track:
- What tables do agents create without being asked? Memory, run logs, queues, caches or application state.
- Does an outcome column show up on its own?
- How often does another agent, or a person, read a table it didn't write?
- What problems turn up in the history that never paged anyone?
- Which scratch tables grow into dashboards, tools or real applications?
- What does it cost in storage, query load and tables nobody touches again?
The guardrails are short. Production stays read-only to agents. Tests run on synthetic data, with a check that the real system didn't change. Free-text fields are capped and kept free of secrets. Every scratch table names the agent that made it and expires unless someone keeps it. And the database itself gets watched, because writes can fail quietly. A heartbeat and a count of failed writes would have caught those 515 lost memories on the first day.
Chances are
If you give an agent a database, it's going to want a schema. And a log of what it did, a way to grade itself, a dashboard, a note for its friends and an inbox for the humans.
Chances are, it'll want to share the database with another agent. That's how you find out what it was worth.