mirror of
https://github.com/csunny/DB-GPT.git
synced 2025-07-24 04:36:23 +00:00
feat(GraphRAG): Support concurrent community summarization (#2160)
This commit is contained in:
parent
e5ec47145f
commit
a14eeb56dd
@ -168,6 +168,7 @@ DOCUMENT_GRAPH_ENABLED=True # enable the graph search for documents and chunks
|
||||
|
||||
KNOWLEDGE_GRAPH_CHUNK_SEARCH_TOP_SIZE=5 # the top size of knowledge graph search for chunks
|
||||
KNOWLEDGE_GRAPH_EXTRACTION_BATCH_SIZE=20 # the batch size of triplet extraction from the text
|
||||
COMMUNITY_SUMMARY_BATCH_SIZE=20 # the batch size of parallel community summary process
|
||||
|
||||
### Chroma vector db config
|
||||
#CHROMA_PERSIST_PATH=/root/DB-GPT/pilot/data
|
||||
|
@ -73,7 +73,7 @@ class GraphExtractor(LLMExtractor):
|
||||
texts: List[str],
|
||||
batch_size: int = 1,
|
||||
limit: Optional[int] = None,
|
||||
) -> List[List[Graph]]:
|
||||
) -> Optional[List[List[Graph]]]:
|
||||
"""Extract graphs from chunks in batches.
|
||||
|
||||
Returns list of graphs in same order as input texts (text <-> graphs).
|
||||
@ -86,11 +86,12 @@ class GraphExtractor(LLMExtractor):
|
||||
|
||||
# Pre-allocate results list to maintain order
|
||||
graphs_list: List[List[Graph]] = [None] * len(texts)
|
||||
total_batches = (len(texts) + batch_size - 1) // batch_size
|
||||
|
||||
for batch_idx in range(total_batches):
|
||||
start_idx = batch_idx * batch_size
|
||||
end_idx = min((batch_idx + 1) * batch_size, len(texts))
|
||||
n_texts = len(texts)
|
||||
|
||||
for batch_idx in range(0, n_texts, batch_size):
|
||||
start_idx = batch_idx
|
||||
end_idx = min(start_idx + batch_size, n_texts)
|
||||
batch_texts = texts[start_idx:end_idx]
|
||||
|
||||
# 2. Create tasks with their original indices
|
||||
@ -104,11 +105,17 @@ class GraphExtractor(LLMExtractor):
|
||||
|
||||
# 3. Process extraction in parallel while keeping track of indices
|
||||
batch_results = await asyncio.gather(
|
||||
*(task for _, task in extraction_tasks)
|
||||
*(task for _, task in extraction_tasks), return_exceptions=True
|
||||
)
|
||||
|
||||
# 4. Place results in the correct positions
|
||||
for (idx, _), graphs in zip(extraction_tasks, batch_results):
|
||||
if isinstance(graphs, Exception):
|
||||
raise RuntimeError(f"Failed to extract graph: {graphs}")
|
||||
if not isinstance(graphs, list) or not all(
|
||||
isinstance(g, Graph) for g in graphs
|
||||
):
|
||||
raise RuntimeError(f"Invalid graph extraction result: {graphs}")
|
||||
graphs_list[idx] = graphs
|
||||
|
||||
assert all(x is not None for x in graphs_list), "All positions should be filled"
|
||||
|
@ -1,7 +1,8 @@
|
||||
"""Define the CommunityStore class."""
|
||||
|
||||
import asyncio
|
||||
import logging
|
||||
from typing import List
|
||||
from typing import List, Optional
|
||||
|
||||
from dbgpt.rag.transformer.community_summarizer import CommunitySummarizer
|
||||
from dbgpt.storage.knowledge_graph.community.base import Community, GraphStoreAdapter
|
||||
@ -27,28 +28,38 @@ class CommunityStore:
|
||||
self._community_summarizer = community_summarizer
|
||||
self._meta_store = BuiltinCommunityMetastore(vector_store)
|
||||
|
||||
async def build_communities(self):
|
||||
async def build_communities(self, batch_size: int = 1):
|
||||
"""Discover communities."""
|
||||
community_ids = await self._graph_store_adapter.discover_communities()
|
||||
|
||||
# summarize communities
|
||||
communities = []
|
||||
for community_id in community_ids:
|
||||
community = await self._graph_store_adapter.get_community(community_id)
|
||||
graph = community.data.format()
|
||||
if not graph:
|
||||
break
|
||||
n_communities = len(community_ids)
|
||||
|
||||
community.summary = await self._community_summarizer.summarize(graph=graph)
|
||||
communities.append(community)
|
||||
logger.info(
|
||||
f"Summarize community {community_id}: " f"{community.summary[:50]}..."
|
||||
for i in range(0, n_communities, batch_size):
|
||||
batch_ids = community_ids[i : i + batch_size]
|
||||
batch_results = await asyncio.gather(
|
||||
*[self._summary_community(cid) for cid in batch_ids]
|
||||
)
|
||||
# filter out None returns
|
||||
communities.extend([c for c in batch_results if c is not None])
|
||||
|
||||
# truncate then save new summaries
|
||||
await self._meta_store.truncate()
|
||||
await self._meta_store.save(communities)
|
||||
|
||||
async def _summary_community(self, community_id: str) -> Optional[Community]:
|
||||
"""Summarize single community."""
|
||||
community = await self._graph_store_adapter.get_community(community_id)
|
||||
if community is None or community.data is None:
|
||||
logger.warning(f"Community {community_id} is empty")
|
||||
return None
|
||||
|
||||
graph = community.data.format()
|
||||
community.summary = await self._community_summarizer.summarize(graph=graph)
|
||||
logger.info(f"Summarize community {community_id}: {community.summary[:50]}...")
|
||||
return community
|
||||
|
||||
async def search_communities(self, query: str) -> List[Community]:
|
||||
"""Search communities."""
|
||||
return await self._meta_store.search(query)
|
||||
|
@ -356,7 +356,7 @@ class TuGraphStoreAdapter(GraphStoreAdapter):
|
||||
return
|
||||
|
||||
# Create the graph schema
|
||||
def _format_graph_propertity_schema(
|
||||
def _format_graph_property_schema(
|
||||
name: str,
|
||||
type: str = "STRING",
|
||||
optional: bool = False,
|
||||
@ -390,9 +390,9 @@ class TuGraphStoreAdapter(GraphStoreAdapter):
|
||||
|
||||
# Create the graph label for document vertex
|
||||
document_proerties: List[Dict[str, Union[str, bool]]] = [
|
||||
_format_graph_propertity_schema("id", "STRING", False),
|
||||
_format_graph_propertity_schema("name", "STRING", False),
|
||||
_format_graph_propertity_schema("_community_id", "STRING", True, True),
|
||||
_format_graph_property_schema("id", "STRING", False),
|
||||
_format_graph_property_schema("name", "STRING", False),
|
||||
_format_graph_property_schema("_community_id", "STRING", True, True),
|
||||
]
|
||||
self.create_graph_label(
|
||||
graph_elem_type=GraphElemType.DOCUMENT, graph_properties=document_proerties
|
||||
@ -400,10 +400,10 @@ class TuGraphStoreAdapter(GraphStoreAdapter):
|
||||
|
||||
# Create the graph label for chunk vertex
|
||||
chunk_proerties: List[Dict[str, Union[str, bool]]] = [
|
||||
_format_graph_propertity_schema("id", "STRING", False),
|
||||
_format_graph_propertity_schema("name", "STRING", False),
|
||||
_format_graph_propertity_schema("_community_id", "STRING", True, True),
|
||||
_format_graph_propertity_schema("content", "STRING", True, True),
|
||||
_format_graph_property_schema("id", "STRING", False),
|
||||
_format_graph_property_schema("name", "STRING", False),
|
||||
_format_graph_property_schema("_community_id", "STRING", True, True),
|
||||
_format_graph_property_schema("content", "STRING", True, True),
|
||||
]
|
||||
self.create_graph_label(
|
||||
graph_elem_type=GraphElemType.CHUNK, graph_properties=chunk_proerties
|
||||
@ -411,10 +411,10 @@ class TuGraphStoreAdapter(GraphStoreAdapter):
|
||||
|
||||
# Create the graph label for entity vertex
|
||||
vertex_proerties: List[Dict[str, Union[str, bool]]] = [
|
||||
_format_graph_propertity_schema("id", "STRING", False),
|
||||
_format_graph_propertity_schema("name", "STRING", False),
|
||||
_format_graph_propertity_schema("_community_id", "STRING", True, True),
|
||||
_format_graph_propertity_schema("description", "STRING", True, True),
|
||||
_format_graph_property_schema("id", "STRING", False),
|
||||
_format_graph_property_schema("name", "STRING", False),
|
||||
_format_graph_property_schema("_community_id", "STRING", True, True),
|
||||
_format_graph_property_schema("description", "STRING", True, True),
|
||||
]
|
||||
self.create_graph_label(
|
||||
graph_elem_type=GraphElemType.ENTITY, graph_properties=vertex_proerties
|
||||
@ -422,10 +422,10 @@ class TuGraphStoreAdapter(GraphStoreAdapter):
|
||||
|
||||
# Create the graph label for relation edge
|
||||
edge_proerties: List[Dict[str, Union[str, bool]]] = [
|
||||
_format_graph_propertity_schema("id", "STRING", False),
|
||||
_format_graph_propertity_schema("name", "STRING", False),
|
||||
_format_graph_propertity_schema("_chunk_id", "STRING", True, True),
|
||||
_format_graph_propertity_schema("description", "STRING", True, True),
|
||||
_format_graph_property_schema("id", "STRING", False),
|
||||
_format_graph_property_schema("name", "STRING", False),
|
||||
_format_graph_property_schema("_chunk_id", "STRING", True, True),
|
||||
_format_graph_property_schema("description", "STRING", True, True),
|
||||
]
|
||||
self.create_graph_label(
|
||||
graph_elem_type=GraphElemType.RELATION, graph_properties=edge_proerties
|
||||
@ -433,9 +433,9 @@ class TuGraphStoreAdapter(GraphStoreAdapter):
|
||||
|
||||
# Create the graph label for include edge
|
||||
include_proerties: List[Dict[str, Union[str, bool]]] = [
|
||||
_format_graph_propertity_schema("id", "STRING", False),
|
||||
_format_graph_propertity_schema("name", "STRING", False),
|
||||
_format_graph_propertity_schema("description", "STRING", True),
|
||||
_format_graph_property_schema("id", "STRING", False),
|
||||
_format_graph_property_schema("name", "STRING", False),
|
||||
_format_graph_property_schema("description", "STRING", True),
|
||||
]
|
||||
self.create_graph_label(
|
||||
graph_elem_type=GraphElemType.INCLUDE, graph_properties=include_proerties
|
||||
@ -443,9 +443,9 @@ class TuGraphStoreAdapter(GraphStoreAdapter):
|
||||
|
||||
# Create the graph label for next edge
|
||||
next_proerties: List[Dict[str, Union[str, bool]]] = [
|
||||
_format_graph_propertity_schema("id", "STRING", False),
|
||||
_format_graph_propertity_schema("name", "STRING", False),
|
||||
_format_graph_propertity_schema("description", "STRING", True),
|
||||
_format_graph_property_schema("id", "STRING", False),
|
||||
_format_graph_property_schema("name", "STRING", False),
|
||||
_format_graph_property_schema("description", "STRING", True),
|
||||
]
|
||||
self.create_graph_label(
|
||||
graph_elem_type=GraphElemType.NEXT, graph_properties=next_proerties
|
||||
|
@ -38,8 +38,7 @@ class CommunitySummaryKnowledgeGraphConfig(BuiltinKnowledgeGraphConfig):
|
||||
password: Optional[str] = Field(
|
||||
default=None,
|
||||
description=(
|
||||
"The password of vector store, "
|
||||
"if not set, will use the default password."
|
||||
"The password of vector store, if not set, will use the default password."
|
||||
),
|
||||
)
|
||||
extract_topk: int = Field(
|
||||
@ -75,6 +74,10 @@ class CommunitySummaryKnowledgeGraphConfig(BuiltinKnowledgeGraphConfig):
|
||||
default=20,
|
||||
description="Batch size of triplets extraction from the text",
|
||||
)
|
||||
community_summary_batch_size: int = Field(
|
||||
default=20,
|
||||
description="Batch size of parallel community building process",
|
||||
)
|
||||
|
||||
|
||||
class CommunitySummaryKnowledgeGraph(BuiltinKnowledgeGraph):
|
||||
@ -130,6 +133,12 @@ class CommunitySummaryKnowledgeGraph(BuiltinKnowledgeGraph):
|
||||
config.knowledge_graph_extraction_batch_size,
|
||||
)
|
||||
)
|
||||
self._community_summary_batch_size = int(
|
||||
os.getenv(
|
||||
"COMMUNITY_SUMMARY_BATCH_SIZE",
|
||||
config.community_summary_batch_size,
|
||||
)
|
||||
)
|
||||
|
||||
def extractor_configure(name: str, cfg: VectorStoreConfig):
|
||||
cfg.name = name
|
||||
@ -177,9 +186,12 @@ class CommunitySummaryKnowledgeGraph(BuiltinKnowledgeGraph):
|
||||
|
||||
async def aload_document(self, chunks: List[Chunk]) -> List[str]:
|
||||
"""Extract and persist graph from the document file."""
|
||||
|
||||
await self._aload_document_graph(chunks)
|
||||
await self._aload_triplet_graph(chunks)
|
||||
await self._community_store.build_communities()
|
||||
await self._community_store.build_communities(
|
||||
batch_size=self._community_summary_batch_size
|
||||
)
|
||||
|
||||
return [chunk.chunk_id for chunk in chunks]
|
||||
|
||||
@ -230,6 +242,8 @@ class CommunitySummaryKnowledgeGraph(BuiltinKnowledgeGraph):
|
||||
[chunk.content for chunk in chunks],
|
||||
batch_size=self._triplet_extraction_batch_size,
|
||||
)
|
||||
if not graphs_list:
|
||||
raise ValueError("No graphs extracted from the chunks")
|
||||
|
||||
# Upsert the graphs into the graph store
|
||||
for idx, graphs in enumerate(graphs_list):
|
||||
|
@ -117,6 +117,7 @@ TRIPLET_GRAPH_ENABLED=True # enable the graph search for the triplets
|
||||
DOCUMENT_GRAPH_ENABLED=True # enable the graph search for documents and chunks
|
||||
KNOWLEDGE_GRAPH_CHUNK_SEARCH_TOP_SIZE=5 # the number of the searched triplets in a retrieval
|
||||
KNOWLEDGE_GRAPH_EXTRACTION_BATCH_SIZE=20 # the batch size of triplet extraction from the text
|
||||
COMMUNITY_SUMMARY_BATCH_SIZE=20 # the batch size of parallel community summary process
|
||||
```
|
||||
|
||||
|
||||
@ -233,7 +234,8 @@ First, create a knowledge base using the `Knowledge Graph` type.
|
||||
<img src={'/img/chat_knowledge/graph_rag/create_knowledge_graph.png'} width="1000px"/>
|
||||
</p>
|
||||
|
||||
Then, upload the documents ([tugraph.md](https://github.com/eosphoros-ai/DB-GPT/blob/main/examples/test_files/tugraph.md), [osgraph.md](https://github.com/eosphoros-ai/DB-GPT/blob/main/examples/test_files/osgraph.md), [dbgpt.md](https://github.com/eosphoros-ai/DB-GPT/blob/main/examples/test_files/dbgpt.md)) and process them automatically (markdown header by default).
|
||||
Then, upload the documents ([graphrag-test.md](https://github.com/eosphoros-ai/DB-GPT/blob/main/examples/test_files/graphrag-test.md)) and process them automatically (markdown header by default).
|
||||
|
||||
<p align="left">
|
||||
<img src={'/img/chat_knowledge/graph_rag/upload_file.png'} width="1000px"/>
|
||||
</p>
|
||||
@ -254,14 +256,15 @@ Performance testing is based on the `gpt-4o-mini` model.
|
||||
|
||||
#### Indexing Performance
|
||||
|
||||
| | DB-GPT | GraphRAG(microsoft) |
|
||||
| ----------------- | --------------------- | -------------------- |
|
||||
| Document Tokens | 42631 | 42631 |
|
||||
| Graph Size | 808 nodes, 1170 edges | 779 nodes, 967 edges |
|
||||
| Prompt Tokens | 452614 | 744990 |
|
||||
| Completion Tokens | 48325 | 227230 |
|
||||
| Total Tokens | 500939 | 972220 |
|
||||
|
||||
| | DB-GPT | GraphRAG(microsoft) |
|
||||
| ------------------- | --------------------- | -------------------- |
|
||||
| Doc Tokens | 42631 | 42631 |
|
||||
| Triplets Graph | 734 nodes, 1064 edges | 779 nodes, 967 edges |
|
||||
| Doc Structure Graph | 76 nodes, 1090 edges | N/A |
|
||||
| Prompt Tokens | 375768 | 744990 |
|
||||
| Completion Tokens | 41797 | 227230 |
|
||||
| Total Tokens | **417565** | 972220 |
|
||||
| Indexing Time | **170s** | 210s |
|
||||
|
||||
#### Querying Performance
|
||||
|
||||
@ -371,6 +374,12 @@ Knowledge Graph = Triplets Graph + Document Structure Graph
|
||||
<img src={'/img/chat_knowledge/graph_rag/image_graphrag_0_6_1.png'} width="1000px"/>
|
||||
</p>
|
||||
|
||||
Thanks to the Document Structure Graph, GraphRAG now can provide references to the original text when answering:
|
||||
|
||||
<p align="left">
|
||||
<img src={'/img/chat_knowledge/graph_rag/doc_structure_graph_demo.png'} width="1000px"/>
|
||||
</p>
|
||||
|
||||
How?
|
||||
|
||||
We decompose standard format files (currently best support for Markdown files) into a directed graph based on their hierarchy and layout information, and store it in a graph database. In this graph:
|
||||
|
BIN
docs/static/img/chat_knowledge/graph_rag/doc_structure_graph_demo.png
vendored
Normal file
BIN
docs/static/img/chat_knowledge/graph_rag/doc_structure_graph_demo.png
vendored
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.3 MiB |
@ -1,185 +0,0 @@
|
||||
# DB-GPT: 用私有化LLM技术定义数据库下一代交互方式
|
||||
## 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(智能体工作流编排)等多种技术能力,让围绕数据库构建大模型应用更简单,更方便。
|
||||
🚀 **数据3.0 时代,基于模型、数据库,企业/开发者可以用更少的代码搭建自己的专属应用。**
|
||||
## 效果演示
|
||||
### AI原生数据智能应用
|
||||
|
||||
---
|
||||
|
||||
- 🔥🔥🔥 [V0.5.0发布——通过工作流与智能体开发原生数据应用](https://www.yuque.com/eosphoros/dbgpt-docs/owcrh9423f9rqkg2)
|
||||
|
||||
---
|
||||
|
||||
### Data Agents
|
||||

|
||||

|
||||

|
||||
## 目录
|
||||
|
||||
- [架构方案](#架构方案)
|
||||
- [安装](#安装)
|
||||
- [特性简介](#特性一览)
|
||||
- [贡献](#贡献)
|
||||
- [路线图](#路线图)
|
||||
- [联系我们](#联系我们)
|
||||
## 架构方案
|
||||

|
||||
核心能力主要有以下几个部分:
|
||||
|
||||
- **RAG(Retrieval Augmented Generation)**,RAG是当下落地实践最多,也是最迫切的领域,DB-GPT目前已经实现了一套基于RAG的框架,用户可以基于DB-GPT的RAG能力构建知识类应用。
|
||||
- **GBI**:生成式BI是DB-GPT项目的核心能力之一,为构建企业报表分析、业务洞察提供基础的数智化技术保障。
|
||||
- **微调框架**: 模型微调是任何一个企业在垂直、细分领域落地不可或缺的能力,DB-GPT提供了完整的微调框架,实现与DB-GPT项目的无缝打通,在最近的微调中,基于spider的准确率已经做到了82.5%
|
||||
- **数据驱动的Multi-Agents框架**: DB-GPT提供了数据驱动的自进化Multi-Agents框架,目标是可以持续基于数据做决策与执行。
|
||||
- **数据工厂**: 数据工厂主要是在大模型时代,做可信知识、数据的清洗加工。
|
||||
- **数据源**: 对接各类数据源,实现生产业务数据无缝对接到DB-GPT核心能力。
|
||||
### 智能体编排语言(AWEL)
|
||||
AWEL(Agentic Workflow Expression Language)是一套专为大模型应用开发设计的智能体工作流表达语言,它提供了强大的功能和灵活性。通过 AWEL API 您可以专注于大模型应用业务逻辑的开发,而不需要关注繁琐的模型和环境细节,AWEL 采用分层 API 的设计, AWEL 的分层 API 设计架构如下图所示:
|
||||
|
||||

|
||||
|
||||
AWEL在设计上分为三个层次,依次为算子层、AgentFrame层以及DSL层,以下对三个层次做简要介绍。
|
||||
|
||||
- 算子层
|
||||
|
||||
算子层是指LLM应用开发过程中一个个最基本的操作原子,比如在一个RAG应用开发时。 检索、向量化、模型交互、Prompt处理等都是一个个基础算子。 在后续的发展中,框架会进一步对算子进行抽象与标准化设计。 可以根据标准API快速实现一组算子。
|
||||
|
||||
- AgentFrame层
|
||||
|
||||
AgentFrame层将算子做进一步封装,可以基于算子做链式计算。 这一层链式计算也支持分布式,支持如filter、join、map、reduce等一套链式计算操作。 后续也将支持更多的计算逻辑。
|
||||
|
||||
- DSL层
|
||||
|
||||
DSL层提供一套标准的结构化表示语言,可以通过写DSL语句完成AgentFrame与算子的操作,让围绕数据编写大模型应用更具确定性,避免通过自然语言编写的不确定性,使得围绕数据与大模型的应用编程变为确定性应用编程。
|
||||
### RAG架构
|
||||

|
||||
### Agent架构
|
||||
DB-GPT Agent是一个多Agent框架,目的是提供生产级Agent构建的基础框架能力。我们认为,生产级代理应用程序需要基于数据驱动的决策,并且可以在可控制的工作流中进行编排。
|
||||
在我们的设计中,提供了一套以Agent为核心,融合多模型管理、RAGs、API调用、可视化、AWEL智能体编排、Text2SQL、意图识别等一系列技术的生产级数据应用开发框架。
|
||||

|
||||
如同所示: 在DB-GPT中,Agent是一等公民,其他RAGs、Tools、数据源等都是Agent依赖的资源,包括模型也是一种资源。
|
||||
Agent的核心模块主要有Memory、Profile、Planing、Action等模块。
|
||||
围绕Agent的核心模块,往上构建多Agent之间的协作能力,协作主要有三种形式。
|
||||
|
||||
1. 单一Agent: 单个Agent有具体任务与目标,不涉及多模型协作。
|
||||
2. Auto-Plan: Agent自己制定计划,在多Agent协作时负责路径规划、分工协作等。
|
||||
3. AWEL: 编排,通过程序编排来实现多智能体的协作。
|
||||
### 多模型架构
|
||||
在AIGC应用探索与生产落地中,难以避免直接与模型服务对接,但是目前大模型的推理部署还没有一个事实标准,不断有新的模型发布,也不断有新的训练方法被提出,我们需要花大量的时间来适配多变的底层模型环境,而这在一定程度上制约了AIGC应用的探索和落地。
|
||||

|
||||
SMMF由模型推理层、模型部署层两部分组成。模型推理层对应模型推理框架vLLM、TGI和TensorRT等。模型部署层向下对接推理层,向上提供模型服务能力。 模型部署框架在推理框架之上,提供了多模型实例、多推理框架、多云、自动扩缩容与可观测性等能力。
|
||||
### 子模块
|
||||
|
||||
- [DB-GPT-Hub](https://github.com/eosphoros-ai/DB-GPT-Hub) 通过微调来持续提升Text2SQL效果
|
||||
- [DB-GPT-Plugins](https://github.com/eosphoros-ai/DB-GPT-Plugins) DB-GPT 插件仓库, 兼容Auto-GPT
|
||||
- [GPT-Vis](https://github.com/eosphoros-ai/DB-GPT-Web) 可视化协议
|
||||
- [dbgpts](https://github.com/eosphoros-ai/dbgpts) dbgpts 是官方提供的数据应用仓库, 包含数据智能应用, 智能体编排流程模版, 通用算子等构建在DB-GPT之上的资源。
|
||||
## 安装
|
||||
[**教程**](https://www.yuque.com/eosphoros/dbgpt-docs/bex30nsv60ru0fmx)
|
||||
|
||||
- [**快速开始**](https://www.yuque.com/eosphoros/dbgpt-docs/ew0kf1plm0bru2ga)
|
||||
- [源码安装](https://www.yuque.com/eosphoros/dbgpt-docs/urh3fcx8tu0s9xmb)
|
||||
- [Docker安装](https://www.yuque.com/eosphoros/dbgpt-docs/glf87qg4xxcyrp89)
|
||||
- [Docker Compose安装](https://www.yuque.com/eosphoros/dbgpt-docs/wwdu11e0v5nkfzin)
|
||||
- [**使用手册**](https://www.yuque.com/eosphoros/dbgpt-docs/tkspdd0tcy2vlnu4)
|
||||
- [知识库](https://www.yuque.com/eosphoros/dbgpt-docs/ycyz3d9b62fccqxh)
|
||||
- [数据对话](https://www.yuque.com/eosphoros/dbgpt-docs/gd9hbhi1dextqgbz)
|
||||
- [Excel对话](https://www.yuque.com/eosphoros/dbgpt-docs/prugoype0xd2g4bb)
|
||||
- [数据库对话](https://www.yuque.com/eosphoros/dbgpt-docs/wswpv3zcm2c9snmg)
|
||||
- [报表分析](https://www.yuque.com/eosphoros/dbgpt-docs/vsv49p33eg4p5xc1)
|
||||
- [Agents](https://www.yuque.com/eosphoros/dbgpt-docs/pom41m7oqtdd57hm)
|
||||
- [**进阶教程**](https://www.yuque.com/eosphoros/dbgpt-docs/dxalqb8wsv2xkm5f)
|
||||
- [智能体工作流使用](https://www.yuque.com/eosphoros/dbgpt-docs/hcomfb3yrleg7gmq)
|
||||
- [智能应用使用](https://www.yuque.com/eosphoros/dbgpt-docs/aiagvxeb86iarq6r)
|
||||
- [多模型管理](https://www.yuque.com/eosphoros/dbgpt-docs/huzgcf2abzvqy8uv)
|
||||
- [命令行使用](https://www.yuque.com/eosphoros/dbgpt-docs/gd4kgumgd004aly8)
|
||||
- [**模型服务部署**](https://www.yuque.com/eosphoros/dbgpt-docs/vubxiv9cqed5mc6o)
|
||||
- [单机部署](https://www.yuque.com/eosphoros/dbgpt-docs/kwg1ed88lu5fgawb)
|
||||
- [集群部署](https://www.yuque.com/eosphoros/dbgpt-docs/gmbp9619ytyn2v1s)
|
||||
- [vLLM](https://www.yuque.com/eosphoros/dbgpt-docs/bhy9igdvanx1uluf)
|
||||
- [**如何Debug**](https://www.yuque.com/eosphoros/dbgpt-docs/eyg0ocbc2ce3q95r)
|
||||
- [**AWEL**](https://www.yuque.com/eosphoros/dbgpt-docs/zozbzslbfk0m0op5)
|
||||
- [**FAQ**](https://www.yuque.com/eosphoros/dbgpt-docs/gomtc46qonmyt44l)
|
||||
## 特性一览
|
||||
|
||||
- **私域问答&数据处理&RAG**支持内置、多文件格式上传、插件自抓取等方式自定义构建知识库,对海量结构化,非结构化数据做统一向量存储与检索
|
||||
- **多数据源&GBI**支持自然语言与Excel、数据库、数仓等多种数据源交互,并支持分析报告。
|
||||
- **自动化微调**围绕大语言模型、Text2SQL数据集、LoRA/QLoRA/Pturning等微调方法构建的自动化微调轻量框架, 让TextSQL微调像流水线一样方便。详见: [DB-GPT-Hub](https://github.com/eosphoros-ai/DB-GPT-Hub)
|
||||
- **数据驱动的Agents插件**支持自定义插件执行任务,原生支持Auto-GPT插件模型,Agents协议采用Agent Protocol标准
|
||||
- **多模型支持与管理**海量模型支持,包括开源、API代理等几十种大语言模型。如LLaMA/LLaMA2、Baichuan、ChatGLM、文心、通义、智谱等。当前已支持如下模型:
|
||||
- 新增支持模型
|
||||
- 🔥🔥🔥 [Meta-Llama-3.1-405B-Instruct](https://huggingface.co/meta-llama/Meta-Llama-3.1-405B-Instruct)
|
||||
- 🔥🔥🔥 [Meta-Llama-3.1-70B-Instruct](https://huggingface.co/meta-llama/Meta-Llama-3.1-70B-Instruct)
|
||||
- 🔥🔥🔥 [Meta-Llama-3.1-8B-Instruct](https://huggingface.co/meta-llama/Meta-Llama-3.1-8B-Instruct)
|
||||
- 🔥🔥🔥 [gemma-2-27b-it](https://huggingface.co/google/gemma-2-27b-it)
|
||||
- 🔥🔥🔥 [gemma-2-9b-it](https://huggingface.co/google/gemma-2-9b-it)
|
||||
- 🔥🔥🔥 [DeepSeek-Coder-V2-Instruct](https://huggingface.co/deepseek-ai/DeepSeek-Coder-V2-Instruct)
|
||||
- 🔥🔥🔥 [DeepSeek-Coder-V2-Lite-Instruct](https://huggingface.co/deepseek-ai/DeepSeek-Coder-V2-Lite-Instruct)
|
||||
- 🔥🔥🔥 [Qwen2-57B-A14B-Instruct](https://huggingface.co/Qwen/Qwen2-57B-A14B-Instruct)
|
||||
- 🔥🔥🔥 [Qwen2-57B-A14B-Instruct](https://huggingface.co/Qwen/Qwen2-57B-A14B-Instruct)
|
||||
- 🔥🔥🔥 [Qwen2-72B-Instruct](https://huggingface.co/Qwen/Qwen2-72B-Instruct)
|
||||
- 🔥🔥🔥 [Qwen2-7B-Instruct](https://huggingface.co/Qwen/Qwen2-7B-Instruct)
|
||||
- 🔥🔥🔥 [Qwen2-1.5B-Instruct](https://huggingface.co/Qwen/Qwen2-1.5B-Instruct)
|
||||
- 🔥🔥🔥 [Qwen2-0.5B-Instruct](https://huggingface.co/Qwen/Qwen2-0.5B-Instruct)
|
||||
- 🔥🔥🔥 [glm-4-9b-chat](https://huggingface.co/THUDM/glm-4-9b-chat)
|
||||
- 🔥🔥🔥 [Phi-3](https://huggingface.co/collections/microsoft/phi-3-6626e15e9585a200d2d761e3)
|
||||
- 🔥🔥🔥 [Yi-1.5-34B-Chat](https://huggingface.co/01-ai/Yi-1.5-34B-Chat)
|
||||
- 🔥🔥🔥 [Yi-1.5-9B-Chat](https://huggingface.co/01-ai/Yi-1.5-9B-Chat)
|
||||
- 🔥🔥🔥 [Yi-1.5-6B-Chat](https://huggingface.co/01-ai/Yi-1.5-6B-Chat)
|
||||
- 🔥🔥🔥 [Qwen1.5-110B-Chat](https://huggingface.co/Qwen/Qwen1.5-110B-Chat)
|
||||
- 🔥🔥🔥 [Qwen1.5-MoE-A2.7B-Chat](https://huggingface.co/Qwen/Qwen1.5-MoE-A2.7B-Chat)
|
||||
- 🔥🔥🔥 [Meta-Llama-3-70B-Instruct](https://huggingface.co/meta-llama/Meta-Llama-3-70B-Instruct)
|
||||
- 🔥🔥🔥 [Meta-Llama-3-8B-Instruct](https://huggingface.co/meta-llama/Meta-Llama-3-8B-Instruct)
|
||||
- 🔥🔥🔥 [CodeQwen1.5-7B-Chat](https://huggingface.co/Qwen/CodeQwen1.5-7B-Chat)
|
||||
- 🔥🔥🔥 [Qwen1.5-32B-Chat](https://huggingface.co/Qwen/Qwen1.5-32B-Chat)
|
||||
- 🔥🔥🔥 [Starling-LM-7B-beta](https://huggingface.co/Nexusflow/Starling-LM-7B-beta)
|
||||
- 🔥🔥🔥 [gemma-7b-it](https://huggingface.co/google/gemma-7b-it)
|
||||
- 🔥🔥🔥 [gemma-2b-it](https://huggingface.co/google/gemma-2b-it)
|
||||
- 🔥🔥🔥 [SOLAR-10.7B](https://huggingface.co/upstage/SOLAR-10.7B-Instruct-v1.0)
|
||||
- 🔥🔥🔥 [Mixtral-8x7B](https://huggingface.co/mistralai/Mixtral-8x7B-Instruct-v0.1)
|
||||
- 🔥🔥🔥 [Qwen-72B-Chat](https://huggingface.co/Qwen/Qwen-72B-Chat)
|
||||
- 🔥🔥🔥 [Yi-34B-Chat](https://huggingface.co/01-ai/Yi-34B-Chat)
|
||||
- [更多开源模型](https://www.yuque.com/eosphoros/dbgpt-docs/iqaaqwriwhp6zslc#qQktR)
|
||||
- 支持在线代理模型
|
||||
- [x] [DeepSeek.deepseek-chat](https://platform.deepseek.com/api-docs/)
|
||||
- [x] [Ollama.API](https://github.com/ollama/ollama/blob/main/docs/api.md)
|
||||
- [x] [月之暗面.Moonshot](https://platform.moonshot.cn/docs/)
|
||||
- [x] [零一万物.Yi](https://platform.lingyiwanwu.com/docs)
|
||||
- [x] [OpenAI·ChatGPT](https://api.openai.com/)
|
||||
- [x] [百川·Baichuan](https://platform.baichuan-ai.com/)
|
||||
- [x] [阿里·通义](https://www.aliyun.com/product/dashscope)
|
||||
- [x] [百度·文心](https://cloud.baidu.com/product/wenxinworkshop?track=dingbutonglan)
|
||||
- [x] [智谱·ChatGLM](http://open.bigmodel.cn/)
|
||||
- [x] [讯飞·星火](https://xinghuo.xfyun.cn/)
|
||||
- [x] [Google·Bard](https://bard.google.com/)
|
||||
- [x] [Google·Gemini](https://makersuite.google.com/app/apikey)
|
||||
- **隐私安全**通过私有化大模型、代理脱敏等多种技术保障数据的隐私安全。
|
||||
- [支持数据源](https://www.yuque.com/eosphoros/dbgpt-docs/rc4r27ybmdwg9472)
|
||||
## Image
|
||||
🌐 [AutoDL镜像](https://www.codewithgpu.com/i/eosphoros-ai/DB-GPT/dbgpt)
|
||||
🌐 [小程序云部署](https://www.yuque.com/eosphoros/dbgpt-docs/ek12ly8k661tbyn8)
|
||||
### 多语言切换
|
||||
在.env 配置文件当中,修改LANGUAGE参数来切换使用不同的语言,默认是英文(中文zh, 英文en, 其他语言待补充)
|
||||
## 使用说明
|
||||
### 多模型使用
|
||||
### 数据Agents使用
|
||||
|
||||
- [数据Agents](https://www.yuque.com/eosphoros/dbgpt-docs/gwz4rayfuwz78fbq)
|
||||
## 贡献
|
||||
## 更加详细的贡献指南请参考[如何贡献](https://github.com/eosphoros-ai/DB-GPT/blob/main/CONTRIBUTING.md)。
|
||||
这是一个用于数据库的复杂且创新的工具, 我们的项目也在紧急的开发当中, 会陆续发布一些新的feature。如在使用当中有任何具体问题, 优先在项目下提issue, 如有需要, 请联系如下微信,我会尽力提供帮助,同时也非常欢迎大家参与到项目建设中。
|
||||
## Licence
|
||||
The MIT License (MIT)
|
||||
## 引用
|
||||
如果您发现`DB-GPT`对您的研究或开发有用,请引用以下[论文](https://arxiv.org/abs/2312.17449):
|
||||
```
|
||||
@article{xue2023dbgpt,
|
||||
title={DB-GPT: Empowering Database Interactions with Private Large Language Models},
|
||||
author={Siqiao Xue and Caigao Jiang and Wenhui Shi and Fangyin Cheng and Keting Chen and Hongjun Yang and Zhiping Zhang and Jianshan He and Hongyang Zhang and Ganglin Wei and Wang Zhao and Fan Zhou and Danrui Qi and Hong Yi and Shaodong Liu and Faqiang Chen},
|
||||
year={2023},
|
||||
journal={arXiv preprint arXiv:2312.17449},
|
||||
url={https://arxiv.org/abs/2312.17449}
|
||||
}
|
||||
```
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,286 +0,0 @@
|
||||
# TuGraph
|
||||
TuGraph图数据库由蚂蚁集团与清华大学联合研发,构建了一套包含图存储、图计算、图学习、图研发平台的完善的图技术体系,支持海量多源的关联数据的实时处理,显著提升数据分析效率,支撑了蚂蚁支付、安全、社交、公益、数据治理等300多个场景应用。拥有业界领先规模的图集群,解决了图数据分析面临的大数据量、高吞吐率和低延迟等重大挑战,是蚂蚁集团金融风控能力的重要基础设施,显著提升了欺诈洗钱等金融风险的实时识别能力和审理分析效率,并面向金融、工业、政务服务等行业客户。TuGraph产品家族中,开源产品包括:TuGraph DB、TuGraph Analytics、OSGraph、ChatTuGraph等。内源产品包括:GeaBase、GeaFlow、GeaLearn、GeaMaker等。
|
||||
|
||||
TuGraph企业级图数据管理平台提供对关联数据的复杂、深度分析功能。TuGraph以分布式集群架构,支持海量数据的高吞吐、高可用性、高并发读写和ACID事务操作。通过对数据的分片、分区,支持水平扩展,提供对点、边、属性、拓扑等结构的查询、过滤、索引等功能。TuGraph提供离线、近线、在线的图算法和图学习能力,内置数十种算法,能够对全图、子图、动态图的模式和特征进行处理,通过可视化或数据服务形式与外部数据源交互。此外,TuGraph提供可视化的展示和操作界面,覆盖图研发和服务的全生命周期,支持主流的图查询语言,提供便捷的访问和开发接口,能够与外部多模数据源进行导入导出、存量/增量/批量更新和备份。TuGraph还提供精美和实用的图生产环境管理监控,满足企业用户的技术和业务应用需要。
|
||||
|
||||
TuGraph在金融风控方面的应用实践主要包括个人信贷业务、反欺诈、洗钱路径追踪等问题。利用多维交叉关联信息深度刻画申请和交易行为,识别多种复杂、规模化、隐蔽性的欺诈网络和洗钱网络;结合聚类分析、风险传播等算法,实时计算用户的风险评分,在风险行为发生前预先识别,帮助金融机构提升效率、降低风险。基于TuGraph企业级图数据管理平台,蚂蚁集团增加反欺诈稽核金额6%,反洗钱风险审理分析效率提升90%。每天计算近10亿用户大约200亿左右边关系,对疑似团伙类犯罪风险识别能力提高近10倍。此外,为某银行提供的信贷图平台提升了13%的风控模型区分度;为某银行完成的信用卡申请团伙欺诈分析方案,运算时间缩短至原有的1/60;为某银行搭建的企业风险图平台,在对小微企业评级放贷问题中,担保圈识别准确率达到90%以上。
|
||||
|
||||
|
||||
## 1. TuGraph DB
|
||||
|
||||
### 1.1 简介
|
||||
TuGraph DB 是支持大数据容量、低延迟查找和快速图分析功能的高效图数据库。TuGraph社区版于2022年9月开源,提供了完整的图数据库基础功能和成熟的产品设计(如ACID兼容的事务、编程API和配套工具等),适用于单实例部署。社区版支持TB级别的数据规模,为用户管理和分析复杂关联数据提供了高效、易用、可靠的平台,是学习TuGraph和实现小型项目的理想选择。
|
||||
|
||||
### 1.2 TuGraph特性
|
||||
TuGraph是支持大数据量、低延迟查找和快速图分析功能的高效图数据库。TuGraph也是基于磁盘的数据库,支持存储多达数十TB的数据。TuGraph提供多种API,使用户能够轻松构建应用程序,并使其易于扩展和优化。
|
||||
|
||||
它具有如下功能特征:
|
||||
|
||||
* 属性图模型
|
||||
* 实时增删查改
|
||||
* 多重图(点间允许多重边)
|
||||
* 多图(大图与多个子图)
|
||||
* 完善的ACID事务处理,隔离级别为可串行化(serializable)
|
||||
* 点边索引
|
||||
* 混合事务和分析处理(HTAP),支持图查询、图分析、图学习
|
||||
* 主流图查询语言(OpenCypher、ISO GQL等)
|
||||
* 支持OLAP API,内置30多种图分析算法
|
||||
* 基于C++/Python的存储过程,含事务内并行Traversal API
|
||||
* 提供图可视化工具
|
||||
* 在性能和可扩展性方面的支持:
|
||||
* 千万点/秒的高吞吐率
|
||||
* TB级大容量
|
||||
* 高可用性支持
|
||||
* 高性能批量导入
|
||||
* 在线/离线的备份恢复
|
||||
|
||||
|
||||
主要功能:
|
||||
|
||||
- 标签属性图模型
|
||||
- 完善的 ACID 事务处理
|
||||
- 内置 34 图分析算法
|
||||
- 支持全文/主键/二级索引
|
||||
- OpenCypher 图查询语言
|
||||
- 基于 C++/Python 的存储过程
|
||||
|
||||
性能和可扩展性:
|
||||
|
||||
- LDBC SNB世界记录保持者 (2022/9/1 https://ldbcouncil.org/benchmarks/snb/)
|
||||
- 支持存储多达数十TB的数据
|
||||
- 每秒访问数百万个顶点
|
||||
- 快速批量导入
|
||||
|
||||
TuGraph DB的文档在[链接](https://tugraph-db.readthedocs.io/zh_CN/latest),欢迎访问我们的[官网](https://www.tugraph.org)。
|
||||
|
||||
### 1.3 快速上手
|
||||
|
||||
一个简单的方法是使用docker进行设置,可以在[DockerHub](https://hub.docker.com/u/tugraph)中找到, 名称为`tugraph/tugraph-runtime-[os]:[tugraph version]`,
|
||||
例如, `tugraph/tugraph-runtime-centos7:3.3.0`。
|
||||
|
||||
更多详情请参考 [快速上手文档](./docs/zh-CN/source/3.quick-start/1.preparation.md) 和 [业务开发指南](./docs/zh-CN/source/development_guide.md).
|
||||
|
||||
### 1.4 从源代码编译
|
||||
|
||||
建议在Linux系统中构建TuGraph DB,Docker环境是个不错的选择。如果您想设置一个新的环境,请参考[Dockerfile](ci/images).
|
||||
|
||||
以下是编译TuGraph DB的步骤:
|
||||
|
||||
1. 如果需要web接口运行`deps/build_deps.sh`,不需要web接口则跳过此步骤
|
||||
2. 根据容器系统信息执行`cmake .. -DOURSYSTEM=centos`或者`cmake .. -DOURSYSTEM=ubuntu`
|
||||
3. `make`
|
||||
4. `make package` 或者 `cpack --config CPackConfig.cmake`
|
||||
|
||||
示例:`tugraph/tugraph-compile-centos7`Docker环境
|
||||
|
||||
```bash
|
||||
$ git clone --recursive https://github.com/TuGraph-family/tugraph-db.git
|
||||
$ cd tugraph-db
|
||||
$ deps/build_deps.sh
|
||||
$ mkdir build && cd build
|
||||
$ cmake .. -DOURSYSTEM=centos7
|
||||
$ make
|
||||
$ make package
|
||||
```
|
||||
|
||||
### 1.5 开发
|
||||
|
||||
我们已为在DockerHub中编译准备了环境docker镜像,可以帮助开发人员轻松入门,名称为 `tugraph/tugraph-compile-[os]:[compile version]`, 例如, `tugraph/tugraph-compile-centos7:1.1.0`。
|
||||
|
||||
## 2. TuGraph Analytics
|
||||
|
||||
### 2.1 介绍
|
||||
**TuGraph Analytics** (别名:GeaFlow) 是蚂蚁集团开源的[**性能世界一流**](https://ldbcouncil.org/benchmarks/snb-bi/)的OLAP图数据库,支持万亿级图存储、图表混合处理、实时图计算、交互式图分析等核心能力,目前广泛应用于数仓加速、金融风控、知识图谱以及社交网络等场景。
|
||||
|
||||
关于GeaFlow更多介绍请参考:[GeaFlow介绍文档](docs/docs-cn/introduction.md)
|
||||
|
||||
GeaFlow设计论文参考:[GeaFlow: A Graph Extended and Accelerated Dataflow System](https://dl.acm.org/doi/abs/10.1145/3589771)
|
||||
|
||||
### 2.2 起源
|
||||
|
||||
早期的大数据分析主要以离线处理为主,以Hadoop为代表的技术栈很好的解决了大规模数据的分析问题。然而数据处理的时效性不足,
|
||||
很难满足高实时需求的场景。以Storm为代表的流式计算引擎的出现则很好的解决了数据实时处理的问题,提高了数据处理的时效性。
|
||||
然而,Storm本身不提供状态管理的能力, 对于聚合等有状态的计算显得无能为力。Flink
|
||||
的出现很好的弥补了这一短板,通过引入状态管理以及Checkpoint机制,实现了高效的有状态流计算能力。
|
||||
|
||||
随着数据实时处理场景的丰富,尤其是在实时数仓场景下,实时关系运算(即Stream Join)
|
||||
越来越多的成为数据实时化的难点。Flink虽然具备优秀的状态管理能和出色的性能,然而在处理Join运算,尤其是3度以上Join时,
|
||||
性能瓶颈越来越明显。由于需要在Join两端存放各个输入的数据状态,当Join变多时,状态的数据量急剧扩大,性能也变的难以接受。
|
||||
产生这个问题的本质原因是Flink等流计算系统以表作为数据模型,而表模型本身是一个二维结构,不包含关系的定义和关系的存储,
|
||||
在处理关系运算时只能通过Join运算方式实现,成本很高。
|
||||
|
||||
在蚂蚁的大数据应用场景中,尤其是金融风控、实时数仓等场景下,存在大量Join运算,如何提高Join
|
||||
的时效性和性能成为我们面临的重要挑战,为此我们引入了图模型。图模型是一种以点边结构描述实体关系的数据模型,在图模型里面,点代表实体,
|
||||
边代表关系,数据存储层面点边存放在一起。因此,图模型天然定义了数据的关系同时存储层面物化了点边关系。基于图模型,我们实现了新一代实时计算
|
||||
引擎GeaFlow,很好的解决了复杂关系运算实时化的问题。目前GeaFlow已广泛应用于数仓加速、金融风控、知识图谱以及社交网络等场景。
|
||||
|
||||
### 2.3 特性
|
||||
|
||||
* 分布式实时图计算
|
||||
* 图表混合处理(SQL+GQL语言)
|
||||
* 统一流批图计算
|
||||
* 万亿级图原生存储
|
||||
* 交互式图分析
|
||||
* 高可用和Exactly Once语义
|
||||
* 高阶API算子开发
|
||||
* UDF/图算法/Connector插件支持
|
||||
* 一站式图研发平台
|
||||
* 云原生部署
|
||||
|
||||
### 2.4 快速上手
|
||||
|
||||
1. 准备Git、JDK8、Maven、Docker环境。
|
||||
2. 下载源码:`git clone https://github.com/TuGraph-family/tugraph-analytics`
|
||||
3. 项目构建:`mvn clean install -DskipTests`
|
||||
4. 测试任务:`./bin/gql_submit.sh --gql geaflow/geaflow-examples/gql/loop_detection.sql`
|
||||
3. 构建镜像:`./build.sh --all`
|
||||
4. 启动容器:`docker run -d --name geaflow-console -p 8888:8888 geaflow-console:0.1`
|
||||
|
||||
更多详细内容请参考:[快速上手文档](docs/docs-cn/quick_start.md)。
|
||||
|
||||
### 2.5 开发手册
|
||||
|
||||
GeaFlow支持DSL和API两套编程接口,您既可以通过GeaFlow提供的类SQL扩展语言SQL+ISO/GQL进行流图计算作业的开发,也可以通过GeaFlow的高阶API编程接口通过Java语言进行应用开发。
|
||||
* DSL应用开发:[DSL开发文档](docs/docs-cn/application-development/dsl/overview.md)
|
||||
* API应用开发:[API开发文档](docs/docs-cn/application-development/api/guid.md)
|
||||
|
||||
|
||||
### 2.6 技术架构
|
||||
|
||||
GeaFlow整体架构如下所示:
|
||||
|
||||

|
||||
|
||||
* [DSL层](./principle/dsl_principle.md):即语言层。GeaFlow设计了SQL+GQL的融合分析语言,支持对表模型和图模型统一处理。
|
||||
* [Framework层](./principle/framework_principle.md):即框架层。GeaFlow设计了面向Graph和Stream的两套API支持流、批、图融合计算,并实现了基于Cycle的统一分布式调度模型。
|
||||
* [State层](./principle/state_principle.md):即存储层。GeaFlow设计了面向Graph和KV的两套API支持表数据和图数据的混合存储,整体采用了Sharing Nothing的设计,并支持将数据持久化到远程存储。
|
||||
* [Console平台](./principle/console_principle.md):GeaFlow提供了一站式图研发平台,实现了图数据的建模、加工、分析能力,并提供了图作业的运维管控支持。
|
||||
* **执行环境**:GeaFlow可以运行在多种异构执行环境,如K8S、Ray以及本地模式。
|
||||
|
||||
### 2.7 应用场景
|
||||
|
||||
#### 2.7.1 实时数仓加速
|
||||
数仓场景存在大量Join运算,在DWD层往往需要将多张表展开成一张大宽表,以加速后续查询。当Join的表数量变多时,传统的实时计算引擎很难
|
||||
保证Join的时效性和性能,这也成为目前实时数仓领域一个棘手的问题。基于GeaFlow的实时图计算引擎,可以很好的解决这方面的问题。
|
||||
GeaFlow以图作为数据模型,替代DWD层的宽表,可以实现数据实时构图,同时在查询阶段利用图的点边物化特性,可以极大加速关系运算的查询。
|
||||
|
||||
#### 2.7.2 实时归因分析
|
||||
在信息化的大背景下,对用户行为进行渠道归因和路径分析是流量分析领域中的核心所在。通过实时计算用户的有效行为路径,构建出完整的转化路径,能够快速帮助业务看清楚产品的价值,帮助运营及时调整运营思路。实时归因分析的核心要点是准确性和实效性。准确性要求在成本可控下保证用户行为路径分析的准确性;实效性则要求计算的实时性足够高,才能快速帮助业务决策。
|
||||
基于GeaFlow流图计算引擎的能力可以很好的满足归因分析的准确性和时效性要求。如下图所示:
|
||||

|
||||
GeaFlow首先通过实时构图将用户行为日志转换成用户行为拓扑图,以用户作为图中的点,与其相关的每个行为构建成从该用户指向埋点页面的一条边.然后利用流图计算能力分析提前用户行为子图,在子图上基于归因路径匹配的规则进行匹配计算得出该成交行为相应用户的归因路径,并输出到下游系统。
|
||||
|
||||
#### 2.7.3 实时反套现
|
||||
在信贷风控的场景下,如何进行信用卡反套现是一个典型的风控诉求。基于现有的套现模式分析,可以看到套现是一个环路子图,如何快速,高效在大图中快速判定套现,将极大的增加风险的识别效率。以下图为例,通过将实时交易流、转账流等输入数据源转换成实时交易图,然后根据风控策略对用户交易行为做图特征分析,比如环路检查等特征计算,实时提供给决策和监控平台进行反套现行为判定。通过GeaFlow实时构图和实时图计算能力,可以快速发现套现等异常交易行为,极大降低平台风险。
|
||||

|
||||
|
||||
|
||||
|
||||
## 3. OSGraph
|
||||
|
||||
**OSGraph (Open Source Graph)** 是一个开源图谱关系洞察工具,基于GitHub开源数据全域图谱,实现开发者行为、项目社区生态的分析洞察。可以为开发者、项目Owner、开源布道师、社区运营等提供简洁直观的开源数据视图,帮助你和你的项目制作专属的开源名片、寻求契合的开发伙伴、挖掘深度的社区价值。
|
||||
|
||||
|
||||
### 3.1 产品地址
|
||||
|
||||
**[https://osgraph.com](https://osgraph.com)**
|
||||
|
||||
|
||||
### 3.2 快速开始
|
||||
|
||||
本地启动测试请参考:[OSGraph部署文档](docs/zh-CN/DeveloperManual.md)
|
||||
|
||||
|
||||
### 3.3 功能介绍
|
||||
|
||||
当前产品默认提供了6张开源数据图谱供大家体验,包含项目类图谱3个(贡献、生态、社区)、开发类3个(活动、伙伴、兴趣)。
|
||||
|
||||
|
||||
#### 3.3.1 项目贡献图谱
|
||||
|
||||
**发现项目核心贡献**:根据项目开发者研发活动信息(Issue、PR、Commit、CR等),找到项目核心贡献者。
|
||||
|
||||
**Q**:我想看看给Apache Spark项目写代码的都有谁?
|
||||
|
||||
**A**:选择“项目贡献图谱” - 搜索spark - 选择apache/spark。可以看到HyukjinKwon、dongjoon-hyun等核心贡献者,另外还一不小心捉到两个“显眼包”,AmplabJenkins、SparkQA这两个只参与CodeReview的机器人账号。
|
||||
|
||||

|
||||
|
||||
|
||||
#### 3.3.2 项目生态图谱
|
||||
|
||||
**洞察项目生态伙伴**:提取项目间的开发活动、组织等关联信息,构建项目核心生态关系。
|
||||
|
||||
**Q**:最近很火的开源大模型Llama3周边生态大致是什么样的?
|
||||
|
||||
**A**:选择“项目生态图谱” - 搜索llama3 - 选择meta-llama3/llama3。可以看到pytorch、tensorflow、transformers等知名AI项目,当然还有上科技头条的llama.cpp。比较惊喜的发现是ray竟然和llama3有不少公共开发者,可以深度挖掘一下。
|
||||
|
||||

|
||||
|
||||
|
||||
|
||||
#### 3.3.3 项目社区图谱
|
||||
|
||||
**分析项目社区分布**:根据项目的开发活动、开发者组织等信息,提取项目核心开发者社区分布。
|
||||
|
||||
**Q**:大数据引擎Flink发展这么多年后的社区现状如何?
|
||||
|
||||
**A**:选择“项目社区图谱” - 搜索flink - 选择apache/flink。可以看到项目关注者主要来自中、美、德三国,而Alibaba组织是代码贡献的中坚力量。
|
||||
|
||||

|
||||
|
||||
|
||||
|
||||
#### 3.3.4 开发活动图谱
|
||||
|
||||
**展示个人开源贡献**:根据开发者研发活动信息(Issue、PR、Commit、CR等),找到参与的核心项目。
|
||||
|
||||
**Q**:大神Linus Torvalds最近在参与哪些开源项目?
|
||||
|
||||
**A**:选择“开发活动图谱” - 搜索torvalds。果然linux项目是torvalds的主要工作,不过llvm、mody、libgit2也有所参与,同时也看到他在subsurface这种“潜水日志管理工具”上的大量贡献,果然大佬的爱好都很广泛。
|
||||
|
||||

|
||||
|
||||
|
||||
|
||||
#### 3.3.5 开源伙伴图谱
|
||||
|
||||
**寻找个人开源伙伴**:找到开发者在开源社区中,与之协作紧密的其他开发者。
|
||||
|
||||
**Q**:我想知道在开源社区有没有和我志同道合的人?
|
||||
|
||||
**A**:选择“开发伙伴图谱” - 搜索我的ID。让我震惊的是有那么多陌生人和我关注了同一批项目,这不得找机会认识一下,说不定就能找到新朋友了。而和我合作PR的人基本上都是我认识的朋友和同事,继续探索一下朋友们的开源伙伴,开源社区的“六度人脉”不就来了么。
|
||||
|
||||

|
||||
|
||||
|
||||
|
||||
#### 3.3.6 开源兴趣图谱
|
||||
|
||||
**挖掘个人开源兴趣**:根据参与的项目主题、标签等信息,分析开发者技术领域与兴趣。
|
||||
|
||||
**Q**:GitHub上最活跃的开发者对什么技术感兴趣?
|
||||
|
||||
**A**:选择“开源兴趣图谱” - 搜索sindresorhus([GitHub用户榜](https://gitstar-ranking.com) No.1)。整体来看sindresorhus对node、npm、js很感兴趣,另外他发起的awesome项目足足30W星,令人咋舌!当前的开源兴趣数据主要来自项目有限的标签信息,后续借助AI技术可能会有更好的展现。
|
||||
|
||||

|
||||
|
||||
|
||||
### 3.4 未来规划
|
||||
|
||||
未来将会有更多有趣的图谱和功能加入到OSGraph:
|
||||
|
||||
* 简单灵活的API设计,让图谱无限扩展。
|
||||
* 自由高效的画布交互,无限探索数据价值。
|
||||
* 图谱URL支持嵌入Markdown,制作我的开源名片。
|
||||
* 基于AI技术的项目主题标签分析。
|
||||
* 多人多项目联合分析,图谱洞察一键可达。
|
||||
* 更丰富的数据展示与多维分析。
|
||||
* **更多功能,与你携手共建……**
|
||||
|
||||
|
||||
|
||||
## 4. ChatTuGraph
|
||||
|
||||
ChatTuGraph通过AI技术为TuGraph赋能,可以为图业务研发效能、图产品解决方案、图数据智能分析、图任务自动管控等领域带来更丰富的应用场景。
|
||||
目前ChatTuGraph通过图语言语料生成,借助大模型微调技术实现了自然语言的图数据分析,构建Graph RAG基于知识图谱实现检索增强生成,以降低大模型的推理幻觉,以及通过多智能体技术(Multiple Agents System)实现图数据上的AIGC、智能化等能力。
|
Loading…
Reference in New Issue
Block a user