ElizaOS DKG agent
Last updated
Was this helpful?
Last updated
Was this helpful?
ElizaOS is a popular open source AI agent framework which supports a native DKG integration through the DKG plugin. You can now build AI agents that store their memories on the Decentralized Knowledge Graph (DKG). This setup enables agents to share memories (creating a collective memory) and manage their knowledge transparently and verifiably.
You can watch the following video to learn how to setup a ElizaOS DKG agent, or follow the text instructions below.
ElizaOS is operational on Mac and Ubuntu devices, Windows is not yet supported
You can use the OriginTrail Elizagraph starter kit, which includes the plugin, or using the official ElizaOS repo, where the plugin has already been integrated. The following instructions will assume you are using the Elizagraph Starter kit.
Copy the .env.example
file (from the Elizagraph folder in cloned repository) and rename it to .env
and fill in the necessary details. The following instructions will help you populate the .env file.
Node information
If you do not already have a DKG node set up, you can use a public node that the OriginTrail team set up so that everyone has an easy way to interact with the DKG.
There's one public node available for mainnet (https://positron.origin-trail.network) and one for testnet (https://v6-pegasus-node-02.origin-trail.network). All blockchains are supported on each of the nodes.
Mainnet is the live blockchain for real transactions, while testnet is a risk-free testing environment.
Here's an example of how to set up a MetaMask wallet: here
ENVIRONMENT
: Define your environment. For example, use development
if you're running a local setup, testnet
for a testnet setup, or mainnet
a mainnet setup.
OT_NODE_HOSTNAME
: Enter the hostname or IP address of your OriginTrail DKG node. This will be the URL of the node you set up or http://localhost if you're running it locally.
OT_NODE_PORT
: The port used by the DKG node, typically 8900
.
PUBLIC_KEY
: The public key of the wallet you will use to publish Knowledge Assets.
PRIVATE_KEY
: The private key corresponding to the above wallet. Ensure you keep this secure and never share it outside of the .env file.
BLOCKCHAIN_NAME
: Specify the blockchain network you’re using. otp:2043
(NeuroWeb mainnet), base:8453
(Base mainnet), gnosis:100
(Gnosis mainnet), otp:20430
(NeuroWeb testnet), base:84532
(Base testnet), gnosis:10200
(Gnosis testnet)
In order to fund your wallet on testnet, feel free to use the Faucet in the OriginTrail Discord. There's a message pinned in the #faucet-bot channel in case some of the faucets are down. In that case, feel free to ping the core team to send you some testnet funds manually.
If you are building your agent on the NeuroWeb, you need to get NEURO first and then TRAC.
LLM key
Eliza supports a wide range of LLM providers. To use one of them, create an API key and paste it into the environment file.
Here’s how to get an API key from ChatGPT.
For example, if you want to use an Open AI LLM, populate the OPENAI_API_KEY variable in the .env.
X credentials (in case you want to use X)
Eliza uses a basic X authentication setup. Use your username, password, and email so that the application can post on the platform. If you encounter issues, we recommend you to use the TWITTER_COOKIES variable and copy the cookies from the browser.
If you wish to do so, modify the templates in plugin-dkg/constants.ts
to change the format in which your data is stored or queried.
Firstly, create a character in the characters
folder, for example chatdkg.character.json.
You can look at existing examples in the characters
folder for inspiration.