# allenai/macgyver architecture

> Architecture diagram of the GitHub repository allenai/macgyver, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-09). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/allenai/macgyver
- Repository: https://github.com/allenai/macgyver

## Overview

MacGyver is a research dataset and lightweight code release for creating creative problem-solving tasks and collecting LLM solutions. The main workflow develops problems through progressively harder variants, then uses LLM prompting to obtain solutions; the generation script also filters similar problems using a hosted similarity model. The repository includes the problem dataset and human-solution annotations, plus benchmark answer annotations. Some README-described prompting capabilities are represented by a prompt asset, but their runtime implementation is not shown. Relationships below rely on the README and sampled scripts; the collection script’s imported module name does not match the sampled filename.

Main entry points: [`code/progressive_data_creation/progressive_data_creation.py`](https://github.com/allenai/macgyver/blob/main/code/progressive_data_creation/progressive_data_creation.py) (Problem Generation), [`code/collect_solutions/collect_GPT4_solutions.py`](https://github.com/allenai/macgyver/blob/main/code/collect_solutions/collect_GPT4_solutions.py) (Solution Collection), [`data/MacGyver/problem_solution_pair.xlsx`](https://github.com/allenai/macgyver/blob/main/data/MacGyver/problem_solution_pair.xlsx) (Problem Dataset), [`data/Benchmark_results/benchmark_results.json`](https://github.com/allenai/macgyver/blob/main/data/Benchmark_results/benchmark_results.json) (Benchmark Annotations)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_creation["Problem Creation"]
  node_tags["Topic Tags"]
  node_generation["Problem Generation"]
  node_constraint["Constraint Addition"]
  node_distractors["Distractor Tools"]
  node_similarity["Similarity Filtering"]
end

subgraph group_solutions["Solution Collection"]
  node_collector["Solution Collection"]
  node_solution_prompts["Solution Prompting"]
end

subgraph group_data["Dataset and Annotations"]
  node_problem_data[("Problem Dataset")]
  node_human_solutions[("Human Solutions")]
  node_benchmark[("Benchmark Annotations")]
end

subgraph group_evaluation["Prompt Assets"]
  node_improve_prompts["Improvement Prompts"]
end

node_researcher(("Researcher"))
node_gpt{{"OpenAI Chat API"}}
node_hf{{"Hugging Face Similarity API"}}

node_researcher -->|"provides topics"| node_tags
node_tags -->|"seeds problems"| node_generation
node_generation -->|"requests completions"| node_gpt
node_generation -->|"adds constraints"| node_constraint
node_constraint -->|"adds distractors"| node_distractors
node_distractors -->|"filters problems"| node_similarity
node_similarity -->|"queries similarity"| node_hf
node_problem_data -.->|"supplies problems"| node_collector
node_collector -->|"requests solutions"| node_gpt
node_collector -->|"formats requests"| node_solution_prompts
node_problem_data -->|"documents solvable subset"| node_human_solutions
node_benchmark -->|"supports evaluation"| node_researcher
node_improve_prompts -.->|"provides prompt asset"| node_researcher

click node_generation "https://github.com/allenai/macgyver/blob/main/code/progressive_data_creation/progressive_data_creation.py"
click node_constraint "https://github.com/allenai/macgyver/blob/main/code/progressive_data_creation/progressive_data_creation.py"
click node_distractors "https://github.com/allenai/macgyver/blob/main/code/progressive_data_creation/progressive_data_creation.py"
click node_similarity "https://github.com/allenai/macgyver/blob/main/code/progressive_data_creation/progressive_data_creation.py"
click node_collector "https://github.com/allenai/macgyver/blob/main/code/collect_solutions/collect_GPT4_solutions.py"
click node_problem_data "https://github.com/allenai/macgyver/blob/main/data/MacGyver/problem_solution_pair.xlsx"
click node_human_solutions "https://github.com/allenai/macgyver/blob/main/data/MacGyver/additional_human_solutions.xlsx"
click node_benchmark "https://github.com/allenai/macgyver/blob/main/data/Benchmark_results/benchmark_results.json"
click node_improve_prompts "https://github.com/allenai/macgyver/blob/main/code/improving_LLM_via_prompting/improve_prompts.json"
click node_solution_prompts "https://github.com/allenai/macgyver/blob/main/code/collect_solutions/collect_GPT4_solutions.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_tags,node_generation,node_constraint,node_distractors,node_similarity toneBlue
class node_collector,node_solution_prompts toneAmber
class node_problem_data,node_human_solutions,node_benchmark,node_gpt,node_hf toneMint
class node_improve_prompts toneRose
class node_researcher toneIndigo
```

## Components

### Problem Creation

- **Topic Tags**
- [Problem Generation](https://github.com/allenai/macgyver/blob/main/code/progressive_data_creation/progressive_data_creation.py): `code/progressive_data_creation/progressive_data_creation.py`
- [Constraint Addition](https://github.com/allenai/macgyver/blob/main/code/progressive_data_creation/progressive_data_creation.py): `code/progressive_data_creation/progressive_data_creation.py`
- [Distractor Tools](https://github.com/allenai/macgyver/blob/main/code/progressive_data_creation/progressive_data_creation.py): `code/progressive_data_creation/progressive_data_creation.py`
- [Similarity Filtering](https://github.com/allenai/macgyver/blob/main/code/progressive_data_creation/progressive_data_creation.py): `code/progressive_data_creation/progressive_data_creation.py`

### Solution Collection

- [Solution Collection](https://github.com/allenai/macgyver/blob/main/code/collect_solutions/collect_GPT4_solutions.py): `code/collect_solutions/collect_GPT4_solutions.py`
- [Solution Prompting](https://github.com/allenai/macgyver/blob/main/code/collect_solutions/collect_GPT4_solutions.py): `code/collect_solutions/collect_GPT4_solutions.py`

### Dataset and Annotations

- [Problem Dataset](https://github.com/allenai/macgyver/blob/main/data/MacGyver/problem_solution_pair.xlsx): `data/MacGyver/problem_solution_pair.xlsx`
- [Human Solutions](https://github.com/allenai/macgyver/blob/main/data/MacGyver/additional_human_solutions.xlsx): `data/MacGyver/additional_human_solutions.xlsx`
- [Benchmark Annotations](https://github.com/allenai/macgyver/blob/main/data/Benchmark_results/benchmark_results.json): `data/Benchmark_results/benchmark_results.json`

### Prompt Assets

- [Improvement Prompts](https://github.com/allenai/macgyver/blob/main/code/improving_LLM_via_prompting/improve_prompts.json): `code/improving_LLM_via_prompting/improve_prompts.json`

### Other components

- **Researcher**
- **OpenAI Chat API**
- **Hugging Face Similarity API**

## Connections

- Researcher → Topic Tags: provides topics
- Topic Tags → Problem Generation: seeds problems (evidence: `code/progressive_data_creation/progressive_data_creation.py`)
- Problem Generation → OpenAI Chat API: requests completions (evidence: `code/progressive_data_creation/progressive_data_creation.py`)
- Problem Generation → Constraint Addition: adds constraints (evidence: `code/progressive_data_creation/progressive_data_creation.py`)
- Constraint Addition → Distractor Tools: adds distractors (evidence: `code/progressive_data_creation/progressive_data_creation.py`)
- Distractor Tools → Similarity Filtering: filters problems (evidence: `code/progressive_data_creation/progressive_data_creation.py`)
- Similarity Filtering → Hugging Face Similarity API: queries similarity (evidence: `code/progressive_data_creation/progressive_data_creation.py`)
- Problem Dataset → Solution Collection: supplies problems (evidence: `README.md`)
- Solution Collection → OpenAI Chat API: requests solutions (evidence: `code/collect_solutions/collect_GPT4_solutions.py`)
- Solution Collection → Solution Prompting: formats requests (evidence: `code/collect_solutions/collect_GPT4_solutions.py`)
- Problem Dataset → Human Solutions: documents solvable subset (evidence: `README.md`)
- Benchmark Annotations → Researcher: supports evaluation (evidence: `README.md`)
- Improvement Prompts → Researcher: provides prompt asset (evidence: `README.md`)
