eXpect is the truth-seeking tool. It uses a multi-agent interface and large-scale simulation to predict human reactions to tweets, speeches, and any other input text. You can't do this with most AIs - they're censored and cannot always reflect the full spectrum of human opinion. Using Grok (unfiltered & diverse) and X (to crowdsource real human personas), we can now simulate entire communities' raw reactions to any topic (politics, consumer behavior, etc). eXpect will allow the world to more accurately identify the communal source of truth... to provide a crystal ball into the future. And, as a bonus, on X you can predict how many likes your tweet will get!
Check it out at tryexpect.com!
This is a fun way to explore these very new APIs:
- X API:
- xAI API:
Note: you'll need API keys (into .env) to run. We use a round robin key system (see api.py) to rotate with API limits. Populate any of the keys to use if you just have one of each!
- Pulling X Data: we pull 1,000 of your followers, sample 100 at random, and then pull 100 of their tweets all simultaneously via the X API.
- Simulation: we simultaneously make 100 calls to Grok mini. Each digests an individual's Twitter profile and tweets in order to simulate their reaction to a query.
- Display: we display a histogram of the community's sentiment (float) and a host of reactions (string).
- Frontend Steps
- Ensure your
.envfile is correctly populated according to.env.example pnpm installpnpm dev- NOTE: alternatively, you can follow the steps in the
Dockerfileto run the frontend client!
- Ensure your
- Backend Steps
- Ensure your
.envfile is correctly populated according to.env.example python3 -m venv venvsource venv/bin/activatepip3 install -r requirements.txt- Alternatively, you can use
uvto install as well!
- Alternatively, you can use
- Then, you can run
uvicorn src.api:app --host 0.0.0.0 --port 8080 --reloadfrom the/serverdirectory to locally spin up the API! - NOTE: alternatively, you can follow the steps in the
Dockerfileto run the API!
- Ensure your
Developed by Raghav Pillai, Ray Del Vecchio, Ethan Shaotran, and Giovanni D'Antonio during the first xAI hackathon in San Francisco.
We were running into some rate limits, so tried to add an OpenAI API fallback. It didn't go very well. Grok is too good.