# aluro7in/acme architecture

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

- Interactive diagram: https://gitdiagram.com/aluro7in/acme
- Repository: https://github.com/aluro7in/acme

## Overview

Acme is a reinforcement-learning research framework offering reusable agents and components, with both single-stream and distributed use documented in the README. The main workflow is environment interaction through an actor, optional trajectory recording and replay sampling, then learner updates; evaluation and experiment orchestration surround that loop. The graph retains major JAX and TensorFlow agent families, environment preprocessing, offline datasets, and centralized inference. Some subsystem links are documentation- or index-supported because their implementations were not sampled; uncertain wiring is omitted.

Main entry points: [`acme/environment_loop.py`](https://github.com/aluro7in/acme/blob/master/acme/environment_loop.py) (Environment loop), [`acme/agents`](https://github.com/aluro7in/acme/tree/master/acme/agents) (Agent algorithms), [`acme/wrappers`](https://github.com/aluro7in/acme/tree/master/acme/wrappers) (Environment wrappers), [`acme/core.py`](https://github.com/aluro7in/acme/blob/master/acme/core.py) (Learner interface)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interaction["Environment interaction"]
  node_wrappers["Environment wrappers"]
  node_atari["Atari preprocessing<br/>[atari_wrapper.py]"]
  node_loop["Environment loop"]
  node_actor["Actor interface<br/>[core.py]"]
end

subgraph group_learning["Agents and learning"]
  node_agents["Agent algorithms"]
  node_jaxagents["JAX agents"]
  node_tfagents["TensorFlow agents"]
  node_learner["Learner interface<br/>[core.py]"]
  node_networks["JAX networks"]
end

subgraph group_data["Replay and datasets"]
  node_adder["Adder interface<br/>[base.py]"]
  node_reverbadders["Reverb adders"]
  node_replay[("Replay service")]
  node_reverbdata["Reverb datasets<br/>[reverb.py]"]
  node_datasets["Offline datasets"]
end

subgraph group_runtime["Runtime services"]
  node_specs["Environment specs<br/>[specs.py]"]
  node_counter["Counters<br/>[counting.py]"]
  node_logger["Logging"]
  node_inference["Inference server"]
  node_variables["Variable source<br/>[core.py]"]
end

node_researcher(("Researcher"))
node_environment["Environment"]

node_researcher -->|"selects algorithms"| node_agents
node_environment -.->|"is adapted by"| node_wrappers
node_wrappers -.->|"provides environment"| node_loop
node_atari -->|"uses wrapper base"| node_wrappers
node_atari -->|"uses frame stacking"| node_wrappers
node_loop -->|"steps"| node_environment
node_loop -->|"calls actor"| node_actor
node_actor -.->|"implemented by"| node_agents
node_agents -.->|"includes"| node_jaxagents
node_agents -.->|"includes"| node_tfagents
node_jaxagents -.->|"implements learning"| node_learner
node_jaxagents -->|"uses networks"| node_networks
node_loop -->|"updates counts"| node_counter
node_loop -->|"logs results"| node_logger
node_loop -.->|"reads environment specs"| node_specs
node_actor -.->|"records experience"| node_adder
node_adder -->|"implemented by"| node_reverbadders
node_reverbadders -->|"writes trajectories"| node_replay
node_replay -->|"supplies samples"| node_reverbdata
node_reverbdata -.->|"provides batches"| node_learner
node_datasets -.->|"provides offline data"| node_learner
node_learner -->|"publishes variables"| node_variables
node_variables -->|"supplies parameters"| node_inference

click node_wrappers "https://github.com/aluro7in/acme/tree/master/acme/wrappers"
click node_atari "https://github.com/aluro7in/acme/blob/master/acme/wrappers/atari_wrapper.py"
click node_loop "https://github.com/aluro7in/acme/blob/master/acme/environment_loop.py"
click node_actor "https://github.com/aluro7in/acme/blob/master/acme/core.py"
click node_agents "https://github.com/aluro7in/acme/tree/master/acme/agents"
click node_jaxagents "https://github.com/aluro7in/acme/tree/master/acme/agents/jax"
click node_tfagents "https://github.com/aluro7in/acme/tree/master/acme/agents/tf"
click node_learner "https://github.com/aluro7in/acme/blob/master/acme/core.py"
click node_networks "https://github.com/aluro7in/acme/tree/master/acme/jax/networks"
click node_specs "https://github.com/aluro7in/acme/blob/master/acme/specs.py"
click node_adder "https://github.com/aluro7in/acme/blob/master/acme/adders/base.py"
click node_reverbadders "https://github.com/aluro7in/acme/tree/master/acme/adders/reverb"
click node_reverbdata "https://github.com/aluro7in/acme/blob/master/acme/datasets/reverb.py"
click node_datasets "https://github.com/aluro7in/acme/tree/master/acme/datasets"
click node_counter "https://github.com/aluro7in/acme/blob/master/acme/utils/counting.py"
click node_logger "https://github.com/aluro7in/acme/tree/master/acme/utils/loggers"
click node_inference "https://github.com/aluro7in/acme/blob/master/acme/jax/inference_server.py"
click node_variables "https://github.com/aluro7in/acme/blob/master/acme/core.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_wrappers,node_atari,node_loop,node_actor toneBlue
class node_agents,node_jaxagents,node_tfagents,node_learner,node_networks toneAmber
class node_adder,node_reverbadders,node_replay,node_reverbdata,node_datasets toneMint
class node_specs,node_counter,node_logger,node_inference,node_variables toneRose
class node_researcher,node_environment toneIndigo
```

## Components

### Environment interaction

- [Environment wrappers](https://github.com/aluro7in/acme/tree/master/acme/wrappers): `acme/wrappers`
- [Atari preprocessing](https://github.com/aluro7in/acme/blob/master/acme/wrappers/atari_wrapper.py): `acme/wrappers/atari_wrapper.py`
- [Environment loop](https://github.com/aluro7in/acme/blob/master/acme/environment_loop.py): `acme/environment_loop.py`
- [Actor interface](https://github.com/aluro7in/acme/blob/master/acme/core.py): `acme/core.py`

### Agents and learning

- [Agent algorithms](https://github.com/aluro7in/acme/tree/master/acme/agents): `acme/agents`
- [JAX agents](https://github.com/aluro7in/acme/tree/master/acme/agents/jax): `acme/agents/jax`
- [TensorFlow agents](https://github.com/aluro7in/acme/tree/master/acme/agents/tf): `acme/agents/tf`
- [Learner interface](https://github.com/aluro7in/acme/blob/master/acme/core.py): `acme/core.py`
- [JAX networks](https://github.com/aluro7in/acme/tree/master/acme/jax/networks): `acme/jax/networks`

### Replay and datasets

- [Adder interface](https://github.com/aluro7in/acme/blob/master/acme/adders/base.py): `acme/adders/base.py`
- [Reverb adders](https://github.com/aluro7in/acme/tree/master/acme/adders/reverb): `acme/adders/reverb`
- **Replay service**
- [Reverb datasets](https://github.com/aluro7in/acme/blob/master/acme/datasets/reverb.py): `acme/datasets/reverb.py`
- [Offline datasets](https://github.com/aluro7in/acme/tree/master/acme/datasets): `acme/datasets`

### Runtime services

- [Environment specs](https://github.com/aluro7in/acme/blob/master/acme/specs.py): `acme/specs.py`
- [Counters](https://github.com/aluro7in/acme/blob/master/acme/utils/counting.py): `acme/utils/counting.py`
- [Logging](https://github.com/aluro7in/acme/tree/master/acme/utils/loggers): `acme/utils/loggers`
- [Inference server](https://github.com/aluro7in/acme/blob/master/acme/jax/inference_server.py): `acme/jax/inference_server.py`
- [Variable source](https://github.com/aluro7in/acme/blob/master/acme/core.py): `acme/core.py`

### Other components

- **Researcher**
- **Environment**

## Connections

- Researcher → Agent algorithms: selects algorithms
- Environment → Environment wrappers: is adapted by
- Environment wrappers → Environment loop: provides environment
- Atari preprocessing → Environment wrappers: uses wrapper base (evidence: `acme/wrappers/atari_wrapper.py`)
- Atari preprocessing → Environment wrappers: uses frame stacking (evidence: `acme/wrappers/atari_wrapper.py`)
- Environment loop → Environment: steps (evidence: `acme/environment_loop.py`)
- Environment loop → Actor interface: calls actor (evidence: `acme/environment_loop.py`)
- Actor interface → Agent algorithms: implemented by
- Agent algorithms → JAX agents: includes (evidence: `acme/agents/jax/mpo/learning.py`)
- Agent algorithms → TensorFlow agents: includes (evidence: `acme/agents/tf/mcts/search.py`)
- JAX agents → Learner interface: implements learning
- JAX agents → JAX networks: uses networks (evidence: `acme/agents/jax/mpo/networks.py`)
- Environment loop → Counters: updates counts (evidence: `acme/environment_loop.py`)
- Environment loop → Logging: logs results (evidence: `acme/environment_loop.py`)
- Environment loop → Environment specs: reads environment specs
- Actor interface → Adder interface: records experience
- Adder interface → Reverb adders: implemented by (evidence: `acme/adders/reverb/base.py`)
- Reverb adders → Replay service: writes trajectories (evidence: `acme/adders/reverb/structured.py`)
- Replay service → Reverb datasets: supplies samples (evidence: `acme/datasets/reverb.py`)
- Reverb datasets → Learner interface: provides batches
- Offline datasets → Learner interface: provides offline data
- Learner interface → Variable source: publishes variables (evidence: `acme/core.py`)
- Variable source → Inference server: supplies parameters (evidence: `acme/jax/inference_server.py`)
