Environment file setup
The project uses environment variables for configuration. Create a.env file in the root directory of the repository.
Required variables
These variables are required for basic agent functionality:Private key for the Ethereum wallet that will place bets on prediction markets.How to get it:
- Export from MetaMask or another wallet
- Generate a new wallet using web3 libraries
- Use a test wallet for development
API key for OpenAI services, used by agents that leverage GPT models for reasoning and predictions.How to get it:
- Sign up at platform.openai.com
- Navigate to API keys section
- Create a new secret key
- Copy and save it securely
Optional API keys
These variables enable additional functionality:Web search and research
API key for Serper, which provides Google Search results for agent research.Used by: Research agents, think thoroughly agentsGet it at: serper.dev
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
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
Private key for Farcaster account integration.Used by: Social media agents
Twitter OAuth access token for posting and reading tweets.Used by: Social media agents
Twitter OAuth access token secret.Used by: Social media agents
Twitter API v2 bearer token for authentication.Used by: Social media agents
Twitter API consumer key.Used by: Social media agents
Twitter API consumer secret.Used by: Social media agentsGet Twitter credentials at: developer.twitter.com
Monitoring and observability
Secret key for Langfuse, an LLM engineering platform for tracing and monitoring.Used by: Agent monitoring, debugging
Public key for Langfuse.Used by: Agent monitoring, debugging
Langfuse host URL (defaults to cloud instance if not specified).Used by: Agent monitoring, debuggingGet Langfuse credentials at: langfuse.com
Vector database
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
Database connection URL for SQLAlchemy (e.g., PostgreSQL, SQLite).Format:
postgresql://user:password@host:port/databaseUsed by: Data persistence, agent state managementDevelopment mode
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:- Basic agents
- Research agents
- Advanced agents
Required for:
coinflip, knownoutcomeVerifying configuration
When you run an agent, it will automatically check for required environment variables: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 keysRotate keys regularly
Regularly rotate API keys and private keys, especially after development
Use environment separation
Keep separate
.env files for development, staging, and productionNext steps
Quickstart
Run your first agent with the coinflip example
Create custom agents
Build your own prediction market agent