Giter VIP home page Giter VIP logo

lemming's Introduction

Lemming

IBM Reagraph AI AI AI


This repository hosts the source code for Lemming: A Guided Disambiguation Tool for Plan Selection. Lemming makes use of landmarks to proactively guide the user to select a plan from a set of plans while greedily minimizing the number of disambiguation points. It also provides multiple views into the set of plans that need to be disambiguated, reflecting different considerations for the user in terms of how much information they need to deal with during the disambiguation process.

๐Ÿ† The first Lemming appears in the ICAPS 2023 System Demonstration Track in Prague, where its integration with the NL2LTL package was the runners-up for the People's Choice Best System Demonstration Award. Read more about it here.

Run Docker Images

Pull down the repository.

user:~$ git clone [email protected]:IBM/lemming.git --recursive
user:~$ cd lemming

Build a front-end image.

user:~$ yarn install
user:~$ yarn build

To build a Backend image, pip can be configured with pip.conf at the project root. This is to go around sporadic python index server issues. Your OpenAI API Key (OPENAI_API_KEY) should be defined in backend.env to use NL2LTL service at the backend. For security, backend.env should be removed after the deployment.

To bring up Lemming service,

docker-compose --env-file backend.env -f docker-compose.yml up

To teardown Lemming service,

docker-compose -f docker-compose.yml down

Setting up locally

Carbon Python

Clone the repository and its submodules

user:~$ git clone [email protected]:IBM/lemming.git --recursive
user:~$ cd lemming

Change to a virtual environment

We also strongly recommend using a virtual environment, such as anaconda, for development.

user:~$ conda create --name lemming python=3.10.11
user:~$ conda activate lemming

Install Lemming Dependencies

(lemming) user:~$ pip install -e .

Use the NL2LTL integration (optional)

First, install nl2ltl and plan4past with:

(lemming) user:~$ pip install -e ".[nl2ltl]"

Then, build the symk planner with:

(lemming) user:~$ ./scripts/build-submodules.sh

(Make sure you have autoconf, automake, cmake, g++, libtool, and make pre-installed on your system).

In order to use the NL2LTL Integration, don't forget to add your OpenAI API key to your environment variables with the name OPENAI_API_KEY.

(lemming) user:~$ export OPENAI_API_KEY=<your_openai_api_key>

Start the Lemming Server

The Swagger page will show up at http://localhost:8000/docs. The OpenAPI spec can be obtained from the swagger page.

(lemming) user:~$ python -m uvicorn main:app --reload

Start the Lemming Client

user:~$ yarn install
user:~$ yarn start

Contributing

Contributions are welcome! ๐Ÿค— For instructions on setting up, go here.

You can install dev dependencies with:

(lemming) user:~$ pip install -e ".[dev]"

Citing our work

ICAPS 2023 Demonstration

download

@inproceedings{lemming,
title={{Lemming: A Guided Disambiguation Tool for Plan Selection}},
author={Jungkoo Kang and Tathagata Chakraborti and Michael Katz and Shirin Sohrabi and Francesco Fuggitti},
booktitle={ICAPS System Demonstration Track},
year={2023}}

lemming's People

Contributors

francescofuggitti avatar jkeskingvillage avatar tathagatachakraborti avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Forkers

jurisgpt-ai

lemming's Issues

Deprecation of pydot package

Something to keep an eye out for. ๐Ÿ‘€

DeprecationWarning: nx.nx_pydot.to_pydot depends on the pydot package, which has
known issues and is not actively maintained.

See https://github.com/networkx/networkx/issues/5723
  A = nx.nx_pydot.to_pydot(K5)  # conversion to pydot
DeprecationWarning: nx.nx_pydot.from_pydot depends on the pydot package, which has
known issues and is not actively maintained.

See https://github.com/networkx/networkx/issues/5723
  _ = nx.nx_pydot.from_pydot(A)  # return MultiGraph

Select by edge and not by edge name

๐Ÿž Bug

Currently, a disambiguation choice is registered by edge name and not by edge ID which while the algorithms in the backend follow ID. This needs to be consistent.

๐Ÿ’ก Feature

The implication here is that when making a selection the user is not only selecting membership but also choice. It's debatable which one is the "right" thing to do. The proposal is to put this in as a mode users can select.

For SELECT mode, this does not make much difference visually. For BUILD forward and backward, the ordered choice will fix the second issue in #41 while for unordered choice the color coding scheme needs to update to only show disambiguating choices in green.

๐Ÿ‘€ Note that the two options will have an impact on an ordered versus un-ordered plan generation scheme. This needs to be investigated further during the simulations.

Fix a bug in Build Backward flow

During the development of Lemming Simulator, an issue of Build Backward flow not being able to reduce the number of plans was identified. Fix this issue.

Issues with the HR domain

