Metadata-Version: 2.4
Name: futuresearch-btf
Version: 0.5.4
Summary: Offline research tools for BTF-3 open: BM25 search and paged reading over a question's frozen open corpus, an MCP server, a reference agent and a scorer.
License-Expression: Apache-2.0
Project-URL: Homepage, https://evals.futuresearch.ai/btf3-open
Project-URL: Repository, https://github.com/futuresearch/futuresearch-btf
Project-URL: Dataset, https://huggingface.co/datasets/futuresearch-ai/BTF-3-open
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE-code.txt
Requires-Dist: numpy
Requires-Dist: pandas>=2.0
Requires-Dist: pyarrow
Requires-Dist: tantivy==0.27.0
Provides-Extra: mcp
Requires-Dist: mcp>=1.2; extra == "mcp"
Provides-Extra: agent
Requires-Dist: litellm>=1.106; extra == "agent"
Requires-Dist: mcp>=1.2; extra == "agent"
Dynamic: license-file

# futuresearch-btf

Run and score a forecasting agent on [BTF-3 open](https://evals.futuresearch.ai/btf3-open) offline. BTF-3 open is
the open subset of Bench to the Future 3. Its questions have already resolved. Your agent researches each one using
only web pages captured before the question was asked, so you can score its forecasts straight away instead of
waiting months for the outcome.

`futuresearch-btf` gives your agent BM25 search and paged reading over those pages. It also has an MCP server, a reference
agent and a scorer. It never touches the live web.

The data is on Hugging Face: the questions in
[futuresearch-ai/BTF-3-open](https://huggingface.co/datasets/futuresearch-ai/BTF-3-open) and the pages in
[futuresearch-ai/BTF-3-open-corpus](https://huggingface.co/datasets/futuresearch-ai/BTF-3-open-corpus).

## Install

```bash
pip install "futuresearch-btf[agent]"
```

You need Python 3.11 or newer. The `agent` extra adds the reference agent (through LiteLLM) and the MCP server.
Use `futuresearch-btf[mcp]` if you only want the MCP server, or plain `futuresearch-btf` for search and scoring.

## Download the data

Accept the access form on both dataset pages first, then:

```bash
pip install -U huggingface_hub
hf auth login
hf download futuresearch-ai/BTF-3-open --repo-type dataset --local-dir btf3open
hf download futuresearch-ai/BTF-3-open-corpus --repo-type dataset --local-dir btf3open/corpus
```

The download is about 8 GB. The first search builds an index of about 5 GB in a `.btf_index` folder inside the
download folder, which takes about five minutes. Later searches take about a second.

## Run a model

```bash
# list the questions, and search the pages one question was allowed to see
python -m futuresearch_btf questions --data btf3open | head
python -m futuresearch_btf search --data btf3open --question-id <question_id> "your query"

# run the reference agent on two questions and score it
export ANTHROPIC_API_KEY=...
python -m futuresearch_btf run --data btf3open --model anthropic/claude-sonnet-5 --question-ids <id1> <id2> --out runs/sonnet.jsonl
python -m futuresearch_btf score --data btf3open --runs runs/sonnet.jsonl

# the same questions with no research, as a baseline
python -m futuresearch_btf run --data btf3open --model anthropic/claude-sonnet-5 --closed-book --question-ids <id1> <id2> --out runs/sonnet-closed.jsonl
```

`--model` takes any LiteLLM model string, such as `openai/gpt-6-astra` with `OPENAI_API_KEY` set. Drop
`--question-ids` to run every question. A rerun with the same `--out` skips the questions already done.

Each forecast is a probability that the question resolves YES, scored by its Brier score. Lower is better, and
forecasting 50% on everything scores 0.25. A research run costs from a few cents to a few dollars a question,
depending on the model, so try a few questions before running them all.

## Use your own agent

- `python -m futuresearch_btf serve --data btf3open --question-id <id> --out forecast.json` starts an MCP server for
  one question, with the tools `get_question`, `search`, `read_page` and `submit_forecast`.
- `python -m futuresearch_btf serve-http --data btf3open` serves every question over HTTP.
- [`examples/`](https://github.com/futuresearch/futuresearch-btf/tree/main/examples) has harnesses for the OpenAI and
  Anthropic SDKs.

[INTEGRATING.md](https://github.com/futuresearch/futuresearch-btf/blob/main/INTEGRATING.md) says what to show the
model, what to send back, how forecasts are scored and what to report with a result.

## Licence

The code is under Apache-2.0 (`LICENSE-code.txt`). The questions and the pages have their own licences, given on
each dataset's page. [CHANGELOG.md](https://github.com/futuresearch/futuresearch-btf/blob/main/CHANGELOG.md) lists what
changed between versions.
