Skip to main content

Environment file setup

The project uses environment variables for configuration. Create a .env file in the root directory of the repository.
1

Create .env file

In the root of the repository, create a new file named .env:
2

Add required variables

At minimum, add these two required variables:
.env
Never commit your .env file to version control. It should already be in .gitignore.
3

Add optional variables

Depending on which agents you want to run, you may need additional variables. The agent will inform you if any are missing when you try to run it.

Required variables

These variables are required for basic agent functionality:
string
required
Private key for the Ethereum wallet that will place bets on prediction markets.
Keep this key secure! It controls access to your funds on-chain. Use a dedicated wallet for testing with small amounts.
How to get it:
  • Export from MetaMask or another wallet
  • Generate a new wallet using web3 libraries
  • Use a test wallet for development
string
required
API key for OpenAI services, used by agents that leverage GPT models for reasoning and predictions.How to get it:
  1. Sign up at platform.openai.com
  2. Navigate to API keys section
  3. Create a new secret key
  4. Copy and save it securely

Optional API keys

These variables enable additional functionality:

Web search and research

string
API key for Serper, which provides Google Search results for agent research.Used by: Research agents, think thoroughly agentsGet it at: serper.dev
string
API key for Tavily, a search API optimized for AI agents and LLMs.Used by: Research agents, web scraping agentsGet it at: tavily.com

Blockchain and data

string
API key for The Graph, used to query blockchain data from subgraphs.Used by: Omen agents, market data fetchingGet it at: thegraph.com

Social media integration

string
Private key for Farcaster account integration.Used by: Social media agents
string
Twitter OAuth access token for posting and reading tweets.Used by: Social media agents
string
Twitter OAuth access token secret.Used by: Social media agents
string
Twitter API v2 bearer token for authentication.Used by: Social media agents
string
Twitter API consumer key.Used by: Social media agents
string
Twitter API consumer secret.Used by: Social media agentsGet Twitter credentials at: developer.twitter.com

Monitoring and observability

string
Secret key for Langfuse, an LLM engineering platform for tracing and monitoring.Used by: Agent monitoring, debugging
string
Public key for Langfuse.Used by: Agent monitoring, debugging
string
Langfuse host URL (defaults to cloud instance if not specified).Used by: Agent monitoring, debuggingGet Langfuse credentials at: langfuse.com

Vector database

string
API key for Pinecone vector database, used for semantic search and memory.Used by: Long-term memory agents, embedding agentsGet it at: pinecone.io

Database

string
Database connection URL for SQLAlchemy (e.g., PostgreSQL, SQLite).Format: postgresql://user:password@host:port/databaseUsed by: Data persistence, agent state management

Development mode

string
default:"0"
Set to 1 to open Streamlit apps in no-auth mode for development.
Only use this in development environments, not in production.

Complete .env.example

Here’s the complete .env.example file from the repository:
.env.example

Configuration by agent type

Different agents require different configurations:
Required for: coinflip, knownoutcome

Verifying configuration

When you run an agent, it will automatically check for required environment variables:
If any required variables are missing, you’ll see an error message indicating which ones need to be set.
The agent will only check for variables it actually needs, so you don’t need to configure everything upfront.

Security best practices

Use test wallets

For development, use dedicated test wallets with small amounts of funds

Never commit secrets

Ensure .env is in .gitignore and never commit API keys or private keys

Rotate keys regularly

Regularly rotate API keys and private keys, especially after development

Use environment separation

Keep separate .env files for development, staging, and production

Next steps

Quickstart

Run your first agent with the coinflip example

Create custom agents

Build your own prediction market agent