This pops up while trying to load the canned HR domain in the SELECT mode. Not sure what it is, needs investigation (hold till after after #9 is done).

Driver aborting after search
INFO:     127.0.0.1:55931 - "POST /generate_select_view HTTP/1.1" 200 OK
#wo__postjobs#   Operator not found!!!
Operator names:
#wo__update_jr_details #
#wo__postjobslinkedin #
#wo__getjobrequisitions_selector #
#wo__postjobsindeed #
#wo__getjobrequisitions #
#wo__createnewjobrequisitionexisting #
#slot-filler---hiringmanager #
#slot-filler---status_in_query_get_jrs #
#wo__approve_jrs_approve_jrs_post #
#slot-filler---recruiter #
#slot-filler---hiringmanagernote #
#slot-filler---status_in_query_create_jr #
#wo__showapprovedjrs #
#slot-filler---channelname #
Usage error occurred.
#wo__postjobs#   Operator not found!!!
Operator names:
#wo__update_jr_details #
#wo__postjobslinkedin #
#wo__getjobrequisitions_selector #
#wo__postjobsindeed #
#wo__getjobrequisitions #
#wo__createnewjobrequisitionexisting #
#slot-filler---hiringmanager #
#slot-filler---status_in_query_get_jrs #
#wo__approve_jrs_approve_jrs_post #
#slot-filler---recruiter #
#slot-filler---hiringmanagernote #
#slot-filler---status_in_query_create_jr #
#wo__showapprovedjrs #
#slot-filler---channelname #
Usage error occurred.
#wo__postjobs#   Operator not found!!!
Operator names:
#wo__update_jr_details #
#wo__postjobslinkedin #
#wo__getjobrequisitions_selector #
#wo__postjobsindeed #
#wo__getjobrequisitions #
#wo__createnewjobrequisitionexisting #
#slot-filler---hiringmanager #
#slot-filler---status_in_query_get_jrs #
#wo__approve_jrs_approve_jrs_post #
#slot-filler---recruiter #
#slot-filler---hiringmanagernote #
#slot-filler---status_in_query_create_jr #
#wo__showapprovedjrs #
#slot-filler---channelname #
Usage error occurred.
#wo__postjobs#   Operator not found!!!
Operator names:
#wo__update_jr_details #
#wo__postjobslinkedin #
#wo__getjobrequisitions_selector #
#wo__postjobsindeed #
#wo__getjobrequisitions #
#wo__createnewjobrequisitionexisting #
#slot-filler---hiringmanager #
#slot-filler---status_in_query_get_jrs #
#wo__approve_jrs_approve_jrs_post #
#slot-filler---recruiter #
#slot-filler---hiringmanagernote #
#slot-filler---status_in_query_create_jr #
#wo__showapprovedjrs #
#slot-filler---channelname #
Usage error occurred.

Symk build error

Errors are thrown during symk build. The operating system had cmake autoconf automake g++ libtool make.

#4 32.73 [  8%] Performing build step for 'libcudd'
#4 32.74 make[3]: warning: jobserver unavailable: using -j1.  Add '+' to parent make rule.
#4 32.82 make[4]: *** No rule to make target '/Users/jungkookang/Documents/projects/lemming/server/third_party/symk/src/search/ext/cudd-3.0.0/cudd/cuddAddAbs.c', needed by 'cudd/libcudd_la-cuddAddAbs.lo'.  Stop.
#4 32.82 make[3]: *** [Makefile:1044: all] Error 2
#4 32.82 make[2]: *** [search/CMakeFiles/libcudd.dir/build.make:86: search/libcudd-prefix/src/libcudd-stamp/libcudd-build] Error 2
#4 32.82 make[1]: *** [CMakeFiles/Makefile2:215: search/CMakeFiles/libcudd.dir/all] Error 2
#4 32.82 make: *** [Makefile:91: all] Error 2
#4 32.82 Building configuration release.
#4 32.82 Executing command "cmake -G Unix Makefiles -DCMAKE_BUILD_TYPE=Release ../../src" in directory "/code/server/third_party/symk/./builds/release".
#4 32.82 Executing command "make -j4" in directory "/code/server/third_party/symk/./builds/release".
#4 32.82 Traceback (most recent call last):
#4 32.82   File "/code/server/third_party/symk/./build.py", line 166, in <module>
#4 32.82     main()
#4 32.82   File "/code/server/third_party/symk/./build.py", line 162, in main
#4 32.82     build(config_name, CONFIGS[config_name], make_parameters)
#4 32.82   File "/code/server/third_party/symk/./build.py", line 139, in build
#4 32.82     try_run([MAKE] + make_parameters, cwd=build_path)
#4 32.82   File "/code/server/third_party/symk/./build.py", line 109, in try_run
#4 32.82     subprocess.check_call(cmd, cwd=cwd)
#4 32.82   File "/usr/local/lib/python3.10/subprocess.py", line 369, in check_call
#4 32.82     raise CalledProcessError(retcode, cmd)
#4 32.82 subprocess.CalledProcessError: Command '['make', '-j4']' returned non-zero exit status 2.
#4 ERROR: process "/bin/sh -c scripts/build-submodules.sh" did not complete successfully: exit code: 1

Remove deprecated OpenAI models

openai.error.InvalidRequestError: The model `text-davinci-003` 
has been deprecated, learn more here: https://platform.openai.com/docs/deprecations

Landmarks without PDDL domain

Currently, landmark-based selection choices are generated according to the theoretical definition of what is a disjunctive action landmark in classical planning problem. We can relax this assumption to any input set of plans.

  • new choice generation algorithm that gives that best set of disjunctive choices for an input set of plans
  • relax inputs on frontend so we don't need problem and domain file as necessary (so if problem and domain are there then input plans are optional OR only input plans are provided).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.