Agent File (.af): An open file format for serializing stateful AI agents with persistent memory and behavior. Share, checkpoint, and version control agents across compatible frameworks.
See the code
Agent File (.af): An open file format for stateful agents.
[ View .af Schema ] [ Download .af Examples ] [ Contributing ]
Agent File (.af) is an open standard file format for serializing stateful AI agents. Originally designed for the Letta framework, Agent File provides a portable way to share agents with persistent memory and behavior.
Agent Files package all components of a stateful agent: system prompts, editable memory (personality and user information), tool configurations (code and schemas), and LLM settings. By standardizing these elements in a single format, Agent File enables seamless transfer between compatible frameworks, while allowing for easy checkpointing and version control of agent state.
Each agent in this directory has been trained and tuned for specific purposes. You can explore them at:
agents/
└── @{owner}/
└── {agent-name}/
├── {agent-name}.af # The agent file
└── {agent-name}.webp # Avatar image
| Agent | Author | Description |
|---|---|---|
| Loop | @letta-ai | A ChatGPT alternative focused on memory. Direct, dry, remembers everything. |
You can deploy any agent file to your own Letta server using the ADE, REST API, or SDK.
.af file from this repository
# Install SDK with `pip install letta-client>=1.0.0`
from letta_client import Letta
# Assuming a Letta Server is running at http://localhost:8283
client = Letta(base_url="http://localhost:8283")
# Import your .af file from any location
agent_state = client.agents.import_file(file=open("/path/to/agent/file.af", "rb"))
print(f"Imported agent: {agent_state.id}")
// Install SDK with `npm install @letta-ai/letta-client@^1.0.0`
import { LettaClient } from '@letta-ai/letta-client'
import { readFileSync } from 'fs';
import { Blob } from 'buffer';
// Assuming a Letta Server is running at http://localhost:8283
const client = new LettaClient({ baseUrl: "http://localhost:8283" });
// Import your .af file from any location
const file = new Blob([readFileSync('/path/to/agent/file.af')])
const agentState = await client.agents.importFile(file, {})
console.log(`Imported agent: ${agentState.id}`);
# Assuming a Letta Server is running at http://localhost:8283
curl -X POST "http://localhost:8283/v1/agents/import" -F "file=/path/to/agent/file.af"
Have an agent you've trained and want to share? We'd love to include it.
Fork this repository
Create your agent directory:
agents/@{your-github-handle}/{agent-name}/
Export your agent from Letta using the ADE or via the API (see Exporting Agents below)
Add required files:
{agent-name}.af — Your exported agent file{agent-name}.webp — Square avatar imageSubmit a pull request
See agents/CONTRIBUTING.md for detailed guidelines.
You can export your own .af files to share (or contribute!) by selecting "Export Agent" in the ADE:

# Assuming a Letta Server is running at http://localhost:8283
curl -X GET http://localhost:8283/v1/agents/{AGENT_ID}/export
// Install SDK with `npm install @letta-ai/letta-client@^1.0.0`
import { LettaClient } from '@letta-ai/letta-client'
// Assuming a Letta Server is running at http://localhost:8283
const client = new LettaClient({ baseUrl: "http://localhost:8283" });
// Export your agent into a serialized schema object (which you can write to a file)
const schema = await client.agents.exportFile("<AGENT_ID>");
# Install SDK with `pip install letta-client>=1.0.0`
from letta_client import Letta
# Assuming a Letta Server is running at http://localhost:8283
client = Letta(base_url="http://localhost:8283")
# Export your agent into a serialized schema object (which you can write to a file)
schema = client.agents.export_file(agent_id="<AGENT_ID>")
The AI ecosystem is witnessing rapid growth in agent development, with each framework implementing its own storage mechanisms. Agent File addresses the need for a standard that enables:
.af include?A .af file contains all the state required to re-create the exact same agent:
| Component | Description |
|---|---|
| Model configuration | Context window limit, model name, embedding model name |
| Message history | Complete chat history with in_context field indicating if a message is in the current context window |
| System prompt | Initial instructions that define the agent's behavior |
| Memory blocks | In-context memory segments for personality, user info, etc. |
| Tool rules | Definitions of how tools should be sequenced or constrained |
| Environment variables | Configuration values for tool execution |
| Tools | Complete tool definitions including source code and JSON schema |
We currently do not support Passages (the units of Archival Memory in Letta/MemGPT), which have support for them on the roadmap.
You can view the entire schema of .af in the Letta repository here.
.af work with frameworks other than Letta?Theoretically, other frameworks could also load in .af files if they convert the state into their own representations. Some concepts, such as context window "blocks" which can be edited or shared between agents, are not implemented in other frameworks, so may need to be adapted per-framework.
Adding .af support requires mapping Agent File components (agent state) to your framework's equivalent featureset. The main steps include parsing the schema, translating prompts/tools/memory, and implementing import/export functionality.
For implementation details or to contribute to Agent File, join our Discord community or check the Letta GitHub repository.
.af handle secrets?Agents have associated secrets for tool execution in Letta (see docs). When you export agents with secrets, the secrets are set to null.
Training an agent takes time. You teach it your knowledge embedded in these agents
Think of preferences, correct its mistakes, build up its context. That investment has value.
By sharing trained agents:
# Install dependencies
npm install
# Run the development server
npm run dev
# Build for production (syncs agents automatically)
npm run build
The web frontend displays all agents in the agents/ directory. During build, agent files are synced to public/agents/ for static serving.
.af filesMade with ❤️ by the Letta team and OSS contributors
TypeScript
67.7%
Python
23.2%
SCSS
6.7%
Shell
1.8%
Agent File (.af): An open file format for serializing stateful AI agents with persistent memory and behavior. Share, checkpoint, and version control agents across compatible frameworks.
See the code
Agent File (.af): An open file format for stateful agents.
[ View .af Schema ] [ Download .af Examples ] [ Contributing ]
Agent File (.af) is an open standard file format for serializing stateful AI agents. Originally designed for the Letta framework, Agent File provides a portable way to share agents with persistent memory and behavior.
Agent Files package all components of a stateful agent: system prompts, editable memory (personality and user information), tool configurations (code and schemas), and LLM settings. By standardizing these elements in a single format, Agent File enables seamless transfer between compatible frameworks, while allowing for easy checkpointing and version control of agent state.
Each agent in this directory has been trained and tuned for specific purposes. You can explore them at:
agents/
└── @{owner}/
└── {agent-name}/
├── {agent-name}.af # The agent file
└── {agent-name}.webp # Avatar image
| Agent | Author | Description |
|---|---|---|
| Loop | @letta-ai | A ChatGPT alternative focused on memory. Direct, dry, remembers everything. |
You can deploy any agent file to your own Letta server using the ADE, REST API, or SDK.
.af file from this repository
# Install SDK with `pip install letta-client>=1.0.0`
from letta_client import Letta
# Assuming a Letta Server is running at http://localhost:8283
client = Letta(base_url="http://localhost:8283")
# Import your .af file from any location
agent_state = client.agents.import_file(file=open("/path/to/agent/file.af", "rb"))
print(f"Imported agent: {agent_state.id}")
// Install SDK with `npm install @letta-ai/letta-client@^1.0.0`
import { LettaClient } from '@letta-ai/letta-client'
import { readFileSync } from 'fs';
import { Blob } from 'buffer';
// Assuming a Letta Server is running at http://localhost:8283
const client = new LettaClient({ baseUrl: "http://localhost:8283" });
// Import your .af file from any location
const file = new Blob([readFileSync('/path/to/agent/file.af')])
const agentState = await client.agents.importFile(file, {})
console.log(`Imported agent: ${agentState.id}`);
# Assuming a Letta Server is running at http://localhost:8283
curl -X POST "http://localhost:8283/v1/agents/import" -F "file=/path/to/agent/file.af"
Have an agent you've trained and want to share? We'd love to include it.
Fork this repository
Create your agent directory:
agents/@{your-github-handle}/{agent-name}/
Export your agent from Letta using the ADE or via the API (see Exporting Agents below)
Add required files:
{agent-name}.af — Your exported agent file{agent-name}.webp — Square avatar imageSubmit a pull request
See agents/CONTRIBUTING.md for detailed guidelines.
You can export your own .af files to share (or contribute!) by selecting "Export Agent" in the ADE:

