File System Operations
Navigate parsed documents and the cross-doc memory store via Unix-shell verbs.
POST /v3/fs is a single op-driven endpoint that lets an LLM agent
(or any programmatic client) walk a corpus the way it would walk a
filesystem — ls to list, cat to read, grep to search, head
for a quick peek, stat for metadata, and find / open / xref
for the cross-doc entity memory layer.
The body always carries an op field; other fields apply per op.
The response envelope is uniform: {op, data, hasMore?, nextCursor?, count?, hint?}.
Doc-level ops (work on every parsed document)
ls: list parsed documents withpageCount,sectionCount,entityCount, and a shortpreviewEntitiesarray.cat: read one doc's full parse JSON, optionally sliced byrange(page / pageRange / sectionTypes) or projected byselect(dotted paths like["sections.label", "sections.page"]).head: first N sections of one doc.grep: substring or regex search across recent parse outputs.scoperestricts tosections/entities/relationships.pathscopes to one doc.countOnly: truereturns only the hit count.stat: metadata only — page/section/entity counts, timestamps.
Memory-level ops (require linkAcrossDocuments: true on the parse function)
find: list canonical entities, filterable bytype,search,since. Returns an empty list with ahintwhen no docs have been memory-linked.open: fetch one entity plus its mentions across docs.xref: for one entity, return the actual sections (with content) across docs that mention it. The "where exactly is X discussed" loop in one round trip.
Pagination
List ops (ls, find) paginate by cursor: pass the last item's
nextCursor from a previous response to fetch the next page;
hasMore: false signals the last page. Same idiom as /v3/calls
and /v3/outputs.
Authorization
API Key Authenticate using API Key in request header
In: header
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
curl -X POST "https://api.bem.ai/v3/fs" \ -H "Content-Type: application/json" \ -d '{ "op": "ls" }'{
"op": "ls",
"data": null,
"hasMore": true,
"nextCursor": "string",
"count": 0,
"hint": "string"
}