# Using S3 for temporary storage

The agent SDK needs a location to store files that are being uploaded and files that it has generated.  By default, it uses the filesystem to store these, within the current working directory.  In some cases, particuarly if you want users to download those files that are created, you'll want to setup an S3 bucket.

{% hint style="warning" %}
Your S3 bucket should **not** be public! The SDK uses time limited access urls so that you can keep all your buckets private.
{% endhint %}

### Setting up S3 in the SDK

To configure S3 within the SDK, there are a few steps you need to take.  First you need to tell the SDK which region and what bucket to use.  Just set the environment variables below or add the properties to your `application.properties`. To set this up.

```
aws.download.region=${AWS_DOWNLOAD_REGION:eu-central-1}
aws.download.bucket=${AWS_DOWNLOAD_BUCKET:}
```

Now we need to ensure we have our credentials set.

#### Running locally

When we're running locally (the `dev` or `local` profile) - you'll also need to set your AWS credentials.  We recommend setting these inside a application-local.properties file or similar that is just for that running profile:

{% code title="application-local.properties" %}

```properties
aws.secret.key=${AWS_SECRET_KEY:}
aws.access.key=${AWS_ACCESS_KEY:}
```

{% endcode %}

Now when you run the SDK you'll be able to interact with S3 just as if you were inside AWS.

#### Running inside AWS

When running within AWS, all you need to do is set the profile to `aws` .  This tells the SDK to pick up the access from the instance roles.  Just be sure that you have setup your instance IAM profile to have access to S3.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.peoplelogic.dev/guides/getting-started-with-the-talent-agent-sdk/working-with-documents/using-s3-for-temporary-storage.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