# Assuming a Letta Server is running at http://localhost:8283
curl -X GET http://localhost:8283/v1/agents/{AGENT_ID}/export
// Install SDK with `npm install @letta-ai/letta-client@^1.0.0`
import { LettaClient } from '@letta-ai/letta-client'
// Assuming a Letta Server is running at http://localhost:8283
const client = new LettaClient({ baseUrl: "http://localhost:8283" });
// Export your agent into a serialized schema object (which you can write to a file)
const schema = await client.agents.exportFile("<AGENT_ID>");
# Install SDK with `pip install letta-client>=1.0.0`
from letta_client import Letta
# Assuming a Letta Server is running at http://localhost:8283
client = Letta(base_url="http://localhost:8283")
# Export your agent into a serialized schema object (which you can write to a file)
schema = client.agents.export_file(agent_id="<AGENT_ID>")
The AI ecosystem is witnessing rapid growth in agent development, with each framework implementing its own storage mechanisms. Agent File addresses the need for a standard that enables:
.af include?A .af file contains all the state required to re-create the exact same agent:
| Component | Description |
|---|---|
| Model configuration | Context window limit, model name, embedding model name |
| Message history | Complete chat history with in_context field indicating if a message is in the current context window |
| System prompt | Initial instructions that define the agent's behavior |
| Memory blocks | In-context memory segments for personality, user info, etc. |
| Tool rules | Definitions of how tools should be sequenced or constrained |
| Environment variables | Configuration values for tool execution |
| Tools | Complete tool definitions including source code and JSON schema |
We currently do not support Passages (the units of Archival Memory in Letta/MemGPT), which have support for them on the roadmap.
You can view the entire schema of .af in the Letta repository here.
.af work with frameworks other than Letta?Theoretically, other frameworks could also load in .af files if they convert the state into their own representations. Some concepts, such as context window "blocks" which can be edited or shared between agents, are not implemented in other frameworks, so may need to be adapted per-framework.
Adding .af support requires mapping Agent File components (agent state) to your framework's equivalent featureset. The main steps include parsing the schema, translating prompts/tools/memory, and implementing import/export functionality.
For implementation details or to contribute to Agent File, join our Discord community or check the Letta GitHub repository.
.af handle secrets?Agents have associated secrets for tool execution in Letta (see docs). When you export agents with secrets, the secrets are set to null.
Training an agent takes time. You teach it your knowledge embedded in these agents
Think of preferences, correct its mistakes, build up its context. That investment has value.
By sharing trained agents:
# Install dependencies
npm install
# Run the development server
npm run dev
# Build for production (syncs agents automatically)
npm run build
The web frontend displays all agents in the agents/ directory. During build, agent files are synced to public/agents/ for static serving.
.af filesMade with ❤️ by the Letta team and OSS contributors
TypeScript
67.7%
Python
23.2%
SCSS
6.7%
Shell
1.8%