When to Use EFS
Your agents store local data
Your agents store local data
Agents like Pal use DuckDB to store structured data locally. Without EFS, this data is lost when containers restart.
You need data to survive deployments
You need data to survive deployments
Each
ag infra up creates new containers. EFS ensures your data persists across deployments.Multiple containers need shared access
Multiple containers need shared access
Pal Agent Requirements
| Agent | EFS Required? | Why |
|---|---|---|
| Pal | Yes | Stores DuckDB at /data/pal.db |
| Knowledge Agent | No | Uses PostgreSQL (RDS) |
| MCP Agent | No | Stateless |
DuckDB Single Worker Requirement
Multiple workers cause “database is locked” errors and potential data corruption.Data Persistence Summary
| Data Type | Storage | Survives Restart? |
|---|---|---|
| Agent memory & sessions | PostgreSQL (RDS) | ✓ Yes |
| Knowledge embeddings | PostgreSQL (RDS) | ✓ Yes |
| Pal’s DuckDB (notes, bookmarks) | Local /data | ✗ No (needs EFS) |
| File uploads | Local filesystem | ✗ No (needs EFS or S3) |
Architecture
Setup Guide
Create an EFS File System
Create a new file system in your AWS region:Save the
FileSystemId from the response (e.g., fs-0123456789abcdef0).Create an Access Point
Access points provide application-specific entry points with user/permission mapping:Save the
AccessPointId from the response (e.g., fsap-0123456789abcdef0).The UID/GID
61000 matches the non-root user in the AgentOS container. This ensures your application can read and write to EFS.Create Mount Targets
EFS needs mount targets in each subnet your ECS tasks use. First, deploy to create the EFS security group:Then get the security group ID:Create mount targets in each subnet:
Settings Reference
| Setting | Type | Description |
|---|---|---|
efs_file_system_id | str | EFS file system ID (e.g., fs-0123456789abcdef0) |
efs_access_point_id | str | Access point ID (e.g., fsap-0123456789abcdef0). Optional but recommended for permission mapping. |
How It Works
When you configure EFS settings, the infrastructure automatically:- Creates a security group (
*-efs-sg) allowing NFS traffic (port 2049) from your app containers - Configures an ECS volume with transit encryption enabled
- Mounts the volume at
/datain your container
prd_resources.py:
Cost
EFS pricing is based on storage used:| Storage Class | Price (US East) |
|---|---|
| Standard | $0.30/GB-month |
| Infrequent Access | $0.016/GB-month |
| Archive | $0.008/GB-month |
- 1 GB of agent data: ~$0.30/month
- 10 GB of documents: ~$3.00/month
Troubleshooting
Mount target not found
Mount target not found
Ensure you’ve created mount targets in the same subnets specified in
infra/settings.py. Each subnet needs its own mount target.Permission denied errors
Permission denied errors
Check that your access point uses UID/GID
61000 to match the container user. Verify with:ECS task fails to start
ECS task fails to start
Check that the EFS security group allows inbound NFS (port 2049) from your app security group:
Data not persisting
Data not persisting
Ensure your application writes to
/data, not another directory. Check your DATA_DIR environment variable.