OriginTrail
  • Get started with OriginTrail
  • OriginTrail Ecosystem — Call for Papers (Coming Soon)
  • Key Concepts
    • Decentralized Knowledge Graph (DKG)
    • DKG key concepts
  • TRAC: DKG utility token
  • Build with DKG
    • Quickstart (test drive the DKG in 5 mins)
      • Quickstart with Node.js
      • Quickstart with Python
    • Querying the DKG
    • DKG Edge Node
      • DKG Edge Node architecture
      • Get started with the Edge Node boilerplate
        • Automated setup with the installer
        • Manual setup
        • Usage example
      • Customize & build with the Edge Node
      • Knowledge Mining and dRAG examples
      • Deploy your Edge Node based project
        • Automated deployment with installer
      • DKG Edge Node inception program
      • DKG Edge Node API documentation
    • DKG Core Node
      • Run a V8 Core Node on testnet
        • Preparation for V8 DKG Core Node deployment
        • V8 DKG Core Node installation
      • Run a V8 Core Node on mainnet
        • Preparation for V8 DKG Core Node deployment
        • V8 DKG Core Node installation
      • How to open up your node for publishing
    • DKG toolkit
      • DKG SDK
        • Development environment setup
        • DKG Javascript SDK (dkg.js)
          • Interact with DKG paranets
          • Knowledge submission & curation
          • Paranet's incentives pool implementation
        • DKG Python SDK (dkg.py)
      • DKG paranets
        • Deploying a DKG paranet
        • Building with DKG paranets
        • Syncing a DKG Paranet
        • Initial Paranet Offerings (IPOs)
          • IPO specification
          • Launching your IPO
          • Paranet's incentives pool
          • IPO voting
      • AI agents
        • ElizaOS DKG agent
        • Custom DKG Python agent
        • Custom DKG JavaScript agent
      • Using the DKG with MCP
    • Ecosystem call for papers
  • DKG under the hood
    • Introduction
    • Delegated staking
      • Step-by-step staking
      • Redelegating stake
  • Random Sampling DKG Proof System
    • Random sampling rollout
    • Random Sampling FAQ
  • DKG Sync
  • Integrated Blockchains
    • Base blockchain
      • Connect to Base
    • Gnosis chain
      • Connect to Gnosis
    • NeuroWeb
    • Teleport instructions - NeuroWeb
    • Bridging to Moonbeam
    • Deployed smart contracts
  • Bounties & rewards
    • General bug bounty
    • Code contributions & V8 bug bounty
  • Whitepapers & RFCs
    • OriginTrail whitepaper
    • OriginTrail RFCs
  • Useful Resources
    • What's new with OriginTrail V8
    • DKG V8 guidebook
      • Protocol updates
      • Feature roadmap
      • How to upgrade to V8?
    • Public nodes
    • Tutorials
    • Test token faucet
    • Development principles
    • Community created resources
    • Linked data & knowledge graphs
    • Available networks, network details and RPCs
    • OT Node Engine implementation details
      • Modules
      • Command Executor
    • Contribution guidelines
      • Guidelines for automated test contributions
    • Explore the OriginTrail ecosystem
Powered by GitBook
On this page
  • Video tutorial (~1h 15mins)
  • Classic instructions
  • Prerequisites - make sure you have them all set up
  • Step-by-step
  • 1. Clone the Elizagraph repository
  • 2. Install dependencies and build the project
  • 3. Set up environment variables
  • 4. Customize DKG Knowledge Asset & query templates
  • 5. Run the character

Was this helpful?

Edit on GitHub
  1. Build with DKG
  2. DKG toolkit
  3. AI agents

ElizaOS DKG agent

PreviousAI agentsNextCustom DKG Python agent

Last updated 1 month ago

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

Video tutorial (~1h 15mins)

Classic instructions

Prerequisites - make sure you have them all set up

Step-by-step

1. Clone the Elizagraph repository

git clone https://github.com/OriginTrail/elizagraph.git
cd elizagraph

2. Install dependencies and build the project

pnpm install
pnpm run build

3. Set up environment variables

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.

  1. 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.

Mainnet is the live blockchain for real transactions, while testnet is a risk-free testing environment.

  • ENVIRONMENT: Define your environment. For example, use development if you're running a local setup, testnetfor a testnet setup, or mainneta 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)

If you are building your agent on the NeuroWeb, you need to get NEURO first and then TRAC.

  1. 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.

For example, if you want to use an Open AI LLM, populate the OPENAI_API_KEY variable in the .env.

OPENAI_API_KEY= # obtain the key on https://platform.openai.com/
  1. 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.

4. Customize DKG Knowledge Asset & query templates

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.

5. Run the character

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.

pnpm start --characters="characters/chatdkg.character.json"

Notes

  • There is no need to manually add plugin-dkg to the plugins array, it will load automatically because it is included in the agent/src/index.ts file.

  • Ensure you configure the X client (if you wish to use X) and select your LLM provider in the character settings.

You can use the OriginTrail , which includes the plugin, or using the , where the plugin has already been integrated. The following instructions will assume you are using the Elizagraph Starter kit.

There's one public node available for mainnet () and one for testnet (). All blockchains are supported on each of the nodes.

Alternatively, you could also set up and connect to your own Edge Node for further features like a graph & chatbot interface, customizable knowledge mining pipelines, private knowledge assets, and more. Check out Edge Nodes .

Here's an example of how to set up a MetaMask wallet:

In order to fund your wallet on testnet, feel free to use the in the . 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.

Here’s how to get an .

Additionally, you can modify the interactions with the DKG in the Eliza providers, actions, and evaluators by calling different DKG.js functions, or modifying the parameters. For example, you could use a paranet for your agent. Check out the SDK docs .

Elizagraph starter kit
official ElizaOS repo
Python 2.7+
Node.js 23+
pnpm
https://positron.origin-trail.network
https://v6-pegasus-node-02.origin-trail.network
here
here
Faucet
OriginTrail Discord
API key from ChatGPT
here
Video: How to build an AI agent with ElizaOS DKG Plugin