Skip to main content

Prerequisites

Before installing, ensure you have:
  • Python 3.11 or higher - The project requires Python ~3.11.0
  • pip - Python package installer
  • Git - For cloning the repository
The project uses Poetry for dependency management, which provides reproducible builds and better dependency resolution than pip alone.

Installation steps

1

Clone the repository

First, clone the Gnosis Prediction Market Agent repository:
git clone https://github.com/gnosis/prediction-market-agent.git
cd prediction-market-agent
2

Install Poetry

Install Poetry using Python 3.11’s pip:
python3.11 -m pip install poetry
If python3.11 is not found, you may need to install Python 3.11 first using your system’s package manager or from python.org.
3

Install project dependencies

Use Poetry to install all project dependencies:
python3.11 -m poetry install
This will:
  • Create a virtual environment
  • Install all required dependencies from pyproject.toml
  • Set up the project for development
The installation may take several minutes as the project has many dependencies including LangChain, OpenAI, web3, and various AI frameworks.
4

Activate the Poetry shell

Activate the Poetry-managed virtual environment:
python3.11 -m poetry shell
You should see your terminal prompt change to indicate you’re in the Poetry environment.
5

Verify installation

Verify the installation by checking the available commands:
python prediction_market_agent/run_agent.py --help
You should see the help output with available agents and market types.

Key dependencies

The project includes these major dependencies:
  • OpenAI (^1.91.0) - GPT models for agent reasoning
  • LangChain (^1.0.0) - Framework for building LLM applications
  • CrewAI (^1.0.0) - Multi-agent orchestration
  • Pydantic AI (^1.0.0) - Type-safe AI applications
  • Autogen (^0.4.0) - Multi-agent conversations
  • prediction-market-agent-tooling (^0.69.24) - Core APIs for interacting with prediction markets
  • prediction-prophet - Forecasting and research tools
  • web3 (version 6-8) - Ethereum blockchain interaction
  • Streamlit (1.49.1) - Interactive web apps
  • Typer (0.9.x) - CLI framework
  • pytest - Testing framework
  • mypy (^1.8.0) - Static type checking
  • black (^23.12.1) - Code formatting

Development dependencies

If you’re contributing to the project, Poetry will also install development dependencies including:
  • Jupyter and JupyterLab - For notebook-based development
  • ape-foundry - Local blockchain testing
  • freezegun - Time mocking for tests
  • matplotlib and seaborn - Data visualization

Next steps

Configuration

Set up your environment variables and API keys

Quickstart

Run your first agent with the coinflip example

Build docs developers (and LLMs) love