Store and share files
Create a file store, upload files to it, and attach it to a project so the agent can read and write persistent files across sessions. File stores materialize as real directories in the agent’s sandbox. The agent sees them as a normal filesystem path, not an API.
In the UI
In the UI
-
Navigate to your project’s Settings tab.
-
Under File stores, click Add file store.
-
Choose an existing store or create a new one by entering a name.
-
Upload files to the store through the file browser.
-
The store is now attached. The next session on this project will see it as a directory.
Programmatically
Create a file store, upload files, and attach it to a project. Each project can have multiple file stores, and each store can be shared across projects.
-
Create a file store:
Terminal window ren file-stores create --name "project-data"The response includes the store
id(e.g.fst_abc123). -
Upload a file to the store:
Terminal window ren file-stores files upload fst_abc123 \--path "data/config.json" \--file ./config.json -
Attach the store to a project:
Terminal window ren projects file-stores add prj_def456 \--file-store-id fst_abc123
List stores and their files:
ren file-stores listren file-stores files list fst_abc123Remove a file from the store:
ren file-stores files remove fst_abc123 --path "data/config.json"Detach a store from a project:
ren projects file-stores remove prj_def456 fst_abc123-
Create a file store with
POST /api/file-stores:Terminal window curl -X POST https://api.renai.build/api/file-stores \-H "Authorization: Bearer $REN_PAT_TOKEN" \-H "Content-Type: application/json" \-d '{"name": "project-data"}'The response includes the store
id. -
Upload a file (two-step: presign, then PUT):
Terminal window # Start the upload — get a presigned URLcurl -X POST https://api.renai.build/api/file-stores/fst_abc123/files/uploads \-H "Authorization: Bearer $REN_PAT_TOKEN" \-H "Content-Type: application/json" \-d '{"path": "data/config.json", "contentType": "application/json"}'# PUT the file to the presigned URL returned above, then finalize:curl -X POST https://api.renai.build/api/file-stores/fst_abc123/files/finalize \-H "Authorization: Bearer $REN_PAT_TOKEN" \-H "Content-Type: application/json" \-d '{"path": "data/config.json"}' -
Attach the store to a project with
POST /api/projects/{id}/file-stores:Terminal window curl -X POST https://api.renai.build/api/projects/prj_def456/file-stores \-H "Authorization: Bearer $REN_PAT_TOKEN" \-H "Content-Type: application/json" \-d '{"fileStoreId": "fst_abc123"}'
Create a file store and attach it to a project:
import { createRenClient, pat } from "@renai-labs/sdk"
const client = createRenClient({ baseUrl: "https://api.renai.build", auth: pat(process.env.REN_PAT_TOKEN!),})
const { data: store, error } = await client.fileStore.create({ body: { name: "project-data" },})if (error) throw errorconsole.log(store.id) // "fst_abc123"
await client.project.fileStore.add({ path: { id: "prj_def456" }, body: { fileStoreId: store.id },})Upload files with the CLI (ren file-stores files upload), or use the
two-step presign-and-PUT flow shown in the API tab.
File stores are scoped to an owner (org or user). One store per owner can be marked isDefault. It’s automatically attached to new projects in that scope. When an agent modifies files in a store, the changes persist. The next session on the same project picks up where the last one left off.