From 1b569c9b03cce14ea7dc563cb4102692a91cde8f Mon Sep 17 00:00:00 2001 From: Florian Date: Fri, 30 Aug 2024 16:50:20 +0800 Subject: [PATCH] add ut --- examples/rag/graph_rag_example.py | 95 ++++++++++++++-------- examples/rag/graph_rag_summary_example.py | 70 ---------------- examples/test_files/graph_rag_mini.md | 97 ---------------------- examples/test_files/graphrag-mini.md | 99 ++++++++++++++++++++++- 4 files changed, 157 insertions(+), 204 deletions(-) delete mode 100644 examples/rag/graph_rag_summary_example.py delete mode 100644 examples/test_files/graph_rag_mini.md diff --git a/examples/rag/graph_rag_example.py b/examples/rag/graph_rag_example.py index 9ff47c4d4..40d5b01e3 100644 --- a/examples/rag/graph_rag_example.py +++ b/examples/rag/graph_rag_example.py @@ -3,12 +3,17 @@ import pytest from dbgpt.configs.model_config import ROOT_PATH -from dbgpt.core import ModelMessage, HumanPromptTemplate, ModelRequest, Chunk +from dbgpt.core import Chunk, HumanPromptTemplate, ModelMessage, ModelRequest from dbgpt.model.proxy.llms.chatgpt import OpenAILLMClient from dbgpt.rag import ChunkParameters from dbgpt.rag.assembler import EmbeddingAssembler +from dbgpt.rag.embedding import DefaultEmbeddingFactory from dbgpt.rag.knowledge import KnowledgeFactory from dbgpt.rag.retriever import RetrieverStrategy +from dbgpt.storage.knowledge_graph.community_summary import ( + CommunitySummaryKnowledgeGraph, + CommunitySummaryKnowledgeGraphConfig, +) from dbgpt.storage.knowledge_graph.knowledge_graph import ( BuiltinKnowledgeGraph, BuiltinKnowledgeGraphConfig, @@ -18,6 +23,14 @@ pre-requirements: * Set LLM config (url/sk) in `.env`. * Install pytest utils: `pip install pytest pytest-asyncio` + * Config TuGraph following the format below. + ``` + GRAPH_STORE_TYPE=TuGraph + TUGRAPH_HOST=127.0.0.1 + TUGRAPH_PORT=7687 + TUGRAPH_USERNAME=admin + TUGRAPH_PASSWORD=73@TuGraph + ``` Examples: ..code-block:: shell pytest -s examples/rag/graph_rag_example.py @@ -25,33 +38,60 @@ llm_client = OpenAILLMClient() model_name = "gpt-4o-mini" -rag_template = ( - "Based on the following [Context] {context}, answer [Question] {question}." -) -file = "examples/test_files/graphrag-mini.md" -question = "What is TuGraph ?" + +@pytest.mark.asyncio +async def test_naive_graph_rag(): + await __run_graph_rag( + knowledge_file="examples/test_files/graphrag-mini.md", + chunk_strategy="CHUNK_BY_SIZE", + knowledge_graph=__create_naive_kg_connector(), + question="What's the relationship between TuGraph and DB-GPT ?", + ) + + +@pytest.mark.asyncio +async def test_community_graph_rag(): + await __run_graph_rag( + knowledge_file="examples/test_files/graphrag-mini.md", + chunk_strategy="CHUNK_BY_MARKDOWN_HEADER", + knowledge_graph=__create_community_kg_connector(), + question="What's the relationship between TuGraph and DB-GPT ?", + ) -def _create_kg_connector(): +def __create_naive_kg_connector(): """Create knowledge graph connector.""" return BuiltinKnowledgeGraph( config=BuiltinKnowledgeGraphConfig( - name="graph_rag_test", + name="naive_graph_rag_test", embedding_fn=None, llm_client=llm_client, model_name=model_name, - graph_store_type='MemoryGraph' + graph_store_type="MemoryGraph", ), ) -async def chat_rag(chunk: Chunk) -> str: - template = HumanPromptTemplate.from_template(rag_template) - messages = template.format_messages( - context=chunk, - question=question +def __create_community_kg_connector(): + """Create community knowledge graph connector.""" + return CommunitySummaryKnowledgeGraph( + config=CommunitySummaryKnowledgeGraphConfig( + name="community_graph_rag_test", + embedding_fn=DefaultEmbeddingFactory.openai(), + llm_client=llm_client, + model_name=model_name, + graph_store_type="TuGraphGraph", + ), + ) + + +async def ask_chunk(chunk: Chunk, question) -> str: + rag_template = ( + "Based on the following [Context] {context}, " "answer [Question] {question}." ) + template = HumanPromptTemplate.from_template(rag_template) + messages = template.format_messages(context=chunk.content, question=question) model_messages = ModelMessage.from_base_messages(messages) request = ModelRequest(model=model_name, messages=model_messages) response = await llm_client.generate(request=request) @@ -64,38 +104,27 @@ async def chat_rag(chunk: Chunk) -> str: return response.text -@pytest.mark.asyncio -async def test_naive_graph_rag(): - file_path = os.path.join(ROOT_PATH, file) +async def __run_graph_rag(knowledge_file, chunk_strategy, knowledge_graph, question): + file_path = os.path.join(ROOT_PATH, knowledge_file).format() knowledge = KnowledgeFactory.from_file_path(file_path) - graph_store = _create_kg_connector() - try: - chunk_parameters = ChunkParameters(chunk_strategy="CHUNK_BY_SIZE") + chunk_parameters = ChunkParameters(chunk_strategy=chunk_strategy) # get embedding assembler assembler = await EmbeddingAssembler.aload_from_knowledge( knowledge=knowledge, chunk_parameters=chunk_parameters, - index_store=graph_store, + index_store=knowledge_graph, retrieve_strategy=RetrieverStrategy.GRAPH, ) await assembler.apersist() # get embeddings retriever retriever = assembler.as_retriever(1) - chunks = await retriever.aretrieve_with_scores( - question, score_threshold=0.3 - ) + chunks = await retriever.aretrieve_with_scores(question, score_threshold=0.3) # chat - print(f"{await chat_rag(chunks[0])}") - - except Exception as e: - graph_store.delete_vector_name("graph_rag_test") - raise e + print(f"{await ask_chunk(chunks[0], question)}") - -@pytest.mark.asyncio -async def test_community_graph_rag(): - pass + finally: + knowledge_graph.delete_vector_name(knowledge_graph.get_config().name) diff --git a/examples/rag/graph_rag_summary_example.py b/examples/rag/graph_rag_summary_example.py deleted file mode 100644 index f054acaa9..000000000 --- a/examples/rag/graph_rag_summary_example.py +++ /dev/null @@ -1,70 +0,0 @@ -import asyncio -import os - -from dbgpt.configs.model_config import ROOT_PATH -from dbgpt.model.proxy.llms.chatgpt import OpenAILLMClient -from dbgpt.rag import ChunkParameters -from dbgpt.rag.assembler import EmbeddingAssembler -from dbgpt.rag.knowledge import KnowledgeFactory -from dbgpt.rag.retriever import RetrieverStrategy -from dbgpt.storage.knowledge_graph.community_summary import ( - CommunitySummaryKnowledgeGraph, - CommunitySummaryKnowledgeGraphConfig, -) -from dbgpt.storage.knowledge_graph.knowledge_graph import BuiltinKnowledgeGraphConfig - -"""GraphRAG example. - pre-requirements: - * Set LLM config (url/sk) in `.env`. - * Setup/startup TuGraph from: https://github.com/TuGraph-family/tugraph-db - * Config TuGraph following the format below. - ``` - GRAPH_STORE_TYPE=TuGraph - TUGRAPH_HOST=127.0.0.1 - TUGRAPH_PORT=7687 - TUGRAPH_USERNAME=admin - TUGRAPH_PASSWORD=73@TuGraph - GRAPH_COMMUNITY_SUMMARY_ENABLED=True - ``` - Examples: - ..code-block:: shell - python examples/rag/graph_rag_summary_example.py -""" - - -def _create_kg_connector(): - """Create knowledge graph connector.""" - return CommunitySummaryKnowledgeGraph( - config=CommunitySummaryKnowledgeGraphConfig( - name="graph_rag_test", - embedding_fn=None, - llm_client=OpenAILLMClient(), - model_name="gpt-3.5-turbo", - ), - ) - - -async def main(): - file_path = os.path.join(ROOT_PATH, "examples/test_files/graph_rag_mini.md") - knowledge = KnowledgeFactory.from_file_path(file_path) - graph_store = _create_kg_connector() - chunk_parameters = ChunkParameters(chunk_strategy="CHUNK_BY_SIZE") - # get embedding assembler - assembler = await EmbeddingAssembler.aload_from_knowledge( - knowledge=knowledge, - chunk_parameters=chunk_parameters, - index_store=graph_store, - retrieve_strategy=RetrieverStrategy.GRAPH, - ) - await assembler.apersist() - # get embeddings retriever - retriever = assembler.as_retriever(3) - chunks = await retriever.aretrieve_with_scores( - "What actions has Megatron taken ?", score_threshold=0.3 - ) - print(f"embedding rag example results:{chunks}") - graph_store.delete_vector_name("graph_rag_test") - - -if __name__ == "__main__": - asyncio.run(main()) diff --git a/examples/test_files/graph_rag_mini.md b/examples/test_files/graph_rag_mini.md deleted file mode 100644 index 134e642ff..000000000 --- a/examples/test_files/graph_rag_mini.md +++ /dev/null @@ -1,97 +0,0 @@ - -# TuGraph DB项目生态图谱 -Entities: -(TuGraph-family/tugraph-db#github_repo) -(vesoft-inc/nebula#github_repo) -(PaddlePaddle/Paddle#github_repo) -(apache/brpc#github_repo) -(TuGraph-family/tugraph-web#github_repo) -(TuGraph-family/tugraph-db-client-java#github_repo) -(alibaba/GraphScope#github_repo) -(ClickHouse/ClickHouse#github_repo) -(TuGraph-family/fma-common#github_repo) -(vesoft-inc/nebula-docs-cn#github_repo) -(eosphoros-ai/DB-GPT#github_repo) -(eosphoros-ai#github_organization) -(yandex#github_organization) -(alibaba#github_organization) -(TuGraph-family#github_organization) -(baidu#github_organization) -(apache#github_organization) -(vesoft-inc#github_organization) - -Relationships: -(TuGraph-family/tugraph-db#common_developer#vesoft-inc/nebula#common_developer count 10) -(TuGraph-family/tugraph-db#common_developer#PaddlePaddle/Paddle#common_developer count 9) -(TuGraph-family/tugraph-db#common_developer#apache/brpc#common_developer count 7) -(TuGraph-family/tugraph-db#common_developer#TuGraph-family/tugraph-web#common_developer count 7) -(TuGraph-family/tugraph-db#common_developer#TuGraph-family/tugraph-db-client-java#common_developer count 7) -(TuGraph-family/tugraph-db#common_developer#alibaba/GraphScope#common_developer count 6) -(TuGraph-family/tugraph-db#common_developer#ClickHouse/ClickHouse#common_developer count 6) -(TuGraph-family/tugraph-db#common_developer#TuGraph-family/fma-common#common_developer count 6) -(TuGraph-family/tugraph-db#common_developer#vesoft-inc/nebula-docs-cn#common_developer count 6) -(TuGraph-family/tugraph-db#common_developer#eosphoros-ai/DB-GPT#common_developer count 6) -(eosphoros-ai/DB-GPT#belong_to#eosphoros-ai#belong_to) -(ClickHouse/ClickHouse#belong_to#yandex#belong_to) -(alibaba/GraphScope#belong_to#alibaba#belong_to) -(TuGraph-family/tugraph-db#belong_to#TuGraph-family#belong_to) -(TuGraph-family/tugraph-web#belong_to#TuGraph-family#belong_to) -(TuGraph-family/fma-common#belong_to#TuGraph-family#belong_to) -(TuGraph-family/tugraph-db-client-java#belong_to#TuGraph-family#belong_to) -(PaddlePaddle/Paddle#belong_to#baidu#belong_to) -(apache/brpc#belong_to#apache#belong_to) -(vesoft-inc/nebula#belong_to#vesoft-inc#belong_to) -(vesoft-inc/nebula-docs-cn#belong_to#vesoft-inc#belong_to) - - -# DB-GPT项目生态图谱 -Entities: -(eosphoros-ai/DB-GPT#github_repo) -(chatchat-space/Langchain-Chatchat#github_repo) -(hiyouga/LLaMA-Factory#github_repo) -(lm-sys/FastChat#github_repo) -(langchain-ai/langchain#github_repo) -(eosphoros-ai/DB-GPT-Hub#github_repo) -(THUDM/ChatGLM-6B#github_repo) -(langgenius/dify#github_repo) -(vllm-project/vllm#github_repo) -(QwenLM/Qwen#github_repo) -(PaddlePaddle/PaddleOCR#github_repo) -(vllm-project#github_organization) -(eosphoros-ai#github_organization) -(PaddlePaddle#github_organization) -(QwenLM#github_organization) -(THUDM#github_organization) -(lm-sys#github_organization) -(chatchat-space#github_organization) -(langchain-ai#github_organization) -(langgenius#github_organization) - -Relationships: -(eosphoros-ai/DB-GPT#common_developer#chatchat-space/Langchain-Chatchat#common_developer count 82) -(eosphoros-ai/DB-GPT#common_developer#hiyouga/LLaMA-Factory#common_developer count 45) -(eosphoros-ai/DB-GPT#common_developer#lm-sys/FastChat#common_developer count 39) -(eosphoros-ai/DB-GPT#common_developer#langchain-ai/langchain#common_developer count 37) -(eosphoros-ai/DB-GPT#common_developer#eosphoros-ai/DB-GPT-Hub#common_developer count 37) -(eosphoros-ai/DB-GPT#common_developer#THUDM/ChatGLM-6B#common_developer count 31) -(eosphoros-ai/DB-GPT#common_developer#langgenius/dify#common_developer count 30) -(eosphoros-ai/DB-GPT#common_developer#vllm-project/vllm#common_developer count 27) -(eosphoros-ai/DB-GPT#common_developer#QwenLM/Qwen#common_developer count 26) -(eosphoros-ai/DB-GPT#common_developer#PaddlePaddle/PaddleOCR#common_developer count 24) -(vllm-project/vllm#belong_to#vllm-project#belong_to) -(eosphoros-ai/DB-GPT#belong_to#eosphoros-ai#belong_to) -(eosphoros-ai/DB-GPT-Hub#belong_to#eosphoros-ai#belong_to) -(PaddlePaddle/PaddleOCR#belong_to#PaddlePaddle#belong_to) -(QwenLM/Qwen#belong_to#QwenLM#belong_to) -(THUDM/ChatGLM-6B#belong_to#THUDM#belong_to) -(lm-sys/FastChat#belong_to#lm-sys#belong_to) -(chatchat-space/Langchain-Chatchat#belong_to#chatchat-space#belong_to) -(langchain-ai/langchain#belong_to#langchain-ai#belong_to) -(langgenius/dify#belong_to#langgenius#belong_to) - - -# TuGraph简介 -TuGraph图数据库由蚂蚁集团与清华大学联合研发,构建了一套包含图存储、图计算、图学习、图研发平台的完善的图技术体系,支持海量多源的关联数据的实时处理,显著提升数据分析效率,支撑了蚂蚁支付、安全、社交、公益、数据治理等300多个场景应用。拥有业界领先规模的图集群,解决了图数据分析面临的大数据量、高吞吐率和低延迟等重大挑战,是蚂蚁集团金融风控能力的重要基础设施,显著提升了欺诈洗钱等金融风险的实时识别能力和审理分析效率,并面向金融、工业、政务服务等行业客户。TuGraph产品家族中,开源产品包括:TuGraph DB、TuGraph Analytics、OSGraph、ChatTuGraph等。内源产品包括:GeaBase、GeaFlow、GeaLearn、GeaMaker等。 - -# DB-GPT简介 -DB-GPT是一个开源的AI原生数据应用开发框架(AI Native Data App Development framework with AWEL(Agentic Workflow Expression Language) and Agents)。目的是构建大模型领域的基础设施,通过开发多模型管理(SMMF)、Text2SQL效果优化、RAG框架以及优化、Multi-Agents框架协作、AWEL(智能体工作流编排)等多种技术能力,让围绕数据库构建大模型应用更简单,更方便。 \ No newline at end of file diff --git a/examples/test_files/graphrag-mini.md b/examples/test_files/graphrag-mini.md index b30a2774f..134e642ff 100644 --- a/examples/test_files/graphrag-mini.md +++ b/examples/test_files/graphrag-mini.md @@ -1,6 +1,97 @@ -# TuGraph -TuGraph图数据库由蚂蚁集团与清华大学联合研发,构建了一套包含图存储、图计算、图学习、图研发平台的完善的图技术体系,支持海量多源的关联数据的实时处理,显著提升数据分析效率,支撑了蚂蚁支付、安全、社交、公益、数据治理等300多个场景应用。拥有业界领先规模的图集群,解决了图数据分析面临的大数据量、高吞吐率和低延迟等重大挑战,是蚂蚁集团金融风控能力的重要基础设施,显著提升了欺诈洗钱等金融风险的实时识别能力和审理分析效率,并面向金融、工业、政务服务等行业客户。TuGraph产品家族中,开源产品包括:TuGraph DB、TuGraph Analytics、OSGraph、ChatTuGraph等。内源产品包括:GeaBase、GeaFlow、GeaLearn、GeaMaker等。 -TuGraph企业级图数据管理平台提供对关联数据的复杂、深度分析功能。TuGraph以分布式集群架构,支持海量数据的高吞吐、高可用性、高并发读写和ACID事务操作。通过对数据的分片、分区,支持水平扩展,提供对点、边、属性、拓扑等结构的查询、过滤、索引等功能。TuGraph提供离线、近线、在线的图算法和图学习能力,内置数十种算法,能够对全图、子图、动态图的模式和特征进行处理,通过可视化或数据服务形式与外部数据源交互。此外,TuGraph提供可视化的展示和操作界面,覆盖图研发和服务的全生命周期,支持主流的图查询语言,提供便捷的访问和开发接口,能够与外部多模数据源进行导入导出、存量/增量/批量更新和备份。TuGraph还提供精美和实用的图生产环境管理监控,满足企业用户的技术和业务应用需要。 +# TuGraph DB项目生态图谱 +Entities: +(TuGraph-family/tugraph-db#github_repo) +(vesoft-inc/nebula#github_repo) +(PaddlePaddle/Paddle#github_repo) +(apache/brpc#github_repo) +(TuGraph-family/tugraph-web#github_repo) +(TuGraph-family/tugraph-db-client-java#github_repo) +(alibaba/GraphScope#github_repo) +(ClickHouse/ClickHouse#github_repo) +(TuGraph-family/fma-common#github_repo) +(vesoft-inc/nebula-docs-cn#github_repo) +(eosphoros-ai/DB-GPT#github_repo) +(eosphoros-ai#github_organization) +(yandex#github_organization) +(alibaba#github_organization) +(TuGraph-family#github_organization) +(baidu#github_organization) +(apache#github_organization) +(vesoft-inc#github_organization) + +Relationships: +(TuGraph-family/tugraph-db#common_developer#vesoft-inc/nebula#common_developer count 10) +(TuGraph-family/tugraph-db#common_developer#PaddlePaddle/Paddle#common_developer count 9) +(TuGraph-family/tugraph-db#common_developer#apache/brpc#common_developer count 7) +(TuGraph-family/tugraph-db#common_developer#TuGraph-family/tugraph-web#common_developer count 7) +(TuGraph-family/tugraph-db#common_developer#TuGraph-family/tugraph-db-client-java#common_developer count 7) +(TuGraph-family/tugraph-db#common_developer#alibaba/GraphScope#common_developer count 6) +(TuGraph-family/tugraph-db#common_developer#ClickHouse/ClickHouse#common_developer count 6) +(TuGraph-family/tugraph-db#common_developer#TuGraph-family/fma-common#common_developer count 6) +(TuGraph-family/tugraph-db#common_developer#vesoft-inc/nebula-docs-cn#common_developer count 6) +(TuGraph-family/tugraph-db#common_developer#eosphoros-ai/DB-GPT#common_developer count 6) +(eosphoros-ai/DB-GPT#belong_to#eosphoros-ai#belong_to) +(ClickHouse/ClickHouse#belong_to#yandex#belong_to) +(alibaba/GraphScope#belong_to#alibaba#belong_to) +(TuGraph-family/tugraph-db#belong_to#TuGraph-family#belong_to) +(TuGraph-family/tugraph-web#belong_to#TuGraph-family#belong_to) +(TuGraph-family/fma-common#belong_to#TuGraph-family#belong_to) +(TuGraph-family/tugraph-db-client-java#belong_to#TuGraph-family#belong_to) +(PaddlePaddle/Paddle#belong_to#baidu#belong_to) +(apache/brpc#belong_to#apache#belong_to) +(vesoft-inc/nebula#belong_to#vesoft-inc#belong_to) +(vesoft-inc/nebula-docs-cn#belong_to#vesoft-inc#belong_to) + + +# DB-GPT项目生态图谱 +Entities: +(eosphoros-ai/DB-GPT#github_repo) +(chatchat-space/Langchain-Chatchat#github_repo) +(hiyouga/LLaMA-Factory#github_repo) +(lm-sys/FastChat#github_repo) +(langchain-ai/langchain#github_repo) +(eosphoros-ai/DB-GPT-Hub#github_repo) +(THUDM/ChatGLM-6B#github_repo) +(langgenius/dify#github_repo) +(vllm-project/vllm#github_repo) +(QwenLM/Qwen#github_repo) +(PaddlePaddle/PaddleOCR#github_repo) +(vllm-project#github_organization) +(eosphoros-ai#github_organization) +(PaddlePaddle#github_organization) +(QwenLM#github_organization) +(THUDM#github_organization) +(lm-sys#github_organization) +(chatchat-space#github_organization) +(langchain-ai#github_organization) +(langgenius#github_organization) + +Relationships: +(eosphoros-ai/DB-GPT#common_developer#chatchat-space/Langchain-Chatchat#common_developer count 82) +(eosphoros-ai/DB-GPT#common_developer#hiyouga/LLaMA-Factory#common_developer count 45) +(eosphoros-ai/DB-GPT#common_developer#lm-sys/FastChat#common_developer count 39) +(eosphoros-ai/DB-GPT#common_developer#langchain-ai/langchain#common_developer count 37) +(eosphoros-ai/DB-GPT#common_developer#eosphoros-ai/DB-GPT-Hub#common_developer count 37) +(eosphoros-ai/DB-GPT#common_developer#THUDM/ChatGLM-6B#common_developer count 31) +(eosphoros-ai/DB-GPT#common_developer#langgenius/dify#common_developer count 30) +(eosphoros-ai/DB-GPT#common_developer#vllm-project/vllm#common_developer count 27) +(eosphoros-ai/DB-GPT#common_developer#QwenLM/Qwen#common_developer count 26) +(eosphoros-ai/DB-GPT#common_developer#PaddlePaddle/PaddleOCR#common_developer count 24) +(vllm-project/vllm#belong_to#vllm-project#belong_to) +(eosphoros-ai/DB-GPT#belong_to#eosphoros-ai#belong_to) +(eosphoros-ai/DB-GPT-Hub#belong_to#eosphoros-ai#belong_to) +(PaddlePaddle/PaddleOCR#belong_to#PaddlePaddle#belong_to) +(QwenLM/Qwen#belong_to#QwenLM#belong_to) +(THUDM/ChatGLM-6B#belong_to#THUDM#belong_to) +(lm-sys/FastChat#belong_to#lm-sys#belong_to) +(chatchat-space/Langchain-Chatchat#belong_to#chatchat-space#belong_to) +(langchain-ai/langchain#belong_to#langchain-ai#belong_to) +(langgenius/dify#belong_to#langgenius#belong_to) + + +# TuGraph简介 +TuGraph图数据库由蚂蚁集团与清华大学联合研发,构建了一套包含图存储、图计算、图学习、图研发平台的完善的图技术体系,支持海量多源的关联数据的实时处理,显著提升数据分析效率,支撑了蚂蚁支付、安全、社交、公益、数据治理等300多个场景应用。拥有业界领先规模的图集群,解决了图数据分析面临的大数据量、高吞吐率和低延迟等重大挑战,是蚂蚁集团金融风控能力的重要基础设施,显著提升了欺诈洗钱等金融风险的实时识别能力和审理分析效率,并面向金融、工业、政务服务等行业客户。TuGraph产品家族中,开源产品包括:TuGraph DB、TuGraph Analytics、OSGraph、ChatTuGraph等。内源产品包括:GeaBase、GeaFlow、GeaLearn、GeaMaker等。 -TuGraph在金融风控方面的应用实践主要包括个人信贷业务、反欺诈、洗钱路径追踪等问题。利用多维交叉关联信息深度刻画申请和交易行为,识别多种复杂、规模化、隐蔽性的欺诈网络和洗钱网络;结合聚类分析、风险传播等算法,实时计算用户的风险评分,在风险行为发生前预先识别,帮助金融机构提升效率、降低风险。基于TuGraph企业级图数据管理平台,蚂蚁集团增加反欺诈稽核金额6%,反洗钱风险审理分析效率提升90%。每天计算近10亿用户大约200亿左右边关系,对疑似团伙类犯罪风险识别能力提高近10倍。此外,为某银行提供的信贷图平台提升了13%的风控模型区分度;为某银行完成的信用卡申请团伙欺诈分析方案,运算时间缩短至原有的1/60;为某银行搭建的企业风险图平台,在对小微企业评级放贷问题中,担保圈识别准确率达到90%以上。 +# DB-GPT简介 +DB-GPT是一个开源的AI原生数据应用开发框架(AI Native Data App Development framework with AWEL(Agentic Workflow Expression Language) and Agents)。目的是构建大模型领域的基础设施,通过开发多模型管理(SMMF)、Text2SQL效果优化、RAG框架以及优化、Multi-Agents框架协作、AWEL(智能体工作流编排)等多种技术能力,让围绕数据库构建大模型应用更简单,更方便。 \ No newline at end of file