AI / LLMs
Quickstart

Quickstart for AI

Use Storacha to store your LLM, RAG knowledge fragments, agent state, outputs and all the rest in a decentralized network of storage nodes.

Storacha can be used to dynamically store data generated by AI Agents, or for storage/retrieval of initial training data, including RAG knowledge as well as intermediate state. Data can be retrieved by AI Agents using HTTP or over IPFS via bitswap (opens in a new tab).

Coming soon: mutable and private data!

To store data from an AI Agent you can use the JS Client, Go Client or the HTTP Bridge (language independent). Either way, your AI Agent is going to need 2 things - an identity (a DID) and a delegation allowing it to store data to a Space. This should be done offline, on your development machine.

Generate a DID

Currently the best way to generate a DID (Decentralized Identifier) for your agent is to use the CLI tool:

Install the CLI tool

Make sure Node.js (opens in a new tab) is installed first, then install the CLI tool:

npm install -g @web3-storage/w3cli

Generate a DID

w3 key create

Output should look something like:

# did:key:z6Mkh9TtUbFJcUHhMmS9dEbqpBbHPbL9oxg1zziWn1CYCNZ2
MgCb+bRGl02JqlWMPUxCyntxlYj0T/zLtR2tn8LFvw6+Yke0BKAP/OUu2tXpd+tniEoOzB3pxqxHZpRhrZl1UYUeraT0=
⚠️

Make a note of the private key (starting Mg...). It will be used as an environment variable later. Also note down the public key (starting did:key:) as this will be used next to create the delegation.

Obtain Proofs

Proofs are delegations to your agent enabling it to perform tasks. Currently the best way to obtain proofs that will allow you to interact with the Storacha API is to use the CLI tool:

💡

If you're new to Storacha, login with GitHub to get a trial developer account with 100MB of free storage!

Create a Space

If you haven't already, install the CLI tool and generate a DID.

w3 space create [NAME]

Delegate Capabilities to Your Agent

w3 delegation create -c space/blob/add -c space/index/add -c filecoin/offer -c upload/add <AGENT_DID> --base64

This will create a delegation with the minimum permissions required for your agent to write to your space. Make sure you use your agent DID, not the DID of the space you just created!

💡

Make a note of the space DID from above. Your agent will need to reference it later.

Integrate with an AI Agent

The JS Client, Go Client or HTTP Bridge can be integrated directly in any AI Agent. In client libraries you simply need to load the agent identity (DID) and the delegation you created above.

Instructions for initializing clients with an identity and delegation:

We also provide integrations for specific frameworks making it even easier to use Storacha in these environments.

ElizaOS

ElizaOS is an AI agent operating system for building, deploying, and managing intelligent agents. Storacha provides a plugin that enables agents to interact with a distributed storage network, allowing for file uploads and retrieval.

View the ElizaOS integration docs

More integrations coming soon!