Back to directory

K-RagRec

A PyTorch implementation, from an ACL paper, of knowledge-graph retrieval-augmented generation for LLM-based recommendation, evaluated on MovieLens and Amazon Book datasets.

K-RagRec

K-RagRec is the official research code for a paper on using knowledge-graph retrieval to improve large-language-model-based recommendation. It processes a knowledge graph for a chosen dataset, builds corresponding knowledge vector databases, retrieves relevant knowledge sub-graphs for a given user or item, re-ranks them, and feeds the result into a graph-aware LLM recommender for training and evaluation.

The repository provides training and evaluation scripts with configurable parameters such as the adaptive ratio, number of retrieved sub-graphs and number of re-ranked sub-graphs, and ships processed data and knowledge graphs for MovieLens-1M, with raw data provided for MovieLens-20M and Amazon Book so they can be processed the same way. Experiments were run on two NVIDIA A6000 GPUs, with a separate code path provided for a single-GPU setup; it requires Python 3.9 with specific pinned versions of PyTorch, Transformers, NetworkX and PEFT.

More in RAG

See all 540
  • ai·rete·rag

    ai-rete-rag.com

    A platform that pairs a Rete rule engine with retrieval-augmented generation, so deterministic rules decide an outcome and grounded retrieval explains the decision in plain language.

  • Xtriever

    github.com

    A hybrid retrieval engine for retrieval-augmented generation, written in Rust to run on-device on a phone or a laptop, combining lexical BM25 search, dense embedding search, reciprocal-rank fusion and cross-encoder re-ranking with no server.

  • FileFlux

    github.com

    A .NET library that turns PDF, DOCX, HWP and other documents into optimized chunks for RAG systems, through a five-stage pipeline built on high-performance Rust FFI readers.