AI AgentsAI Infrastructure

Why We Built Our Agent File System on Postgres

Why our AI agent file system runs on Postgres rather than a disk per organization, git or an object store, and the trade-offs we accepted.

Or LeviBy Or Levi · Co-founder, Ventos · · 6 min read

When we gave our agents a file system, the first question was where the files would live. The obvious answer is a disk. We went with Postgres instead. This post is about why, and what it cost us.

The short version: one system that holds the files, the search over them and the boundary between organizations stays consistent in a way that three attached systems do not.

An agent file system gives AI agents an organization's knowledge as folders and files they can list, search and read, instead of a pile of retrieved text fragments. The agent opens an account folder, reads the agreement, follows a reference to the meeting notes beside it. At Ventos, that file system runs on Postgres.

What follows is one level below the Agent File System page, at the level of design decisions rather than implementation detail.

Why give AI agents a file system instead of RAG?

My read is that today's models are strongest in one environment above others: a codebase, where they were trained on vast amounts of listing folders, grepping, opening files and following references. Retrieval-augmented generation (RAG) hands the agent the closest fragments instead, and a fragment does not know which account it belongs to or what sits next to it. So we gave agents the organization as files, with hybrid semantic and keyword search as one way into the tree rather than a replacement for it. The Company Brain is what the organization knows; the file system is how an agent finds its way around it.

Once we had decided the agent should see files, we had to decide what those files would sit on.

Why not a disk, git or an object store?

A disk works for one user on a laptop, but it gives you files and nothing else: no search across them and no way to make several writes land together. Giving each organization its own disk solves isolation and makes everything else harder. Every disk has to be provisioned, sized, backed up, restored and upgraded on its own, and access control comes down to Unix users, groups and file permissions, which get unwieldy once who may see which folder follows an organization's changing structure.

Git is how local projects keep a history of who changed what, and it works for one developer's repository. For an organization's shared knowledge it is awkward: people, syncs and agents write constantly and at the same time, git has no per-folder read control, and removing something once it is committed means rewriting history.

An object store is a durable place for bytes, poor at structured questions like "everything under this account that changed this quarter", and it knows nothing about which organization the data belongs to. A dedicated file service with search and isolation layered on top still leaves several systems to keep in step, and I didn't want to maintain that.

The alternative a CTO will ask about first is a dedicated search or vector index next to the files. It answers "what is closest to this phrase" well. It is also one more store to keep consistent with the files, and it gives the agent no tree to walk. Search should be one way into the file system, not a parallel system with its own idea of what exists.

Why Postgres for an AI agent file system?

Postgres lets the files, the search over them and the boundary between organizations live in one system that has been run in production for decades. It is a virtual file system: folders and files are records in the database, and the agent sees ordinary folders and files. When an agent lists a folder or runs a search, both answers come from the same place, and the boundary between organizations is enforced in the same system as the data.

Each organization's data is isolated from every other organization's, at the data layer. That keeps the boundary simple to reason about and to verify. The security page covers the rest of how we handle data.

Writes are transactional, which matters more than it sounds. Agents write to memory and skills while syncs bring in changes from the CRM, Google Drive and the other source systems, often at the same moment, and proactive agents do it on their own schedule. A write either lands completely or not at all, and readers never see a half-written file. The same model lets one document live in several places while being stored once: a renewal agreement belongs to the account, to the project tracking the renewal and to the person who owns the relationship, and in the database it is one document reachable from three paths. On a disk that would be copies or links, each with its own way of going wrong.

Because folders and files are already records, the same foundation would let us build finer-grained permissions on folders and files, and a history of who changed what. Both would be more records beside the files, inside the same boundary between organizations, so there is no separate permissions or audit service to run and keep in sync.

Postgres is boring, which is what we wanted. I'd rather spend engineering time on how agents use an organization's knowledge, agent memory included, than on running storage nobody else runs.

What we gave up

It is not a POSIX file system, at least not yet. You cannot mount it or point arbitrary Unix tools at it. We are experimenting with a FUSE mount that would let you use it as a regular file system, but it isn't ready or available. We picked the operations agents lean on (list, glob, grep, read, and write where writing is allowed) and built those. When an agent needs an ordinary disk to run code or analysis, each person has a private workspace for that, with the same file tools.

That also means we own the semantics. When grep is a database query rather than a program, keeping it close to what the model learned on is our job, and anywhere our version behaves differently, the agent notices.

Binary files are a different kind of thing from text. A markdown note and a long scanned PDF do not fit the same shape of storage. Text is where the database does most of its work; PDFs, spreadsheets and images are part of the file system but are handled on their own terms.

Throughput and storage have ceilings that a bucket of files does not. An organization's knowledge is large for a person and modest for a database, so we sit well inside them, and we will revisit the choice if that stops being true. We would rather meet limits in a system with a long record in production than discover them in one we wrote ourselves.

I'd take that trade again. For how agents navigate and search day to day, see how the Agent File System works; for what they find there, see what the Company Brain holds.