A Jev-inspired framework of decision models on knowledge and active graphs for multi-agent recommender systems
Paper · Quick start · Documentation · Models · Reproduce the paper
Decision models, such as the commercial Jev or the open Kev models, are language models that return one probability for each option of a typed question, in one forward pass and without generating text. Decision4Rec makes them usable for recommendation, with the decision model as an exchangeable part:
- a knowledge graph of the scenario, kept live on the ActiveGraph runtime, writes the logs as short statements ("sold 1,240 times", "often bought after your last item");
- a multi-agent pool, with the trained recommender of the scenario as one of the agents, proposes candidates, and a residual ranker keeps the best 30;
- a decision model reads them through one typed-question interface (the System One protocol), and a Luce model turns its answers into a ranking;
- a fusion step combines its answers with the score of the ranker.
A commercial model through its API, a released open model and a trained open model run on the same requests, and changing the decision model is one line of configuration.
Note. Decision4Rec is not affiliated with TypeSafe AI. "Jev" names the interface that inspired the framework; the framework works with any decision model that speaks the same protocol, such as the open Kev models.
- Architecture
- Results at a glance
- Installation
- Quick start
- Repository layout
- Extending Decision4Rec
- Trained models
- Reproducing the paper
- Data and licenses
- Citation
- License
| Module | Contract | Code |
|---|---|---|
| Knowledge graph of the scenario | in: logs and catalogue; out: statements on scales of the scenario | decision4rec/evidence, decision4rec/graph |
| Multi-agent pool | in: user history; out: ranked candidates and "found by" lines | decision4rec/agents/pool.py |
| Decision model | in: state and typed questions; out: one distribution per question | decision4rec/decision |
| Ranking and fusion | in: answers over random orders; out: calibrated ranking | decision4rec/operators |
The three variants studied in the paper share these modules:
| Variant | What the decision model reads |
|---|---|
| Decision4Rec-Full | the 30 best items of the multi-agent pool, with statements and "found by" lines |
| Decision4Rec-List | the 30 best items of the trained recommender (no pool) |
| Decision4Rec-KG | the 30 candidates of the knowledge graph (no trained recommender) |
Version 2 (November 2026). Confirmation on users never used in development, with the analysis plan frozen (SHA-256) before scoring. NDCG@10, full-catalogue ranking; trained Kev-9B decision model, mean of three seeds; Holm correction inside each family.
| Domain (10,000 reserved users each) | Best trained baseline (SASRecF+) | Decision4Rec-Full | vs baseline | vs its own list |
|---|---|---|---|---|
| Video Games | 0.0478 | 0.0608 | +27.2% | +9.3% |
| Musical Instruments | 0.0278 | 0.0375 | +34.8% | +7.4% |
| Steam | 0.0613 | 0.0649 | +6.0% | +8.2% |
| Industrial & Scientific (never used to train the decision model) | 0.0263 | 0.0326 | +23.9% | +8.1% |
All differences are significant after the Holm correction (p < 0.01).
Held-out scenarios. In nine scenarios that were never read (five Amazon catalogues, MovieLens-32M and MIND-small; 10,000 reserved users each), Decision4Rec-Full is 10.0 to 69.5% above the best trained baseline in eight and at its level on MIND-small (-0.9%, not significant); it is above its own list in all nine (+1.4 to +7.2%), significantly in seven. On the 3,040 MovieLens-1M users outside development it is 6.4% (plain) and 7.3% (enriched) above the best baseline, but not significantly above its own list: there the gain comes from the pool.
UniSRec. On the same users, Decision4Rec-Full is above fine-tuned UniSRec in every setting where both were run: by 14.7 to 30.6% in the four main domains, 21.5 to 52.9% in the nine held-out scenarios and 32.2 and 34.1% on MovieLens-1M (Holm p < 0.01 in all fifteen). After the time cut it is above in all four domains (+7.8 to +31.9%), but only Steam is significant.
A law of evidence. The information that a trained decision model adds to the list, in nats per choice, falls with the logarithm of the earlier purchases of the target: -0.039 to -0.095 nats per tenfold on reserved users (Holm p <= 0.002). The law holds for every trained decision model, also a plain language model trained the same way; it holds in time on a stream replayed on the ActiveGraph runtime; masking item titles costs rare targets while dropping the statements costs popular ones. A blind forecast of the size of the gain in nine held-out scenarios ordered them well but failed its pre-registered bar, and is reported as a failure.
The tables and figures of version 2 are generated from the result files in results/paper_json/ by scripts/paper_tables.py and scripts/paper_figs.py; scripts/claims_audit.py checks every number of the text against these files.
Development results of version 1 (2,000 development test users per domain)
NDCG@10 on 2,000 development test users per domain (full-catalogue ranking, leave-one-out). Industrial and Scientific is never seen when training the decision model.
| System | Video Games | Musical Instr. | Steam | Industrial & Sci. |
|---|---|---|---|---|
| Best trained baseline | 0.0622 | 0.0370 | 0.0790 | 0.0310 |
| Decision4Rec-Full, no decision model (pool + residual ranker) | 0.0730 | 0.0468 | 0.0786 | 0.0386 |
| Decision4Rec-Full, trained Kev-0.8B | 0.0741 | 0.0467 | 0.0802 | 0.0401 |
| Decision4Rec-Full, trained Kev-4B | 0.0780 | 0.0504 | 0.0801 | 0.0407 |
The contribution of the decision model grows with its size; the paper reports the full analysis, the commercial Jev, MovieLens-1M and the controls.
Decision4Rec needs Python 3.11 or newer. A GPU is needed to train the recommenders and to serve or train decision models (a 24 GB GPU is enough for Kev-0.8B and Kev-4B).
git clone https://github.com/marcopoli/decision4rec.git
cd decision4rec
bash scripts/env.sh # creates .venv with every library of the experiments
source .venv/bin/activateFor a minimal install (the framework only):
pip install -e .Optional extras: train (PyTorch), logit (Transformers, for language models read through label logits), active (ActiveGraph), dev (pytest).
Decision models are served by their own servers. For the open Kev models:
git clone https://github.com/jaredpalmer/kev.git ~/kev
cd ~/kev && uv sync --extra serve
uv run --extra serve python -m kev.serve --run jaredpalmer/kev-4b --port 8009A complete run on synthetic data, with a mock decision model, in a few minutes on a laptop:
decision4rec prepare --dataset synthetic --out data/processed/synthetic
decision4rec run --config configs/synthetic.yaml # writes runs/synthetic/synthetic_oracle/report.md
decision4rec report runs/synthetic/synthetic_oracle # recompute the report of a run folderOn a real domain, with the full architecture and a released Kev model:
bash scripts/setting.sh small data # download and prepare the datasets
bash scripts/setting.sh small retriever # train SASRecF on each domain
bash scripts/setting.sh small baselines # train the baselines
decision4rec run --config configs/small/vg_rtm.yaml --backend configs/backends/kev-4b.yamlscripts/setting.sh runs every stage of the paper, starts and stops the decision-model server, and resumes where it stopped. Run bash scripts/setting.sh small <stage> for one stage, or see docs/reproduce_the_paper.md.
decision4rec/
├── decision4rec/
│ ├── agents/ multi-agent pool, residual ranker, ActiveGraph agents
│ ├── data/ dataset format, loaders, evaluation cases, reserved users
│ ├── decision/ decision-model backends (System One, logit, mock) and cache
│ ├── eval/ metrics and paired tests
│ ├── evidence/ statements of the knowledge graph and the prompt builder
│ ├── experiments/ runner, benchmark, record export, reports
│ ├── graph/ item knowledge graph
│ ├── models/ SASRec, SASRecF and the other baselines
│ └── operators/ Luce model, block designs, ranking, risk control
├── configs/ one YAML file per experiment (small/, large/, backends/)
├── scripts/ setting.sh (all stages), env.sh, analysis and probe scripts
├── splits/ the users scored by every table (development, reserved, held-out scenarios, MovieLens-1M ranker) with SHA-256 digests
├── tests/ pytest suite
└── docs/ guides
| I want to... | Guide |
|---|---|
| run on my own dataset | docs/add_a_dataset.md |
| use another decision model (Jev, Kev, a Jev-like model, any LLM) | docs/decision_models.md |
| add an agent to the candidate pool | docs/agents.md |
| train my own decision model on real choices | docs/decision_models.md#training-a-decision-model |
The trained decision models are adapters on Qwen base models (Qwen3.5 and Qwen3.8), trained from the released Kev models on real choices of three domains (Video Games, Musical Instruments, Steam). They are published on Hugging Face:
| Model | Base | Records | Role in the paper |
|---|---|---|---|
m-polignano/decision4rec-kev-9b-all |
Qwen/Qwen3.5-9B-Base | all 34,667 | main decision model of version 2 (seed 0) |
m-polignano/decision4rec-kev-9b-all-seed1 |
Qwen/Qwen3.5-9B-Base | all 34,667 | seed 1 (law of evidence, mean of 3 seeds) |
m-polignano/decision4rec-kev-9b-all-seed2 |
Qwen/Qwen3.5-9B-Base | all 34,667 | seed 2 (law of evidence, mean of 3 seeds) |
m-polignano/decision4rec-kev-0.8b |
Qwen/Qwen3.5-0.8B-Base | all 34,667 | size table, law of evidence |
m-polignano/decision4rec-kev-4b |
Qwen/Qwen3.5-4B-Base | all 34,667 | size table, law of evidence |
m-polignano/decision4rec-kev-27b-all |
Qwen/Qwen3.8-27B | all 34,667 | size table, law of evidence |
m-polignano/decision4rec-kev-9b |
Qwen/Qwen3.5-9B-Base | same 8,000 | size table (data-matched) |
m-polignano/decision4rec-kev-27b |
Qwen/Qwen3.8-27B | same 8,000 | size table (data-matched) |
Serve one as any Kev checkpoint:
uv run --extra serve python -m kev.serve --run m-polignano/decision4rec-kev-9b-all --port 8009Every number of the paper comes from one stage of scripts/setting.sh and one report under runs/small/. For version 2, the scoring scripts write the JSON files of results/paper_json/ (confirmation: scripts/r1_score.py; law: scripts/thin_probe.py law; forecast: scripts/forecast_predict.py, scripts/l2b_score.py; stream replay on ActiveGraph: scripts/c2_stream.py, scripts/c2_score.py; mechanism: scripts/mechanism.py; accounting: scripts/accounting.py; UniSRec: scripts/b5_unisrec.py, scripts/b5_score.py; levers: scripts/fusion_table.py; cost: scripts/c6_cost.py). The mapping from tables to stages, the hardware, the run times and the random seeds are in docs/reproduce_the_paper.md. The development and test users of every domain are fixed by seeds and can be rebuilt exactly; their identifiers will also be released.
The datasets are not redistributed. scripts/setting.sh small data downloads them from their sources and prepares them:
| Dataset | Source | Terms |
|---|---|---|
| Amazon Reviews 2023 (Video Games, Musical Instruments, Industrial and Scientific) | amazon-reviews-2023.github.io | research use, see the source |
| Steam | cseweb.ucsd.edu/~wckang | research use, see the source |
| MovieLens-1M | grouplens.org | no redistribution |
The hosted Jev runs need your own key (export TYPESAFE_API_KEY=...); their answers are not distributed, as required by the TypeSafe terms of service. Decision4Rec never trains on Jev outputs.
The paper is on arXiv: arXiv:2610.26035.
@misc{polignano2026decision4rec,
title = {Decision4Rec: A Jev-Inspired Framework of Decision Models on Knowledge and Active Graphs
for Multi-Agent Recommender Systems},
author = {Polignano, Marco and Mehta, Het Darshan and Lops, Pasquale and De Luca, Ernesto William
and Semeraro, Giovanni},
year = {2026},
eprint = {2610.26035},
archivePrefix = {arXiv},
primaryClass = {cs.IR},
url = {http://arxiv.org/abs/2610.26035}
}The code is released under the Apache License 2.0. The trained models keep the licenses of their base models (Qwen3.5) and of Kev (Apache-2.0).
Decision4Rec builds on Kev, ActiveGraph, the Qwen models and the System One protocol of TypeSafe AI.
