A forecasting system that improves on the UC Berkeley research on zero-knowledge forecasting (paper available here) by implementing a wisdom of the crowd element.
ZK Forecaster uses a graph-based approach to generate forecasts for complex questions. The system:
- Creates a baseline understanding of the forecasting question
- Gathers relevant news articles using targeted search queries
- Analyzes these articles to generate reflections on their relevance
- Produces multiple forecasts using parallel executions
- Implements wisdom of the crowd aggregation to produce a more robust final prediction
The original UC Berkeley research introduced the concept of zero-knowledge forecasting using large language models. This project enhances that approach by:
- Wisdom of the Crowd: Multiple parallel forecast executions are aggregated to reduce individual bias and improve forecast accuracy
- Structured Graph-Based Approach: Using LangGraph to create a systematic flow of information processing
- Dynamic News Gathering: Targeted search queries based on the baseline understanding
- Advanced Reflection: Deep analysis of retrieved information before making predictions
The system consists of several components:
- Baseline Node: Establishes a foundational understanding of the forecasting question
- News Node: Generates and executes targeted search queries to gather relevant information
- Reflection Node: Analyzes gathered information to identify key insights
- Forecast Node: Generates individual forecasts
- Aggregator: Combines multiple forecasts using wisdom of the crowd principles
- Python 3.9+
- OpenAI API key
- Google Serper API key
- LangGraph library
- Other dependencies listed in requirements.txt
- Clone this repository
- Create a
.envfile with your API keys:OPENAI_API_KEY=your_openai_key SERPER_API_KEY=your_serper_key - Install dependencies:
pip install -r requirements.txt - Run the forecaster:
python main.py
# Sample inputs
question = "Will renewable energy sources account for more than 50% of global energy production by 2030?"
final_date = "December 31, 2030"
crowd = 3 # Number of parallel forecasts to run
result = get_forecast_result(question, final_date, crowd)