A plugin providing distributed storage functionality for ElizaOS agents.
The Storacha plugin enables agents to interact with a distributed storage network, allowing for file uploads and retrieval.
npx elizaos plugins add @elizaos-plugins/plugin-storacha
-
Add the plugin to the Agent configuration, e.g.
// eliza/agent/src/defaultCharacter.ts export const defaultCharacter: Character = { name: "Eliza", username: "eliza", plugins: ["@elizaos-plugins/plugin-storacha"], ... };
-
Create the env var file
cp .env.example agent/.env
-
Generate and set the Agent Private Key
w3 key create
- Copy the private key (e.g.,
MgCYJE...Ig3Kk=
) and set it to theSTORACHA_AGENT_PRIVATE_KEY
env var. - Copy the Agent DID key (e.g.,
did:key:...
) to create the Agent Delegation.
- Copy the private key (e.g.,
-
Create the Agent Delegation
- Replace
AGENT_DID_KEY
with the DID Key you copied in the previous step and execute:
w3 delegation create AGENT_DID_KEY \ --can 'store/add' \ --can 'filecoin/offer' \ --can 'upload/add' \ --can 'space/blob/add' \ --can 'space/index/add' | base64
- Copy the base64 encoded content and set it to the
STORACHA_AGENT_DELEGATION
env var.
- Replace
-
Set the model
- If you are starting from scratch you may want to use OpenRouter API to provide the LLM Model for the Agent.
- Just create an account and API key at: https://openrouter.ai
- Then set the
OPENROUTER_API_KEY
env var. - The default agent character is already configured to use OpenRouter.
- Build and start the agent from the project root folder
pnpm install --no-frozen-lockfile && pnpm build && pnpm start
- In another terminal start the Web Client to interact with the agent
pnpm start:client
- Open http://localhost:5173 in browser and have fun
- STORAGE_UPLOAD action for uploading files to the Storacha network
- Supports multiple file types and sizes
- Provides a link to access uploaded files
- STORAGE_RETRIEVE action for reading files from the IPFS based on a CID.
- Embeds the file in the Agent response as an attachment, so the user can download it.
-
Clone the repository
-
Install dependencies
pnpm install
- Build the plugin
pnpm run build
@elizaos/core: workspace:*
- Conversation History & Agent Context Backup
- Cross Agent Data Sharing
- Encryption with LIT Protocol
You can access the Storacha Client directly from the agent code if the plugin is enabled in the character
file, see the Quickstart for AI guide for more info.
MIT & Apache 2