Skip to content

A demo that how AI agent networks can store trust assertions on Ceramic and use the EigenTrust algorithm to calculate global peer scores

Notifications You must be signed in to change notification settings

ceramicstudio/eigentrust-orbis-example

Repository files navigation

Agent Reputation Example using EigenTrust and OrbisDB

This demo emulates the following flow:

  1. OrbisDB to store peer-to-peer trust assertions agents are assigning each other
  2. EigenTrust (using the OpenRank SDK) to calculate global trust scores across the network of agents

In short, this shows how AI agent networks can utilize Ceramic to allow individual autonomous agents to self-authenticate using dedicated private keys, write peer rating assertions for other agents given their performance across arbitrary data points (like "accuracy") to save on Ceramic, and use OpenRank (using the EigenTrust algorithm) to consume those data points and calculate global trust scores.

Getting Started

  1. First, install the dependencies:
yarn install
  1. Second, make a copy of the .env.example file, rename it to .env and update the values accordingly:
cp .env.example .env
  1. Create a WalletConnect project ID by visiting https://cloud.walletconnect.com/sign-in, create a new project (with a name of your choosing and the App type selected), and copy the Project ID key once available.

Once copied, assign it to NEXT_PUBLIC_WALLET_CONNECT_PROJECT_ID in your new .env file

  1. Visit the Orbis Studio and create a free account if you do not already have one.

First, set up a new context (required to use a shared instance). You can call it whatever you like. Assign the resulting string value (starting with "k") to NEXT_PUBLIC_CONTEXT_ID in your .env file.

Next, copy the value you see under "Environment ID" and assign it to NEXT_PUBLIC_ENV_ID in your .env file.

Finally, run the following to generate random private seeds that your agents will use to self-authenticate onto the network and write data:

yarn generate

You should see the seed strings appear in your console. Copy each string and assign it to the remaining missing variables. For example, the value for news_agent should be assigned to NEWS_AGENT_SEED in your .env file, and so on.

  1. A schema has already been created for you for this demo and left as a default value in your .env file (assigned to NEXT_PUBLIC_ASSERTION_TABLE), so no action is needed here. For reference, you can view the JSON definition and a sample deploy script showing how to deploy complex definitions using the OrbisDB SDK.

  2. You will need to start up your Python server next:

# first create and activate a virtual environment
cd server
python3 -m venv myenv
source myenv/bin/activate

# install deps
pip install -r requirements.txt

# start server
python3 server.py 
  1. Finally, in a new terminal, run the NextJS app:
yarn dev

Open http://localhost:3000 with your browser to see the result.

Learn More

To learn more about OrbisDB please visit the following links

About

A demo that how AI agent networks can store trust assertions on Ceramic and use the EigenTrust algorithm to calculate global peer scores

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published