
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.
Browse our collection of ready-to-use agents below. Each agent has a direct download link (to download the .af
file) and a separate instructions README with a guide on how to use the agent. To contribute your own Agent File to the repo, simply open a pull request!
To use one of the agents, download the agent file (.af
) by clicking the link below, then upload it to Letta or any other framework that supports Agent File.
Agent Type | Description | Download | Instructions |
---|---|---|---|
π§ MemGPT | An agent with memory management tools for infinite context, as described in the MemGPT paper. Two example files: a fresh agent and one with an existing conversation history (pre-fill). | Download (empty) Download (pre-fill) | README |
π Deep Research | A research agent with planning, search, and memory tools to enable writing deep research reports from iterative research |
Download | README |
π§βπΌ Customer Support | A customer support agent that has dummy tools for handling order cancellations, looking up order status, and also memory | Download | README |
πΈοΈ Stateless Workflow | A stateless graph workflow agent (no memory and deterministic tool calling) that evaluates recruting candidates and drafts emails | Download | README |
π Composio Tools | An example of an agent that uses a Composio tool to star a GitHub repository |
Download | README |
You can import and export .af
files to and from any Letta Server (self-deployed with Docker or Letta Desktop, or via Letta Cloud). To run the import and export commands, you can use the visual Agent Development Environment (ADE), or the REST APIs or developer SDKs (Python and TypeScript).
Load downloaded .af
files into your ADE to easily re-create your agent:
# 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"
// Install SDK with `npm install @letta-ai/letta-client`
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.importAgentSerialized(file, {})
console.log(`Imported agent: ${agentState.id}`);
# Install SDK with `pip install letta-client`
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_agent_serialized(file=open("/path/to/agent/file.af", "rb"))
print(f"Imported agent: {agent.id}")
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`
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.exportAgentSerialized("<AGENT_ID>");
# Install SDK with `pip install letta-client`
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_agent_serialized(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:
- π Portability: Move agents between systems or deploy them to new environments
- π€ Collaboration: Share your agents with other developers and the community
- πΎ Preservation: Archive agent configurations to preserve your work
- π Versioning: Track changes to agents over time through a standardized format
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.
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.
Agents have associated secrets for tool execution in Letta (see docs). When you export agents with secrets, the secrets are set to null
.
We're just launching Agent File and would love your help in shaping its future:
- Share Example Agents: Contribute your own
.af
files by opening a pull request with your agent and usage instructions - Join the Discussion: Connect with other agent developers in our Discord server to share ideas and agent files
- Provide Feedback: Open GitHub issues with suggestions, feature requests, or to report compatibility challenges
- Help Refine the Format: As an emerging format, Agent File will evolve based on community input and real-world usage
- Support MCP servers/configs
- Support archival memory passages
- Support data sources (i.e. files)
- Migration support between schema changes
- Multi-agent
.af
files - Converters between frameworks
Made with β€οΈ by the Letta team and OSS contributors
Documentation β’ Community β’ GitHub