DB-GPT icon indicating copy to clipboard operation
DB-GPT copied to clipboard

feat: add GraphRAG framework and integrate TuGraph

Open fanzhidongyzby opened this issue 9 months ago • 3 comments

Issue: https://github.com/eosphoros-ai/DB-GPT/issues/1505

fanzhidongyzby avatar May 09 '24 11:05 fanzhidongyzby

hi, @fanzhidongyzby ,Graph RAG is an amazing feature, could you give some use cases?

Aries-ckt avatar May 09 '24 15:05 Aries-ckt

hi, @fanzhidongyzby ,Graph RAG is an amazing feature, could you give some use cases?

@Aries-ckt Subsequent documentation sections illustrate the use and workflow of Graph RAG with examples.

fanzhidongyzby avatar May 10 '24 14:05 fanzhidongyzby

Here are tests for Graph RAG framework:

  • [Triplet/Keyword Extractor Test]: tests/intetration_tests/transformer/test_extactor.py
  • [MemoryGraph Test]: tests/unit_tests/graph/test_graph.py
  • [MemoryGraphStore Test]: tests/intetration_tests/graph_store/test_memgraph_store.py
  • [TuGraphStore Test]: tests/intetration_tests/graph_store/test_tugraph_store.py
  • [Graph RAG Example]: examples/rag/graph_rag_example.py

fanzhidongyzby avatar May 15 '24 12:05 fanzhidongyzby

In this PR, we have implemented the ability to use the TuGraph database for retrieval-augmented generation (RAG). This feature is currently integrated into the Chat Knowledge module. TuGraph is supported from Version 4.3.0 and above.

When creating a knowledge base, users can choose between the following two storage types:

Knowledge Graph Vector Store Different storage types will have corresponding icons displayed in the frontend.

If the user chooses to create a knowledge base of the Knowledge Graph type and successfully creates it, they can click the "View Graph" button to view the graph of the current knowledge base.

Additionally, users can obtain relevant knowledge content through the Chat Knowledge conversation feature.

  1. Create Knowledge create_knowledge_graph

  2. Knowledge Graph and Open Graph Visual view_graph

  3. Graph Visual Page graph_data

  4. Chat Knowledge By Graph graph_rag_chat

KingSkyLi avatar May 16 '24 05:05 KingSkyLi

为什么我这边输入文档是中文,生成的却是英文的Graph?

sophiesun333 avatar Jul 02 '24 11:07 sophiesun333

@sophiesun333

The reasoning of the large model has certain uncertainties. The default prompt words of the current system are still in English. Before the release, we conducted document tests in both Chinese and English. For your situation, it is recommended to try again or contribute a pr to provide the ability to switch Chinese prompt words.

fanzhidongyzby avatar Jul 03 '24 02:07 fanzhidongyzby

Given its unreliability, can we have a conversation on DB-GPT by loading a subgraph which has constructed on Tugraph?

sophiesun333 avatar Jul 08 '24 02:07 sophiesun333

@sophiesun333 This demand can be realized. When DB-GPT loads documents into TuGraph, it will detect whether the Graph name exists. If it exists, it will be automatically merged. Of course, doing this is indeed a little tricky. You still need to understand the structure of the current text graph (although it is very simple). The best way is to directly provide the ability to introduce the existing graph from the product side. If you are interested, welcome to discuss and build together.

fanzhidongyzby avatar Jul 08 '24 02:07 fanzhidongyzby

I suggest directly provide the ability to introduce the existing graph from the product side。 I attempted to use GLM-4-9B-CHAT to import the knowledge graph generated from text, which was not correct, resulting in knowledge-based conversations not being able to answer my questions correctly. So I hope to provide the ability to build dialogues based on user generated knowledge graphs.

sophiesun333 avatar Jul 08 '24 04:07 sophiesun333