Page cover

Build unstoppable Eliza agents

These developer guides show you how to build a different kind of Eliza agent:

  • Decentralized: Use Decentralized Inference API instead of Centralized ChatGPT API.

  • Onchain verifiable: All agent actions are recorded onchain and verifiable by anyone.

  • Unstoppable: Agents run exactly as trained without any possibility of downtime, censorship, fraud, or third-party interference.

  • Intelligent: Give your Eliza new superpowers with state-of-the-art onchain AI models such as DeepSeek R1, Llama 3.1 405B, and Hermes 3 70B.

Step 1: Create an on-chain Eliza Agent

EternalAI allows creating on-chain Agent on +10 blockchains.

In this guide, we create a new on-chain Eliza agent on Base.

First, we need to compile a system prompt, save it to a file and then run the following commands:

git clone https://github.com/eternalai-org/eternal-ai.git

cd eternal-ai/developer-guides/examples/how-to-mint-agent

npm i

export RPC_URL=https://mainnet.base.org PRIVATE_KEY=<PRIVATE_KEY> AGENT_SYSTEM_PROMPT=<PATH_TO_YOUR_SYSTEM_PROMPT> AGENT_FEE=0

ts-node ./mintAgent.ts

Note: replace PRIVATE_KEYand AGENT_SYSTEM_PROMPTto your private key (that has some ETH on Base) and path to system prompt file created above respectively.

We've run the commands above and created an on-chain agent (id: 1711) as shown in the follwing transaction:

Step 2: Get the code

Today, the Eliza framework is the easiest way to spin up your own AI agent. Eternal AI has already been built into the Eliza framework. You can pull the Eliza source code and start building with Eternal AI.

Step 3: Create your .env file

Copy .env.example to .env

Update the .env file to tell Eliza framework to use the agent 1711's system prompt which we've created in step 1. And for this tutorial, we'll use Base chain and Hermes 3 70B model, so we need to update configurations as follows:

For the ETERNALAI_API_KEY, you can get it here.

For the ETERNALAI_MODEL, you can find the list of supported chains and models here.

Step 4: Build your Eliza agent

Run the following commands to install and build the source code:

Step 5: Run your Eliza agent

Start with eternalai.character.json or any character configuration supported by the Eliza framework.

The character configuration file is where you define your Eliza agent's personality.

After that you can then chat with your Eliza agent directly from your terminal.

Step 6: Verify the onchain prompt transaction

With Eternal AI's Decentralized Inference, everything is onchain verifiable.

Let's look at an onchain prompt transaction on BaseScan. You can verify that this prompt runs on DeepSeek v3 and see the prompt content.

Step 7: Verify the onchain response transaction

Now, let's look at the onchain response tx on BaseScan. You can see the actual response content. Everything is onchain and verifiable.

Step 8 (Advanced): Reproduce the response

Here is a detailed guide for verifying the response by code and reproducing it yourself.

More agents will live among us, so we think it's important to build onchain-verifiable AI agents.

As with anything in crypto — "Don't trust the AI, verify it."

Don't Trust, Verify

Step 9 (Advanced): Read the whitepaper

If you want to understand how Eternal AI's Decentralized Inference works, you can read the "AI-powered Base" whitepaper.

Congrats!

Congrats! You've finished building your Eliza agent with two superpowers:

  • Onchain verifiable on Base

  • Powered by Llama 3.1 405B

Questions? Join the Eternal AI Devs group on Telegram: https://t.me/EternalAIDevs.

Last updated