Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Enabling Natural Language Graph Queries in GraphScope with chatGPT #2648 #3271

Merged
merged 13 commits into from
Oct 27, 2023

Conversation

Suchun-sv
Copy link
Contributor

What do these changes do?

[TL;DR] We add LLM support to enhance the basic graph queries, allowing users to interact with graphs more casually.

Specifically, the detailed steps can be shown as:

  1. Using the Langchain to send natural language sentences to LLM (chatGPT, chatGLM, and so on) with manually designed prompts.
  2. Adding the schema of graphs to form more expected results from LLM.
  3. Extract Cypher statements from the results.
  4. Running Cypher on the Graphs through the Cypher interactive backend.
  5. Return results from the backend.

Our contribution can be summarized as:

1. Well-designed Langchain pipeline as well as prompt templates (langchain_cypher.py).
2. Exposed the query interface (query.py::query_to_cypher).

Related issue number

We are related to the issue #2648

Fixes

@welcome
Copy link

welcome bot commented Sep 28, 2023

Thanks for submitting your first pull request! You are awesome! 🤗
Please make sure you have signed the CLA, as this is a mandatory check before a PR being merged.
Welcome to the GraphScope community! 🎉 You can meet the community on DingTalk or Slack.

@CLAassistant
Copy link

CLAassistant commented Sep 28, 2023

CLA assistant check
All committers have signed the CLA.

@longbinlai longbinlai self-requested a review October 20, 2023 07:38
@Suchun-sv Suchun-sv changed the title [FEATURE-2648] Enabling Natural Language Graph Queries in GraphScope with chatGPT [feat-2648] Enabling Natural Language Graph Queries in GraphScope with chatGPT Oct 21, 2023
@Suchun-sv Suchun-sv changed the title [feat-2648] Enabling Natural Language Graph Queries in GraphScope with chatGPT feat: Enabling Natural Language Graph Queries in GraphScope with chatGPT #2648 Oct 21, 2023
@codecov-commenter
Copy link

codecov-commenter commented Oct 23, 2023

Codecov Report

Merging #3271 (0d75359) into main (4d3a83e) will decrease coverage by 0.35%.
Report is 2 commits behind head on main.
The diff coverage is 0.00%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3271      +/-   ##
==========================================
- Coverage   41.39%   41.04%   -0.35%     
==========================================
  Files         107      109       +2     
  Lines       11203    11298      +95     
==========================================
  Hits         4637     4637              
- Misses       6566     6661      +95     
Files Coverage Δ
python/graphscope/langchain_prompt/query.py 0.00% <0.00%> (ø)
...on/graphscope/langchain_prompt/langchain_cypher.py 0.00% <0.00%> (ø)

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1942a67...0d75359. Read the comment docs.

Copy link
Collaborator

@longbinlai longbinlai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@longbinlai longbinlai merged commit 23809be into alibaba:main Oct 27, 2023
42 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants