OpenViSTAI · Agents · Blockchain · Crypto
Menu
RAG & Knowledge Systems

Kg Rag

Kg Rag is an open-source research codebase that retrieves knowledge-graph context and incorporates it into large-language-model prompts for knowledge-intensive tasks. Its documented example uses the biomedical SPOKE graph and disease-focused workflows, with GPT and Llama generation options.

Independent OpenViST project profile, based on linked sources.

Kg Rag — OpenViST project profile in RAG & Knowledge Systems.
OpenViST project illustration. See the linked sources for product details.
Understand the project

Practical overview

When it fits

Use Kg Rag when you want to explore a locally configured, graph-enriched language-model workflow, particularly for disease-related biomedical questions.

Who it is for

  • Biomedical and bioinformatics researchers exploring graph-grounded language-model answers.
  • Developers who want to study or adapt a notebook-based knowledge-graph RAG workflow.
  • Technical users comfortable configuring a local Python project and its model settings.

Documented uses

  • Add biomedical knowledge-graph context to prompts about diseases.
  • Compare language-model prompting with and without retrieved graph context.
  • Run a documented GPT or Llama generation workflow from a local terminal.
  • Explore adapting graph-backed retrieval to knowledge-intensive questions in another domain.
Before you choose

Requirements & limits

The code repository is public and identifies the Apache-2.0 license.

  • The README describes the framework broadly as task-agnostic, but its run instructions say the implementation is currently designed for disease-related prompts.
  • Setup requires a local Python environment, dependencies, and configuration in config.yaml; setup creates a disease vector database.
  • The project documents GPT workflows through OpenAI or Azure and a separate Llama workflow.
  • Replacing or extending the biomedical graph is a possible adaptation, but the repository materials do not document a tested graph migration.
  • This is a research codebase with notebook and terminal workflows, rather than a documented hosted service or API.

Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.

Source-based practical guide

Set up the disease knowledge-graph data

Prepare the local repository by creating its disease vector database, with an optional Llama model download.

Before you start

  • A local Python environment; the README specifies Python 3.10.9 for its scripts.
  • The KG_RAG repository and its requirements installed.
  • A populated config.yaml file.

Steps

  1. Clone the repository and enter its directory.

  2. Create and activate a Python 3.10.9 environment.

  3. Install dependencies with pip install -r requirements.txt.

  4. Update config.yaml with the required local configuration.

  5. From the KG_RAG directory, run python -m kg_rag.run_setup and follow the interactive setup; choose whether to download Llama.

Expected outcome

The setup script creates the disease vector database; downloading Llama is optional.

Guide limitations

  • The README says the implementation is currently designed for disease-related prompts.
  • This setup recipe does not run a generation prompt.
Source-based practical guide

Run a GPT-based KG-RAG prompt from the terminal

Use the repository's documented GPT text-generation entry point after completing setup and configuration.

Before you start

  • A configured KG_RAG checkout with dependencies installed and setup completed.
  • GPT_API_TYPE configured for OpenAI or Azure, as indicated in the README.
  • A GPT model selection supported by the documented command examples.

Steps

  1. From the KG_RAG directory, select the OpenAI or Azure GPT_API_TYPE configuration.

  2. Run the documented kg_rag.rag_based_generation.GPT.text_generation module with the -g argument and a supported model name, such as gpt-4 or the README's provider-specific GPT-3.5 Turbo name.

  3. For the documented interactive mode, add -i True to the command.

Expected outcome

The repository starts its GPT-based generation workflow; interactive mode lets the user go through each process step interactively.

Guide limitations

  • The README's run instructions describe a disease-focused implementation.
  • The documented generation example is a local terminal workflow, not a hosted chat service.
Evidence and transparency

Sources & review

Source record details
Source availability
Active
Sources checked
15 October 2026
Original website title
BaranziniLab/KG_RAG · Official homepage title · retained in its source language