Storacha implements a database adapter for ElizaOS that enables decentralized storage of agent data using the Storacha network.
- Storacha: A decentralized storage network built on IPFS and w3up, providing secure and efficient data storage with content addressing.
- ElizaOS: An AI agent operating system that enables building, deploying and managing intelligent agents. website
Before getting started, ensure you have:
- Node.js 23+
- pnpm 9+
- Git for version control
- A code editor (VS Code recommended)
- Storacha delegation token - (learn how to create one at storacha.network)
- Clone the repository
git clone https://github.com/elizaos/eliza.git
cd eliza
- Switch to latest tagged release
# This project iterates fast, so we recommend checking out the latest release
git checkout $(git describe --tags --abbrev=0)
# If the above doesn't work, try:
# git checkout $(git describe --tags `git rev-list --tags --max-count=1`)
- Install dependencies
pnpm install --no-frozen-lockfile
- Build ElizaOS
pnpm build
- Install the Storacha package
pnpm add @storacha/adapter-storacha
- Add the Storacha Adapter to the agent runtime
--- a/agent/src/index.ts
+++ b/agent/src/index.ts
@@ -7,6 +7,7 @@ import { LensAgentClient } from "@elizaos/client-lens";
import { SlackClientInterface } from "@elizaos/client-slack";
import { TelegramClientInterface } from "@elizaos/client-telegram";
import { TwitterClientInterface } from "@elizaos/client-twitter";
+import { StorachaDatabaseAdapter } from "@storacha/elizaos-adapter";
import {
AgentRuntime,
CacheManager,
@@ -677,8 +678,12 @@ async function startAgent(
fs.mkdirSync(dataDir, { recursive: true });
}
- db = initializeDatabase(dataDir) as IDatabaseAdapter &
- IDatabaseCacheAdapter;
+ db = new StorachaDatabaseAdapter({
+ delegation: process.env.STORACHA_DELEGATION,
+ storachaAgentPrivateKey: process.env.STORACHA_AGENT_PRIVATE_KEY,
+ gateway: process.env.GATEWAY || 'https://w3s.link/ipfs',
+ });
await db.init();
- Copy the example environment file:
cp .env.example .env
- Configure the required variables in your
.env
:
# Required Configuration
STORACHA_DELEGATION=your-delegation-token # Get from storacha.network
STORACHA_AGENT_PRIVATE_KEY=your-private-key # Your agent's Ed25519 private key
# Optional Configuration
GATEWAY=https://w3s.link/ipfs # Custom IPFS gateway if needed
- Create Memory Storage Adapter for ElizaOS
- Integrate with Storacha Client Using Existing Delegation
- Implement Agent Data Sharing Mechanisms
- Provide Developer Documentation
- Make It Work with ElizaOS
- Add GitHub SSO Onboarding and Free-Tier Storage via Stripe
- Add Encrypted Agent Storage with Lit Protocol
- Handle Mutability for Stored Data
MIT & Apache-2.0