Skip to content

feat: initialize rag based on HugeGraph#20

Merged
simon824 merged 5 commits intoapache:mainfrom
Ling-Yuchen:graph-rag
Oct 26, 2023
Merged

feat: initialize rag based on HugeGraph#20
simon824 merged 5 commits intoapache:mainfrom
Ling-Yuchen:graph-rag

Conversation

@Ling-Yuchen
Copy link
Copy Markdown
Contributor

@Ling-Yuchen Ling-Yuchen commented Oct 20, 2023

close #19
Feature: utilize relevant data in the graph database as context for llm to response to the natural langauge query (RAG).

Steps involved:

  1. Extract keywords: extract and expand the keyword set from the query sentence by llm
  2. Query graph: get center nodes by matching keywords, extract a sub-graph with a certain deep as "knowledge"
  3. Synthesize answer: get answer from llm through the original query and knowledge from graph

All the data required and generated in the whole process is transfered through a dict "context", explained in examples/graph_rag_test.py.

Copy link
Copy Markdown

@javeme javeme left a comment

Choose a reason for hiding this comment

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

LGTM

@simon824 simon824 merged commit 31b1720 into apache:main Oct 26, 2023
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.

[Feature] rag based on HugeGraph

3 participants