by heavyset_go · 10mo ago · 0 comments
Implementing a database abstraction as a file system for an LLM feels like an extra layer of indirection for indirection's sake: just have the LLM write some views/queries/stored procs and give it sane access permissions.
LLMs are smart enough to use databases, email, etc without needing a FUSE layer to do so, and permissions/views/etc will keep it from doing or seeing stuff it shouldn't. You'll be keeping access and permissions where they belong, and not in a FUSE layer, and you won't have to maintain a weird abstraction that's annoying/hampered with licensing issues if you want to deploy it cross platform.
Also, your simplified FUSE abstraction will not map accurately to the state of the world unless you're really comprehensive with your implementation, and at that point, you might as well be interacting directly in order to handle that state accurately.
I think there is a gap between “real file systems” and “non file things in a database” where mapping your application representation of things to a filesystem is useful. Basically all those platforms that let users upload files for different purposes and work with them (ex Google Drive, notion, etc). In those cases representing files to an agent via a filesystem is the more intuitive and powerful interface compared to some home grown tools that the model never saw during training.
https://github.com/nalgeon/sqlean/blob/main/docs/fileio.md
fileio_read - Read file contents as a blob.
fileio_scan - Read a file line by line.
fileio_write - Write a blob to a file.
fileio_append - Append a string to a file.
fileio_mkdir - Create a directory.
fileio_symlink - Create a symlink.
fileio_ls - List files in a directory.
If one only exposes sqlite command query access and limit certain aspects of this sqlite extension depending on the use case perhaps, I feel like this might be a good alternative as well?Edit: thinking more about it I think its for actually making sqlite interact with the filesystem and not the idea of it acting as a file system itself without too much overhead, I was thinking something like the sqlite database itself stores data and then we could do these operations fileio etc. but this isnt possible from what I could gather.
perhaps this might be more interesting https://github.com/narumatt/sqlitefs but what I mean is if something like the merge of fileio + sqlitefs where things dont have to go through fuse in general if that makes sense hopefully
Maybe I went a little tangential but sqlite is really awesome