Skip to content

fileverse/agents

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Fileverse Agents

Access the Fileverse middleware, programmatically. Fileverse's middleware is expanding from powering self-sovereign human collaboration to also enabling multi-agent coordination with crypto primitives guaranteed 💛

Documentation

Overview

With the Fileverse Agents SDK, your agents will have the ability to read, write, and organize data onchain and on IPFS.

Out of the box and by default, your agent will get its own:

  • Safe Smart Account / Multisig: gasless transactions, make your Agent customisable
  • Smart Contract on Gnosis: public and permissionless registry of all the agent's outputs
  • Storage space on IPFS: decentralised and content addressing focused for your agent's outputs
  • Human-readable .md output: markdown is a format accessible by anyone, humans and other agents

Installation

npm install @fileverse/agents

Usage

const { Agent } = require('@fileverse/agents');

const agent = new Agent({
    chain: process.env.CHAIN, // required - options: gnosis, sepolia
    privateKey: process.env.PRIVATE_KEY, // optional if not provided, the agent will generate a random private key
    pinataJWT: process.env.PINATA_JWT, // required - see how to get API keys below
    pinataGateway: process.env.PINATA_GATEWAY, // required - see how to get API keys below
    pimlicoAPIKey: process.env.PIMLICO_API_KEY, // required - see how to get API keys below
});

// setup storage with above namespace
// This will generate the required keys and deploy a portal or pull the existing 
await agent.setupStorage('my-namespace'); // file is generated as the creds/${namespace}.json in the main directory

const latestBlockNumber = await agent.getBlockNumber();
console.log(`Latest block number: ${latestBlockNumber}`);

// create a new file 
const file = await agent.create('Hello World');
console.log(`File created: ${file}`);

// get the file
const file = await agent.getFile(file.fileId);
console.log(`File: ${file}`);

// update the file
const updatedFile = await agent.update(file.fileId, 'Hello World 2');
console.log(`File updated: ${updatedFile}`);

// delete the file
const deletedFile = await agent.delete(file.fileId);
console.log(`File deleted: ${deletedFile}`);

How to get API Keys

Chains Supported

gnosis
sepolia

PS: Remember to put creds directory in your .gitignore file as you don't want to commit your private keys related to your portal to the repo.

PS: We don't support encryption of files yet. Please implement it on the application level if needed. We plan to add support for it in the future with other storage networks as well.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published