---
title: "Architecture"
manual: "AI Foundation"
version: "1.2"
permalink: "https://docs.typo3.org/permalink/nitsan/ns-t3af:architecture@1.2"
source: "DeveloperGuide/Architecture/Index.rst"
modified: "2026-09-15T06:30:06+00:00"
---

# Architecture

## Overview

![For Developers tab showing AI Foundation architecture at a glance](../../Images/for-developers.png)

AI Foundation is a shared foundation layer:

```text
Consuming Extension Code
        |
        v
AiServiceInterface
        |
        v
AdapterRegistry -> Provider adapters
        |
        v
   Provider APIs
```

Parallel support:

```text
AiStatisticsService -> OpenAiOrganizationUsageService -> OpenAI Usage API
HttpAuthUtility    -> Protected URL fetching with optional Basic Auth
```

## Main components

-   **Request orchestration**: `AiServiceInterface` and `AiService`
-   **Provider adapters**: `AdapterRegistry` and `AdapterInterface` implementations
-   **Statistics processing**: `AiStatisticsService` and `OpenAiOrganizationUsageService`
-   **Engine configuration filtering**: `AiEngineConfiguration`
-   **Utility and environment helpers**: `AiUniverseUtilityHelper`
-   **HTTP auth helper**: `HttpAuthUtility`

## Configuration model

Runtime AI requests resolve through provider rows in
[AI Providers](https://docs.typo3.org/permalink/nitsan/ns-t3af:ai-providers@1.2). Optional extension settings cover
translation helpers, Basic Auth, notifications, and MCP switches. See
[Configuration](https://docs.typo3.org/permalink/nitsan/ns-t3af:configuration@1.2).

This includes:

-   provider adapters, encrypted API keys, and model IDs
-   default provider selection
-   optional temperature and capability flags on provider rows
-   optional Basic Auth settings for protected URL fetching

## Caching

The extension registers cache `nst3af_statistics` in `ext_localconf.php`.

Statistics service stores processed data in this cache to reduce repeated usage API calls.

## Constraints

-   No native frontend plugin and no Fluid frontend output in this package.
-   Primary role is reusable service infrastructure.
