Skip to main content
Version: v2.0

aixplain File Manager

aixplain File Manager is an aixplain-managed utility tool that saves files and text into your workspace storage and returns a hosted download URL and resource ID for each item. Use it to persist an agent's outputs — generated documents, reports, datasets — so they can be downloaded or reused later, instead of returning raw content inline.

View the asset on the aixplain Marketplace.


Setup​

from aixplain import Aixplain

aix = Aixplain(api_key="<AIXPLAIN_API_KEY>")

Get the tool​

aixplain File Manager is a built-in utility, so you fetch it by ID rather than connecting it. There is no OAuth step and no config payload.

FILE_MANAGER_ID = "6a0216cffb2a801f1c41e32e"

file_manager = aix.Tool.get(FILE_MANAGER_ID)

print("Name:", file_manager.name)
print("Description:", file_manager.description)
Show output

You can also discover it with aix.Tool.search("file manager").


Available Actions​

ActionDescription
save_contentSave one or more pieces of text as files
save_filesSave one or more existing files into storage by URL

Each action takes a data payload. The inputs per action:

ActionInputRequiredNotes
save_contentcontentsYesList of strings — one file is created per string
save_contentnamesYesList of file names, one per content item
save_contenttagsNoOptional list of tags to attach to the resources
save_filesurlsYesList of source file URLs to ingest
save_filesnamesNoList of file names, one per URL
save_filestagsNoOptional list of tags to attach to the resources

Every successful call returns a list with one entry per item, each containing the resource id, the name, and a signedUrl (a time-limited download link).


Save text content​

Write one or more strings to storage and get back a hosted link for each.

result = file_manager.run(
action="save_content",
data={
"contents": ["Q3 revenue summary: total $1.2M, up 14% QoQ."],
"names": ["q3_summary.txt"],
},
)
print(result.data)
Show output

Save files by URL​

Ingest existing files by URL into your workspace storage.

result = file_manager.run(
action="save_files",
data={
"urls": ["https://your-source.example.com/report.pdf"],
"names": ["report.pdf"],
},
)
print(result.data)
Show output

On failure, the item is returned with an error field instead of an id/signedUrl:

[{'url': 'https://...', 'name': 'report.pdf', 'error': 'Failed to create file resource'}]
warning

save_files ingests URLs that aixplain can reach. Source URLs that are not reachable from the platform return Failed to create file resource. For content you generate at runtime, use save_content instead of writing the content to an external URL first.


Use with an Agent​

Attach the aixplain File Manager to an agent so it can persist its own outputs and hand back a download link.

file_manager = aix.Tool.get("6a0216cffb2a801f1c41e32e")
file_manager.allowed_actions = ["save_content"]

agent = aix.Agent(
name="Report Saver",
description="Writes a short report and saves it as a downloadable file",
instructions=(
"Write the requested report, then save it with the aixplain File Manager "
"save_content action and return the download link to the user."
),
tools=[file_manager],
)
agent.save()

response = agent.run(
query="Write a 3-sentence status update for the BrewBox launch and save it as a file."
)
print(response.data.output)
Show output
note

Set allowed_actions to just the action the agent needs (for example ["save_content"]) so the agent is not over-privileged with both actions.


Example Use Cases​

  • Deliverable hand-off — an agent that generates a deck, PDF, or spreadsheet saves the file and returns a clickable download link instead of inline content
  • Report archiving — persist each run's report with tags so it can be retrieved or referenced later
  • File ingestion — pull an existing file by URL into your workspace so other agents and workflows can reuse it

Notes​

  • signedUrl values are time-limited presigned links. Re-save or re-fetch the resource if the link has expired.
  • save_content requires both contents and names, and the two lists must be the same length.
  • aixplain File Manager is a built-in utility — there is no connect/OAuth step and no asset to delete; fetch it with aix.Tool.get(...) whenever you need it.