🌐 Choose a Network
Memory can be backed by either Lighthouse storage network. Select it with the network parameter or MEMORY_NETWORK:
import { Memory, LighthouseClient } from '@lighthouse-web3/memory'
// Via environment (works for the MCP server too)
const memory = Memory.fromEnv(process.env, { network: 'ipfs-filecoin' })
// Or explicitly
const client = new LighthouseClient(apiKey, { network: 'ipfs-walrus' })
const store = new Memory(client, { namespace: 'my-agent' })
MEMORY_NETWORK=ipfs-filecoin # or ipfs-walrus (default)
Short aliases walrus and filecoin are accepted.
Comparison
ipfs-walrus (default) | ipfs-filecoin | |
|---|---|---|
| Backing | Walrus blobs on Sui | IPFS + Filecoin deals |
| Upload endpoint | upload-walrus.lighthouse.storage | upload.lighthouse.storage |
| Gateway | gateway-walrus.lighthouse.storage | gateway.lighthouse.storage |
| Quota accounting | ~63 MB per blob (erasure coding) | Actual file size |
Walrus blob IDs (blobIds()) | ✅ | Returns [] |
| API key | Created with a Sui wallet | Any Lighthouse API key |
Notes
- Isolation — each network keeps its own local index per namespace; the same namespace on both networks never mixes. Memories written to one network are recalled and rebuilt from that network only.
- Quota — on Walrus, batching is essential (every blob costs ~63 MB of quota regardless of size); on IPFS/Filecoin, quota tracks real bytes, so batching mainly reduces request overhead.
- Sui integrations — choose
ipfs-walruswhen you need Walrus-native blob IDs for on-chain references or Sui ecosystem tooling.