Skip to content

Kuuga-2/near-kuuga

Repository files navigation

NEAR Eliza Starter

Gitpod Ready-to-Code

Description Description

The starter for building Eliza agents with NEAR Protocol and NEAR AI, created with below awesome technology stack 🔥:

Multichain Features:

dbef7cf3-f79f-430c-9497-f92b61c9d151

Prepare Environment

1. Install NEAR AI CLI

NEAR AI provides free agent hosting and inference APIs. You can skip this step if you want to use other model providers.

Install NEAR AI CLI following the instructions in https://docs.near.ai/cli.

To login NEAR AI, you'll need a mainnet NEAR account, it's recommended to create the account with the Bitte Wallet option in NEAR AI user interface.

# python 3.11 recommended
python3 -m pip install nearai
# Bitte Wallet is recommended for creating one mainnet NEAR account for login
nearai login

2. Create Testnet NEAR Account

Create testnet NEAR account via https://testnet.mynearwallet.com (You'll receive 10 NEAR on testnet once created). Please notice this testnet account is different from the mainnet NEAR account you have created in step (1).

Claim more testnet NEAR from https://near-faucet.io if needed.

3. Configure environment variables

Duplicate environment template

cp .env.example .env

Add your NEAR account created in step (2) and its private key to .env

NEAR_NETWORK=testnet
NEAR_RPC_URL=https://neart.lava.build
NEAR_ADDRESS=xxxx.testnet
NEAR_WALLET_SECRET_KEY=ed25519:xxxxxxxx

Specify the models to use, e.g. DeepSeek-V3

SMALL_NEARAI_MODEL=  # Default: fireworks::accounts/fireworks/models/llama-v3p2-3b-instruct
MEDIUM_NEARAI_MODEL= # Default: fireworks::accounts/fireworks/models/llama-v3p1-70b-instruct
LARGE_NEARAI_MODEL=fireworks::accounts/fireworks/models/deepseek-v3  # Default: fireworks::accounts/fireworks/models/llama-v3p1-405b-instruct
IMAGE_NEARAI_MODEL=  # Default: fireworks::accounts/fireworks/models/playground-v2-5-1024px-aesthetic

Install and Start Agent

Node.js version >= 22 is required

1. Install pnpm

npm i -g pnpm

2. Install dependencies

# agent dependencies
pnpm i
# web client dependencies
cd client && pnpm i && cd ..

3. Start agent

In one terminal session, start the agent server, in interactive mode by default.

pnpm start

4. Start web client

Start the web client in another terminal session

pnpm start:client

Customize Your Agent

Custom characters

Open src/character.ts to modify the default character.

To load custom characters instead:

  • Use pnpm start --characters="path/to/your/character.json"
  • Multiple character files can be loaded simultaneously

Add more clients

Add Discord and Twitter for example

# in character.ts
clients: [Clients.TWITTER, Clients.DISCORD],

# in character.json
clients: ["twitter", "discord"]

Add login credentials and keys to .env

DISCORD_APPLICATION_ID="discord-application-id"
DISCORD_API_TOKEN="discord-api-token"

TWITTER_USERNAME="username"
TWITTER_PASSWORD="password"
TWITTER_EMAIL="[email protected]"

Use a different model provider

Use OpenRouter for example

# in character.ts
modelProvider: ModelProviderName.OPENROUTER,

# in character.json
"modelProvider": "openrouter",

Edit environment variable

OPENROUTER_API_KEY="sk-xx-xx-xxx"

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published