@storacha/elizaos-plugin
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.
Installation
pnpm install @storacha/elizaos-pluginConfiguration
Add the plugin to the Agent configuration:
// eliza/agent/src/defaultCharacter.ts
import { storagePlugin } from "@storacha/elizaos-plugin";
export const defaultCharacter: Character = {
name: "Eliza",
username: "eliza",
plugins: [storagePlugin],
// ...
};Create the env var file
cp .env.example agent/.envLoad the Agent Private Key
Set the STORACHA_AGENT_PRIVATE_KEY env var to the private key (e.g. MgCYJE...Ig3Kk=) you created in the quickstart.
Load the Agent Delegation
Set the STORACHA_AGENT_DELEGATION env var to the delegation you created in the quickstart.
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 openrouter.ai (opens in a new tab) and then set the OPENROUTER_API_KEY env var.
The default agent character is already configured to use OpenRouter.
Build & Run
Start the Agent
Build and start the agent from the project root folder:
pnpm install --no-frozen-lockfile
pnpm build
pnpm startStart the Web Client
In another terminal start the Web Client to interact with the agent:
pnpm start:clientInteract
Open http://localhost:5173 in browser and have fun!
API Reference
Actions
STORAGE_UPLOAD
Use this action when the user wants to upload a file to Storacha distributed storage network.
Supports multiple file types and sizes and provides a link to access uploaded files.
Aliases
UPLOADSTORESAVEPUTPIN
STORAGE_RETRIEVE
Use this action when a user asks you to retrieve a file from the Storacha network based on a CID.
Embeds the file in the Agent response as an attachment, so the user can download it.
Aliases
RETRIEVERETRIEVE_FILERETRIEVE_FILE_FROM_STORAGERETRIEVE_FILE_FROM_IPFSGETGET_FILEGET_FILE_FROM_STORAGEGET_FILE_FROM_IPFSGET_FILE_FROM_CIDLOADLOAD_FILELOAD_FILE_FROM_STORAGELOAD_FILE_FROM_IPFSLOAD_FILE_FROM_CIDREADREAD_FILEREAD_FILE_FROM_STORAGEREAD_FILE_FROM_IPFSREAD_FILE_FROM_CID
Future Enhancements
- Conversation History & Agent Context Backup
- Cross Agent Data Sharing
- Encryption with LIT Protocol
- Mutable references