# bakedsoups/nextsteamgame architecture

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

- Interactive diagram: https://gitdiagram.com/bakedsoups/nextsteamgame
- Repository: https://github.com/bakedsoups/nextsteamgame

## Overview

NextSteamGame builds game metadata and review-derived semantic profiles offline, canonicalizes their tags, and precomputes candidate pools. The live workflow is game search → reference-profile inspection and preference adjustment → retrieval of a saved pool → weighted reranking → recommendations. The graph includes the documented metadata, review/semantics, canonicalization, and retrieval stages plus the runtime stack. Offline links follow README descriptions; sampled source confirms review processing and some runtime module responsibilities, but the frontend request wiring and several pipeline implementations were not inspected.

Main entry points: [`app.py`](https://github.com/bakedsoups/nextsteamgame/blob/main/app.py) (FastAPI endpoints), [`backend/retrieval.py`](https://github.com/bakedsoups/nextsteamgame/blob/main/backend/retrieval.py) (Candidate retrieval), [`db_creation/metadata_pipeline/pipeline.py`](https://github.com/bakedsoups/nextsteamgame/blob/main/db_creation/metadata_pipeline/pipeline.py) (Metadata collection), [`db_creation/db_builders/initial_noncanon_db/builder.py`](https://github.com/bakedsoups/nextsteamgame/blob/main/db_creation/db_builders/initial_noncanon_db/builder.py) (Profile builder)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_offline["Offline data pipelines"]
  node_metadata["Metadata collection<br/>[pipeline.py]"]
  node_metadata_db[("Metadata SQLite<br/>[paths.py]")]
  node_review_semantics["Review semantics<br/>[pipeline.py]"]
  node_semantics_builder["Profile builder<br/>[builder.py]"]
  node_noncanon_db[("Raw profile database<br/>[paths.py]")]
  node_canonicalization["Tag canonicalization<br/>[runner.py]"]
  node_final_pipeline["Final profile assembly<br/>[pipeline.py]"]
  node_final_db[("Canonical profile database<br/>[paths.py]")]
end

subgraph group_retrieval["Candidate retrieval"]
  node_chroma_pipeline["Vector indexing<br/>[pipeline.py]"]
  node_chroma[("Chroma index<br/>[paths.py]")]
  node_precompute["Candidate precomputation"]
  node_candidate_db[("Candidate pools<br/>[pg_store.py]")]
end

subgraph group_runtime["Recommendation service"]
  node_api["FastAPI endpoints<br/>[app.py]"]
  node_retriever["Candidate retrieval<br/>[retrieval.py]"]
  node_scorer["Preference reranking<br/>[recommender.py]"]
  node_store[("Postgres game store<br/>[pg_store.py]")]
end

subgraph group_frontend["User experience"]
  node_frontend["Recommendation interface<br/>[page.tsx]"]
  node_recommendations["Scored matches"]
end

node_user(("Player"))
node_steam{{"Steam APIs"}}
node_steamspy{{"SteamSpy"}}

node_steam -->|"supplies data"| node_metadata
node_steamspy -->|"supplies data"| node_metadata
node_metadata -->|"writes metadata"| node_metadata_db
node_review_semantics -->|"generates profiles"| node_semantics_builder
node_semantics_builder -.->|"stores profiles"| node_noncanon_db
node_noncanon_db -->|"provides tags"| node_canonicalization
node_canonicalization -->|"maps tags"| node_final_pipeline
node_final_pipeline -->|"builds profiles"| node_final_db
node_final_db -->|"provides profiles"| node_chroma_pipeline
node_chroma_pipeline -->|"writes vectors"| node_chroma
node_chroma -->|"retrieves neighbors"| node_precompute
node_precompute -->|"saves candidate pools"| node_candidate_db
node_user -->|"sets preferences"| node_frontend
node_frontend -->|"requests matches"| node_api
node_api -->|"loads candidates"| node_retriever
node_retriever -->|"reads candidate IDs"| node_candidate_db
node_retriever -->|"hydrates profiles"| node_store
node_retriever -->|"scores candidates"| node_scorer
node_api -.->|"reranks results"| node_scorer
node_api -->|"returns matches"| node_recommendations

click node_metadata "https://github.com/bakedsoups/nextsteamgame/blob/main/db_creation/metadata_pipeline/pipeline.py"
click node_metadata_db "https://github.com/bakedsoups/nextsteamgame/blob/main/db_creation/paths.py"
click node_review_semantics "https://github.com/bakedsoups/nextsteamgame/blob/main/db_creation/noncanon_pipeline/pipeline.py"
click node_semantics_builder "https://github.com/bakedsoups/nextsteamgame/blob/main/db_creation/db_builders/initial_noncanon_db/builder.py"
click node_noncanon_db "https://github.com/bakedsoups/nextsteamgame/blob/main/db_creation/paths.py"
click node_canonicalization "https://github.com/bakedsoups/nextsteamgame/blob/main/db_creation/canon_pipeline/runner.py"
click node_final_pipeline "https://github.com/bakedsoups/nextsteamgame/blob/main/db_creation/final_pipeline/pipeline.py"
click node_final_db "https://github.com/bakedsoups/nextsteamgame/blob/main/db_creation/paths.py"
click node_chroma_pipeline "https://github.com/bakedsoups/nextsteamgame/blob/main/db_creation/chroma_pipeline/pipeline.py"
click node_chroma "https://github.com/bakedsoups/nextsteamgame/blob/main/db_creation/paths.py"
click node_precompute "https://github.com/bakedsoups/nextsteamgame/blob/main/db_creation/precompute_candidates.py"
click node_candidate_db "https://github.com/bakedsoups/nextsteamgame/blob/main/backend/pg_store.py"
click node_frontend "https://github.com/bakedsoups/nextsteamgame/blob/main/frontend/app/page.tsx"
click node_api "https://github.com/bakedsoups/nextsteamgame/blob/main/app.py"
click node_retriever "https://github.com/bakedsoups/nextsteamgame/blob/main/backend/retrieval.py"
click node_scorer "https://github.com/bakedsoups/nextsteamgame/blob/main/backend/recommender.py"
click node_store "https://github.com/bakedsoups/nextsteamgame/blob/main/backend/pg_store.py"
click node_recommendations "https://github.com/bakedsoups/nextsteamgame/blob/main/frontend/components/recommendations-panel.tsx"

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_metadata,node_metadata_db,node_review_semantics,node_semantics_builder,node_noncanon_db,node_canonicalization,node_final_pipeline,node_final_db toneBlue
class node_chroma_pipeline,node_chroma,node_precompute,node_candidate_db toneAmber
class node_api,node_retriever,node_scorer,node_store,node_steam toneMint
class node_frontend,node_recommendations toneRose
class node_user,node_steamspy toneIndigo
```

## Components

### Offline data pipelines

- [Metadata collection](https://github.com/bakedsoups/nextsteamgame/blob/main/db_creation/metadata_pipeline/pipeline.py): `db_creation/metadata_pipeline/pipeline.py`
- [Metadata SQLite](https://github.com/bakedsoups/nextsteamgame/blob/main/db_creation/paths.py): `db_creation/paths.py`
- [Review semantics](https://github.com/bakedsoups/nextsteamgame/blob/main/db_creation/noncanon_pipeline/pipeline.py): `db_creation/noncanon_pipeline/pipeline.py`
- [Profile builder](https://github.com/bakedsoups/nextsteamgame/blob/main/db_creation/db_builders/initial_noncanon_db/builder.py): `db_creation/db_builders/initial_noncanon_db/builder.py`
- [Raw profile database](https://github.com/bakedsoups/nextsteamgame/blob/main/db_creation/paths.py): `db_creation/paths.py`
- [Tag canonicalization](https://github.com/bakedsoups/nextsteamgame/blob/main/db_creation/canon_pipeline/runner.py): `db_creation/canon_pipeline/runner.py`
- [Final profile assembly](https://github.com/bakedsoups/nextsteamgame/blob/main/db_creation/final_pipeline/pipeline.py): `db_creation/final_pipeline/pipeline.py`
- [Canonical profile database](https://github.com/bakedsoups/nextsteamgame/blob/main/db_creation/paths.py): `db_creation/paths.py`

### Candidate retrieval

- [Vector indexing](https://github.com/bakedsoups/nextsteamgame/blob/main/db_creation/chroma_pipeline/pipeline.py): `db_creation/chroma_pipeline/pipeline.py`
- [Chroma index](https://github.com/bakedsoups/nextsteamgame/blob/main/db_creation/paths.py): `db_creation/paths.py`
- [Candidate precomputation](https://github.com/bakedsoups/nextsteamgame/blob/main/db_creation/precompute_candidates.py): `db_creation/precompute_candidates.py`
- [Candidate pools](https://github.com/bakedsoups/nextsteamgame/blob/main/backend/pg_store.py): `backend/pg_store.py`

### Recommendation service

- [FastAPI endpoints](https://github.com/bakedsoups/nextsteamgame/blob/main/app.py): `app.py`
- [Candidate retrieval](https://github.com/bakedsoups/nextsteamgame/blob/main/backend/retrieval.py): `backend/retrieval.py`
- [Preference reranking](https://github.com/bakedsoups/nextsteamgame/blob/main/backend/recommender.py): `backend/recommender.py`
- [Postgres game store](https://github.com/bakedsoups/nextsteamgame/blob/main/backend/pg_store.py): `backend/pg_store.py`

### User experience

- [Recommendation interface](https://github.com/bakedsoups/nextsteamgame/blob/main/frontend/app/page.tsx): `frontend/app/page.tsx`
- [Scored matches](https://github.com/bakedsoups/nextsteamgame/blob/main/frontend/components/recommendations-panel.tsx): `frontend/components/recommendations-panel.tsx`

### Other components

- **Player**
- **Steam APIs**
- **SteamSpy**

## Connections

- Steam APIs → Metadata collection: supplies data
- SteamSpy → Metadata collection: supplies data
- Metadata collection → Metadata SQLite: writes metadata (evidence: `db_creation/metadata_pipeline/pipeline.py`)
- Review semantics → Profile builder: generates profiles (evidence: `db_creation/noncanon_pipeline/pipeline.py`)
- Profile builder → Raw profile database: stores profiles (evidence: `db_creation/db_builders/initial_noncanon_db/builder.py`)
- Raw profile database → Tag canonicalization: provides tags
- Tag canonicalization → Final profile assembly: maps tags
- Final profile assembly → Canonical profile database: builds profiles (evidence: `db_creation/final_pipeline/pipeline.py`)
- Canonical profile database → Vector indexing: provides profiles
- Vector indexing → Chroma index: writes vectors
- Chroma index → Candidate precomputation: retrieves neighbors
- Candidate precomputation → Candidate pools: saves candidate pools
- Player → Recommendation interface: sets preferences
- Recommendation interface → FastAPI endpoints: requests matches
- FastAPI endpoints → Candidate retrieval: loads candidates (evidence: `app.py`)
- Candidate retrieval → Candidate pools: reads candidate IDs
- Candidate retrieval → Postgres game store: hydrates profiles
- Candidate retrieval → Preference reranking: scores candidates (evidence: `backend/retrieval.py`)
- FastAPI endpoints → Preference reranking: reranks results (evidence: `app.py`)
- FastAPI endpoints → Scored matches: returns matches
