> ## Documentation Index
> Fetch the complete documentation index at: https://aidflow.aigensys.com/llms.txt
> Use this file to discover all available pages before exploring further.

# ProjectContext

> AID.ctx.project.ProjectContext

```python theme={"theme":{"light":"dracula-soft","dark":"dracula"}}
from AID.ctx.project import ProjectContext
```

Project Context for defining, configuring AIG pipeline parameters and accessing
the key engine context components.

This class acts as the entry point for both interactive UI sessions and
headless script execution. It manages the initialization of the user interface
(if enabled), collects configuration parameters, and delegates the creation
of the runtime context (`PipelineContext`).

It supports a dual-mode architecture:

1. **UI Mode (HTML)**: Launches `ProjectGenesis` and `PipelineConfigurator`
   web panels for interactive parameter tuning. Kwargs pre-fill the interactive
   panels for visual verification.
2. **Script Mode**: Kwargs values are applied directly for scripted/headless
   execution.

> [!NOTE]
>
> Configuration values are resolved by precedence (highest
> first):
>
> 1. Kwargs — from the current `genesis()` / `params()` call.
> 2. Saved state — persisted from a prior session - `UI Mode only`.
> 3. Schema defaults — fallback values from the schema layer.

> [!NOTE]
>
> AIDflow Parametrization methods:
>
> * **genesis**: Initializes the gateway layer (identity + data loading).
> * **params**: Initializes the pipeline hyperparameters and runtime context.
> * **get\_setup**: Returns the final merged `Parameters` object used for training.

#### Parameters

**`config`** : *`Config`*
The global configuration object containing UI mode, theme, and other settings.

**`css_id`** : *`str`*
A unique ID suffix used to generate CSS panel identifiers\
(e.g., 'gateway-v1', 'config-v1').

#### Examples

Interactive usage:

```python theme={"theme":{"light":"dracula-soft","dark":"dracula"}}
ctx = ProjectContext()
ctx.genesis(kind='v')  # Launches gateway in vertical style
ctx.params()           # Launches config panel
```

Script usage:

```python theme={"theme":{"light":"dracula-soft","dark":"dracula"}}
ctx = ProjectContext()
ctx.genesis(
    project      = 'test',
    input_data   = 'test.csv',
    target       = 'target',
    yy_mm        = 'decision_date',
    yy_mm_format = '%Y-%m-%d'
)
ctx.params(
    min_bin_share = 10,
    gb_strategy   = 0, 
    gb_max_leaves = 50
)
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.