Supercharge Your AI Agents with Decentralized Storage: Storacha Plugin for elizaOS
Meet the Storacha plugin for elizaOS — the easiest way to give your agents decentralized, persistent memory.
Building autonomous AI agents is exciting! But without a solid way to store and share data, they can feel like brains without long-term memory. elizaOS is a cutting-edge framework for autonomous AI agents. When you combine elizaOS with the new Storacha plugin, those agents gain a powerful memory boost via decentralized storage. In this post, we’ll explore how Storacha’s Filecoin/IPFS-powered storage integrates with elizaOS to give your AI agents secure, shareable, and persistent data capabilities. We’ll cover why this matters, what you can do with it, and how to get it running in your own projects.
The Challenge: AI Agents Need a Storage Strategy
Autonomous AI agents often need to remember information, share files, or archive their outputs. Traditionally, you might stash data on a central server or rely on the agent’s in-memory state, but those approaches can be brittle and siloed. What happens when you want multiple agents to collaborate on a task? Or when an agent needs to recall a fact that it learned yesterday?
elizaOS, a plugin-based AI agent framework, lets developers easily extend agent capabilities. However, out of the box, agents have limited long-term memory or cross-agent data sharing. You could wire up a database or cloud storage, but that introduces centralized points of failure and management overhead. This is where decentralized storage comes in as a game-changer for AI agent deployments.
The Storacha Plugin for elizaOS: Giving Agents a Decentralized Memory
The Storacha plugin is a drop-in module for elizaOS that bridges your agent to the Storacha network. Once installed, your agent gains new actions that allow it to upload files to decentralized storage and retrieve them later using their Content IDs (CIDs). Under the hood, the plugin handles all the heavy lifting: interacting with the Storacha client, managing authorization, and returning results to the agent or user.
What does this enable? Your AI agent can now do things like:
- Save outputs or files persistently: For example, an agent that generates an image or a report can call an upload action to store that file on Storacha. The plugin returns a CID (Content ID) that the agent can share or save for later. That file is now safely stored in a decentralized way — even if the agent restarts, the data remains available.
- Retrieve by reference: Given a CID, the agent can fetch the corresponding data using a retrieve action. The Storacha plugin will pull the content from the network (via IPFS Gateways) and provide it back (even attaching the file in the agent’s response if needed). This is incredibly useful for recalling previously stored information or fetching knowledge shared by another agent.
- Share data across agents: Because storage is content-addressed and global, one agent can upload something and hand the CID off to another agent. The second agent can retrieve that data by CID. This opens the door to multi-agent workflows where AI agents cooperate by sharing a common pool of knowledge or files — without any direct API integrations between them. Everything funnels through Storacha’s decentralized data layer.
- Audit and trust the data: Every piece of data the agent stores has a verifiable CID. You get a transparent log of what your agent created or consumed. If you ever need to audit agent decisions or reproduce a result, you can pull the exact data by its CID. This is especially important as AI systems become more autonomous — having a tamper-proof record of their inputs/outputs builds trust.
Behind the scenes, the plugin uses Storacha’s client libraries to perform the uploads and downloads. It authenticates the agent using a decentralized identity (your agent’s DID and a delegation proof, which we’ll set up in a moment). All data transfers are content-addressed, meaning the agent doesn’t worry about file paths or URLs — just CIDs.
Getting Started
Ready to give your elizaOS agent a decentralized memory? Let’s walk through the setup. The integration is straightforward for anyone familiar with Node.js or TypeScript projects, with just a one-time credential setup for the decentralized bits.
Step 1: Install the Storacha plugin package: In your elizaOS project, add the plugin via your package manager. For example, using PNPM:
pnpm install @storacha/elizaos-plugin(Use the equivalent npm install or yarn add if those are your tools of choice.)
Step 2: Enable the plugin in your agent: elizaOS agents are configured to use plugins via a list. You need to import the Storacha plugin and include it. For instance, in your agent’s configuration (e.g., agent/src/defaultCharacter.ts):
import { storagePlugin } from "@storacha/elizaos-plugin";
export const defaultCharacter: Character = {
name: "Eliza",
username: "eliza",
plugins: [storagePlugin],
// ... other settings ...
};This tells elizaOS to load the Storacha storage plugin when the agent starts.
Step 3: Set up your agent’s DID and credentials: Because we’re connecting to a decentralized network, we need to generate a decentralized identity for your agent and give it permission to use your Storacha storage space. Storacha provides a CLI (w3) to handle this, or you can use the Storacha web dashboard. The quick steps with the CLI are:
- Generate a DID key pair: Run w3 key create. This will output a new private key and its corresponding DID (which will look like did:key:z6Mk… etc.). Copy the private key string — you’ll need it in a moment — and note the DID.
- Delegate storage access to the agent: Using the DID from the previous step, run a delegation command to authorize it. For example:
w3 delegation create <agent_DID> --can 'store/add' --can 'filecoin/offer' -c 'upload/add' -c 'space/blob/add' -c 'space/index/add' --base64- This instructs Storacha to create a delegation granting your agent the ability to add uploads in your space. The output will be a long base64 string (the UCAN delegation proof). A UCAN is a User Controlled Authorization Network.
- Configure environment variables: In your elizaOS project, open the environment config (you might copy agent/.env.example to agent/.env if you haven’t already). Add your new credentials:
STORACHA_AGENT_PRIVATE_KEY=<your private key from w3 key create>
STORACHA_AGENT_DELEGATION=<the base64 token from delegation>- These tell the Storacha plugin which identity to use (private key) and provide the authorization proof it needs to act on your behalf. By using a UCAN delegation, you ensure the agent can only do what you have allowed it to do (in this case, add and retrieve files) and nothing more.
Note: The Storacha docs have a detailed quickstart if you need more guidance on creating an account, managing spaces, or using the web UI to get these values. Once the above is done, your agent effectively has its “wallet” for storage set up.
Step 4: Run the agent and verify: Start your elizaOS agent as you normally would (for example, pnpm start after building). On startup, the Storacha plugin will initialize using the provided keys. Look for a log message like “Storage client is initialized”, indicating a successful connection. From this point, your agent is empowered with two new actions: one to upload data to Storacha, and one to fetch data by CID.
You can test it out through whatever interface you use to chat or interact with your agent:
- To upload a file, instruct your agent in natural language, e.g., “Save this file to storage” (depending on how your agent is programmed to handle user requests). The agent will invoke the STORAGE_UPLOAD action under the hood. It might respond with a confirmation and the CID of the stored file. For example: “File stored successfully. The content ID is bafkrei….” Now the file is content-addressed in Storacha’s network.
- To retrieve a file, you (or any other agent) can ask for that CID. For instance: “Retrieve file bafkrei….” The agent will perform a STORAGE_RETRIEVE action, pull the data from Storacha, and (depending on your agent’s UI) return the file or its contents. In a chat interface, the agent might provide a download link or even embed the content if it’s text or an image.
These actions can also be triggered programmatically. For example, an agent could decide on its own to archive something by calling the plugin’s upload method internally. As a developer, you don’t have to manage IPFS clients or HTTP requests — just prompt or call the high-level actions, and the plugin handles the rest.
Conclusion
elizaOS + Storacha is a powerful combo for building smarter, more open AI agents. With just a few steps, you can add secure, decentralized memory that scales — and persists — across agent lifecycles.
We’ve covered the plugin and how to get started, so whether you’re building a media-savvy assistant or a multi-agent system, this integration lets your agents store, share, and recall knowledge like never before.
Ready to future-proof your AI stack? Try the Storacha plugin and start building agents with memory that lasts.
Happy hacking, and welcome to the era of autonomous agents with a decentralized backbone!
Try It for Free!
Storacha offers free storage to help you get started:
- GitHub Users: Get 100MB of free storage when you sign up with your GitHub account
- Email Users: Get 5GB free when you register with an email + credit card
→ Start building with Storacha AI
And if you build something cool with the elizaOS + Storacha Plugin, don’t forget to tag us on X (Twitter) , we’d love to see what you’re working on.
Learn More & Start Building
Want to go deeper or start experimenting? Here are some helpful resources: