# harveyai/biglaw-bench architecture

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

- Interactive diagram: https://gitdiagram.com/harveyai/biglaw-bench
- Repository: https://github.com/harveyai/biglaw-bench

## Overview

BigLaw Bench is a collection of legal-work evaluation benchmarks and datasets, not an application that executes legal tasks. Its documented workflow is to evaluate model performance on benchmark tasks, assess responses with task-specific rubrics, and combine credit and penalties into an answer score. The repository provides three branches: core legal tasks, SPA deal-point workflows, and retrieval datasets for contracts and discovery emails. The README documents these capabilities, but no source excerpts show runtime orchestration or rubric implementations, so the graph reflects only documented relationships.

Main entry points: [`blb-core`](https://github.com/harveyai/biglaw-bench/tree/main/blb-core) (Core legal tasks), [`blb-retrieval`](https://github.com/harveyai/biglaw-bench/tree/main/blb-retrieval) (Retrieval datasets), [`blb-workflows/spa`](https://github.com/harveyai/biglaw-bench/tree/main/blb-workflows/spa) (SPA deal points), [`blb-core/core-samples.csv`](https://github.com/harveyai/biglaw-bench/blob/main/blb-core/core-samples.csv) (Core samples)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_core["Core Benchmark"]
  node_core_tasks["Core legal tasks"]
  node_transactional["Transactional tasks"]
  node_litigation["Litigation tasks"]
  node_core_samples["Core samples<br/>[core-samples.csv]"]
end

subgraph group_workflow["SPA Workflow"]
  node_spa_benchmark["SPA deal points"]
  node_spa_schema["SPA schema<br/>[schema.json]"]
  node_spa_samples["SPA samples<br/>[spa-samples.csv]"]
end

subgraph group_retrieval["Retrieval Benchmark"]
  node_retrieval_benchmark["Retrieval datasets"]
  node_contracts["Contract datasets"]
  node_spa_contracts["SPA contracts"]
  node_emails["Discovery emails"]
end

subgraph group_evaluation["Evaluation Methodology"]
  node_rubrics["Task rubrics"]
  node_answer_quality["Answer quality"]
  node_source_reliability["Source reliability"]
  node_answer_score["Final answer score"]
end

node_model(("LLM"))

node_model -->|"evaluated on"| node_core_tasks
node_model -->|"evaluated on"| node_spa_benchmark
node_model -->|"evaluated on"| node_retrieval_benchmark
node_core_tasks -->|"includes"| node_transactional
node_core_tasks -->|"includes"| node_litigation
node_core_tasks -->|"sample tasks at"| node_core_samples
node_spa_benchmark -->|"defines"| node_spa_schema
node_spa_benchmark -->|"sample tasks at"| node_spa_samples
node_retrieval_benchmark -->|"includes"| node_contracts
node_retrieval_benchmark -->|"includes"| node_spa_contracts
node_retrieval_benchmark -->|"includes"| node_emails
node_core_tasks -->|"assessed with"| node_rubrics
node_spa_benchmark -->|"assessed with"| node_rubrics
node_retrieval_benchmark -->|"assessed with"| node_rubrics
node_rubrics -->|"measures"| node_answer_quality
node_rubrics -->|"measures"| node_source_reliability
node_answer_quality -->|"contributes to"| node_answer_score
node_source_reliability -->|"contributes to"| node_answer_score

click node_core_tasks "https://github.com/harveyai/biglaw-bench/tree/main/blb-core"
click node_transactional "https://github.com/harveyai/biglaw-bench/tree/main/blb-core"
click node_litigation "https://github.com/harveyai/biglaw-bench/tree/main/blb-core"
click node_core_samples "https://github.com/harveyai/biglaw-bench/blob/main/blb-core/core-samples.csv"
click node_spa_benchmark "https://github.com/harveyai/biglaw-bench/tree/main/blb-workflows/spa"
click node_spa_schema "https://github.com/harveyai/biglaw-bench/blob/main/blb-workflows/spa/schema.json"
click node_spa_samples "https://github.com/harveyai/biglaw-bench/blob/main/blb-workflows/spa/spa-samples.csv"
click node_retrieval_benchmark "https://github.com/harveyai/biglaw-bench/tree/main/blb-retrieval"
click node_contracts "https://github.com/harveyai/biglaw-bench/tree/main/blb-retrieval/merger_agreements"
click node_spa_contracts "https://github.com/harveyai/biglaw-bench/tree/main/blb-retrieval/spa"
click node_emails "https://github.com/harveyai/biglaw-bench/tree/main/blb-retrieval/discovery_emails"

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_core_tasks,node_transactional,node_litigation,node_core_samples toneBlue
class node_spa_benchmark,node_spa_schema,node_spa_samples toneAmber
class node_retrieval_benchmark,node_contracts,node_spa_contracts,node_emails toneMint
class node_rubrics,node_answer_quality,node_source_reliability,node_answer_score toneRose
class node_model toneIndigo
```

## Components

### Core Benchmark

- [Core legal tasks](https://github.com/harveyai/biglaw-bench/tree/main/blb-core): `blb-core`
- [Transactional tasks](https://github.com/harveyai/biglaw-bench/tree/main/blb-core): `blb-core`
- [Litigation tasks](https://github.com/harveyai/biglaw-bench/tree/main/blb-core): `blb-core`
- [Core samples](https://github.com/harveyai/biglaw-bench/blob/main/blb-core/core-samples.csv): `blb-core/core-samples.csv`

### SPA Workflow

- [SPA deal points](https://github.com/harveyai/biglaw-bench/tree/main/blb-workflows/spa): `blb-workflows/spa`
- [SPA schema](https://github.com/harveyai/biglaw-bench/blob/main/blb-workflows/spa/schema.json): `blb-workflows/spa/schema.json`
- [SPA samples](https://github.com/harveyai/biglaw-bench/blob/main/blb-workflows/spa/spa-samples.csv): `blb-workflows/spa/spa-samples.csv`

### Retrieval Benchmark

- [Retrieval datasets](https://github.com/harveyai/biglaw-bench/tree/main/blb-retrieval): `blb-retrieval`
- [Contract datasets](https://github.com/harveyai/biglaw-bench/tree/main/blb-retrieval/merger_agreements): `blb-retrieval/merger_agreements`
- [SPA contracts](https://github.com/harveyai/biglaw-bench/tree/main/blb-retrieval/spa): `blb-retrieval/spa`
- [Discovery emails](https://github.com/harveyai/biglaw-bench/tree/main/blb-retrieval/discovery_emails): `blb-retrieval/discovery_emails`

### Evaluation Methodology

- **Task rubrics**
- **Answer quality**
- **Source reliability**
- **Final answer score**

### Other components

- **LLM**

## Connections

- LLM → Core legal tasks: evaluated on (evidence: `README.md`)
- LLM → SPA deal points: evaluated on (evidence: `README.md`)
- LLM → Retrieval datasets: evaluated on (evidence: `README.md`)
- Core legal tasks → Transactional tasks: includes (evidence: `README.md`)
- Core legal tasks → Litigation tasks: includes (evidence: `README.md`)
- Core legal tasks → Core samples: sample tasks at (evidence: `README.md`)
- SPA deal points → SPA schema: defines (evidence: `README.md`)
- SPA deal points → SPA samples: sample tasks at (evidence: `README.md`)
- Retrieval datasets → Contract datasets: includes (evidence: `README.md`)
- Retrieval datasets → SPA contracts: includes (evidence: `README.md`)
- Retrieval datasets → Discovery emails: includes (evidence: `README.md`)
- Core legal tasks → Task rubrics: assessed with (evidence: `README.md`)
- SPA deal points → Task rubrics: assessed with (evidence: `README.md`)
- Retrieval datasets → Task rubrics: assessed with (evidence: `README.md`)
- Task rubrics → Answer quality: measures (evidence: `README.md`)
- Task rubrics → Source reliability: measures (evidence: `README.md`)
- Answer quality → Final answer score: contributes to (evidence: `README.md`)
- Source reliability → Final answer score: contributes to (evidence: `README.md`)
