Skip to content

edacrema/ZK_Forecasting_Agent

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ZK Forecaster

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.

Project Overview

ZK Forecaster uses a graph-based approach to generate forecasts for complex questions. The system:

  1. Creates a baseline understanding of the forecasting question
  2. Gathers relevant news articles using targeted search queries
  3. Analyzes these articles to generate reflections on their relevance
  4. Produces multiple forecasts using parallel executions
  5. Implements wisdom of the crowd aggregation to produce a more robust final prediction

Key Improvements Over Original Research

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

System Architecture

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

Requirements

  • Python 3.9+
  • OpenAI API key
  • Google Serper API key
  • LangGraph library
  • Other dependencies listed in requirements.txt

Getting Started

  1. Clone this repository
  2. Create a .env file with your API keys:
    OPENAI_API_KEY=your_openai_key
    SERPER_API_KEY=your_serper_key
    
  3. Install dependencies: pip install -r requirements.txt
  4. Run the forecaster: python main.py

Example Usage

# 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)

License

MIT License

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages