Skip to content

Latest commit

 

History

History

grok

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

Grok agent example

This example uses the Grok API for responses and XMTP for secure messaging. You can test your agent on xmtp.chat or any other XMTP-compatible client.

Environment variables

To run your XMTP agent, you must create a .env file with the following variables:

WALLET_KEY= # the private key of the wallet
ENCRYPTION_KEY= # encryption key for the local database
GROK_API_KEY= # the API key for the Grok API
XMTP_ENV= # local, dev, production

You can generate random xmtp keys with the following command:

yarn gen:keys <name>

Warning

Running the gen:keys or gen:keys <name> command will append keys to your existing .env file.

Run the agent

# git clone repo
git clone https://github.com/ephemeraHQ/xmtp-agent-examples.git
# go to the folder
cd xmtp-agent-examples
# install packages
yarn
# go to the folder
cd examples/grok
# generate random xmtp keys (optional)
yarn gen:keys
# run the example
yarn dev