A library for exploring the landscape of AI Agent frameworks, using the example application of a prediction market betting agent. The various agents interact with markets from Presagio (with former name Omen), Manifold, and Polymarket.
These agents build on top of the prediction market APIs from https://github.com/gnosis/prediction-market-agent-tooling.
Install the project dependencies with poetry, using Python >=3.11:
python3.11 -m pip install poetry
python3.11 -m poetry install
python3.11 -m poetry shellCreate a .env file in the root of the repo with the following variables as a minimal requirement:
BET_FROM_PRIVATE_KEY=...
OPENAI_API_KEY=...Depending on the agent you want to run, you may require additional variables. When you run an agent, it will tell you if you need to set any additional variables.
- Pick a prediction market question, or create your own, and pick one or more agents to perform research and make a prediction:
streamlit run scripts/agent_app.py(Deployed here) - [deprecated] An autonomous agent with function calling. Can be 'prodded' by the user to guide its strategy:
streamlit run prediction_market_agent/agents/microchain_agent/app.py(Deployed here)
The on-chain activity of the deployed agents from this repo can be tracked on a Dune dashboard here.
Execute prediction_market_agent/run_agent.py, specifying the ID of the 'runnable agent', and the market type as arguments:
% python prediction_market_agent/run_agent.py --help
Usage: run_agent.py [OPTIONS] AGENT:{coinflip|replicate_to_omen|think_thorough
ly|think_thoroughly_prophet|think_thoroughly_prophet_kelly
|knownoutcome|microchain|microchain_modifiable_system_prom
pt_0|microchain_modifiable_system_prompt_1|microchain_modi
fiable_system_prompt_2|microchain_modifiable_system_prompt
_3|microchain_with_goal_manager_agent_0|metaculus_bot_tour
nament_agent|prophet_gpt4o|prophet_gpt4|prophet_gpt4_final
|prophet_gpt4_kelly|olas_embedding_oa|social_media|omen_cl
eaner|ofv_challenger}
MARKET_TYPE:{omen|manifold|polymarket|metaculus}For example:
python prediction_market_agent/run_agent.py coinflip omenThe easiest way to make your own agent that places a bet on a prediction market is to subclass the DeployableTraderAgent. See DeployableCoinFlipAgent for a minimal example.
From there, you can add it to the RUNNABLE_AGENTS dict in prediction_market_agent/run_agent.py, and use that as the entrypoint for running the agent in your cloud deployment.
See the Issues for ideas of things that need fixing or implementing. The team is also receptive to new issues and PRs.
A great self-contained first contribution would be to implement an agent using a framework in the 'Other frameworks to try' issue.
Read README_hackathon.md for instructions tailored to hackathon participants or anyone who wants a quickstart to creating a new agent.