Skip to content

RAGFlow is an agent-native database: a Retrieval-Augmented Generation (RAG) engine that grew into context infrastructure.

Update license (#2086)

Jin Hai99af1cbeaca7
diff --git a/graphrag/claim_extractor.py b/graphrag/claim_extractor.py
index ee9e7f3237..942bafa3f8 100644
--- a/graphrag/claim_extractor.py
+++ b/graphrag/claim_extractor.py
@@ -1,22 +1,10 @@
-#
-# Copyright 2024 The InfiniFlow Authors. All Rights Reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
+# Copyright (c) 2024 Microsoft Corporation.
+# Licensed under the MIT License
"""
Reference:
- [graphrag](https://github.com/microsoft/graphrag)
"""
+
import argparse
import json
import logging
diff --git a/graphrag/claim_prompt.py b/graphrag/claim_prompt.py
index 5678ffd134..b65971bbea 100644
--- a/graphrag/claim_prompt.py
+++ b/graphrag/claim_prompt.py
@@ -1,18 +1,5 @@
-#
-# Copyright 2024 The InfiniFlow Authors. All Rights Reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
+# Copyright (c) 2024 Microsoft Corporation.
+# Licensed under the MIT License
"""
Reference:
- [graphrag](https://github.com/microsoft/graphrag)
diff --git a/graphrag/community_report_prompt.py b/graphrag/community_report_prompt.py
index 3b042d08b4..554ea367c9 100644
--- a/graphrag/community_report_prompt.py
+++ b/graphrag/community_report_prompt.py
@@ -1,18 +1,5 @@
-#
-# Copyright 2024 The InfiniFlow Authors. All Rights Reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
+# Copyright (c) 2024 Microsoft Corporation.
+# Licensed under the MIT License
"""
Reference:
- [graphrag](https://github.com/microsoft/graphrag)
diff --git a/graphrag/community_reports_extractor.py b/graphrag/community_reports_extractor.py
index eb2c213c7c..27b805ff44 100644
--- a/graphrag/community_reports_extractor.py
+++ b/graphrag/community_reports_extractor.py
@@ -1,18 +1,5 @@
-#
-# Copyright 2024 The InfiniFlow Authors. All Rights Reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
+# Copyright (c) 2024 Microsoft Corporation.
+# Licensed under the MIT License
"""
Reference:
- [graphrag](https://github.com/microsoft/graphrag)
diff --git a/graphrag/description_summary.py b/graphrag/description_summary.py
index b49ecb022b..3aa3287e7e 100644
--- a/graphrag/description_summary.py
+++ b/graphrag/description_summary.py
@@ -1,18 +1,5 @@
-#
-# Copyright 2024 The InfiniFlow Authors. All Rights Reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
+# Copyright (c) 2024 Microsoft Corporation.
+# Licensed under the MIT License
"""
Reference:
- [graphrag](https://github.com/microsoft/graphrag)
diff --git a/graphrag/entity_embedding.py b/graphrag/entity_embedding.py
index 7e247a8d18..ca9932b65d 100644
--- a/graphrag/entity_embedding.py
+++ b/graphrag/entity_embedding.py
@@ -1,18 +1,5 @@
-#
-# Copyright 2024 The InfiniFlow Authors. All Rights Reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
+# Copyright (c) 2024 Microsoft Corporation.
+# Licensed under the MIT License
"""
Reference:
- [graphrag](https://github.com/microsoft/graphrag)
diff --git a/graphrag/entity_resolution.py b/graphrag/entity_resolution.py
index 909207682d..92152aa9a5 100644
--- a/graphrag/entity_resolution.py
+++ b/graphrag/entity_resolution.py
@@ -13,6 +13,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
+
import logging
import re
import traceback
diff --git a/graphrag/graph_extractor.py b/graphrag/graph_extractor.py
index 00d0f72ad6..c2dc530eec 100644
--- a/graphrag/graph_extractor.py
+++ b/graphrag/graph_extractor.py
@@ -1,21 +1,10 @@
-#
-# Copyright 2024 The InfiniFlow Authors. All Rights Reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
+# Copyright (c) 2024 Microsoft Corporation.
+# Licensed under the MIT License
"""
Reference:
- [graphrag](https://github.com/microsoft/graphrag)
"""
+
import logging
import numbers
import re
diff --git a/graphrag/graph_prompt.py b/graphrag/graph_prompt.py
index 11f3a6aee2..53ce61ad8d 100644
--- a/graphrag/graph_prompt.py
+++ b/graphrag/graph_prompt.py
@@ -1,22 +1,10 @@
-#
-# Copyright 2024 The InfiniFlow Authors. All Rights Reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
+# Copyright (c) 2024 Microsoft Corporation.
+# Licensed under the MIT License
"""
Reference:
- [graphrag](https://github.com/microsoft/graphrag)
"""
+
GRAPH_EXTRACTION_PROMPT = """
-Goal-
Given a text document that is potentially relevant to this activity and a list of entity types, identify all entities of those types from the text and all relationships among the identified entities.
diff --git a/graphrag/leiden.py b/graphrag/leiden.py
index 4fa1720ab4..8179706181 100644
--- a/graphrag/leiden.py
+++ b/graphrag/leiden.py
@@ -1,18 +1,5 @@
-#
-# Copyright 2024 The InfiniFlow Authors. All Rights Reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
+# Copyright (c) 2024 Microsoft Corporation.
+# Licensed under the MIT License
"""
Reference:
- [graphrag](https://github.com/microsoft/graphrag)
diff --git a/graphrag/mind_map_extractor.py b/graphrag/mind_map_extractor.py
index 652c871d6d..2968e9e361 100644
--- a/graphrag/mind_map_extractor.py
+++ b/graphrag/mind_map_extractor.py
@@ -13,6 +13,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
+
import collections
import logging
import re
diff --git a/graphrag/mind_map_prompt.py b/graphrag/mind_map_prompt.py
index 4613c12dd3..37f324cfa0 100644
--- a/graphrag/mind_map_prompt.py
+++ b/graphrag/mind_map_prompt.py
@@ -13,6 +13,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
+
MIND_MAP_EXTRACTION_PROMPT = """
- Role: You're a talent text processor to summarize a piece of text into a mind map.
diff --git a/graphrag/utils.py b/graphrag/utils.py
index a4524362cd..ec7be23dfb 100644
--- a/graphrag/utils.py
+++ b/graphrag/utils.py
@@ -1,18 +1,5 @@
-#
-# Copyright 2024 The InfiniFlow Authors. All Rights Reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
+# Copyright (c) 2024 Microsoft Corporation.
+# Licensed under the MIT License
"""
Reference:
- [graphrag](https://github.com/microsoft/graphrag)