From 446be289aa04db839a784ec4ecfee900a3b17513 Mon Sep 17 00:00:00 2001 From: Chengbiao Jin Date: Wed, 30 Jul 2025 16:51:40 -0700 Subject: [PATCH] Add license headers --- LICENSE.txt | 3 +++ common/chunkers/markdown_chunker.py | 14 ++++++++++++++ common/chunkers/semantic_chunker.py | 14 ++++++++++++++ common/config.py | 14 ++++++++++++++ common/db/connections.py | 14 ++++++++++++++ common/embeddings/tigergraph_embedding_store.py | 14 ++++++++++++++ .../extractors/LLMEntityRelationshipExtractor.py | 14 ++++++++++++++ common/gsql/supportai/SupportAI_Schema.gsql | 16 ++++++++++++++++ .../SupportAI_Schema_Native_Vector.gsql | 16 ++++++++++++++++ .../retrievers/Chunk_Sibling_Search.gsql | 16 ++++++++++++++++ .../retrievers/Chunk_Sibling_Vector_Search.gsql | 16 ++++++++++++++++ .../retrievers/Content_Similarity_Search.gsql | 16 ++++++++++++++++ .../Content_Similarity_Vector_Search.gsql | 16 ++++++++++++++++ .../Entity_Relationship_Retrieval.gsql | 16 ++++++++++++++++ .../retrievers/GraphRAG_Community_Search.gsql | 16 ++++++++++++++++ .../GraphRAG_Community_Search_Display.gsql | 16 ++++++++++++++++ .../GraphRAG_Community_Vector_Search.gsql | 16 ++++++++++++++++ .../retrievers/GraphRAG_Hybrid_Search.gsql | 16 ++++++++++++++++ .../GraphRAG_Hybrid_Search_Display.gsql | 16 ++++++++++++++++ .../GraphRAG_Hybrid_Vector_Search.gsql | 16 ++++++++++++++++ .../supportai/retrievers/Keyword_Search.gsql | 16 ++++++++++++++++ common/llm_services/aws_bedrock_service.py | 14 ++++++++++++++ common/llm_services/base_llm.py | 14 ++++++++++++++ common/llm_services/google_genai_service.py | 14 ++++++++++++++ common/llm_services/openai_service.py | 14 ++++++++++++++ common/py_schemas/schemas.py | 14 ++++++++++++++ common/py_schemas/tool_io_schemas.py | 14 ++++++++++++++ ecc/app/eventual_consistency_checker.py | 14 ++++++++++++++ ecc/app/graphrag/community_summarizer.py | 14 ++++++++++++++ ecc/app/graphrag/graph_rag.py | 14 ++++++++++++++ ecc/app/graphrag/util.py | 14 ++++++++++++++ ecc/app/graphrag/workers.py | 14 ++++++++++++++ ecc/app/main.py | 14 ++++++++++++++ ecc/app/supportai/supportai_init.py | 14 ++++++++++++++ ecc/app/supportai/workers.py | 14 ++++++++++++++ graphrag/app/agent.py | 14 ++++++++++++++ graphrag/app/agent/agent_generation.py | 14 ++++++++++++++ graphrag/app/agent/agent_graph.py | 14 ++++++++++++++ graphrag/app/agent/agent_router.py | 14 ++++++++++++++ graphrag/app/main.py | 14 ++++++++++++++ graphrag/app/routers/supportai.py | 14 ++++++++++++++ graphrag/app/routers/ui.py | 14 ++++++++++++++ graphrag/app/tools/generate_cypher.py | 14 ++++++++++++++ graphrag/app/tools/generate_function.py | 14 ++++++++++++++ graphrag/app/tools/generate_gsql.py | 14 ++++++++++++++ graphrag/app/tools/map_question_to_schema.py | 14 ++++++++++++++ 46 files changed, 661 insertions(+) create mode 100644 LICENSE.txt diff --git a/LICENSE.txt b/LICENSE.txt new file mode 100644 index 0000000..0c0672d --- /dev/null +++ b/LICENSE.txt @@ -0,0 +1,3 @@ +Copyright (c) 2025 TigerGraph, Inc. +You can get the full official license text here: +https://www.apache.org/licenses/LICENSE-2.0.txt diff --git a/common/chunkers/markdown_chunker.py b/common/chunkers/markdown_chunker.py index 20b20e1..5086076 100644 --- a/common/chunkers/markdown_chunker.py +++ b/common/chunkers/markdown_chunker.py @@ -1,3 +1,17 @@ +# Copyright (c) 2025 TigerGraph, Inc. +# +# 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. + from common.chunkers.base_chunker import BaseChunker from langchain_text_splitters.markdown import ExperimentalMarkdownSyntaxTextSplitter diff --git a/common/chunkers/semantic_chunker.py b/common/chunkers/semantic_chunker.py index cc17bf8..6ba0474 100644 --- a/common/chunkers/semantic_chunker.py +++ b/common/chunkers/semantic_chunker.py @@ -1,3 +1,17 @@ +# Copyright (c) 2025 TigerGraph, Inc. +# +# 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. + from common.chunkers.base_chunker import BaseChunker from common.embeddings.embedding_services import EmbeddingModel from langchain_experimental.text_splitter import ( diff --git a/common/config.py b/common/config.py index a088500..55c6c73 100644 --- a/common/config.py +++ b/common/config.py @@ -1,3 +1,17 @@ +# Copyright (c) 2025 TigerGraph, Inc. +# +# 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. + import json import os diff --git a/common/db/connections.py b/common/db/connections.py index 9e4f208..746669b 100644 --- a/common/db/connections.py +++ b/common/db/connections.py @@ -1,3 +1,17 @@ +# Copyright (c) 2025 TigerGraph, Inc. +# +# 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. + import logging import asyncio from typing import Annotated diff --git a/common/embeddings/tigergraph_embedding_store.py b/common/embeddings/tigergraph_embedding_store.py index eb09938..a560233 100644 --- a/common/embeddings/tigergraph_embedding_store.py +++ b/common/embeddings/tigergraph_embedding_store.py @@ -1,3 +1,17 @@ +# Copyright (c) 2025 TigerGraph, Inc. +# +# 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. + import logging import traceback import json diff --git a/common/extractors/LLMEntityRelationshipExtractor.py b/common/extractors/LLMEntityRelationshipExtractor.py index 477b44b..1251ce9 100644 --- a/common/extractors/LLMEntityRelationshipExtractor.py +++ b/common/extractors/LLMEntityRelationshipExtractor.py @@ -1,3 +1,17 @@ +# Copyright (c) 2025 TigerGraph, Inc. +# +# 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. + import json from typing import List import logging diff --git a/common/gsql/supportai/SupportAI_Schema.gsql b/common/gsql/supportai/SupportAI_Schema.gsql index d05f06d..94fcc9e 100644 --- a/common/gsql/supportai/SupportAI_Schema.gsql +++ b/common/gsql/supportai/SupportAI_Schema.gsql @@ -1,3 +1,19 @@ +/* + * Copyright (c) 2025 TigerGraph, Inc. + * + * 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. +*/ + CREATE SCHEMA_CHANGE JOB add_supportai_schema { ADD VERTEX DocumentChunk(PRIMARY_ID id STRING, idx INT, epoch_added UINT, epoch_processing UINT, epoch_processed UINT) WITH STATS="OUTDEGREE_BY_EDGETYPE", PRIMARY_ID_AS_ATTRIBUTE="true"; ADD VERTEX Document(PRIMARY_ID id STRING, epoch_added UINT, epoch_processing UINT, epoch_processed UINT) WITH STATS="OUTDEGREE_BY_EDGETYPE", PRIMARY_ID_AS_ATTRIBUTE="true"; diff --git a/common/gsql/supportai/SupportAI_Schema_Native_Vector.gsql b/common/gsql/supportai/SupportAI_Schema_Native_Vector.gsql index 586024c..f778caa 100644 --- a/common/gsql/supportai/SupportAI_Schema_Native_Vector.gsql +++ b/common/gsql/supportai/SupportAI_Schema_Native_Vector.gsql @@ -1,3 +1,19 @@ +/* + * Copyright (c) 2025 TigerGraph, Inc. + * + * 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. +*/ + CREATE SCHEMA_CHANGE JOB add_supportai_vector { ALTER VERTEX DocumentChunk ADD VECTOR ATTRIBUTE embedding(dimension=1536, metric="cosine"); ALTER VERTEX Document ADD VECTOR ATTRIBUTE embedding(dimension=1536, metric="cosine"); diff --git a/common/gsql/supportai/retrievers/Chunk_Sibling_Search.gsql b/common/gsql/supportai/retrievers/Chunk_Sibling_Search.gsql index ec85710..f64dae2 100644 --- a/common/gsql/supportai/retrievers/Chunk_Sibling_Search.gsql +++ b/common/gsql/supportai/retrievers/Chunk_Sibling_Search.gsql @@ -1,3 +1,19 @@ +/* + * Copyright (c) 2025 TigerGraph, Inc. + * + * 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. +*/ + CREATE OR REPLACE DISTRIBUTED QUERY Chunk_Sibling_Search(STRING json_list_vts="[]", STRING v_type="DocumentChunk", UINT lookback=3, INT lookahead=3, BOOL verbose = False) { TYPEDEF TUPLE VertexTypes; MapAccum> @@verbose_info; diff --git a/common/gsql/supportai/retrievers/Chunk_Sibling_Vector_Search.gsql b/common/gsql/supportai/retrievers/Chunk_Sibling_Vector_Search.gsql index 7f84287..99525e7 100644 --- a/common/gsql/supportai/retrievers/Chunk_Sibling_Vector_Search.gsql +++ b/common/gsql/supportai/retrievers/Chunk_Sibling_Vector_Search.gsql @@ -1,3 +1,19 @@ +/* + * Copyright (c) 2025 TigerGraph, Inc. + * + * 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. +*/ + CREATE OR REPLACE DISTRIBUTED QUERY Chunk_Sibling_Vector_Search(STRING v_type, LIST query_vector, UINT top_k=5, UINT lookback=3, INT lookahead=3, BOOL verbose = False) { TYPEDEF TUPLE VertexTypes; diff --git a/common/gsql/supportai/retrievers/Content_Similarity_Search.gsql b/common/gsql/supportai/retrievers/Content_Similarity_Search.gsql index 2a5f699..269ba9f 100644 --- a/common/gsql/supportai/retrievers/Content_Similarity_Search.gsql +++ b/common/gsql/supportai/retrievers/Content_Similarity_Search.gsql @@ -1,3 +1,19 @@ +/* + * Copyright (c) 2025 TigerGraph, Inc. + * + * 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. +*/ + CREATE OR REPLACE DISTRIBUTED QUERY Content_Similarity_Search(STRING json_list_vts="[]", STRING v_type="DocumentChunk", BOOL verbose = False) { TYPEDEF TUPLE VertexTypes; SetAccum @@start_set_type; diff --git a/common/gsql/supportai/retrievers/Content_Similarity_Vector_Search.gsql b/common/gsql/supportai/retrievers/Content_Similarity_Vector_Search.gsql index bd02e34..d9bb0de 100644 --- a/common/gsql/supportai/retrievers/Content_Similarity_Vector_Search.gsql +++ b/common/gsql/supportai/retrievers/Content_Similarity_Vector_Search.gsql @@ -1,3 +1,19 @@ +/* + * Copyright (c) 2025 TigerGraph, Inc. + * + * 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. +*/ + CREATE OR REPLACE DISTRIBUTED QUERY Content_Similarity_Vector_Search(STRING v_type, LIST query_vector, INT top_k=5, BOOL verbose = False) { TYPEDEF tuple Similarity_Results; TYPEDEF TUPLE VertexTypes; diff --git a/common/gsql/supportai/retrievers/Entity_Relationship_Retrieval.gsql b/common/gsql/supportai/retrievers/Entity_Relationship_Retrieval.gsql index 7423a39..fd0c954 100644 --- a/common/gsql/supportai/retrievers/Entity_Relationship_Retrieval.gsql +++ b/common/gsql/supportai/retrievers/Entity_Relationship_Retrieval.gsql @@ -1,3 +1,19 @@ +/* + * Copyright (c) 2025 TigerGraph, Inc. + * + * 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. +*/ + CREATE OR REPLACE DISTRIBUTED QUERY Entity_Relationship_Retrieval(SET entities, SET relationships, INT top_k=5) { SumAccum @num_touched; MapAccum> @@final_retrieval; diff --git a/common/gsql/supportai/retrievers/GraphRAG_Community_Search.gsql b/common/gsql/supportai/retrievers/GraphRAG_Community_Search.gsql index dbbe014..58f92e9 100644 --- a/common/gsql/supportai/retrievers/GraphRAG_Community_Search.gsql +++ b/common/gsql/supportai/retrievers/GraphRAG_Community_Search.gsql @@ -1,3 +1,19 @@ +/* + * Copyright (c) 2025 TigerGraph, Inc. + * + * 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. +*/ + CREATE OR REPLACE DISTRIBUTED QUERY GraphRAG_Community_Search(STRING json_list_vts="[]", INT community_level=2, BOOL with_chunk = true, BOOL with_doc = false, BOOL verbose = false) { MapAccum> @@final_retrieval; MapAccum> @@verbose_info; diff --git a/common/gsql/supportai/retrievers/GraphRAG_Community_Search_Display.gsql b/common/gsql/supportai/retrievers/GraphRAG_Community_Search_Display.gsql index 10ccc26..bdfef52 100644 --- a/common/gsql/supportai/retrievers/GraphRAG_Community_Search_Display.gsql +++ b/common/gsql/supportai/retrievers/GraphRAG_Community_Search_Display.gsql @@ -1,3 +1,19 @@ +/* + * Copyright (c) 2025 TigerGraph, Inc. + * + * 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. +*/ + CREATE OR REPLACE DISTRIBUTED QUERY GraphRAG_Community_Search_Display(STRING json_list_vts, UINT community_level = 2, BOOL with_chunk = true) { MapAccum> @@final_retrieval; SetAccum @@edges; diff --git a/common/gsql/supportai/retrievers/GraphRAG_Community_Vector_Search.gsql b/common/gsql/supportai/retrievers/GraphRAG_Community_Vector_Search.gsql index 38f36f4..29594d8 100644 --- a/common/gsql/supportai/retrievers/GraphRAG_Community_Vector_Search.gsql +++ b/common/gsql/supportai/retrievers/GraphRAG_Community_Vector_Search.gsql @@ -1,3 +1,19 @@ +/* + * Copyright (c) 2025 TigerGraph, Inc. + * + * 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. +*/ + CREATE OR REPLACE DISTRIBUTED QUERY GraphRAG_Community_Vector_Search(LIST query_vector, INT community_level=2, INT top_k = 3, BOOL with_chunk = true, BOOL with_doc = false, BOOL verbose = false) { MapAccum> @@final_retrieval; MapAccum> @@verbose_info; diff --git a/common/gsql/supportai/retrievers/GraphRAG_Hybrid_Search.gsql b/common/gsql/supportai/retrievers/GraphRAG_Hybrid_Search.gsql index d051f7b..ea8fa29 100644 --- a/common/gsql/supportai/retrievers/GraphRAG_Hybrid_Search.gsql +++ b/common/gsql/supportai/retrievers/GraphRAG_Hybrid_Search.gsql @@ -1,3 +1,19 @@ +/* + * Copyright (c) 2025 TigerGraph, Inc. + * + * 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. +*/ + CREATE OR REPLACE DISTRIBUTED QUERY GraphRAG_Hybrid_Search(STRING json_list_vts = "[]", UINT num_hops=5, UINT num_seen_min=1, BOOL chunk_only=False, BOOL doc_only = False, BOOL verbose = False) { TYPEDEF TUPLE VertexTypes; SetAccum @@start_set; diff --git a/common/gsql/supportai/retrievers/GraphRAG_Hybrid_Search_Display.gsql b/common/gsql/supportai/retrievers/GraphRAG_Hybrid_Search_Display.gsql index 263fe0d..6eec379 100644 --- a/common/gsql/supportai/retrievers/GraphRAG_Hybrid_Search_Display.gsql +++ b/common/gsql/supportai/retrievers/GraphRAG_Hybrid_Search_Display.gsql @@ -1,3 +1,19 @@ +/* + * Copyright (c) 2025 TigerGraph, Inc. + * + * 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. +*/ + CREATE OR REPLACE DISTRIBUTED QUERY GraphRAG_Hybrid_Search_Display(STRING json_list_vts, UINT num_hops=5, UINT num_seen_min=1, BOOL chunk_only=False) { SetAccum @@start_set; SetAccum @@tmp_set; diff --git a/common/gsql/supportai/retrievers/GraphRAG_Hybrid_Vector_Search.gsql b/common/gsql/supportai/retrievers/GraphRAG_Hybrid_Vector_Search.gsql index d6c8e16..d8c483d 100644 --- a/common/gsql/supportai/retrievers/GraphRAG_Hybrid_Vector_Search.gsql +++ b/common/gsql/supportai/retrievers/GraphRAG_Hybrid_Vector_Search.gsql @@ -1,3 +1,19 @@ +/* + * Copyright (c) 2025 TigerGraph, Inc. + * + * 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. +*/ + CREATE OR REPLACE DISTRIBUTED QUERY GraphRAG_Hybrid_Vector_Search(Set v_types, LIST query_vector, UINT top_k=5, UINT num_hops=3, UINT num_seen_min=1, BOOL chunk_only = False, BOOL doc_only = False, BOOL verbose = False) { TYPEDEF TUPLE VertexTypes; diff --git a/common/gsql/supportai/retrievers/Keyword_Search.gsql b/common/gsql/supportai/retrievers/Keyword_Search.gsql index c909030..9f1763f 100644 --- a/common/gsql/supportai/retrievers/Keyword_Search.gsql +++ b/common/gsql/supportai/retrievers/Keyword_Search.gsql @@ -1,3 +1,19 @@ +/* + * Copyright (c) 2025 TigerGraph, Inc. + * + * 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. +*/ + CREATE OR REPLACE DISTRIBUTED QUERY Keyword_Search(SET keywords, STRING mode = "ANY", INT top_k = 5, BOOL doc_only = False, BOOL verbose = False) { TYPEDEF TUPLE VertexTypes; SetAccum @@selected_set; diff --git a/common/llm_services/aws_bedrock_service.py b/common/llm_services/aws_bedrock_service.py index d0dcaf1..ebd1f18 100644 --- a/common/llm_services/aws_bedrock_service.py +++ b/common/llm_services/aws_bedrock_service.py @@ -1,3 +1,17 @@ +# Copyright (c) 2025 TigerGraph, Inc. +# +# 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. + import boto3 from langchain_community.chat_models import BedrockChat import logging diff --git a/common/llm_services/base_llm.py b/common/llm_services/base_llm.py index 730774d..f9b3927 100644 --- a/common/llm_services/base_llm.py +++ b/common/llm_services/base_llm.py @@ -1,3 +1,17 @@ +# Copyright (c) 2025 TigerGraph, Inc. +# +# 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. + class LLM_Model: """Base LLM_Model Class diff --git a/common/llm_services/google_genai_service.py b/common/llm_services/google_genai_service.py index 7b6c7cf..883e670 100644 --- a/common/llm_services/google_genai_service.py +++ b/common/llm_services/google_genai_service.py @@ -1,3 +1,17 @@ +# Copyright (c) 2025 TigerGraph, Inc. +# +# 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. + import logging import os diff --git a/common/llm_services/openai_service.py b/common/llm_services/openai_service.py index 8834353..0faa358 100644 --- a/common/llm_services/openai_service.py +++ b/common/llm_services/openai_service.py @@ -1,3 +1,17 @@ +# Copyright (c) 2025 TigerGraph, Inc. +# +# 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. + import logging import os diff --git a/common/py_schemas/schemas.py b/common/py_schemas/schemas.py index ff7d296..f6150e2 100644 --- a/common/py_schemas/schemas.py +++ b/common/py_schemas/schemas.py @@ -1,3 +1,17 @@ +# Copyright (c) 2025 TigerGraph, Inc. +# +# 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. + import enum from typing import Dict, List, Optional, Union diff --git a/common/py_schemas/tool_io_schemas.py b/common/py_schemas/tool_io_schemas.py index af81038..c7bc9c0 100644 --- a/common/py_schemas/tool_io_schemas.py +++ b/common/py_schemas/tool_io_schemas.py @@ -1,3 +1,17 @@ +# Copyright (c) 2025 TigerGraph, Inc. +# +# 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. + from typing import Dict, List, Optional from pydantic import BaseModel, Field diff --git a/ecc/app/eventual_consistency_checker.py b/ecc/app/eventual_consistency_checker.py index e9d21cc..dad7d7d 100644 --- a/ecc/app/eventual_consistency_checker.py +++ b/ecc/app/eventual_consistency_checker.py @@ -1,3 +1,17 @@ +# Copyright (c) 2025 TigerGraph, Inc. +# +# 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. + import logging import time from typing import Dict, List diff --git a/ecc/app/graphrag/community_summarizer.py b/ecc/app/graphrag/community_summarizer.py index e3c4f71..64c7053 100644 --- a/ecc/app/graphrag/community_summarizer.py +++ b/ecc/app/graphrag/community_summarizer.py @@ -1,3 +1,17 @@ +# Copyright (c) 2025 TigerGraph, Inc. +# +# 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. + import re from langchain_core.prompts import PromptTemplate diff --git a/ecc/app/graphrag/graph_rag.py b/ecc/app/graphrag/graph_rag.py index 75c321e..0e06e75 100644 --- a/ecc/app/graphrag/graph_rag.py +++ b/ecc/app/graphrag/graph_rag.py @@ -1,3 +1,17 @@ +# Copyright (c) 2025 TigerGraph, Inc. +# +# 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. + import asyncio import json import logging diff --git a/ecc/app/graphrag/util.py b/ecc/app/graphrag/util.py index b1493a2..6a7534a 100644 --- a/ecc/app/graphrag/util.py +++ b/ecc/app/graphrag/util.py @@ -1,3 +1,17 @@ +# Copyright (c) 2025 TigerGraph, Inc. +# +# 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. + import asyncio import base64 import logging diff --git a/ecc/app/graphrag/workers.py b/ecc/app/graphrag/workers.py index ae0b157..e439304 100644 --- a/ecc/app/graphrag/workers.py +++ b/ecc/app/graphrag/workers.py @@ -1,3 +1,17 @@ +# Copyright (c) 2025 TigerGraph, Inc. +# +# 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. + import asyncio import base64 import logging diff --git a/ecc/app/main.py b/ecc/app/main.py index becdde5..5d5f9e3 100644 --- a/ecc/app/main.py +++ b/ecc/app/main.py @@ -1,3 +1,17 @@ +# Copyright (c) 2025 TigerGraph, Inc. +# +# 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. + import os os.environ["ECC"] = "true" diff --git a/ecc/app/supportai/supportai_init.py b/ecc/app/supportai/supportai_init.py index 1356a8e..25dc78b 100644 --- a/ecc/app/supportai/supportai_init.py +++ b/ecc/app/supportai/supportai_init.py @@ -1,3 +1,17 @@ +# Copyright (c) 2025 TigerGraph, Inc. +# +# 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. + import asyncio import logging import time diff --git a/ecc/app/supportai/workers.py b/ecc/app/supportai/workers.py index 7c91083..ab1c89f 100644 --- a/ecc/app/supportai/workers.py +++ b/ecc/app/supportai/workers.py @@ -1,3 +1,17 @@ +# Copyright (c) 2025 TigerGraph, Inc. +# +# 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. + import base64 import time import logging diff --git a/graphrag/app/agent.py b/graphrag/app/agent.py index 834eb48..ecc5c75 100644 --- a/graphrag/app/agent.py +++ b/graphrag/app/agent.py @@ -1,3 +1,17 @@ +# Copyright (c) 2025 TigerGraph, Inc. +# +# 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. + import time from langchain.agents import AgentType, initialize_agent from typing import List, Union diff --git a/graphrag/app/agent/agent_generation.py b/graphrag/app/agent/agent_generation.py index f9f86e2..5391746 100644 --- a/graphrag/app/agent/agent_generation.py +++ b/graphrag/app/agent/agent_generation.py @@ -1,3 +1,17 @@ +# Copyright (c) 2025 TigerGraph, Inc. +# +# 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. + import logging from langchain.prompts import PromptTemplate from langchain_core.output_parsers import PydanticOutputParser diff --git a/graphrag/app/agent/agent_graph.py b/graphrag/app/agent/agent_graph.py index ee7ca1d..b73b7aa 100644 --- a/graphrag/app/agent/agent_graph.py +++ b/graphrag/app/agent/agent_graph.py @@ -1,3 +1,17 @@ +# Copyright (c) 2025 TigerGraph, Inc. +# +# 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. + import json import logging from typing import Dict, List, Optional diff --git a/graphrag/app/agent/agent_router.py b/graphrag/app/agent/agent_router.py index c86337c..08c0c12 100644 --- a/graphrag/app/agent/agent_router.py +++ b/graphrag/app/agent/agent_router.py @@ -1,3 +1,17 @@ +# Copyright (c) 2025 TigerGraph, Inc. +# +# 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. + from langchain.prompts import PromptTemplate from langchain_core.output_parsers import PydanticOutputParser from langchain_community.callbacks.manager import get_openai_callback diff --git a/graphrag/app/main.py b/graphrag/app/main.py index 9d34afb..713d089 100644 --- a/graphrag/app/main.py +++ b/graphrag/app/main.py @@ -1,3 +1,17 @@ +# Copyright (c) 2025 TigerGraph, Inc. +# +# 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. + import json import logging import time diff --git a/graphrag/app/routers/supportai.py b/graphrag/app/routers/supportai.py index 76db299..4bba7dd 100644 --- a/graphrag/app/routers/supportai.py +++ b/graphrag/app/routers/supportai.py @@ -1,3 +1,17 @@ +# Copyright (c) 2025 TigerGraph, Inc. +# +# 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. + import json import logging from typing import Annotated diff --git a/graphrag/app/routers/ui.py b/graphrag/app/routers/ui.py index b664305..fbe7165 100644 --- a/graphrag/app/routers/ui.py +++ b/graphrag/app/routers/ui.py @@ -1,3 +1,17 @@ +# Copyright (c) 2025 TigerGraph, Inc. +# +# 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. + import asyncio import base64 import logging diff --git a/graphrag/app/tools/generate_cypher.py b/graphrag/app/tools/generate_cypher.py index cfef440..faa78d4 100644 --- a/graphrag/app/tools/generate_cypher.py +++ b/graphrag/app/tools/generate_cypher.py @@ -1,3 +1,17 @@ +# Copyright (c) 2025 TigerGraph, Inc. +# +# 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. + import logging from typing import Iterable from langchain_community.callbacks.manager import get_openai_callback diff --git a/graphrag/app/tools/generate_function.py b/graphrag/app/tools/generate_function.py index 77ecc12..fb6db33 100644 --- a/graphrag/app/tools/generate_function.py +++ b/graphrag/app/tools/generate_function.py @@ -1,3 +1,17 @@ +# Copyright (c) 2025 TigerGraph, Inc. +# +# 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. + import json import logging from typing import Dict, List, Optional, Type, Union diff --git a/graphrag/app/tools/generate_gsql.py b/graphrag/app/tools/generate_gsql.py index 3bcbe98..46d90f2 100644 --- a/graphrag/app/tools/generate_gsql.py +++ b/graphrag/app/tools/generate_gsql.py @@ -1,3 +1,17 @@ +# Copyright (c) 2025 TigerGraph, Inc. +# +# 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. + import logging from typing import Iterable from langchain_community.callbacks.manager import get_openai_callback diff --git a/graphrag/app/tools/map_question_to_schema.py b/graphrag/app/tools/map_question_to_schema.py index 1fd5f0e..d79015d 100644 --- a/graphrag/app/tools/map_question_to_schema.py +++ b/graphrag/app/tools/map_question_to_schema.py @@ -1,3 +1,17 @@ +# Copyright (c) 2025 TigerGraph, Inc. +# +# 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. + from langchain.tools import BaseTool from langchain.tools.base import ToolException from langchain.llms.base import LLM