This repository implements Retrieval-Augmented Generation (RAG) for GPSR (General Purpose Service Robot) tasks.
git clone https://github.com/lcas/rag_gpsr.git
cd rag_gpsr
pip install -r requirements.txt #Tested with Python 3.10.12The scripts require ollama server to be running at the local machine at localhost:11434 (default port)
curl -fsSL https://ollama.com/install.sh | sh
ollama serve
For latest info please see : Ollama
ollama pull llama3.2
Any model could be pulled and used, but specify inside rag_gpsr.py
cd rag_gpsr/docker
./build-docker.sh
./run-docker.sh
This opens a container with all requirements installed.
Once inside the docker, go to
cd /home/rag_gpsr/rag_gpsr
and follow the instructions below
Build the vector database with
cd db
python vector_embedding.pyWait till the embedding is built, and then run the following with your task.
python rag_gpsr.py "<task>"from rag_gpsr import RAG_GPSR
query = "<task>"
gpsr_instance = RAG_GPSR()
output_func = gpsr_instance.handle_query(query)
#To execute the function
exec(output_func)By Default, the dataset corresponds to a copy of RoboCup Data inside db/data
The Files maps/location_names.md ,maps/room_names.md and objects/objects.md are markdown files which can be modified (or added) as per requirements.
The Robot capabilities can be modified (or added) inside utils/capabilities.py by defining the functions within the file. Though most of the current implementations assume the existence of primitive actions that are called inside each of the defined functions, independent functions and capabilities can be defined.
After any change to the configurations, the vector database needs to be rebuilt with Configure Settings
If you use this repository in your research, please cite the following paper:
@article{Attenborough2025,
author = "Eden Attenborough and Hariharan Arunachalam and Juan Pablo Vasconez and Francesco Del Duchetto and Riccardo Polvara and Leonardo Guevara",
title = "{A Retrieval Augmented Generation Approach for Planning on General Purpose Service Robots}",
booktitle={Advanced Research in Technologies, Information, Innovation and Sustainability (ARTIIS)},
year = "2025"
}The dataset used in the paper above, including GPSR command list, environmental information, robot capabilities, manually labeled task decompositions, and benchmark results from experiments, can be found in Paper_Dataset.xlsx
Pull requests are welcome. For major changes, please open an issue first.