Skip to main content
const folder = await airstore.smartFolders.create('ws_abc123', {
  integration: 'gmail',
  name: 'Unread Emails',
  guidance: 'unread emails from the inbox',
})
Smart folders are natural language queries that materialize as directories in the virtual filesystem. Results sync in the background.

create()

Create a smart folder.
const folder = await airstore.smartFolders.create('ws_abc123', {
  integration: 'gmail',
  name: 'Investor Emails',
  guidance: 'emails from investors in the last 30 days',
  outputFormat: 'folder',
})
Parameters
ParameterTypeRequiredDefaultDescription
workspaceIdstringYesWorkspace external ID
integrationstringYesIntegration source (e.g., gmail, github)
namestringYesDisplay name
guidancestringNoNatural language query for the LLM
outputFormat'folder' | 'file'Nofolderfolder = one file per result; file = single aggregated file
fileExtstringNoFile extension for file output (e.g., .md)
Returns Promise<SmartFolder>
FieldTypeDescription
external_idstringUnique identifier
integrationstringIntegration source
pathstringVirtual filesystem path
namestringDisplay name
guidancestringLLM guidance text
output_formatstringOutput format
created_atstringISO 8601 timestamp

list()

List all smart folders in a workspace.
const folders = await airstore.smartFolders.list('ws_abc123')
Parameters
ParameterTypeRequiredDescription
workspaceIdstringYesWorkspace external ID
Returns Promise<SmartFolder[]>

retrieve()

Get a smart folder by its virtual path.
const folder = await airstore.smartFolders.retrieve('ws_abc123', '/Sources/gmail/Unread Emails')
Parameters
ParameterTypeRequiredDescription
workspaceIdstringYesWorkspace external ID
queryPathstringYesVirtual filesystem path of the smart folder
Returns Promise<SmartFolder>

update()

Update a smart folder’s name or guidance.
const updated = await airstore.smartFolders.update('ws_abc123', 'sq_abc123', {
  guidance: 'unread emails from the last 7 days only',
})
Updating guidance triggers a re-sync with the new query. Parameters
ParameterTypeRequiredDescription
workspaceIdstringYesWorkspace external ID
queryIdstringYesSmart folder external ID
namestringNoNew display name
guidancestringNoNew LLM guidance
Returns Promise<SmartFolder>

del()

Delete a smart folder.
await airstore.smartFolders.del('ws_abc123', 'sq_abc123')
Parameters
ParameterTypeRequiredDescription
workspaceIdstringYesWorkspace external ID
queryIdstringYesSmart folder external ID
Returns Promise<void>