Skip to main content

Architecture

Fair Forge follows a simple yet powerful architecture designed for extensibility and ease of use.

Overview

Data Flow

The core data flow in Fair Forge is:
  1. Retriever loads your conversation data (list[Dataset], Iterator[Dataset], or Iterator[StreamedBatch])
  2. FairForge base class iterates through datasets
  3. Metric implementations process each conversation batch
  4. Results are collected in self.metrics
1

Load Data

Retriever.load_dataset() returns list[Dataset]
2

Process Datasets

FairForge._process() iterates through datasets
3

Compute Metrics

Metric.batch() processes each conversation
4

Collect Results

Results stored in self.metrics

Core Components

FairForge Base Class

All metrics inherit from FairForge (fair_forge/core/base.py):

Retriever

Abstract base class for data loading:

Data Structures

Dataset: A complete conversation session
Batch: A single Q&A interaction

Metric Architecture

Each metric follows this pattern:

Statistical Modes

Fair Forge supports two statistical approaches:
Returns point estimates (floats):

Module Structure

Extension Points

Fair Forge is designed for extensibility:

Next Steps

Retriever

Create custom retrievers for any data source

Streaming Retrievers

Process large datasets with streaming modes

Dataset & Batch

Understand data structures