# dcoelho045/nfl-intelligence-platform architecture

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

- Interactive diagram: https://gitdiagram.com/dcoelho045/nfl-intelligence-platform
- Repository: https://github.com/dcoelho045/nfl-intelligence-platform
- Video tour (about a minute): https://gitdiagram.com/dcoelho045/nfl-intelligence-platform/video

## Overview

NFL Intelligence Platform provides deterministic NFL analytics, trained game and fantasy predictions, and evidence-backed assistant answers through HTTP and MCP interfaces. The main path is client request → adapter → shared services → nflverse data, model artifacts, or retrieval sources → typed, provenance-bearing result. The assistant orchestrates tools but does not calculate statistics or probabilities. The graph preserves the documented analytics, prediction, curated-knowledge, web-search, and MCP capabilities; connections for unsampled subsystems are included only where the README or source index supports them.

Main entry points: [`src/nfl_platform/services/container.py`](https://github.com/dcoelho045/nfl-intelligence-platform/blob/main/src/nfl_platform/services/container.py) (Service container), [`src/nfl_platform/llm/agent.py`](https://github.com/dcoelho045/nfl-intelligence-platform/blob/main/src/nfl_platform/llm/agent.py) (Assistant agent), [`src/nfl_platform/services/research.py`](https://github.com/dcoelho045/nfl-intelligence-platform/blob/main/src/nfl_platform/services/research.py) (Research service), [`src/nfl_platform/services`](https://github.com/dcoelho045/nfl-intelligence-platform/tree/main/src/nfl_platform/services) (Analytics services)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interfaces["Product interfaces"]
  node_http["HTTP API<br/>[app.py]"]
  node_mcp["MCP server<br/>[server.py]"]
  node_assistant_route["Assistant route<br/>[assistant.py]"]
  node_mcp_tools["MCP tools"]
end

subgraph group_services["Domain services"]
  node_container["Service container<br/>[container.py]"]
  node_analytics_services["Analytics services"]
  node_research_service["Research service<br/>[research.py]"]
  node_prediction_service["Prediction service<br/>[predictions.py]"]
end

subgraph group_data["Data and analytics"]
  node_loader["NFL data loader<br/>[loader.py]"]
  node_nflverse[("nflverse data")]
  node_analytics["Deterministic analytics"]
  node_snapshots[("Data snapshots<br/>[snapshots.py]")]
end

subgraph group_ml["Prediction models"]
  node_training["Model training<br/>[pipeline.py]"]
  node_features["Game and fantasy features"]
  node_registry[("Model registry<br/>[store.py]")]
  node_predictions["Game and fantasy predictions"]
end

subgraph group_evidence["Assistant and evidence"]
  node_agent["Assistant agent<br/>[agent.py]"]
  node_llm_tools["Assistant tools"]
  node_chat_provider["Chat provider<br/>[openai_client.py]"]
  node_knowledge["Curated knowledge search<br/>[retriever.py]"]
  node_web_search["Web search<br/>[search.py]"]
  node_search_provider["Search provider<br/>[provider.py]"]
end

node_user(("Client"))
node_external_search(("Web search service"))

node_user -->|"sends request"| node_http
node_user -->|"uses tools"| node_mcp
node_http -->|"resolves services"| node_container
node_http -->|"routes assistant"| node_assistant_route
node_mcp -->|"uses services"| node_container
node_mcp -->|"registers tools"| node_mcp_tools
node_container -->|"builds services"| node_analytics_services
node_container -->|"builds service"| node_research_service
node_container -->|"builds service"| node_prediction_service
node_container -->|"shares loader"| node_loader
node_loader -->|"loads datasets"| node_nflverse
node_analytics_services -->|"computes statistics"| node_analytics
node_analytics -->|"reads datasets"| node_loader
node_training -->|"builds features"| node_features
node_training -->|"writes artifacts"| node_registry
node_training -.->|"uses snapshots"| node_snapshots
node_prediction_service -->|"loads artifacts"| node_registry
node_prediction_service -->|"produces predictions"| node_predictions
node_predictions -->|"returns predictions"| node_user
node_assistant_route -->|"asks question"| node_agent
node_mcp_tools -->|"calls services"| node_analytics_services
node_agent -.->|"dispatches tools"| node_llm_tools
node_llm_tools -->|"calls services"| node_analytics_services
node_agent -.->|"requests completion"| node_chat_provider
node_agent -.->|"requests evidence"| node_research_service
node_research_service -->|"searches corpus"| node_knowledge
node_research_service -->|"searches web"| node_web_search
node_web_search -->|"queries provider"| node_search_provider
node_search_provider -.->|"searches"| node_external_search

click node_http "https://github.com/dcoelho045/nfl-intelligence-platform/blob/main/src/nfl_platform/api/app.py"
click node_mcp "https://github.com/dcoelho045/nfl-intelligence-platform/blob/main/src/nfl_platform/mcp_server/server.py"
click node_assistant_route "https://github.com/dcoelho045/nfl-intelligence-platform/blob/main/src/nfl_platform/api/routers/assistant.py"
click node_mcp_tools "https://github.com/dcoelho045/nfl-intelligence-platform/tree/main/src/nfl_platform/mcp_server/tools"
click node_container "https://github.com/dcoelho045/nfl-intelligence-platform/blob/main/src/nfl_platform/services/container.py"
click node_analytics_services "https://github.com/dcoelho045/nfl-intelligence-platform/tree/main/src/nfl_platform/services"
click node_research_service "https://github.com/dcoelho045/nfl-intelligence-platform/blob/main/src/nfl_platform/services/research.py"
click node_prediction_service "https://github.com/dcoelho045/nfl-intelligence-platform/blob/main/src/nfl_platform/services/predictions.py"
click node_loader "https://github.com/dcoelho045/nfl-intelligence-platform/blob/main/src/nfl_platform/data/ingestion/loader.py"
click node_analytics "https://github.com/dcoelho045/nfl-intelligence-platform/tree/main/src/nfl_platform/analytics"
click node_snapshots "https://github.com/dcoelho045/nfl-intelligence-platform/blob/main/src/nfl_platform/data/storage/snapshots.py"
click node_training "https://github.com/dcoelho045/nfl-intelligence-platform/blob/main/src/nfl_platform/ml/training/pipeline.py"
click node_features "https://github.com/dcoelho045/nfl-intelligence-platform/tree/main/src/nfl_platform/ml/features"
click node_registry "https://github.com/dcoelho045/nfl-intelligence-platform/blob/main/src/nfl_platform/ml/registry/store.py"
click node_predictions "https://github.com/dcoelho045/nfl-intelligence-platform/tree/main/src/nfl_platform/ml/predict"
click node_agent "https://github.com/dcoelho045/nfl-intelligence-platform/blob/main/src/nfl_platform/llm/agent.py"
click node_llm_tools "https://github.com/dcoelho045/nfl-intelligence-platform/tree/main/src/nfl_platform/llm/tools"
click node_chat_provider "https://github.com/dcoelho045/nfl-intelligence-platform/blob/main/src/nfl_platform/llm/providers/openai_client.py"
click node_knowledge "https://github.com/dcoelho045/nfl-intelligence-platform/blob/main/src/nfl_platform/retrieval/knowledge/retriever.py"
click node_web_search "https://github.com/dcoelho045/nfl-intelligence-platform/blob/main/src/nfl_platform/retrieval/web/search.py"
click node_search_provider "https://github.com/dcoelho045/nfl-intelligence-platform/blob/main/src/nfl_platform/retrieval/web/provider.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_http,node_mcp,node_assistant_route,node_mcp_tools,node_user toneBlue
class node_container,node_analytics_services,node_research_service,node_prediction_service toneAmber
class node_loader,node_nflverse,node_analytics,node_snapshots toneMint
class node_training,node_features,node_registry,node_predictions toneRose
class node_agent,node_llm_tools,node_chat_provider,node_knowledge,node_web_search,node_search_provider,node_external_search toneIndigo
```

## Components

### Product interfaces

- [HTTP API](https://github.com/dcoelho045/nfl-intelligence-platform/blob/main/src/nfl_platform/api/app.py): `src/nfl_platform/api/app.py`
- [MCP server](https://github.com/dcoelho045/nfl-intelligence-platform/blob/main/src/nfl_platform/mcp_server/server.py): `src/nfl_platform/mcp_server/server.py`
- [Assistant route](https://github.com/dcoelho045/nfl-intelligence-platform/blob/main/src/nfl_platform/api/routers/assistant.py): `src/nfl_platform/api/routers/assistant.py`
- [MCP tools](https://github.com/dcoelho045/nfl-intelligence-platform/tree/main/src/nfl_platform/mcp_server/tools): `src/nfl_platform/mcp_server/tools`

### Domain services

- [Service container](https://github.com/dcoelho045/nfl-intelligence-platform/blob/main/src/nfl_platform/services/container.py): `src/nfl_platform/services/container.py`
- [Analytics services](https://github.com/dcoelho045/nfl-intelligence-platform/tree/main/src/nfl_platform/services): `src/nfl_platform/services`
- [Research service](https://github.com/dcoelho045/nfl-intelligence-platform/blob/main/src/nfl_platform/services/research.py): `src/nfl_platform/services/research.py`
- [Prediction service](https://github.com/dcoelho045/nfl-intelligence-platform/blob/main/src/nfl_platform/services/predictions.py): `src/nfl_platform/services/predictions.py`

### Data and analytics

- [NFL data loader](https://github.com/dcoelho045/nfl-intelligence-platform/blob/main/src/nfl_platform/data/ingestion/loader.py): `src/nfl_platform/data/ingestion/loader.py`
- **nflverse data**
- [Deterministic analytics](https://github.com/dcoelho045/nfl-intelligence-platform/tree/main/src/nfl_platform/analytics): `src/nfl_platform/analytics`
- [Data snapshots](https://github.com/dcoelho045/nfl-intelligence-platform/blob/main/src/nfl_platform/data/storage/snapshots.py): `src/nfl_platform/data/storage/snapshots.py`

### Prediction models

- [Model training](https://github.com/dcoelho045/nfl-intelligence-platform/blob/main/src/nfl_platform/ml/training/pipeline.py): `src/nfl_platform/ml/training/pipeline.py`
- [Game and fantasy features](https://github.com/dcoelho045/nfl-intelligence-platform/tree/main/src/nfl_platform/ml/features): `src/nfl_platform/ml/features`
- [Model registry](https://github.com/dcoelho045/nfl-intelligence-platform/blob/main/src/nfl_platform/ml/registry/store.py): `src/nfl_platform/ml/registry/store.py`
- [Game and fantasy predictions](https://github.com/dcoelho045/nfl-intelligence-platform/tree/main/src/nfl_platform/ml/predict): `src/nfl_platform/ml/predict`

### Assistant and evidence

- [Assistant agent](https://github.com/dcoelho045/nfl-intelligence-platform/blob/main/src/nfl_platform/llm/agent.py): `src/nfl_platform/llm/agent.py`
- [Assistant tools](https://github.com/dcoelho045/nfl-intelligence-platform/tree/main/src/nfl_platform/llm/tools): `src/nfl_platform/llm/tools`
- [Chat provider](https://github.com/dcoelho045/nfl-intelligence-platform/blob/main/src/nfl_platform/llm/providers/openai_client.py): `src/nfl_platform/llm/providers/openai_client.py`
- [Curated knowledge search](https://github.com/dcoelho045/nfl-intelligence-platform/blob/main/src/nfl_platform/retrieval/knowledge/retriever.py): `src/nfl_platform/retrieval/knowledge/retriever.py`
- [Web search](https://github.com/dcoelho045/nfl-intelligence-platform/blob/main/src/nfl_platform/retrieval/web/search.py): `src/nfl_platform/retrieval/web/search.py`
- [Search provider](https://github.com/dcoelho045/nfl-intelligence-platform/blob/main/src/nfl_platform/retrieval/web/provider.py): `src/nfl_platform/retrieval/web/provider.py`

### Other components

- **Client**
- **Web search service**

## Connections

- Client → HTTP API: sends request (evidence: `README.md`)
- Client → MCP server: uses tools (evidence: `README.md`)
- HTTP API → Service container: resolves services (evidence: `src/nfl_platform/api/app.py`)
- HTTP API → Assistant route: routes assistant (evidence: `src/nfl_platform/api/app.py`)
- MCP server → Service container: uses services (evidence: `src/nfl_platform/mcp_server/server.py`)
- MCP server → MCP tools: registers tools (evidence: `src/nfl_platform/mcp_server/server.py`)
- Service container → Analytics services: builds services (evidence: `src/nfl_platform/services/container.py`)
- Service container → Research service: builds service (evidence: `src/nfl_platform/services/container.py`)
- Service container → Prediction service: builds service (evidence: `src/nfl_platform/services/container.py`)
- Service container → NFL data loader: shares loader (evidence: `src/nfl_platform/services/container.py`)
- NFL data loader → nflverse data: loads datasets (evidence: `src/nfl_platform/data/ingestion/loader.py`)
- Analytics services → Deterministic analytics: computes statistics (evidence: `README.md`)
- Deterministic analytics → NFL data loader: reads datasets (evidence: `src/nfl_platform/analytics/players.py`)
- Model training → Game and fantasy features: builds features (evidence: `src/nfl_platform/ml/training/pipeline.py`)
- Model training → Model registry: writes artifacts (evidence: `src/nfl_platform/ml/training/pipeline.py`)
- Model training → Data snapshots: uses snapshots (evidence: `src/nfl_platform/ml/cli.py`)
- Prediction service → Model registry: loads artifacts (evidence: `src/nfl_platform/services/container.py`)
- Prediction service → Game and fantasy predictions: produces predictions (evidence: `README.md`)
- Game and fantasy predictions → Client: returns predictions (evidence: `README.md`)
- Assistant route → Assistant agent: asks question (evidence: `README.md`)
- MCP tools → Analytics services: calls services (evidence: `README.md`)
- Assistant agent → Assistant tools: dispatches tools
- Assistant tools → Analytics services: calls services (evidence: `README.md`)
- Assistant agent → Chat provider: requests completion
- Assistant agent → Research service: requests evidence
- Research service → Curated knowledge search: searches corpus (evidence: `src/nfl_platform/services/container.py`)
- Research service → Web search: searches web (evidence: `src/nfl_platform/services/research.py`)
- Web search → Search provider: queries provider (evidence: `src/nfl_platform/retrieval/web/search.py`)
- Search provider → Web search service: searches
