JSON File Tree
For environments where mounting an S3 filesystem isn’t practical — like serverless functions, Vercel’s bash tool, or lightweight sandboxes — you can fetch the entire file tree as a JSON object.Fetch the Tree
files object is a flat map of path → content. Directory structure is encoded in the paths (e.g., clauses/force-majeure.md).
Use with AI Agents
Write to a Virtual Filesystem
Search In-Memory
Use with Vercel AI SDK
Fetch a Single File
If you only need one file, use the individual file endpoint:.json files) with the appropriate Content-Type header. More efficient than fetching the entire tree when you know which file you need.
When to Use Tree vs. S3 Mounting
| Approach | Best for |
|---|---|
| JSON tree | Serverless functions, in-memory agents, quick lookups |
| S3 mounting | Long-running sandboxes, agents that use shell tools, large documents |
| Single file | When you know exactly which file you need |