Newer
Older
A tool that uses Large Language Models to assist users in generating meaningful queries for knowledge graphs based on their schema and natural language input.
## Table of Contents
- [Description](#introduction)
- [Features](#features)
- [Getting Started](#getting-started)
- [Prerequisites](#prerequisites)
- [Installation](#installation)
- [Usage](#usage)
- [Support](#support)
- [Contributing](#contributing)
- [License](#license)
- [Author](#authors-and-acknowledgement)
## Description
The **LLM Query Recommender** simplifies querying knowledge graphs by leveraging Large Language Models (LLMs).
Designed to bridge the gap between technical experts and non-expert users, this tool allows users to interact with complex knowledge graphs using natural language.
The system interprets user intents, generates schema-compliant queries, and validates their correctness through automated evaluation methods.
This project aims to democratize access to knowledge graphs, enabling anyone to explore data effortlessly.
## Features
- **Natural language input**: Accepts plain language queries and generates schema-compliant Cypher queries.
- **Automated validation**:
- **Schema compliance check**: Ensures syntactic validity against the graph’s schema.
- **Self-checking**: Validates query correctness using an LLM.
- **Semantic re-interpretation**: Compares query alignment with user intent using semantic similarity metrics.
- **Customizable and scalable**: Built in Python, optimized for GPU, and easily configurable for different schemas and LLMs.
- **Experimentation support**: Facilitates testing across varying prompt complexities and schemas.
## Getting Started
### Prerequisites
- **Knowledge graph schema**: A schema JSON format file of the knowledge graph you wish to query (3 are included in repository)
### Installation
1. **Clone the repository**
```
git clone https://git.science.uu.nl/graphpolaris/experiments/llm-query-recommender.git
cd llm-query-recommender
```
2. **Install dependencies**
```
pip install -r requirements.txt
```
## Usage
1. **Prepare the knowledge graph schema**
Ensure you have the schema of the knowledge graph available. (3 example schemas in ./schema)
2. **Save prompts in Excel**
Write your prompts in the following file and give them a difficulty.
```
experimentation/queries.xlsx
```
3. **Specify schema**
Edit the desirable schema path in the following file.
```
user_input.json
```
4. **Run the application**
```
python main.py
```
For support contact me at tvandermeijden at students dot uu dot nl
Contributions are always welcome. If you have suggestions or found a bug, open an issue or submit a pull request.
T.B.D.
- **Thijmen van der Meijden**