# smarino76/kaggriculture architecture

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

- Interactive diagram: https://gitdiagram.com/smarino76/kaggriculture
- Repository: https://github.com/smarino76/kaggriculture

## Overview

This repository implements a Kaggriculture game-playing agent. The environment supplies an observation; `agent.py` updates domain experts, applies its farming and market rules, and returns farmer and market actions. The experts analyze financial, agricultural, inventory, market, and livestock state, though the sampled policy primarily makes decisions directly from the observation. `features.py` offers separate time and farm feature extraction. The README is empty, and unsampled code limits confidence about additional integrations or how feature extraction is consumed.

Main entry points: [`agent.py`](https://github.com/smarino76/kaggriculture/blob/main/agent.py) (Agent policy), [`experts/business.py`](https://github.com/smarino76/kaggriculture/blob/main/experts/business.py) (Livestock expert)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_policy["Agent policy"]
  node_agent["Agent policy<br/>[agent.py]"]
end

subgraph group_analysis["State analysis"]
  node_financial["Financial expert<br/>[business.py]"]
  node_agriculture["Agriculture expert<br/>[business.py]"]
  node_inventory["Inventory expert<br/>[business.py]"]
  node_market["Market expert<br/>[business.py]"]
  node_livestock["Livestock expert<br/>[business.py]"]
  node_features["Feature extraction<br/>[features.py]"]
end

node_environment(("Kaggriculture environment"))

node_environment -->|"sends observation"| node_agent
node_agent -->|"returns actions"| node_environment
node_agent -->|"updates state"| node_financial
node_agent -->|"updates state"| node_agriculture
node_agent -->|"updates state"| node_inventory
node_agent -->|"updates state"| node_market
node_agent -->|"updates state"| node_livestock
node_agent -.->|"reads debug features"| node_livestock

click node_agent "https://github.com/smarino76/kaggriculture/blob/main/agent.py"
click node_financial "https://github.com/smarino76/kaggriculture/blob/main/experts/business.py"
click node_agriculture "https://github.com/smarino76/kaggriculture/blob/main/experts/business.py"
click node_inventory "https://github.com/smarino76/kaggriculture/blob/main/experts/business.py"
click node_market "https://github.com/smarino76/kaggriculture/blob/main/experts/business.py"
click node_livestock "https://github.com/smarino76/kaggriculture/blob/main/experts/business.py"
click node_features "https://github.com/smarino76/kaggriculture/blob/main/features.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_agent toneBlue
class node_financial,node_agriculture,node_inventory,node_market,node_livestock,node_features toneAmber
class node_environment toneIndigo
```

## Components

### Agent policy

- [Agent policy](https://github.com/smarino76/kaggriculture/blob/main/agent.py): `agent.py`

### State analysis

- [Financial expert](https://github.com/smarino76/kaggriculture/blob/main/experts/business.py): `experts/business.py`
- [Agriculture expert](https://github.com/smarino76/kaggriculture/blob/main/experts/business.py): `experts/business.py`
- [Inventory expert](https://github.com/smarino76/kaggriculture/blob/main/experts/business.py): `experts/business.py`
- [Market expert](https://github.com/smarino76/kaggriculture/blob/main/experts/business.py): `experts/business.py`
- [Livestock expert](https://github.com/smarino76/kaggriculture/blob/main/experts/business.py): `experts/business.py`
- [Feature extraction](https://github.com/smarino76/kaggriculture/blob/main/features.py): `features.py`

### Other components

- **Kaggriculture environment**

## Connections

- Kaggriculture environment → Agent policy: sends observation
- Agent policy → Kaggriculture environment: returns actions
- Agent policy → Financial expert: updates state
- Agent policy → Agriculture expert: updates state
- Agent policy → Inventory expert: updates state
- Agent policy → Market expert: updates state
- Agent policy → Livestock expert: updates state
- Agent policy → Livestock expert: reads debug features
