# rllm-team/rllm architecture

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

- Interactive diagram: https://gitdiagram.com/rllm-team/rllm
- Repository: https://github.com/rllm-team/rllm

## Overview

rLLM is a PyTorch library for relational table learning, combining standardized graph, table, and LLM-oriented modules to build and train learning methods. A typical user workflow is to select a dataset, represent and transform its relational data, then use loaders and model components for learning. Major branches also include standalone graph/table architectures and LLM-assisted feature engineering and retrieval. The README documents these capabilities; sampled source confirms the storage, LLM adapter, retrieval, and feature-engineering details, but not the wiring of every model or data stage.

Main entry points: [`rllm/llm/llm_module/retrieval/retrieval_llm.py`](https://github.com/rllm-team/rllm/blob/main/rllm/llm/llm_module/retrieval/retrieval_llm.py) (Retrieval prediction), [`rllm/llm/llm_module/featllm/feat_engineer.py`](https://github.com/rllm-team/rllm/blob/main/rllm/llm/llm_module/featllm/feat_engineer.py) (Feature engineering), [`rllm/llm/llm_module/langchain_llm.py`](https://github.com/rllm-team/rllm/blob/main/rllm/llm/llm_module/langchain_llm.py) (LangChain adapter), [`rllm/llm/llm_module/featllm/feat_llm.py`](https://github.com/rllm-team/rllm/blob/main/rllm/llm/llm_module/featllm/feat_llm.py) (FeatLLM training)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_data["Data and loading"]
  node_datasets["Datasets"]
  node_data_types["Graph and tables"]
  node_loaders["Data loaders"]
  node_sampling["Neighbor sampling"]
end

subgraph group_prep["Preparation"]
  node_preprocessing["Preprocessing"]
  node_table_transforms["Table transforms"]
  node_graph_transforms["Graph transforms"]
end

subgraph group_models["Learning models"]
  node_encoders["Feature encoders"]
  node_table_convs["Table networks"]
  node_graph_convs["Graph networks"]
  node_model_zoo["RTL and task models"]
  node_losses["Learning losses"]
end

subgraph group_llm["LLM workflows"]
  node_feat_engineer["Feature engineering<br/>[feat_engineer.py]"]
  node_feat_llm["FeatLLM training<br/>[feat_llm.py]"]
  node_retrieval_llm["Retrieval prediction<br/>[retrieval_llm.py]"]
  node_retriever["Table retriever<br/>[retriever.py]"]
  node_llm_api["LLM interface<br/>[general_llm.py]"]
  node_langchain["LangChain adapter<br/>[langchain_llm.py]"]
end

subgraph group_runtime["Shared runtime"]
  node_storage["Data storage<br/>[storage.py]"]
end

node_user(("Library user"))
node_external_llm(("Language model"))

node_user -->|"selects data"| node_datasets
node_user -->|"chooses method"| node_model_zoo
node_feat_llm -->|"generates features"| node_feat_engineer
node_retrieval_llm -->|"retrieves examples"| node_retriever
node_retrieval_llm -->|"queries"| node_external_llm
node_feat_engineer -->|"queries"| node_external_llm
node_llm_api -->|"adapts through"| node_langchain
node_langchain -->|"invokes"| node_external_llm

click node_datasets "https://github.com/rllm-team/rllm/tree/main/rllm/datasets"
click node_data_types "https://github.com/rllm-team/rllm/tree/main/rllm/data"
click node_loaders "https://github.com/rllm-team/rllm/tree/main/rllm/dataloader"
click node_sampling "https://github.com/rllm-team/rllm/tree/main/rllm/dataloader/sampler"
click node_preprocessing "https://github.com/rllm-team/rllm/tree/main/rllm/preprocessing"
click node_table_transforms "https://github.com/rllm-team/rllm/tree/main/rllm/transforms/table_transforms"
click node_graph_transforms "https://github.com/rllm-team/rllm/tree/main/rllm/transforms/graph_transforms"
click node_encoders "https://github.com/rllm-team/rllm/tree/main/rllm/nn/encoder"
click node_table_convs "https://github.com/rllm-team/rllm/tree/main/rllm/nn/conv/table_conv"
click node_graph_convs "https://github.com/rllm-team/rllm/tree/main/rllm/nn/conv/graph_conv"
click node_model_zoo "https://github.com/rllm-team/rllm/tree/main/rllm/nn/models"
click node_losses "https://github.com/rllm-team/rllm/tree/main/rllm/nn/loss"
click node_feat_engineer "https://github.com/rllm-team/rllm/blob/main/rllm/llm/llm_module/featllm/feat_engineer.py"
click node_feat_llm "https://github.com/rllm-team/rllm/blob/main/rllm/llm/llm_module/featllm/feat_llm.py"
click node_retrieval_llm "https://github.com/rllm-team/rllm/blob/main/rllm/llm/llm_module/retrieval/retrieval_llm.py"
click node_retriever "https://github.com/rllm-team/rllm/blob/main/rllm/llm/llm_module/retrieval/retriever.py"
click node_llm_api "https://github.com/rllm-team/rllm/blob/main/rllm/llm/llm_module/general_llm.py"
click node_langchain "https://github.com/rllm-team/rllm/blob/main/rllm/llm/llm_module/langchain_llm.py"
click node_storage "https://github.com/rllm-team/rllm/blob/main/rllm/data/storage.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_datasets,node_data_types,node_loaders,node_sampling,node_user toneBlue
class node_preprocessing,node_table_transforms,node_graph_transforms toneAmber
class node_encoders,node_table_convs,node_graph_convs,node_model_zoo,node_losses toneMint
class node_feat_engineer,node_feat_llm,node_retrieval_llm,node_retriever,node_llm_api,node_langchain toneRose
class node_storage,node_external_llm toneIndigo
```

## Components

### Data and loading

- [Datasets](https://github.com/rllm-team/rllm/tree/main/rllm/datasets): `rllm/datasets`
- [Graph and tables](https://github.com/rllm-team/rllm/tree/main/rllm/data): `rllm/data`
- [Data loaders](https://github.com/rllm-team/rllm/tree/main/rllm/dataloader): `rllm/dataloader`
- [Neighbor sampling](https://github.com/rllm-team/rllm/tree/main/rllm/dataloader/sampler): `rllm/dataloader/sampler`

### Preparation

- [Preprocessing](https://github.com/rllm-team/rllm/tree/main/rllm/preprocessing): `rllm/preprocessing`
- [Table transforms](https://github.com/rllm-team/rllm/tree/main/rllm/transforms/table_transforms): `rllm/transforms/table_transforms`
- [Graph transforms](https://github.com/rllm-team/rllm/tree/main/rllm/transforms/graph_transforms): `rllm/transforms/graph_transforms`

### Learning models

- [Feature encoders](https://github.com/rllm-team/rllm/tree/main/rllm/nn/encoder): `rllm/nn/encoder`
- [Table networks](https://github.com/rllm-team/rllm/tree/main/rllm/nn/conv/table_conv): `rllm/nn/conv/table_conv`
- [Graph networks](https://github.com/rllm-team/rllm/tree/main/rllm/nn/conv/graph_conv): `rllm/nn/conv/graph_conv`
- [RTL and task models](https://github.com/rllm-team/rllm/tree/main/rllm/nn/models): `rllm/nn/models`
- [Learning losses](https://github.com/rllm-team/rllm/tree/main/rllm/nn/loss): `rllm/nn/loss`

### LLM workflows

- [Feature engineering](https://github.com/rllm-team/rllm/blob/main/rllm/llm/llm_module/featllm/feat_engineer.py): `rllm/llm/llm_module/featllm/feat_engineer.py`
- [FeatLLM training](https://github.com/rllm-team/rllm/blob/main/rllm/llm/llm_module/featllm/feat_llm.py): `rllm/llm/llm_module/featllm/feat_llm.py`
- [Retrieval prediction](https://github.com/rllm-team/rllm/blob/main/rllm/llm/llm_module/retrieval/retrieval_llm.py): `rllm/llm/llm_module/retrieval/retrieval_llm.py`
- [Table retriever](https://github.com/rllm-team/rllm/blob/main/rllm/llm/llm_module/retrieval/retriever.py): `rllm/llm/llm_module/retrieval/retriever.py`
- [LLM interface](https://github.com/rllm-team/rllm/blob/main/rllm/llm/llm_module/general_llm.py): `rllm/llm/llm_module/general_llm.py`
- [LangChain adapter](https://github.com/rllm-team/rllm/blob/main/rllm/llm/llm_module/langchain_llm.py): `rllm/llm/llm_module/langchain_llm.py`

### Shared runtime

- [Data storage](https://github.com/rllm-team/rllm/blob/main/rllm/data/storage.py): `rllm/data/storage.py`

### Other components

- **Library user**
- **Language model**

## Connections

- Library user → Datasets: selects data
- Library user → RTL and task models: chooses method
- FeatLLM training → Feature engineering: generates features
- Retrieval prediction → Table retriever: retrieves examples
- Retrieval prediction → Language model: queries
- Feature engineering → Language model: queries
- LLM interface → LangChain adapter: adapts through
- LangChain adapter → Language model: invokes
