# jiwooroh/fit-over-depth architecture

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

- Interactive diagram: https://gitdiagram.com/jiwooroh/fit-over-depth
- Repository: https://github.com/jiwooroh/fit-over-depth

## Overview

Fit Over Depth is a research pipeline for long-context question answering, comparing rehearsal strategies and advancing an extractive model. The intended path is genre-specific corpus preparation, semantic chunking, verbatim sentence selection with document-adaptive compression and selective coherence repair, then QA. Separate experimental branches investigate generative curation and thread memory, question generation, and evaluation. The README documents the final-model workflow; sampled source confirms several internal dependencies, but the QA runner and coherence-repair implementation were not shown, so those links are documented rather than inferred from code.

Main entry points: [`src/pipeline/rehearsal.py`](https://github.com/jiwooroh/fit-over-depth/blob/master/src/pipeline/rehearsal.py) (Rehearsal Pipeline), [`src/pipeline/chuncking.py`](https://github.com/jiwooroh/fit-over-depth/blob/master/src/pipeline/chuncking.py) (Semantic Chunking), [`src/pipeline/embeddings.py`](https://github.com/jiwooroh/fit-over-depth/blob/master/src/pipeline/embeddings.py) (Embedding Client), [`notebooks`](https://github.com/jiwooroh/fit-over-depth/tree/master/notebooks) (QA Evaluation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_corpora["Corpus Preparation"]
  node_corpus_builders["Corpus Builders"]
  node_corpus_data[("Prepared Corpora")]
  node_questions["Eval Questions"]
end

subgraph group_compression["Compression Pipeline"]
  node_chunking["Semantic Chunking<br/>[chuncking.py]"]
  node_chunk_types["Chunk Types<br/>[types.py]"]
  node_embeddings["Embedding Client<br/>[embeddings.py]"]
  node_extractive["Sentence Selector<br/>[extractive.py]"]
  node_rehearsal["Rehearsal Pipeline<br/>[rehearsal.py]"]
  node_gisting["Sentence Scoring<br/>[gisting.py]"]
  node_coherence_repair["Local Context Repair"]
  node_qa["QA Evaluation"]
end

subgraph group_experiments["Experimental Strategies"]
  node_thread_memory[("Thread Memory<br/>[thread_memory.py]")]
  node_curation["Teacher Curation<br/>[curation.py]"]
  node_teacher["Teacher Client<br/>[teacher.py]"]
  node_thread_grouping["Thread Grouping<br/>[thread_grouping.py]"]
  node_question_generation["Question Generation<br/>[qg.py]"]
end

subgraph group_analysis["Evaluation"]
  node_model_comparison["Model Comparison"]
  node_tau_sweep["Threshold Sweep<br/>[run_tau_sweep.py]"]
  node_tau_analysis["Sweep Analysis<br/>[tau_sweep.py]"]
end

node_researcher(("Researcher"))
node_embedding_api{{"NIM Embeddings"}}
node_qa_model{{"QA Model"}}

node_researcher -->|"prepares datasets"| node_corpus_builders
node_corpus_builders -->|"writes corpora"| node_corpus_data
node_researcher -->|"supplies questions"| node_questions
node_corpus_data -.->|"chunks documents"| node_chunking
node_chunking -->|"creates chunks"| node_chunk_types
node_chunking -->|"embeds units"| node_embeddings
node_embeddings -->|"requests vectors"| node_embedding_api
node_rehearsal -->|"scores sentences"| node_extractive
node_rehearsal -->|"uses sentence tools"| node_gisting
node_rehearsal -->|"updates memory"| node_thread_memory
node_chunking -.->|"passes chunks"| node_rehearsal
node_rehearsal -.->|"repairs seams"| node_coherence_repair
node_coherence_repair -.->|"provides context"| node_qa
node_qa -.->|"queries model"| node_qa_model
node_questions -.->|"evaluates answers"| node_qa
node_curation -->|"requests generations"| node_teacher
node_teacher -->|"retrieves and writes"| node_thread_memory
node_thread_grouping -->|"uses embeddings"| node_embeddings
node_researcher -.->|"explores testing effect"| node_question_generation
node_model_comparison -->|"chunks corpus"| node_chunking
node_model_comparison -->|"scores and selects"| node_extractive
node_tau_sweep -->|"runs sweep"| node_tau_analysis
node_tau_analysis -->|"evaluates thresholds"| node_rehearsal

click node_corpus_builders "https://github.com/jiwooroh/fit-over-depth/tree/master/data/scripts"
click node_corpus_data "https://github.com/jiwooroh/fit-over-depth/tree/master/data/processed"
click node_questions "https://github.com/jiwooroh/fit-over-depth/tree/master/data/sample"
click node_chunking "https://github.com/jiwooroh/fit-over-depth/blob/master/src/pipeline/chuncking.py"
click node_chunk_types "https://github.com/jiwooroh/fit-over-depth/blob/master/src/pipeline/types.py"
click node_embeddings "https://github.com/jiwooroh/fit-over-depth/blob/master/src/pipeline/embeddings.py"
click node_extractive "https://github.com/jiwooroh/fit-over-depth/blob/master/src/pipeline/extractive.py"
click node_rehearsal "https://github.com/jiwooroh/fit-over-depth/blob/master/src/pipeline/rehearsal.py"
click node_gisting "https://github.com/jiwooroh/fit-over-depth/blob/master/src/pipeline/gisting.py"
click node_coherence_repair "https://github.com/jiwooroh/fit-over-depth/tree/master/src/pipeline"
click node_qa "https://github.com/jiwooroh/fit-over-depth/tree/master/notebooks"
click node_thread_memory "https://github.com/jiwooroh/fit-over-depth/blob/master/src/pipeline/thread_memory.py"
click node_curation "https://github.com/jiwooroh/fit-over-depth/blob/master/src/pipeline/curation.py"
click node_teacher "https://github.com/jiwooroh/fit-over-depth/blob/master/src/pipeline/teacher.py"
click node_thread_grouping "https://github.com/jiwooroh/fit-over-depth/blob/master/src/pipeline/thread_grouping.py"
click node_question_generation "https://github.com/jiwooroh/fit-over-depth/blob/master/src/pipeline/qg.py"
click node_model_comparison "https://github.com/jiwooroh/fit-over-depth/blob/master/src/eval/compare_maintenance_models.py"
click node_tau_sweep "https://github.com/jiwooroh/fit-over-depth/blob/master/src/eval/run_tau_sweep.py"
click node_tau_analysis "https://github.com/jiwooroh/fit-over-depth/blob/master/src/eval/tau_sweep.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_corpus_builders,node_corpus_data,node_questions toneBlue
class node_chunking,node_chunk_types,node_embeddings,node_extractive,node_rehearsal,node_gisting,node_coherence_repair,node_qa toneAmber
class node_thread_memory,node_curation,node_teacher,node_thread_grouping,node_question_generation toneMint
class node_model_comparison,node_tau_sweep,node_tau_analysis toneRose
class node_researcher,node_embedding_api,node_qa_model toneIndigo
```

## Components

### Corpus Preparation

- [Corpus Builders](https://github.com/jiwooroh/fit-over-depth/tree/master/data/scripts): `data/scripts`
- [Prepared Corpora](https://github.com/jiwooroh/fit-over-depth/tree/master/data/processed): `data/processed`
- [Eval Questions](https://github.com/jiwooroh/fit-over-depth/tree/master/data/sample): `data/sample`

### Compression Pipeline

- [Semantic Chunking](https://github.com/jiwooroh/fit-over-depth/blob/master/src/pipeline/chuncking.py): `src/pipeline/chuncking.py`
- [Chunk Types](https://github.com/jiwooroh/fit-over-depth/blob/master/src/pipeline/types.py): `src/pipeline/types.py`
- [Embedding Client](https://github.com/jiwooroh/fit-over-depth/blob/master/src/pipeline/embeddings.py): `src/pipeline/embeddings.py`
- [Sentence Selector](https://github.com/jiwooroh/fit-over-depth/blob/master/src/pipeline/extractive.py): `src/pipeline/extractive.py`
- [Rehearsal Pipeline](https://github.com/jiwooroh/fit-over-depth/blob/master/src/pipeline/rehearsal.py): `src/pipeline/rehearsal.py`
- [Sentence Scoring](https://github.com/jiwooroh/fit-over-depth/blob/master/src/pipeline/gisting.py): `src/pipeline/gisting.py`
- [Local Context Repair](https://github.com/jiwooroh/fit-over-depth/tree/master/src/pipeline): `src/pipeline`
- [QA Evaluation](https://github.com/jiwooroh/fit-over-depth/tree/master/notebooks): `notebooks`

### Experimental Strategies

- [Thread Memory](https://github.com/jiwooroh/fit-over-depth/blob/master/src/pipeline/thread_memory.py): `src/pipeline/thread_memory.py`
- [Teacher Curation](https://github.com/jiwooroh/fit-over-depth/blob/master/src/pipeline/curation.py): `src/pipeline/curation.py`
- [Teacher Client](https://github.com/jiwooroh/fit-over-depth/blob/master/src/pipeline/teacher.py): `src/pipeline/teacher.py`
- [Thread Grouping](https://github.com/jiwooroh/fit-over-depth/blob/master/src/pipeline/thread_grouping.py): `src/pipeline/thread_grouping.py`
- [Question Generation](https://github.com/jiwooroh/fit-over-depth/blob/master/src/pipeline/qg.py): `src/pipeline/qg.py`

### Evaluation

- [Model Comparison](https://github.com/jiwooroh/fit-over-depth/blob/master/src/eval/compare_maintenance_models.py): `src/eval/compare_maintenance_models.py`
- [Threshold Sweep](https://github.com/jiwooroh/fit-over-depth/blob/master/src/eval/run_tau_sweep.py): `src/eval/run_tau_sweep.py`
- [Sweep Analysis](https://github.com/jiwooroh/fit-over-depth/blob/master/src/eval/tau_sweep.py): `src/eval/tau_sweep.py`

### Other components

- **Researcher**
- **NIM Embeddings**
- **QA Model**

## Connections

- Researcher → Corpus Builders: prepares datasets (evidence: `README.md`)
- Corpus Builders → Prepared Corpora: writes corpora (evidence: `README.md`)
- Researcher → Eval Questions: supplies questions (evidence: `README.md`)
- Prepared Corpora → Semantic Chunking: chunks documents
- Semantic Chunking → Chunk Types: creates chunks (evidence: `src/pipeline/chuncking.py`)
- Semantic Chunking → Embedding Client: embeds units (evidence: `src/pipeline/chuncking.py`)
- Embedding Client → NIM Embeddings: requests vectors (evidence: `src/pipeline/embeddings.py`)
- Rehearsal Pipeline → Sentence Selector: scores sentences (evidence: `src/pipeline/rehearsal.py`)
- Rehearsal Pipeline → Sentence Scoring: uses sentence tools (evidence: `src/pipeline/rehearsal.py`)
- Rehearsal Pipeline → Thread Memory: updates memory (evidence: `src/pipeline/rehearsal.py`)
- Semantic Chunking → Rehearsal Pipeline: passes chunks
- Rehearsal Pipeline → Local Context Repair: repairs seams (evidence: `README.md`)
- Local Context Repair → QA Evaluation: provides context (evidence: `README.md`)
- QA Evaluation → QA Model: queries model (evidence: `README.md`)
- Eval Questions → QA Evaluation: evaluates answers
- Teacher Curation → Teacher Client: requests generations (evidence: `README.md`)
- Teacher Client → Thread Memory: retrieves and writes (evidence: `src/pipeline/teacher.py`)
- Thread Grouping → Embedding Client: uses embeddings (evidence: `src/pipeline/thread_grouping.py`)
- Researcher → Question Generation: explores testing effect (evidence: `README.md`)
- Model Comparison → Semantic Chunking: chunks corpus (evidence: `src/eval/compare_maintenance_models.py`)
- Model Comparison → Sentence Selector: scores and selects (evidence: `src/eval/compare_maintenance_models.py`)
- Threshold Sweep → Sweep Analysis: runs sweep (evidence: `src/eval/run_tau_sweep.py`)
- Sweep Analysis → Rehearsal Pipeline: evaluates thresholds (evidence: `src/eval/tau_sweep.py`)
