BrowseComp-Plus
Use this sample to study an agent that searches a document corpus, reads passages, and submits an answer to a research question. SearchEnv owns the browsing task; make_agent() combines it with a policy and context management.
What you supply
Section titled “What you supply”Provide plaintext question records, reference answers, a retrieval client connected to the corpus, and a policy that generates tool calls. RetrievalArchive retains retrieved evidence. The grade() helper uses normalized exact match; it does not reproduce the benchmark’s semantic judge.
What to adapt
Section titled “What to adapt”The search, open, and find tools illustrate document retrieval by corpus ID. Adapt their observations, call budgets, and grading for your own research task. For a step-by-step agent with TRACE-style result IDs and page cursors, follow BrowseComp-Plus: build a research agent; that tutorial defines its browser interface in the example code.
The reference below covers the sample’s tools, task state, retrieval archive, and assembly helpers.
BrowserFind
Section titled “BrowserFind”Find text within a corpus document and return matching passages.
Definition
BrowserFind.call
Section titled “BrowserFind.call”BrowserOpen
Section titled “BrowserOpen”Read a range of lines from a document identified by its corpus ID.
Definition
BrowserOpen.call
Section titled “BrowserOpen.call”BrowserSearch
Section titled “BrowserSearch”Search the document corpus through the retriever client and return ranked document IDs with snippets.
Definition
BrowserSearch.init
Section titled “BrowserSearch.init”BrowserSearch.call
Section titled “BrowserSearch.call”Hold a BrowseComp-Plus question, reference answer, and dataset metadata.
Definition
Fields
RetrievalArchive
Section titled “RetrievalArchive”Cache the exact observations returned by retrieval calls. An offline archive replays recorded observations and raises an error for a missing call.
Definition
RetrievalArchive.init
Section titled “RetrievalArchive.init”RetrievalArchive.observe
Section titled “RetrievalArchive.observe”RetrievalArchive.save
Section titled “RetrievalArchive.save”RetrievalArchive.load
Section titled “RetrievalArchive.load”SearchEnv
Section titled “SearchEnv”Apply browser actions, track retrieval progress, and grade the final answer against the case’s reference answer.
Definition
SearchEnv.init
Section titled “SearchEnv.init”SearchEnv.initial_state
Section titled “SearchEnv.initial_state”SearchEnv.should_finish
Section titled “SearchEnv.should_finish”Answer when the next task turn would exhaust the task limit.
SearchEnv.finish_tools
Section titled “SearchEnv.finish_tools”Offer only the submit tool on the final-answer turn.
SearchEnv.on_compaction_failure
Section titled “SearchEnv.on_compaction_failure”SearchEnv.step
Section titled “SearchEnv.step”Hold the retrieval task’s branch-local progress, answer, tool-call counts, and remaining steps.
Definition
Fields
DocumentTool
Section titled “DocumentTool”Share document retrieval and line formatting between tools that inspect a corpus document.
Definition
DocumentTool.init
Section titled “DocumentTool.init”DocumentTool.document
Section titled “DocumentTool.document”Compare an answer with its reference using normalized exact match. Official BrowseComp-Plus evaluation uses a separate semantic judge.
Definition
load_cases
Section titled “load_cases”Load BrowseComp-Plus cases from local data or the configured dataset source, with optional case selection.
Definition
make_agent
Section titled “make_agent”Assemble the browser environment, tools, context manager, and agent for BrowseComp-Plus. Run the returned agent on a case’s question.
Definition