agent-file
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.
Science Score: 44.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
✓CITATION.cff file
Found CITATION.cff file -
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
○Academic publication links
-
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (13.8%) to scientific vocabulary
Repository
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.
Basic Info
Statistics
- Stars: 636
- Watchers: 8
- Forks: 43
- Open Issues: 3
- Releases: 0
Metadata Files
README.md
Agent File (.af): An open file format for stateful agents.
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.
👾 Download Example Agents
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
⚠️ NOTE: requires Tavily and Firecrawl keys | 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 recruiting candidates and drafts emails | Download | README |
| 🐙 Composio Tools | An example of an agent that uses a Composio tool to star a GitHub repository
⚠️ Note: requires enabling Composio | Download | README |
Using .af with Letta
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).
Importing Agents
Load downloaded .af files into your ADE to easily re-create your agent:

cURL
```sh
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" ```
Node.js (TypeScript)
``ts
// Install SDK withnpm 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});
```
Python
```python
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
agentstate = client.agents.importagent_serialized(file=open("/path/to/agent/file.af", "rb"))
print(f"Imported agent: {agent.id}") ```
Exporting Agents
You can export your own .af files to share (or contribute!) by selecting "Export Agent" in the ADE:

cURL
```sh
Assuming a Letta Server is running at http://localhost:8283
curl -X GET http://localhost:8283/v1/agents/{AGENT_ID}/export ```
Node.js (TypeScript)
``ts
// Install SDK withnpm 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("
Python
```python
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.exportagentserialized(agentid="<AGENTID>") ```
FAQ
Why Agent File?
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
What state does .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.
Does .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.
How can I add Agent File support to my 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.
How does .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.
🤝 Contributing
We're just launching Agent File and would love your help in shaping its future:
- Share Example Agents: Contribute your own
.affiles 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
Roadmap
- [ ] Support MCP servers/configs
- [ ] Support archival memory passages
- [ ] Support data sources (i.e. files)
- [ ] Migration support between schema changes
- [ ] Multi-agent
.affiles - [ ] Converters between frameworks
Owner
- Name: letta-ai
- Login: letta-ai
- Kind: organization
- Repositories: 1
- Profile: https://github.com/letta-ai
Citation (CITATION.cff)
cff-version: 1.2.0
message: "If you would like to cite this software, please cite it as below."
title: "Agent File (.af): An open standard file format for stateful agents"
authors:
- name: "Letta authors"
website: "https://letta.com"
repository-code: "https://github.com/letta-ai/agent-file"
url: "https://docs.letta.com/"
abstract: "Agent File (.af) is an open standard file format for serializing stateful agents. It provides a portable way to share agents with persistent memory and behavior, packaging all components including system prompts, editable memory, tool configurations, and LLM settings."
keywords:
- agents
- ai
- llm
- memory
- state
- portability
license: Apache-2.0
date-released: "2025-04-02"
GitHub Events
Total
- Issues event: 2
- Watch event: 669
- Delete event: 1
- Push event: 5
- Public event: 1
- Pull request review event: 1
- Pull request event: 7
- Fork event: 56
- Create event: 3
Last Year
- Issues event: 2
- Watch event: 669
- Delete event: 1
- Push event: 5
- Public event: 1
- Pull request review event: 1
- Pull request event: 7
- Fork event: 56
- Create event: 3
Issues and Pull Requests
Last synced: 10 months ago
All Time
- Total issues: 2
- Total pull requests: 12
- Average time to close issues: N/A
- Average time to close pull requests: about 14 hours
- Total issue authors: 2
- Total pull request authors: 4
- Average comments per issue: 0.0
- Average comments per pull request: 0.0
- Merged pull requests: 9
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 2
- Pull requests: 12
- Average time to close issues: N/A
- Average time to close pull requests: about 14 hours
- Issue authors: 2
- Pull request authors: 4
- Average comments per issue: 0.0
- Average comments per pull request: 0.0
- Merged pull requests: 9
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- synergiator (1)
- backnotprop (1)
Pull Request Authors
- cpacker (8)
- sarahwooders (4)
- aiwithbenefits (2)
- cliandy (2)
- didier-durand (1)
Top Labels
Issue Labels
Pull Request Labels
Dependencies
- composio_langchain *
- letta-client *