From 9744977411e94a09cd300b46652a3dbf0dece6b0 Mon Sep 17 00:00:00 2001
From: Rita Brugarolas <rita.brugarolas.brufau@intel.com>
Date: Tue, 22 Oct 2024 06:46:23 +0000
Subject: [PATCH 01/26] graphrag backend and compose

Signed-off-by: Rita Brugarolas <rita.brugarolas.brufau@intel.com>
---
 GraphRAG/Dockerfile.without_rerank            |  36 ++
 .../intel/hpu/gaudi/compose.yaml              | 183 ++++++++++
 .../docker_compose/intel/hpu/gaudi/set_env.sh |  19 +
 GraphRAG/docker_image_build/build.yaml        | 141 ++++++++
 GraphRAG/graphrag.py                          | 340 ++++++++++++++++++
 5 files changed, 719 insertions(+)
 create mode 100644 GraphRAG/Dockerfile.without_rerank
 create mode 100644 GraphRAG/docker_compose/intel/hpu/gaudi/compose.yaml
 create mode 100644 GraphRAG/docker_compose/intel/hpu/gaudi/set_env.sh
 create mode 100644 GraphRAG/docker_image_build/build.yaml
 create mode 100644 GraphRAG/graphrag.py

diff --git a/GraphRAG/Dockerfile.without_rerank b/GraphRAG/Dockerfile.without_rerank
new file mode 100644
index 0000000000..f26639e2ad
--- /dev/null
+++ b/GraphRAG/Dockerfile.without_rerank
@@ -0,0 +1,36 @@
+
+
+# Copyright (C) 2024 Intel Corporation
+# SPDX-License-Identifier: Apache-2.0
+
+FROM python:3.11-slim
+
+RUN apt-get update -y && apt-get install -y --no-install-recommends --fix-missing \
+    git \
+    libgl1-mesa-glx \
+    libjemalloc-dev
+
+RUN useradd -m -s /bin/bash user && \
+    mkdir -p /home/user && \
+    chown -R user /home/user/
+
+WORKDIR /home/user/
+#RUN git clone https://github.com/opea-project/GenAIComps.git
+RUN git clone --branch graphRAG_LI https://github.com/rbrugaro/GenAIComps.git
+
+WORKDIR /home/user/GenAIComps
+RUN pip install --no-cache-dir --upgrade pip && \
+    pip install --no-cache-dir -r /home/user/GenAIComps/requirements.txt && \
+    pip install --no-cache-dir langchain_core
+
+COPY ./graphrag.py /home/user/graphrag.py
+
+ENV PYTHONPATH=$PYTHONPATH:/home/user/GenAIComps
+
+USER user
+
+WORKDIR /home/user
+
+RUN echo 'ulimit -S -n 999999' >> ~/.bashrc
+
+ENTRYPOINT ["python", "graphrag.py", "--without-rerank"]
diff --git a/GraphRAG/docker_compose/intel/hpu/gaudi/compose.yaml b/GraphRAG/docker_compose/intel/hpu/gaudi/compose.yaml
new file mode 100644
index 0000000000..753288c656
--- /dev/null
+++ b/GraphRAG/docker_compose/intel/hpu/gaudi/compose.yaml
@@ -0,0 +1,183 @@
+# Copyright (C) 2024 Intel Corporation
+# SPDX-License-Identifier: Apache-2.0
+
+version: "3.8"
+services:
+  neo4j-apoc:
+    image: neo4j:latest
+    container_name: neo4j-apoc
+    volumes:
+        - /$HOME/neo4j/logs:/logs
+        - /$HOME/neo4j/config:/config
+        - /$HOME/neo4j/data:/data
+        - /$HOME/neo4j/plugins:/plugins
+    ipc: host
+    environment:
+      - NEO4J_AUTH=${NEO4J_USERNAME}/${NEO4J_PASSWORD}
+      - NEO4J_PLUGINS=["apoc"]
+      - NEO4J_apoc_export_file_enabled=true
+      - NEO4J_apoc_import_file_enabled=true
+      - NEO4J_apoc_import_file_use__neo4j__config=true
+      - NEO4J_dbms_security_procedures_unrestricted=apoc.\*
+    ports:
+      - "7474:7474"
+      - "7687:7687"
+    restart: always
+  tei-embedding-service:
+    image: ghcr.io/huggingface/text-embeddings-inference:cpu-1.5
+    container_name: tei-embedding-server
+    ports:
+      - "6006:80"
+    volumes:
+      - "./data:/data"
+    shm_size: 1g
+    environment:
+      no_proxy: ${no_proxy}
+      NO_PROXY: ${no_proxy}
+      http_proxy: ${http_proxy}
+      https_proxy: ${https_proxy}
+      HUGGING_FACE_HUB_TOKEN: ${HUGGINGFACEHUB_API_TOKEN}
+    ipc: host
+    command: --model-id ${EMBEDDING_MODEL_ID} --auto-truncate
+  tgi-gaudi-service:
+    image: ghcr.io/huggingface/tgi-gaudi:2.0.5
+    container_name: tgi-gaudi-server
+    ports:
+      - "6005:80"
+    volumes:
+      - "./data:/data"
+    environment:
+      no_proxy: ${no_proxy}
+      NO_PROXY: ${no_proxy}
+      http_proxy: ${http_proxy}
+      https_proxy: ${https_proxy}
+      HUGGING_FACE_HUB_TOKEN: ${HUGGINGFACEHUB_API_TOKEN}
+      HF_HUB_DISABLE_PROGRESS_BARS: 1
+      HF_HUB_ENABLE_HF_TRANSFER: 0
+      HABANA_VISIBLE_DEVICES: all
+      OMPI_MCA_btl_vader_single_copy_mechanism: none
+      ENABLE_HPU_GRAPH: true
+      LIMIT_HPU_GRAPH: true
+      USE_FLASH_ATTENTION: true
+      FLASH_ATTENTION_RECOMPUTE: true
+    runtime: habana
+    cap_add:
+      - SYS_NICE
+    ipc: host
+    command: --model-id ${LLM_MODEL_ID} --max-input-length 2048 --max-total-tokens 4096
+  dataprep-neo4j:
+    image: opea/dataprep-neo4j-llama_index:latest
+    container_name: dataprep-neo4j-server
+    depends_on:
+      - neo4j-apoc
+      - tgi-gaudi-service
+      - tei-embedding-service
+    ports:
+      - "6004:6004"
+    ipc: host
+    environment:
+      no_proxy: ${no_proxy}
+      http_proxy: ${http_proxy}
+      https_proxy: ${https_proxy}
+      host_ip: ${host_ip}
+      NEO4J_URL: ${NEO4J_URL}
+      NEO4J_USERNAME: ${NEO4J_USERNAME}
+      NEO4J_PASSWORD: ${NEO4J_PASSWORD}
+      TGI_LLM_ENDPOINT: ${TGI_LLM_ENDPOINT}
+      TEI_EMBEDDING_ENDPOINT: ${TEI_EMBEDDING_ENDPOINT}
+      OPENAI_API_KEY: ${OPENAI_API_KEY}
+      OPENAI_EMBEDDING_MODEL: ${OPENAI_EMBEDDING_MODEL}
+      OPENAI_LLM_MODEL: ${OPENAI_LLM_MODEL}
+      EMBEDDING_MODEL_ID: ${EMBEDDING_MODEL_ID}
+      LLM_MODEL_ID: ${LLM_MODEL_ID}
+      LOGFLAG: ${LOGFLAG}
+    restart: unless-stopped
+  retriever-neo4j:
+    image: opea/retriever-neo4j-llama_index:latest
+    container_name: retriever-neo4j-server
+    depends_on:
+      - neo4j-apoc
+      - tgi-gaudi-service
+      - tei-embedding-service
+    ports:
+      - "6009:6009"
+    ipc: host
+    environment:
+      no_proxy: ${no_proxy}
+      http_proxy: ${http_proxy}
+      https_proxy: ${https_proxy}
+      host_ip: ${host_ip}
+      NEO4J_URL: ${NEO4J_URL}
+      NEO4J_USERNAME: ${NEO4J_USERNAME}
+      NEO4J_PASSWORD: ${NEO4J_PASSWORD}
+      TGI_LLM_ENDPOINT: ${TGI_LLM_ENDPOINT}
+      TEI_EMBEDDING_ENDPOINT: ${TEI_EMBEDDING_ENDPOINT}
+      OPENAI_API_KEY: ${OPENAI_API_KEY}
+      OPENAI_EMBEDDING_MODEL: ${OPENAI_EMBEDDING_MODEL}
+      OPENAI_LLM_MODEL: ${OPENAI_LLM_MODEL}
+      EMBEDDING_MODEL_ID: ${EMBEDDING_MODEL_ID}
+      LLM_MODEL_ID: ${LLM_MODEL_ID}
+      LOGFLAG: ${LOGFLAG}
+    restart: unless-stopped
+  graphrag-gaudi-backend-server:
+    image: ${REGISTRY:-opea}/graphrag-without-rerank:${TAG:-latest}
+    container_name: graphrag-gaudi-backend-server
+    depends_on:
+      - neo4j-apoc
+      - tei-embedding-service
+      - retriever-neo4j
+      - tgi-gaudi-service
+    ports:
+      - "8888:8888"
+    environment:
+      - no_proxy=${no_proxy}
+      - https_proxy=${https_proxy}
+      - http_proxy=${http_proxy}
+      - MEGA_SERVICE_HOST_IP=graphrag-gaudi-backend-server
+#      - EMBEDDING_SERVER_HOST_IP=tei-embedding-service
+#      - EMBEDDING_SERVER_PORT=${EMBEDDING_SERVER_PORT:-80}
+      - RETRIEVER_SERVICE_HOST_IP=retriever-neo4j
+      - RETRIEVER_SERVICE_PORT=6009
+      - RETRIEVER_SERVICE_PORT=${RETRIEVER_SERVICE_PORT:-80}
+      - LLM_SERVER_HOST_IP=tgi-gaudi-service
+      - LLM_SERVER_PORT=${LLM_SERVER_PORT:-80}
+      - LOGFLAG=${LOGFLAG}
+    ipc: host
+    restart: always
+  chatqna-gaudi-ui-server:
+    image: ${REGISTRY:-opea}/chatqna-ui:${TAG:-latest}
+    container_name: chatqna-gaudi-ui-server
+    depends_on:
+      - graphrag-gaudi-backend-server
+    ports:
+      - "5173:5173"
+    environment:
+      - no_proxy=${no_proxy}
+      - https_proxy=${https_proxy}
+      - http_proxy=${http_proxy}
+    ipc: host
+    restart: always
+  chatqna-gaudi-nginx-server:
+    image: ${REGISTRY:-opea}/nginx:${TAG:-latest}
+    container_name: chatqna-gaudi-nginx-server
+    depends_on:
+      - graphrag-gaudi-backend-server
+      - chatqna-gaudi-ui-server
+    ports:
+      - "${NGINX_PORT:-80}:80"
+    environment:
+      - no_proxy=${no_proxy}
+      - https_proxy=${https_proxy}
+      - http_proxy=${http_proxy}
+      - FRONTEND_SERVICE_IP=chatqna-gaudi-ui-server
+      - FRONTEND_SERVICE_PORT=5173
+      - BACKEND_SERVICE_NAME=graphrag
+      - BACKEND_SERVICE_IP=graphrag-gaudi-backend-server
+      - BACKEND_SERVICE_PORT=8888
+      - DATAPREP_SERVICE_IP=dataprep-neo4j
+      - DATAPREP_SERVICE_PORT=6004
+    ipc: host
+    restart: always
+networks:
+  default:
+    driver: bridge
diff --git a/GraphRAG/docker_compose/intel/hpu/gaudi/set_env.sh b/GraphRAG/docker_compose/intel/hpu/gaudi/set_env.sh
new file mode 100644
index 0000000000..1d148bfbf3
--- /dev/null
+++ b/GraphRAG/docker_compose/intel/hpu/gaudi/set_env.sh
@@ -0,0 +1,19 @@
+#!/usr/bin/env bash
+
+# Copyright (C) 2024 Intel Corporation
+# SPDX-License-Identifier: Apache-2.0
+
+#Remember to set your private variables mentioned in README
+#host_ip, OPENAI_API_KEY, HUGGINGFACEHUB_API_TOKEN, proxies...
+
+export EMBEDDING_MODEL_ID="BAAI/bge-base-en-v1.5"
+export OPENAI_EMBEDDING_MODEL="text-embedding-3-small"
+export LLM_MODEL_ID="Intel/neural-chat-7b-v3-3"
+export OPENAI_LLM_MODEL="gpt-4o"
+export TEI_EMBEDDING_ENDPOINT="http://${host_ip}:6006"
+export TGI_LLM_ENDPOINT="http://${host_ip}:6005"
+export NEO4J_URL="bolt://${host_ip}:7687"
+export NEO4J_USERNAME=neo4j
+export DATAPREP_SERVICE_ENDPOINT="http://${host_ip}:6004/v1/dataprep"
+export LOGFLAG=True
+export RETRIEVER_SERVICE_PORT=6009
\ No newline at end of file
diff --git a/GraphRAG/docker_image_build/build.yaml b/GraphRAG/docker_image_build/build.yaml
new file mode 100644
index 0000000000..e70dc74663
--- /dev/null
+++ b/GraphRAG/docker_image_build/build.yaml
@@ -0,0 +1,141 @@
+# Copyright (C) 2024 Intel Corporation
+# SPDX-License-Identifier: Apache-2.0
+
+services:
+  # chatqna:
+  #   build:
+  #     args:
+  #       http_proxy: ${http_proxy}
+  #       https_proxy: ${https_proxy}
+  #       no_proxy: ${no_proxy}
+  #     context: ../
+  #     dockerfile: ./Dockerfile
+  #   image: ${REGISTRY:-opea}/chatqna:${TAG:-latest}
+  # chatqna-guardrails:
+  #   build:
+  #     context: ../
+  #     dockerfile: ./Dockerfile.guardrails
+  #   extends: chatqna
+  #   image: ${REGISTRY:-opea}/chatqna-guardrails:${TAG:-latest}
+  # chatqna-without-rerank:
+  #   build:
+  #     context: ../
+  #     dockerfile: ./Dockerfile.without_rerank
+  #   extends: chatqna
+  #   image: ${REGISTRY:-opea}/chatqna-without-rerank:${TAG:-latest}
+  graphrag-without-rerank:
+    build:
+      args:
+        http_proxy: ${http_proxy}
+        https_proxy: ${https_proxy}
+        no_proxy: ${no_proxy}
+      context: ../
+      dockerfile: ./Dockerfile.without_rerank
+    #extends: chatqna
+    image: ${REGISTRY:-opea}/graphrag-without-rerank:${TAG:-latest}
+  # chatqna-ui:
+  #   build:
+  #     context: ../ui
+  #     dockerfile: ./docker/Dockerfile
+  #   extends: chatqna
+  #   image: ${REGISTRY:-opea}/chatqna-ui:${TAG:-latest}
+  # chatqna-conversation-ui:
+  #   build:
+  #     context: ../ui
+  #     dockerfile: ./docker/Dockerfile.react
+  #   extends: chatqna
+  #   image: ${REGISTRY:-opea}/chatqna-conversation-ui:${TAG:-latest}
+  # embedding-tei:
+  #   build:
+  #     context: GenAIComps
+  #     dockerfile: comps/embeddings/tei/langchain/Dockerfile
+  #   extends: chatqna
+  #   image: ${REGISTRY:-opea}/embedding-tei:${TAG:-latest}
+  retriever-neo4j:
+    build:
+      args:
+        http_proxy: ${http_proxy}
+        https_proxy: ${https_proxy}
+        no_proxy: ${no_proxy}
+      context: GenAIComps
+      dockerfile: comps/retrievers/neo4j/llama_index/Dockerfile
+    image: ${REGISTRY:-opea}/retriever-neo4j:${TAG:-latest}
+  # llm-tgi:
+  #   build:
+  #     context: GenAIComps
+  #     dockerfile: comps/llms/text-generation/tgi/Dockerfile
+  #   extends: chatqna
+  #   image: ${REGISTRY:-opea}/llm-tgi:${TAG:-latest}
+  # llm-ollama:
+  #   build:
+  #     context: GenAIComps
+  #     dockerfile: comps/llms/text-generation/ollama/langchain/Dockerfile
+  #   extends: chatqna
+  #   image: ${REGISTRY:-opea}/llm-ollama:${TAG:-latest}
+  # llm-vllm:
+  #   build:
+  #     context: GenAIComps
+  #     dockerfile: comps/llms/text-generation/vllm/langchain/Dockerfile
+  #   extends: chatqna
+  #   image: ${REGISTRY:-opea}/llm-vllm:${TAG:-latest}
+  # llm-vllm-hpu:
+  #   build:
+  #     context: GenAIComps
+  #     dockerfile: comps/llms/text-generation/vllm/langchain/dependency/Dockerfile.intel_hpu
+  #   extends: chatqna
+  #   image: ${REGISTRY:-opea}/llm-vllm-hpu:${TAG:-latest}
+  # llm-vllm-ray:
+  #   build:
+  #     context: GenAIComps
+  #     dockerfile: comps/llms/text-generation/vllm/ray/Dockerfile
+  #   extends: chatqna
+  #   image: ${REGISTRY:-opea}/llm-vllm-ray:${TAG:-latest}
+  # llm-vllm-ray-hpu:
+  #   build:
+  #     context: GenAIComps
+  #     dockerfile: comps/llms/text-generation/vllm/ray/dependency/Dockerfile
+  #   extends: chatqna
+  #   image: ${REGISTRY:-opea}/llm-vllm-ray-hpu:${TAG:-latest}
+  # dataprep-redis:
+  #   build:
+  #     context: GenAIComps
+  #     dockerfile: comps/dataprep/redis/langchain/Dockerfile
+  #   extends: chatqna
+  #   image: ${REGISTRY:-opea}/dataprep-redis:${TAG:-latest}
+  # dataprep-qdrant:
+  #   build:
+  #     context: GenAIComps
+  #     dockerfile: comps/dataprep/qdrant/langchain/Dockerfile
+  #   extends: chatqna
+  #   image: ${REGISTRY:-opea}/dataprep-qdrant:${TAG:-latest}
+  dataprep-neo4j:
+    build:
+      args:
+        http_proxy: ${http_proxy}
+        https_proxy: ${https_proxy}
+        no_proxy: ${no_proxy}
+      context: GenAIComps
+      dockerfile: comps/dataprep/neo4j/llama_index/Dockerfile
+    image: ${REGISTRY:-opea}/dataprep-neo4j:${TAG:-latest}  
+  # guardrails-tgi:
+  #   build:
+  #     context: GenAIComps
+  #     dockerfile: comps/guardrails/llama_guard/langchain/Dockerfile
+  #   extends: chatqna
+  #   image: ${REGISTRY:-opea}/guardrails-tgi:${TAG:-latest}
+  # vllm:
+  #   build:
+  #     context: vllm
+  #     dockerfile: Dockerfile.cpu
+  #   extends: chatqna
+  #   image: ${REGISTRY:-opea}/vllm:${TAG:-latest}
+  nginx:
+    build:
+      args:
+        http_proxy: ${http_proxy}
+        https_proxy: ${https_proxy}
+        no_proxy: ${no_proxy}
+      context: GenAIComps
+      dockerfile: comps/nginx/Dockerfile
+#    extends: chatqna
+    image: ${REGISTRY:-opea}/nginx:${TAG:-latest}
diff --git a/GraphRAG/graphrag.py b/GraphRAG/graphrag.py
new file mode 100644
index 0000000000..6ecdca37d8
--- /dev/null
+++ b/GraphRAG/graphrag.py
@@ -0,0 +1,340 @@
+# Copyright (C) 2024 Intel Corporation
+# SPDX-License-Identifier: Apache-2.0
+
+import argparse
+import json
+import os
+import re
+
+from comps import ChatQnAGateway, MicroService, ServiceOrchestrator, ServiceType, GraphragGateway
+from langchain_core.prompts import PromptTemplate
+
+
+class ChatTemplate:
+    @staticmethod
+    def generate_rag_prompt(question, documents):
+        context_str = "\n".join(documents)
+        if context_str and len(re.findall("[\u4E00-\u9FFF]", context_str)) / len(context_str) >= 0.3:
+            # chinese context
+            template = """
+### 你将扮演一个乐于助人、尊重他人并诚实的助手，你的目标是帮助用户解答问题。有效地利用来自本地知识库的搜索结果。确保你的回答中只包含相关信息。如果你不确定问题的答案，请避免分享不准确的信息。
+### 搜索结果：{context}
+### 问题：{question}
+### 回答：
+"""
+        else:
+            template = """
+### You are a helpful, respectful and honest assistant to help the user with questions. \
+Please combine the following intermediate answers into a final, conscise and coherent response. \
+refer to the search results obtained from the local knowledge base. \
+If you don't know the answer to a question, please don't share false information. \n
+### Intermediate answers: {context} \n
+### Question: {question} \n
+### Answer:
+"""
+        return template.format(context=context_str, question=question)
+
+
+MEGA_SERVICE_HOST_IP = os.getenv("MEGA_SERVICE_HOST_IP", "0.0.0.0")
+MEGA_SERVICE_PORT = int(os.getenv("MEGA_SERVICE_PORT", 8888))
+GUARDRAIL_SERVICE_HOST_IP = os.getenv("GUARDRAIL_SERVICE_HOST_IP", "0.0.0.0")
+GUARDRAIL_SERVICE_PORT = int(os.getenv("GUARDRAIL_SERVICE_PORT", 80))
+EMBEDDING_SERVER_HOST_IP = os.getenv("EMBEDDING_SERVER_HOST_IP", "0.0.0.0")
+EMBEDDING_SERVER_PORT = int(os.getenv("EMBEDDING_SERVER_PORT", 80))
+RETRIEVER_SERVICE_HOST_IP = os.getenv("RETRIEVER_SERVICE_HOST_IP", "0.0.0.0")
+RETRIEVER_SERVICE_PORT = int(os.getenv("RETRIEVER_SERVICE_PORT", 7000))
+RERANK_SERVER_HOST_IP = os.getenv("RERANK_SERVER_HOST_IP", "0.0.0.0")
+RERANK_SERVER_PORT = int(os.getenv("RERANK_SERVER_PORT", 80))
+LLM_SERVER_HOST_IP = os.getenv("LLM_SERVER_HOST_IP", "0.0.0.0")
+LLM_SERVER_PORT = int(os.getenv("LLM_SERVER_PORT", 80))
+
+
+def align_inputs(self, inputs, cur_node, runtime_graph, llm_parameters_dict, **kwargs):
+    print("inputs in align input:\n", inputs)
+    print("retriever ip:", RERANK_SERVER_HOST_IP)
+    print("retriever port:", RETRIEVER_SERVICE_PORT)
+    if self.services[cur_node].service_type == ServiceType.EMBEDDING:
+        inputs["inputs"] = inputs["text"]
+        del inputs["text"]
+    elif self.services[cur_node].service_type == ServiceType.RETRIEVER:
+        print("make no changes for retriever inputs")
+        # prepare the retriever params
+        # retriever_parameters = kwargs.get("retriever_parameters", None)
+        # if retriever_parameters:
+        #     inputs.update(retriever_parameters.dict())
+    elif self.services[cur_node].service_type == ServiceType.LLM:
+        # convert TGI/vLLM to unified OpenAI /v1/chat/completions format
+        next_inputs = {}
+        next_inputs["model"] = "tgi"  # specifically clarify the fake model to make the format unified
+        next_inputs["messages"] = [{"role": "user", "content": inputs["inputs"]}]
+        next_inputs["max_tokens"] = llm_parameters_dict["max_tokens"]
+        next_inputs["top_p"] = llm_parameters_dict["top_p"]
+        next_inputs["stream"] = inputs["streaming"]
+        next_inputs["frequency_penalty"] = inputs["frequency_penalty"]
+        # next_inputs["presence_penalty"] = inputs["presence_penalty"]
+        # next_inputs["repetition_penalty"] = inputs["repetition_penalty"]
+        next_inputs["temperature"] = inputs["temperature"]
+        inputs = next_inputs
+    print("inputs after align:\n", inputs)
+    return inputs
+
+
+def align_outputs(self, data, cur_node, inputs, runtime_graph, llm_parameters_dict, **kwargs):
+    print("data type in align output:\n", type(data))
+    print("data in align output:\n", data)
+    next_data = {}
+    if self.services[cur_node].service_type == ServiceType.EMBEDDING:
+        assert isinstance(data, list)
+        next_data = {"text": inputs["inputs"], "embedding": data[0]}
+    elif self.services[cur_node].service_type == ServiceType.RETRIEVER:
+
+        docs = [doc["text"] for doc in data["retrieved_docs"]]
+
+        with_rerank = runtime_graph.downstream(cur_node)[0].startswith("rerank")
+        if with_rerank and docs:
+            # forward to rerank
+            # prepare inputs for rerank
+            next_data["query"] = data["initial_query"]
+            next_data["texts"] = [doc["text"] for doc in data["retrieved_docs"]]
+        else:
+            # forward to llm
+            if not docs and with_rerank:
+                # delete the rerank from retriever -> rerank -> llm
+                for ds in reversed(runtime_graph.downstream(cur_node)):
+                    for nds in runtime_graph.downstream(ds):
+                        runtime_graph.add_edge(cur_node, nds)
+                    runtime_graph.delete_node_if_exists(ds)
+
+            # handle template
+            # if user provides template, then format the prompt with it
+            # otherwise, use the default template
+            prompt = data["initial_query"]
+            chat_template = llm_parameters_dict["chat_template"]
+            if chat_template:
+                prompt_template = PromptTemplate.from_template(chat_template)
+                input_variables = prompt_template.input_variables
+                if sorted(input_variables) == ["context", "question"]:
+                    prompt = prompt_template.format(question=data["initial_query"], context="\n".join(docs))
+                elif input_variables == ["question"]:
+                    prompt = prompt_template.format(question=data["initial_query"])
+                else:
+                    print(f"{prompt_template} not used, we only support 2 input variables ['question', 'context']")
+                    prompt = ChatTemplate.generate_rag_prompt(data["initial_query"], docs)
+            else:
+                print("no rerank no chat template")
+                prompt = ChatTemplate.generate_rag_prompt(data["initial_query"], docs)
+
+            next_data["inputs"] = prompt
+
+    elif self.services[cur_node].service_type == ServiceType.RERANK:
+        # rerank the inputs with the scores
+        reranker_parameters = kwargs.get("reranker_parameters", None)
+        top_n = reranker_parameters.top_n if reranker_parameters else 1
+        docs = inputs["texts"]
+        reranked_docs = []
+        for best_response in data[:top_n]:
+            reranked_docs.append(docs[best_response["index"]])
+
+        # handle template
+        # if user provides template, then format the prompt with it
+        # otherwise, use the default template
+        prompt = inputs["query"]
+        chat_template = llm_parameters_dict["chat_template"]
+        if chat_template:
+            prompt_template = PromptTemplate.from_template(chat_template)
+            input_variables = prompt_template.input_variables
+            if sorted(input_variables) == ["context", "question"]:
+                prompt = prompt_template.format(question=prompt, context="\n".join(reranked_docs))
+            elif input_variables == ["question"]:
+                prompt = prompt_template.format(question=prompt)
+            else:
+                print(f"{prompt_template} not used, we only support 2 input variables ['question', 'context']")
+                prompt = ChatTemplate.generate_rag_prompt(prompt, reranked_docs)
+        else:
+            prompt = ChatTemplate.generate_rag_prompt(prompt, reranked_docs)
+
+        next_data["inputs"] = prompt
+
+    else:
+        next_data = data
+
+    return next_data
+
+
+def align_generator(self, gen, **kwargs):
+    # openai reaponse format
+    # b'data:{"id":"","object":"text_completion","created":1725530204,"model":"meta-llama/Meta-Llama-3-8B-Instruct","system_fingerprint":"2.0.1-native","choices":[{"index":0,"delta":{"role":"assistant","content":"?"},"logprobs":null,"finish_reason":null}]}\n\n'
+    print("generator in align generator:\n", gen)
+    for line in gen:
+        line = line.decode("utf-8")
+        start = line.find("{")
+        end = line.rfind("}") + 1
+
+        json_str = line[start:end]
+        try:
+            # sometimes yield empty chunk, do a fallback here
+            json_data = json.loads(json_str)
+            if json_data["choices"][0]["finish_reason"] != "eos_token":
+                yield f"data: {repr(json_data['choices'][0]['delta']['content'].encode('utf-8'))}\n\n"
+        except Exception as e:
+            yield f"data: {repr(json_str.encode('utf-8'))}\n\n"
+    yield "data: [DONE]\n\n"
+
+
+class GraphRAGService:
+    def __init__(self, host="0.0.0.0", port=8000):
+        self.host = host
+        self.port = port
+        ServiceOrchestrator.align_inputs = align_inputs
+        ServiceOrchestrator.align_outputs = align_outputs
+        ServiceOrchestrator.align_generator = align_generator
+        self.megaservice = ServiceOrchestrator()
+
+    def add_remote_service(self):
+        
+        embedding = MicroService(
+            name="embedding",
+            host=EMBEDDING_SERVER_HOST_IP,
+            port=EMBEDDING_SERVER_PORT,
+            endpoint="/embed",
+            use_remote_service=True,
+            service_type=ServiceType.EMBEDDING,
+        )
+
+        retriever = MicroService(
+            name="retriever",
+            host=RETRIEVER_SERVICE_HOST_IP,
+            port=RETRIEVER_SERVICE_PORT,
+            endpoint="/v1/retrieval",
+            use_remote_service=True,
+            service_type=ServiceType.RETRIEVER,
+        )
+
+        rerank = MicroService(
+            name="rerank",
+            host=RERANK_SERVER_HOST_IP,
+            port=RERANK_SERVER_PORT,
+            endpoint="/rerank",
+            use_remote_service=True,
+            service_type=ServiceType.RERANK,
+        )
+
+        llm = MicroService(
+            name="llm",
+            host=LLM_SERVER_HOST_IP,
+            port=LLM_SERVER_PORT,
+            endpoint="/v1/chat/completions",
+            use_remote_service=True,
+            service_type=ServiceType.LLM,
+        )
+        self.megaservice.add(embedding).add(retriever).add(rerank).add(llm)
+        self.megaservice.flow_to(embedding, retriever)
+        self.megaservice.flow_to(retriever, rerank)
+        self.megaservice.flow_to(rerank, llm)
+        self.gateway = ChatQnAGateway(megaservice=self.megaservice, host="0.0.0.0", port=self.port)
+
+    def add_remote_service_without_rerank(self):
+
+        # embedding = MicroService(
+        #     name="embedding",
+        #     host=EMBEDDING_SERVER_HOST_IP,
+        #     port=EMBEDDING_SERVER_PORT,
+        #     endpoint="/embed",
+        #     use_remote_service=True,
+        #     service_type=ServiceType.EMBEDDING,
+        # )
+
+        retriever = MicroService(
+            name="retriever",
+            host=RETRIEVER_SERVICE_HOST_IP,
+            port=RETRIEVER_SERVICE_PORT,
+            endpoint="/v1/retrieval",
+            use_remote_service=True,
+            service_type=ServiceType.RETRIEVER,
+        )
+
+        llm = MicroService(
+            name="llm",
+            host=LLM_SERVER_HOST_IP,
+            port=LLM_SERVER_PORT,
+            endpoint="/v1/chat/completions",
+            use_remote_service=True,
+            service_type=ServiceType.LLM,
+        )
+        self.megaservice.add(retriever).add(llm)
+        #self.megaservice.flow_to(embedding, retriever)
+        self.megaservice.flow_to(retriever, llm)
+        self.gateway = GraphragGateway(megaservice=self.megaservice, host="0.0.0.0", port=self.port)
+
+    def add_remote_service_with_guardrails(self):
+        guardrail_in = MicroService(
+            name="guardrail_in",
+            host=GUARDRAIL_SERVICE_HOST_IP,
+            port=GUARDRAIL_SERVICE_PORT,
+            endpoint="/v1/guardrails",
+            use_remote_service=True,
+            service_type=ServiceType.GUARDRAIL,
+        )
+        embedding = MicroService(
+            name="embedding",
+            host=EMBEDDING_SERVER_HOST_IP,
+            port=EMBEDDING_SERVER_PORT,
+            endpoint="/embed",
+            use_remote_service=True,
+            service_type=ServiceType.EMBEDDING,
+        )
+        retriever = MicroService(
+            name="retriever",
+            host=RETRIEVER_SERVICE_HOST_IP,
+            port=RETRIEVER_SERVICE_PORT,
+            endpoint="/v1/retrieval",
+            use_remote_service=True,
+            service_type=ServiceType.RETRIEVER,
+        )
+        rerank = MicroService(
+            name="rerank",
+            host=RERANK_SERVER_HOST_IP,
+            port=RERANK_SERVER_PORT,
+            endpoint="/rerank",
+            use_remote_service=True,
+            service_type=ServiceType.RERANK,
+        )
+        llm = MicroService(
+            name="llm",
+            host=LLM_SERVER_HOST_IP,
+            port=LLM_SERVER_PORT,
+            endpoint="/v1/chat/completions",
+            use_remote_service=True,
+            service_type=ServiceType.LLM,
+        )
+        # guardrail_out = MicroService(
+        #     name="guardrail_out",
+        #     host=GUARDRAIL_SERVICE_HOST_IP,
+        #     port=GUARDRAIL_SERVICE_PORT,
+        #     endpoint="/v1/guardrails",
+        #     use_remote_service=True,
+        #     service_type=ServiceType.GUARDRAIL,
+        # )
+        # self.megaservice.add(guardrail_in).add(embedding).add(retriever).add(rerank).add(llm).add(guardrail_out)
+        self.megaservice.add(guardrail_in).add(embedding).add(retriever).add(rerank).add(llm)
+        self.megaservice.flow_to(guardrail_in, embedding)
+        self.megaservice.flow_to(embedding, retriever)
+        self.megaservice.flow_to(retriever, rerank)
+        self.megaservice.flow_to(rerank, llm)
+        # self.megaservice.flow_to(llm, guardrail_out)
+        self.gateway = ChatQnAGateway(megaservice=self.megaservice, host="0.0.0.0", port=self.port)
+
+
+if __name__ == "__main__":
+    parser = argparse.ArgumentParser()
+    parser.add_argument("--without-rerank", action="store_true")
+    parser.add_argument("--with-guardrails", action="store_true")
+
+    args = parser.parse_args()
+    chatqna = GraphRAGService(host=MEGA_SERVICE_HOST_IP, port=MEGA_SERVICE_PORT)
+    if args.without_rerank:
+        chatqna.add_remote_service_without_rerank()
+    elif args.with_guardrails:
+        chatqna.add_remote_service_with_guardrails()
+    else:
+        chatqna.add_remote_service()

From c9b70289294bd5346715e45a9dc9a9a76f22e31b Mon Sep 17 00:00:00 2001
From: Rita Brugarolas <rita.brugarolas.brufau@intel.com>
Date: Tue, 22 Oct 2024 18:51:55 +0000
Subject: [PATCH 02/26] graphrag backend wrking and add test code

Signed-off-by: Rita Brugarolas <rita.brugarolas.brufau@intel.com>
---
 GraphRAG/graphrag.py                          |  23 +-
 .../test_compose_without_rerank_on_gaudi.sh   | 215 ++++++++++++++++++
 2 files changed, 223 insertions(+), 15 deletions(-)
 create mode 100755 GraphRAG/tests/test_compose_without_rerank_on_gaudi.sh

diff --git a/GraphRAG/graphrag.py b/GraphRAG/graphrag.py
index 6ecdca37d8..67cb275148 100644
--- a/GraphRAG/graphrag.py
+++ b/GraphRAG/graphrag.py
@@ -50,18 +50,11 @@ def generate_rag_prompt(question, documents):
 
 
 def align_inputs(self, inputs, cur_node, runtime_graph, llm_parameters_dict, **kwargs):
-    print("inputs in align input:\n", inputs)
-    print("retriever ip:", RERANK_SERVER_HOST_IP)
-    print("retriever port:", RETRIEVER_SERVICE_PORT)
     if self.services[cur_node].service_type == ServiceType.EMBEDDING:
         inputs["inputs"] = inputs["text"]
         del inputs["text"]
     elif self.services[cur_node].service_type == ServiceType.RETRIEVER:
-        print("make no changes for retriever inputs")
-        # prepare the retriever params
-        # retriever_parameters = kwargs.get("retriever_parameters", None)
-        # if retriever_parameters:
-        #     inputs.update(retriever_parameters.dict())
+        print("make no changes for retriever inputs. AlreadyCheckCompletionRequest")
     elif self.services[cur_node].service_type == ServiceType.LLM:
         # convert TGI/vLLM to unified OpenAI /v1/chat/completions format
         next_inputs = {}
@@ -87,6 +80,7 @@ def align_outputs(self, data, cur_node, inputs, runtime_graph, llm_parameters_di
         assert isinstance(data, list)
         next_data = {"text": inputs["inputs"], "embedding": data[0]}
     elif self.services[cur_node].service_type == ServiceType.RETRIEVER:
+        print(data)
 
         docs = [doc["text"] for doc in data["retrieved_docs"]]
 
@@ -104,25 +98,24 @@ def align_outputs(self, data, cur_node, inputs, runtime_graph, llm_parameters_di
                     for nds in runtime_graph.downstream(ds):
                         runtime_graph.add_edge(cur_node, nds)
                     runtime_graph.delete_node_if_exists(ds)
-
             # handle template
             # if user provides template, then format the prompt with it
             # otherwise, use the default template
-            prompt = data["initial_query"]
+            prompt = inputs.messages[0]["content"]
             chat_template = llm_parameters_dict["chat_template"]
             if chat_template:
                 prompt_template = PromptTemplate.from_template(chat_template)
                 input_variables = prompt_template.input_variables
                 if sorted(input_variables) == ["context", "question"]:
-                    prompt = prompt_template.format(question=data["initial_query"], context="\n".join(docs))
+                    prompt = prompt_template.format(question=prompt, context="\n".join(docs))
                 elif input_variables == ["question"]:
-                    prompt = prompt_template.format(question=data["initial_query"])
+                    prompt = prompt_template.format(question=prompt)
                 else:
                     print(f"{prompt_template} not used, we only support 2 input variables ['question', 'context']")
-                    prompt = ChatTemplate.generate_rag_prompt(data["initial_query"], docs)
+                    prompt = ChatTemplate.generate_rag_prompt(prompt, docs)
             else:
                 print("no rerank no chat template")
-                prompt = ChatTemplate.generate_rag_prompt(data["initial_query"], docs)
+                prompt = ChatTemplate.generate_rag_prompt(prompt, docs)
 
             next_data["inputs"] = prompt
 
@@ -262,7 +255,6 @@ def add_remote_service_without_rerank(self):
             service_type=ServiceType.LLM,
         )
         self.megaservice.add(retriever).add(llm)
-        #self.megaservice.flow_to(embedding, retriever)
         self.megaservice.flow_to(retriever, llm)
         self.gateway = GraphragGateway(megaservice=self.megaservice, host="0.0.0.0", port=self.port)
 
@@ -332,6 +324,7 @@ def add_remote_service_with_guardrails(self):
 
     args = parser.parse_args()
     chatqna = GraphRAGService(host=MEGA_SERVICE_HOST_IP, port=MEGA_SERVICE_PORT)
+    print(RETRIEVER_SERVICE_PORT)
     if args.without_rerank:
         chatqna.add_remote_service_without_rerank()
     elif args.with_guardrails:
diff --git a/GraphRAG/tests/test_compose_without_rerank_on_gaudi.sh b/GraphRAG/tests/test_compose_without_rerank_on_gaudi.sh
new file mode 100755
index 0000000000..f9332b27fb
--- /dev/null
+++ b/GraphRAG/tests/test_compose_without_rerank_on_gaudi.sh
@@ -0,0 +1,215 @@
+#!/bin/bash
+# Copyright (C) 2024 Intel Corporation
+# SPDX-License-Identifier: Apache-2.0
+
+set -e
+IMAGE_REPO=${IMAGE_REPO:-"opea"}
+IMAGE_TAG=${IMAGE_TAG:-"latest"}
+echo "REGISTRY=IMAGE_REPO=${IMAGE_REPO}"
+echo "TAG=IMAGE_TAG=${IMAGE_TAG}"
+export REGISTRY=${IMAGE_REPO}
+export TAG=${IMAGE_TAG}
+
+WORKPATH=$(dirname "$PWD")
+LOG_PATH="$WORKPATH/tests"
+ip_address=$(hostname -I | awk '{print $1}')
+
+function build_docker_images() {
+    cd $WORKPATH/docker_image_build
+    #TODO update the main when components are merged
+    #git clone https://github.com/opea-project/GenAIComps.git && cd GenAIComps && git checkout "${opea_branch:-"main"}" && cd ../
+    git clone https://github.com/rbrugaro/GenAIComps.git && cd GenAIComps && git checkout "${opea_branch:-"graphRAG_LI"}" && cd ../
+
+    echo "Build all the images with --no-cache, check docker_image_build.log for details..."
+    #service_list="chatqna-without-rerank chatqna-ui dataprep-redis retriever-redis nginx"
+    service_list="graphrag-without-rerank dataprep-neo4j retriever-neo4j chatqna-gaudi-ui-server chatqna-gaudi-nginx-server"
+    docker compose -f build.yaml build ${service_list} --no-cache > ${LOG_PATH}/docker_image_build.log
+
+    docker pull ghcr.io/huggingface/tgi-gaudi:2.0.5
+    docker pull ghcr.io/huggingface/text-embeddings-inference:cpu-1.5
+    docker pull neo4j:latest
+    docker images && sleep 1s
+}
+
+function start_services() {
+    cd $WORKPATH/docker_compose/intel/hpu/gaudi
+    export EMBEDDING_MODEL_ID="BAAI/bge-base-en-v1.5"
+    export LLM_MODEL_ID="Intel/neural-chat-7b-v3-3"
+    #export INDEX_NAME="rag-redis"
+    export HUGGINGFACEHUB_API_TOKEN=${HUGGINGFACEHUB_API_TOKEN}
+    #this will need to be updated with the set_env variables and how about the required from private????
+
+    # Start Docker Containers
+    docker compose -f compose_without_rerank.yaml up -d > ${LOG_PATH}/start_services_with_compose.log
+
+    n=0
+    until [[ "$n" -ge 100 ]]; do
+        docker logs tgi-gaudi-server > ${LOG_PATH}/tgi_service_start.log
+        if grep -q Connected ${LOG_PATH}/tgi_service_start.log; then
+            break
+        fi
+        sleep 5s
+        n=$((n+1))
+    done
+}
+
+function validate_service() {
+    local URL="$1"
+    local EXPECTED_RESULT="$2"
+    local SERVICE_NAME="$3"
+    local DOCKER_NAME="$4"
+    local INPUT_DATA="$5"
+
+    if [[ $SERVICE_NAME == *"extract_graph_neo4j"* ]]; then
+        cd $LOG_PATH
+        HTTP_RESPONSE=$(curl --silent --write-out "HTTPSTATUS:%{http_code}" -X POST -F 'files=@./dataprep_file.txt' -H 'Content-Type: multipart/form-data' "$URL")
+    elif [[ $SERVICE_NAME == *"neo4j-apoc"* ]]; then
+         HTTP_RESPONSE=$(curl --silent --write-out "HTTPSTATUS:%{http_code}" "$URL")
+    # elif [[ $SERVICE_NAME == *"dataprep_get"* ]]; then
+    #     HTTP_RESPONSE=$(curl --silent --write-out "HTTPSTATUS:%{http_code}" -X POST -H 'Content-Type: application/json' "$URL")
+    # elif [[ $SERVICE_NAME == *"dataprep_del"* ]]; then
+    #     HTTP_RESPONSE=$(curl --silent --write-out "HTTPSTATUS:%{http_code}" -X POST -d '{"file_path": "all"}' -H 'Content-Type: application/json' "$URL")
+    else
+        HTTP_RESPONSE=$(curl --silent --write-out "HTTPSTATUS:%{http_code}" -X POST -d "$INPUT_DATA" -H 'Content-Type: application/json' "$URL")
+    fi
+    HTTP_STATUS=$(echo $HTTP_RESPONSE | tr -d '\n' | sed -e 's/.*HTTPSTATUS://')
+    RESPONSE_BODY=$(echo $HTTP_RESPONSE | sed -e 's/HTTPSTATUS\:.*//g')
+
+    docker logs ${DOCKER_NAME} >> ${LOG_PATH}/${SERVICE_NAME}.log
+
+    # check response status
+    if [ "$HTTP_STATUS" -ne "200" ]; then
+        echo "[ $SERVICE_NAME ] HTTP status is not 200. Received status was $HTTP_STATUS"
+        exit 1
+    else
+        echo "[ $SERVICE_NAME ] HTTP status is 200. Checking content..."
+    fi
+    # check response body
+    if [[ "$SERVICE_NAME" == "neo4j-apoc" ]]; then
+        echo "[ $SERVICE_NAME ] Skipping content check for neo4j-apoc."
+    else
+        if [[ "$RESPONSE_BODY" != *"$EXPECTED_RESULT"* ]]; then
+            echo "[ $SERVICE_NAME ] Content does not match the expected result: $RESPONSE_BODY"
+            exit 1
+        else
+            echo "[ $SERVICE_NAME ] Content is as expected."
+        fi
+    fi
+
+    sleep 1s
+}
+
+function validate_microservices() {
+    # Check if the microservices are running correctly.
+
+    # validate neo4j-apoc
+    validate_service \
+        "${ip_address}:7474" \
+        "200 OK" \
+        "neo4j-apoc" \
+        "neo4j-apoc" \
+        "" 
+
+    # tei for embedding service
+    validate_service \
+        "${ip_address}:6006/embed" \
+        "[[" \
+        "tei-embedding-service" \
+        "tei-embedding-server" \
+        '{"inputs":"What is Deep Learning?"}'
+
+    sleep 1m # retrieval can't curl as expected, try to wait for more time
+
+    # test /v1/dataprep graph extraction
+    echo "Like many companies in the O&G sector, the stock of Chevron (NYSE:CVX) has declined about 10% over the past 90-days despite the fact that Q2 consensus earnings estimates have risen sharply (~25%) during that same time frame. Over the years, Chevron has kept a very strong balance sheet. FirstEnergy (NYSE:FE – Get Rating) posted its earnings results on Tuesday. The utilities provider reported $0.53 earnings per share for the quarter, topping the consensus estimate of $0.52 by $0.01, RTT News reports. FirstEnergy had a net margin of 10.85% and a return on equity of 17.17%. The Dáil was almost suspended on Thursday afternoon after Sinn Féin TD John Brady walked across the chamber and placed an on-call pager in front of the Minister for Housing Darragh O’Brien during a debate on retained firefighters. Mr O’Brien said Mr Brady had taken part in an act of theatre that was obviously choreographed.Around 2,000 retained firefighters around the country staged a second day of industrial action on Tuesday and are due to start all out-strike action from next Tuesday. The mostly part-time workers, who keep the services going outside of Ireland’s larger urban centres, are taking industrial action in a dispute over pay and working conditions. Speaking in the Dáil, Sinn Féin deputy leader Pearse Doherty said firefighters had marched on Leinster House today and were very angry at the fact the Government will not intervene. Reintroduction of tax relief on mortgages needs to be considered, O’Brien says. Martin withdraws comment after saying People Before Profit would ‘put the jackboot on people’ Taoiseach ‘propagated fears’ farmers forced to rewet land due to nature restoration law – Cairns An intervention is required now. I’m asking you to make an improved offer in relation to pay for retained firefighters, Mr Doherty told the housing minister.I’m also asking you, and challenging you, to go outside after this Order of Business and meet with the firefighters because they are just fed up to the hilt in relation to what you said.Some of them have handed in their pagers to members of the Opposition and have challenged you to wear the pager for the next number of weeks, put up with an €8,600 retainer and not leave your community for the two and a half kilometres and see how you can stand over those type of pay and conditions. At this point, Mr Brady got up from his seat, walked across the chamber and placed the pager on the desk in front of Mr O’Brien. Ceann Comhairle Seán Ó Fearghaíl said the Sinn Féin TD was completely out of order and told him not to carry out a charade in this House, adding it was absolutely outrageous behaviour and not to be encouraged.Mr O’Brien said Mr Brady had engaged in an act of theatre here today which was obviously choreographed and was then interrupted with shouts from the Opposition benches. Mr Ó Fearghaíl said he would suspend the House if this racket continues.Mr O’Brien later said he said he was confident the dispute could be resolved and he had immense regard for firefighters. The minister said he would encourage the unions to re-engage with the State’s industrial relations process while also accusing Sinn Féin of using the issue for their own political gain." > $LOG_PATH/dataprep_file.txt
+    validate_service \
+        "http://${ip_address}:6004/v1/dataprep" \
+        "Data preparation succeeded" \
+        "extract_graph_neo4j" \
+        "dataprep-neo4j-server"
+
+    # retrieval microservice
+    validate_service \
+        "${ip_address}:6009/v1/retrieval" \
+        "Retrieval of answers from community summaries successful" \
+        "retriever_community_answers_neo4j" \
+        "retriever-neo4j-server" \
+        "{\"model\": \"gpt-4o-mini\",\"messages\": [{\"role\": \"user\",\"content\": \"Who is John Brady and has he had any confrontations?\"}]}"
+
+    # tgi for llm service
+    validate_service \
+        "${ip_address}:6005/generate" \
+        "generated_text" \
+        "tgi-gaudi-service" \
+        "tgi-gaudi-server" \
+        '{"inputs":"What is Deep Learning?","parameters":{"max_new_tokens":17, "do_sample": true}}'
+}
+
+function validate_megaservice() {
+    # Curl the Mega Service
+    validate_service \
+        "${ip_address}:8888/v1/graphrag" \
+        "data: " \
+        "graphrag-megaservice" \
+        "graphrag-gaudi-backend-server" \
+        "{\"model\": \"gpt-4o-mini\",\"messages\": [{\"role\": \"user\",\"content\": \"Who is John Brady and has he had any confrontations?\"}]}"
+
+}
+
+function validate_frontend() {
+    cd $WORKPATH/ui/svelte
+    local conda_env_name="OPEA_e2e"
+    export PATH=${HOME}/miniforge3/bin/:$PATH
+    if conda info --envs | grep -q "$conda_env_name"; then
+        echo "$conda_env_name exist!"
+    else
+        conda create -n ${conda_env_name} python=3.12 -y
+    fi
+    source activate ${conda_env_name}
+
+    sed -i "s/localhost/$ip_address/g" playwright.config.ts
+
+    conda install -c conda-forge nodejs -y
+    npm install && npm ci && npx playwright install --with-deps
+    node -v && npm -v && pip list
+
+    exit_status=0
+    npx playwright test || exit_status=$?
+
+    if [ $exit_status -ne 0 ]; then
+        echo "[TEST INFO]: ---------frontend test failed---------"
+        exit $exit_status
+    else
+        echo "[TEST INFO]: ---------frontend test passed---------"
+    fi
+}
+
+function stop_docker() {
+    cd $WORKPATH/docker_compose/intel/hpu/gaudi
+    docker compose  -f compose_without_rerank.yaml stop && docker compose -f compose_without_rerank.yaml rm -f
+}
+
+function main() {
+
+    stop_docker
+    if [[ "$IMAGE_REPO" == "opea" ]]; then build_docker_images; fi
+    start_time=$(date +%s)
+    start_services
+    end_time=$(date +%s)
+    duration=$((end_time-start_time))
+    echo "Mega service start duration is $duration s"
+
+    if [ "${mode}" == "perf" ]; then
+        python3 $WORKPATH/tests/chatqna_benchmark.py
+    elif [ "${mode}" == "" ]; then
+        validate_microservices
+        validate_megaservice
+        #validate_frontend
+    fi
+
+    stop_docker
+    echo y | docker system prune
+
+}
+
+main

From 045550cd50caeba7438087a4860116c5ba20fe7e Mon Sep 17 00:00:00 2001
From: "pre-commit-ci[bot]"
 <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Date: Tue, 22 Oct 2024 18:54:47 +0000
Subject: [PATCH 03/26] [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci
---
 GraphRAG/docker_compose/intel/hpu/gaudi/set_env.sh     | 2 +-
 GraphRAG/docker_image_build/build.yaml                 | 2 +-
 GraphRAG/graphrag.py                                   | 4 ++--
 GraphRAG/tests/test_compose_without_rerank_on_gaudi.sh | 2 +-
 4 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/GraphRAG/docker_compose/intel/hpu/gaudi/set_env.sh b/GraphRAG/docker_compose/intel/hpu/gaudi/set_env.sh
index 1d148bfbf3..20ca26004b 100644
--- a/GraphRAG/docker_compose/intel/hpu/gaudi/set_env.sh
+++ b/GraphRAG/docker_compose/intel/hpu/gaudi/set_env.sh
@@ -16,4 +16,4 @@ export NEO4J_URL="bolt://${host_ip}:7687"
 export NEO4J_USERNAME=neo4j
 export DATAPREP_SERVICE_ENDPOINT="http://${host_ip}:6004/v1/dataprep"
 export LOGFLAG=True
-export RETRIEVER_SERVICE_PORT=6009
\ No newline at end of file
+export RETRIEVER_SERVICE_PORT=6009
diff --git a/GraphRAG/docker_image_build/build.yaml b/GraphRAG/docker_image_build/build.yaml
index e70dc74663..25940d5892 100644
--- a/GraphRAG/docker_image_build/build.yaml
+++ b/GraphRAG/docker_image_build/build.yaml
@@ -116,7 +116,7 @@ services:
         no_proxy: ${no_proxy}
       context: GenAIComps
       dockerfile: comps/dataprep/neo4j/llama_index/Dockerfile
-    image: ${REGISTRY:-opea}/dataprep-neo4j:${TAG:-latest}  
+    image: ${REGISTRY:-opea}/dataprep-neo4j:${TAG:-latest}
   # guardrails-tgi:
   #   build:
   #     context: GenAIComps
diff --git a/GraphRAG/graphrag.py b/GraphRAG/graphrag.py
index 67cb275148..60ae574659 100644
--- a/GraphRAG/graphrag.py
+++ b/GraphRAG/graphrag.py
@@ -6,7 +6,7 @@
 import os
 import re
 
-from comps import ChatQnAGateway, MicroService, ServiceOrchestrator, ServiceType, GraphragGateway
+from comps import ChatQnAGateway, GraphragGateway, MicroService, ServiceOrchestrator, ServiceType
 from langchain_core.prompts import PromptTemplate
 
 
@@ -184,7 +184,7 @@ def __init__(self, host="0.0.0.0", port=8000):
         self.megaservice = ServiceOrchestrator()
 
     def add_remote_service(self):
-        
+
         embedding = MicroService(
             name="embedding",
             host=EMBEDDING_SERVER_HOST_IP,
diff --git a/GraphRAG/tests/test_compose_without_rerank_on_gaudi.sh b/GraphRAG/tests/test_compose_without_rerank_on_gaudi.sh
index f9332b27fb..0ab10637c9 100755
--- a/GraphRAG/tests/test_compose_without_rerank_on_gaudi.sh
+++ b/GraphRAG/tests/test_compose_without_rerank_on_gaudi.sh
@@ -108,7 +108,7 @@ function validate_microservices() {
         "200 OK" \
         "neo4j-apoc" \
         "neo4j-apoc" \
-        "" 
+        ""
 
     # tei for embedding service
     validate_service \

From 99197ea7b52c3b1f775d99c1734836e34d74bb74 Mon Sep 17 00:00:00 2001
From: Rita Brugarolas <rita.brugarolas.brufau@intel.com>
Date: Wed, 23 Oct 2024 17:10:20 +0000
Subject: [PATCH 04/26] code cleanup and test_compose validated

Signed-off-by: Rita Brugarolas <rita.brugarolas.brufau@intel.com>
---
 .../{Dockerfile.without_rerank => Dockerfile} |   2 +-
 .../intel/hpu/gaudi/compose.yaml              |   2 +-
 .../docker_compose/intel/hpu/gaudi/set_env.sh |   2 +-
 GraphRAG/docker_image_build/build.yaml        | 118 ++--------
 GraphRAG/graphrag.py                          | 201 +-----------------
 .../test_compose_without_rerank_on_gaudi.sh   |  12 +-
 6 files changed, 29 insertions(+), 308 deletions(-)
 rename GraphRAG/{Dockerfile.without_rerank => Dockerfile} (93%)

diff --git a/GraphRAG/Dockerfile.without_rerank b/GraphRAG/Dockerfile
similarity index 93%
rename from GraphRAG/Dockerfile.without_rerank
rename to GraphRAG/Dockerfile
index f26639e2ad..a7cda7d29c 100644
--- a/GraphRAG/Dockerfile.without_rerank
+++ b/GraphRAG/Dockerfile
@@ -33,4 +33,4 @@ WORKDIR /home/user
 
 RUN echo 'ulimit -S -n 999999' >> ~/.bashrc
 
-ENTRYPOINT ["python", "graphrag.py", "--without-rerank"]
+ENTRYPOINT ["python", "graphrag.py"]
diff --git a/GraphRAG/docker_compose/intel/hpu/gaudi/compose.yaml b/GraphRAG/docker_compose/intel/hpu/gaudi/compose.yaml
index 753288c656..f691ecd79b 100644
--- a/GraphRAG/docker_compose/intel/hpu/gaudi/compose.yaml
+++ b/GraphRAG/docker_compose/intel/hpu/gaudi/compose.yaml
@@ -120,7 +120,7 @@ services:
       LOGFLAG: ${LOGFLAG}
     restart: unless-stopped
   graphrag-gaudi-backend-server:
-    image: ${REGISTRY:-opea}/graphrag-without-rerank:${TAG:-latest}
+    image: ${REGISTRY:-opea}/graphrag:${TAG:-latest}
     container_name: graphrag-gaudi-backend-server
     depends_on:
       - neo4j-apoc
diff --git a/GraphRAG/docker_compose/intel/hpu/gaudi/set_env.sh b/GraphRAG/docker_compose/intel/hpu/gaudi/set_env.sh
index 20ca26004b..59c400466b 100644
--- a/GraphRAG/docker_compose/intel/hpu/gaudi/set_env.sh
+++ b/GraphRAG/docker_compose/intel/hpu/gaudi/set_env.sh
@@ -8,7 +8,7 @@
 
 export EMBEDDING_MODEL_ID="BAAI/bge-base-en-v1.5"
 export OPENAI_EMBEDDING_MODEL="text-embedding-3-small"
-export LLM_MODEL_ID="Intel/neural-chat-7b-v3-3"
+export LLM_MODEL_ID="meta-llama/Meta-Llama-3-8B-Instruct"
 export OPENAI_LLM_MODEL="gpt-4o"
 export TEI_EMBEDDING_ENDPOINT="http://${host_ip}:6006"
 export TGI_LLM_ENDPOINT="http://${host_ip}:6005"
diff --git a/GraphRAG/docker_image_build/build.yaml b/GraphRAG/docker_image_build/build.yaml
index 25940d5892..f0471c8be4 100644
--- a/GraphRAG/docker_image_build/build.yaml
+++ b/GraphRAG/docker_image_build/build.yaml
@@ -2,55 +2,15 @@
 # SPDX-License-Identifier: Apache-2.0
 
 services:
-  # chatqna:
-  #   build:
-  #     args:
-  #       http_proxy: ${http_proxy}
-  #       https_proxy: ${https_proxy}
-  #       no_proxy: ${no_proxy}
-  #     context: ../
-  #     dockerfile: ./Dockerfile
-  #   image: ${REGISTRY:-opea}/chatqna:${TAG:-latest}
-  # chatqna-guardrails:
-  #   build:
-  #     context: ../
-  #     dockerfile: ./Dockerfile.guardrails
-  #   extends: chatqna
-  #   image: ${REGISTRY:-opea}/chatqna-guardrails:${TAG:-latest}
-  # chatqna-without-rerank:
-  #   build:
-  #     context: ../
-  #     dockerfile: ./Dockerfile.without_rerank
-  #   extends: chatqna
-  #   image: ${REGISTRY:-opea}/chatqna-without-rerank:${TAG:-latest}
-  graphrag-without-rerank:
+  graphrag:
     build:
       args:
         http_proxy: ${http_proxy}
         https_proxy: ${https_proxy}
         no_proxy: ${no_proxy}
       context: ../
-      dockerfile: ./Dockerfile.without_rerank
-    #extends: chatqna
-    image: ${REGISTRY:-opea}/graphrag-without-rerank:${TAG:-latest}
-  # chatqna-ui:
-  #   build:
-  #     context: ../ui
-  #     dockerfile: ./docker/Dockerfile
-  #   extends: chatqna
-  #   image: ${REGISTRY:-opea}/chatqna-ui:${TAG:-latest}
-  # chatqna-conversation-ui:
-  #   build:
-  #     context: ../ui
-  #     dockerfile: ./docker/Dockerfile.react
-  #   extends: chatqna
-  #   image: ${REGISTRY:-opea}/chatqna-conversation-ui:${TAG:-latest}
-  # embedding-tei:
-  #   build:
-  #     context: GenAIComps
-  #     dockerfile: comps/embeddings/tei/langchain/Dockerfile
-  #   extends: chatqna
-  #   image: ${REGISTRY:-opea}/embedding-tei:${TAG:-latest}
+      dockerfile: ./Dockerfile
+    image: ${REGISTRY:-opea}/graphrag:${TAG:-latest}
   retriever-neo4j:
     build:
       args:
@@ -60,54 +20,6 @@ services:
       context: GenAIComps
       dockerfile: comps/retrievers/neo4j/llama_index/Dockerfile
     image: ${REGISTRY:-opea}/retriever-neo4j:${TAG:-latest}
-  # llm-tgi:
-  #   build:
-  #     context: GenAIComps
-  #     dockerfile: comps/llms/text-generation/tgi/Dockerfile
-  #   extends: chatqna
-  #   image: ${REGISTRY:-opea}/llm-tgi:${TAG:-latest}
-  # llm-ollama:
-  #   build:
-  #     context: GenAIComps
-  #     dockerfile: comps/llms/text-generation/ollama/langchain/Dockerfile
-  #   extends: chatqna
-  #   image: ${REGISTRY:-opea}/llm-ollama:${TAG:-latest}
-  # llm-vllm:
-  #   build:
-  #     context: GenAIComps
-  #     dockerfile: comps/llms/text-generation/vllm/langchain/Dockerfile
-  #   extends: chatqna
-  #   image: ${REGISTRY:-opea}/llm-vllm:${TAG:-latest}
-  # llm-vllm-hpu:
-  #   build:
-  #     context: GenAIComps
-  #     dockerfile: comps/llms/text-generation/vllm/langchain/dependency/Dockerfile.intel_hpu
-  #   extends: chatqna
-  #   image: ${REGISTRY:-opea}/llm-vllm-hpu:${TAG:-latest}
-  # llm-vllm-ray:
-  #   build:
-  #     context: GenAIComps
-  #     dockerfile: comps/llms/text-generation/vllm/ray/Dockerfile
-  #   extends: chatqna
-  #   image: ${REGISTRY:-opea}/llm-vllm-ray:${TAG:-latest}
-  # llm-vllm-ray-hpu:
-  #   build:
-  #     context: GenAIComps
-  #     dockerfile: comps/llms/text-generation/vllm/ray/dependency/Dockerfile
-  #   extends: chatqna
-  #   image: ${REGISTRY:-opea}/llm-vllm-ray-hpu:${TAG:-latest}
-  # dataprep-redis:
-  #   build:
-  #     context: GenAIComps
-  #     dockerfile: comps/dataprep/redis/langchain/Dockerfile
-  #   extends: chatqna
-  #   image: ${REGISTRY:-opea}/dataprep-redis:${TAG:-latest}
-  # dataprep-qdrant:
-  #   build:
-  #     context: GenAIComps
-  #     dockerfile: comps/dataprep/qdrant/langchain/Dockerfile
-  #   extends: chatqna
-  #   image: ${REGISTRY:-opea}/dataprep-qdrant:${TAG:-latest}
   dataprep-neo4j:
     build:
       args:
@@ -117,19 +29,7 @@ services:
       context: GenAIComps
       dockerfile: comps/dataprep/neo4j/llama_index/Dockerfile
     image: ${REGISTRY:-opea}/dataprep-neo4j:${TAG:-latest}
-  # guardrails-tgi:
-  #   build:
-  #     context: GenAIComps
-  #     dockerfile: comps/guardrails/llama_guard/langchain/Dockerfile
-  #   extends: chatqna
-  #   image: ${REGISTRY:-opea}/guardrails-tgi:${TAG:-latest}
-  # vllm:
-  #   build:
-  #     context: vllm
-  #     dockerfile: Dockerfile.cpu
-  #   extends: chatqna
-  #   image: ${REGISTRY:-opea}/vllm:${TAG:-latest}
-  nginx:
+  chatqna-gaudi-nginx-server:
     build:
       args:
         http_proxy: ${http_proxy}
@@ -137,5 +37,13 @@ services:
         no_proxy: ${no_proxy}
       context: GenAIComps
       dockerfile: comps/nginx/Dockerfile
-#    extends: chatqna
     image: ${REGISTRY:-opea}/nginx:${TAG:-latest}
+  chatqna-gaudi-ui-server:
+    build:
+      args:
+        http_proxy: ${http_proxy}
+        https_proxy: ${https_proxy}
+        no_proxy: ${no_proxy}
+      context: ../ui
+      dockerfile: ./docker/Dockerfile
+    image: ${REGISTRY:-opea}/chatqna-ui:${TAG:-latest}
diff --git a/GraphRAG/graphrag.py b/GraphRAG/graphrag.py
index 60ae574659..e1fabdd495 100644
--- a/GraphRAG/graphrag.py
+++ b/GraphRAG/graphrag.py
@@ -6,7 +6,7 @@
 import os
 import re
 
-from comps import ChatQnAGateway, GraphragGateway, MicroService, ServiceOrchestrator, ServiceType
+from comps import GraphragGateway, MicroService, ServiceOrchestrator, ServiceType
 from langchain_core.prompts import PromptTemplate
 
 
@@ -37,23 +37,14 @@ def generate_rag_prompt(question, documents):
 
 MEGA_SERVICE_HOST_IP = os.getenv("MEGA_SERVICE_HOST_IP", "0.0.0.0")
 MEGA_SERVICE_PORT = int(os.getenv("MEGA_SERVICE_PORT", 8888))
-GUARDRAIL_SERVICE_HOST_IP = os.getenv("GUARDRAIL_SERVICE_HOST_IP", "0.0.0.0")
-GUARDRAIL_SERVICE_PORT = int(os.getenv("GUARDRAIL_SERVICE_PORT", 80))
-EMBEDDING_SERVER_HOST_IP = os.getenv("EMBEDDING_SERVER_HOST_IP", "0.0.0.0")
-EMBEDDING_SERVER_PORT = int(os.getenv("EMBEDDING_SERVER_PORT", 80))
 RETRIEVER_SERVICE_HOST_IP = os.getenv("RETRIEVER_SERVICE_HOST_IP", "0.0.0.0")
 RETRIEVER_SERVICE_PORT = int(os.getenv("RETRIEVER_SERVICE_PORT", 7000))
-RERANK_SERVER_HOST_IP = os.getenv("RERANK_SERVER_HOST_IP", "0.0.0.0")
-RERANK_SERVER_PORT = int(os.getenv("RERANK_SERVER_PORT", 80))
 LLM_SERVER_HOST_IP = os.getenv("LLM_SERVER_HOST_IP", "0.0.0.0")
 LLM_SERVER_PORT = int(os.getenv("LLM_SERVER_PORT", 80))
 
 
 def align_inputs(self, inputs, cur_node, runtime_graph, llm_parameters_dict, **kwargs):
-    if self.services[cur_node].service_type == ServiceType.EMBEDDING:
-        inputs["inputs"] = inputs["text"]
-        del inputs["text"]
-    elif self.services[cur_node].service_type == ServiceType.RETRIEVER:
+    if self.services[cur_node].service_type == ServiceType.RETRIEVER:
         print("make no changes for retriever inputs. AlreadyCheckCompletionRequest")
     elif self.services[cur_node].service_type == ServiceType.LLM:
         # convert TGI/vLLM to unified OpenAI /v1/chat/completions format
@@ -73,81 +64,29 @@ def align_inputs(self, inputs, cur_node, runtime_graph, llm_parameters_dict, **k
 
 
 def align_outputs(self, data, cur_node, inputs, runtime_graph, llm_parameters_dict, **kwargs):
-    print("data type in align output:\n", type(data))
-    print("data in align output:\n", data)
     next_data = {}
-    if self.services[cur_node].service_type == ServiceType.EMBEDDING:
-        assert isinstance(data, list)
-        next_data = {"text": inputs["inputs"], "embedding": data[0]}
-    elif self.services[cur_node].service_type == ServiceType.RETRIEVER:
-        print(data)
-
+    if self.services[cur_node].service_type == ServiceType.RETRIEVER:
         docs = [doc["text"] for doc in data["retrieved_docs"]]
-
-        with_rerank = runtime_graph.downstream(cur_node)[0].startswith("rerank")
-        if with_rerank and docs:
-            # forward to rerank
-            # prepare inputs for rerank
-            next_data["query"] = data["initial_query"]
-            next_data["texts"] = [doc["text"] for doc in data["retrieved_docs"]]
-        else:
-            # forward to llm
-            if not docs and with_rerank:
-                # delete the rerank from retriever -> rerank -> llm
-                for ds in reversed(runtime_graph.downstream(cur_node)):
-                    for nds in runtime_graph.downstream(ds):
-                        runtime_graph.add_edge(cur_node, nds)
-                    runtime_graph.delete_node_if_exists(ds)
-            # handle template
-            # if user provides template, then format the prompt with it
-            # otherwise, use the default template
-            prompt = inputs.messages[0]["content"]
-            chat_template = llm_parameters_dict["chat_template"]
-            if chat_template:
-                prompt_template = PromptTemplate.from_template(chat_template)
-                input_variables = prompt_template.input_variables
-                if sorted(input_variables) == ["context", "question"]:
-                    prompt = prompt_template.format(question=prompt, context="\n".join(docs))
-                elif input_variables == ["question"]:
-                    prompt = prompt_template.format(question=prompt)
-                else:
-                    print(f"{prompt_template} not used, we only support 2 input variables ['question', 'context']")
-                    prompt = ChatTemplate.generate_rag_prompt(prompt, docs)
-            else:
-                print("no rerank no chat template")
-                prompt = ChatTemplate.generate_rag_prompt(prompt, docs)
-
-            next_data["inputs"] = prompt
-
-    elif self.services[cur_node].service_type == ServiceType.RERANK:
-        # rerank the inputs with the scores
-        reranker_parameters = kwargs.get("reranker_parameters", None)
-        top_n = reranker_parameters.top_n if reranker_parameters else 1
-        docs = inputs["texts"]
-        reranked_docs = []
-        for best_response in data[:top_n]:
-            reranked_docs.append(docs[best_response["index"]])
-
         # handle template
         # if user provides template, then format the prompt with it
         # otherwise, use the default template
-        prompt = inputs["query"]
+        prompt = inputs.messages[0]["content"]
         chat_template = llm_parameters_dict["chat_template"]
         if chat_template:
             prompt_template = PromptTemplate.from_template(chat_template)
             input_variables = prompt_template.input_variables
             if sorted(input_variables) == ["context", "question"]:
-                prompt = prompt_template.format(question=prompt, context="\n".join(reranked_docs))
+                prompt = prompt_template.format(question=prompt, context="\n".join(docs))
             elif input_variables == ["question"]:
                 prompt = prompt_template.format(question=prompt)
             else:
                 print(f"{prompt_template} not used, we only support 2 input variables ['question', 'context']")
-                prompt = ChatTemplate.generate_rag_prompt(prompt, reranked_docs)
+                prompt = ChatTemplate.generate_rag_prompt(prompt, docs)
         else:
-            prompt = ChatTemplate.generate_rag_prompt(prompt, reranked_docs)
+            print("no rerank no chat template")
+            prompt = ChatTemplate.generate_rag_prompt(prompt, docs)
 
         next_data["inputs"] = prompt
-
     else:
         next_data = data
 
@@ -185,58 +124,6 @@ def __init__(self, host="0.0.0.0", port=8000):
 
     def add_remote_service(self):
 
-        embedding = MicroService(
-            name="embedding",
-            host=EMBEDDING_SERVER_HOST_IP,
-            port=EMBEDDING_SERVER_PORT,
-            endpoint="/embed",
-            use_remote_service=True,
-            service_type=ServiceType.EMBEDDING,
-        )
-
-        retriever = MicroService(
-            name="retriever",
-            host=RETRIEVER_SERVICE_HOST_IP,
-            port=RETRIEVER_SERVICE_PORT,
-            endpoint="/v1/retrieval",
-            use_remote_service=True,
-            service_type=ServiceType.RETRIEVER,
-        )
-
-        rerank = MicroService(
-            name="rerank",
-            host=RERANK_SERVER_HOST_IP,
-            port=RERANK_SERVER_PORT,
-            endpoint="/rerank",
-            use_remote_service=True,
-            service_type=ServiceType.RERANK,
-        )
-
-        llm = MicroService(
-            name="llm",
-            host=LLM_SERVER_HOST_IP,
-            port=LLM_SERVER_PORT,
-            endpoint="/v1/chat/completions",
-            use_remote_service=True,
-            service_type=ServiceType.LLM,
-        )
-        self.megaservice.add(embedding).add(retriever).add(rerank).add(llm)
-        self.megaservice.flow_to(embedding, retriever)
-        self.megaservice.flow_to(retriever, rerank)
-        self.megaservice.flow_to(rerank, llm)
-        self.gateway = ChatQnAGateway(megaservice=self.megaservice, host="0.0.0.0", port=self.port)
-
-    def add_remote_service_without_rerank(self):
-
-        # embedding = MicroService(
-        #     name="embedding",
-        #     host=EMBEDDING_SERVER_HOST_IP,
-        #     port=EMBEDDING_SERVER_PORT,
-        #     endpoint="/embed",
-        #     use_remote_service=True,
-        #     service_type=ServiceType.EMBEDDING,
-        # )
-
         retriever = MicroService(
             name="retriever",
             host=RETRIEVER_SERVICE_HOST_IP,
@@ -258,76 +145,8 @@ def add_remote_service_without_rerank(self):
         self.megaservice.flow_to(retriever, llm)
         self.gateway = GraphragGateway(megaservice=self.megaservice, host="0.0.0.0", port=self.port)
 
-    def add_remote_service_with_guardrails(self):
-        guardrail_in = MicroService(
-            name="guardrail_in",
-            host=GUARDRAIL_SERVICE_HOST_IP,
-            port=GUARDRAIL_SERVICE_PORT,
-            endpoint="/v1/guardrails",
-            use_remote_service=True,
-            service_type=ServiceType.GUARDRAIL,
-        )
-        embedding = MicroService(
-            name="embedding",
-            host=EMBEDDING_SERVER_HOST_IP,
-            port=EMBEDDING_SERVER_PORT,
-            endpoint="/embed",
-            use_remote_service=True,
-            service_type=ServiceType.EMBEDDING,
-        )
-        retriever = MicroService(
-            name="retriever",
-            host=RETRIEVER_SERVICE_HOST_IP,
-            port=RETRIEVER_SERVICE_PORT,
-            endpoint="/v1/retrieval",
-            use_remote_service=True,
-            service_type=ServiceType.RETRIEVER,
-        )
-        rerank = MicroService(
-            name="rerank",
-            host=RERANK_SERVER_HOST_IP,
-            port=RERANK_SERVER_PORT,
-            endpoint="/rerank",
-            use_remote_service=True,
-            service_type=ServiceType.RERANK,
-        )
-        llm = MicroService(
-            name="llm",
-            host=LLM_SERVER_HOST_IP,
-            port=LLM_SERVER_PORT,
-            endpoint="/v1/chat/completions",
-            use_remote_service=True,
-            service_type=ServiceType.LLM,
-        )
-        # guardrail_out = MicroService(
-        #     name="guardrail_out",
-        #     host=GUARDRAIL_SERVICE_HOST_IP,
-        #     port=GUARDRAIL_SERVICE_PORT,
-        #     endpoint="/v1/guardrails",
-        #     use_remote_service=True,
-        #     service_type=ServiceType.GUARDRAIL,
-        # )
-        # self.megaservice.add(guardrail_in).add(embedding).add(retriever).add(rerank).add(llm).add(guardrail_out)
-        self.megaservice.add(guardrail_in).add(embedding).add(retriever).add(rerank).add(llm)
-        self.megaservice.flow_to(guardrail_in, embedding)
-        self.megaservice.flow_to(embedding, retriever)
-        self.megaservice.flow_to(retriever, rerank)
-        self.megaservice.flow_to(rerank, llm)
-        # self.megaservice.flow_to(llm, guardrail_out)
-        self.gateway = ChatQnAGateway(megaservice=self.megaservice, host="0.0.0.0", port=self.port)
-
 
 if __name__ == "__main__":
-    parser = argparse.ArgumentParser()
-    parser.add_argument("--without-rerank", action="store_true")
-    parser.add_argument("--with-guardrails", action="store_true")
+    graphrag = GraphRAGService(host=MEGA_SERVICE_HOST_IP, port=MEGA_SERVICE_PORT)
+    graphrag.add_remote_service()
 
-    args = parser.parse_args()
-    chatqna = GraphRAGService(host=MEGA_SERVICE_HOST_IP, port=MEGA_SERVICE_PORT)
-    print(RETRIEVER_SERVICE_PORT)
-    if args.without_rerank:
-        chatqna.add_remote_service_without_rerank()
-    elif args.with_guardrails:
-        chatqna.add_remote_service_with_guardrails()
-    else:
-        chatqna.add_remote_service()
diff --git a/GraphRAG/tests/test_compose_without_rerank_on_gaudi.sh b/GraphRAG/tests/test_compose_without_rerank_on_gaudi.sh
index 0ab10637c9..eb7816a66d 100755
--- a/GraphRAG/tests/test_compose_without_rerank_on_gaudi.sh
+++ b/GraphRAG/tests/test_compose_without_rerank_on_gaudi.sh
@@ -21,8 +21,7 @@ function build_docker_images() {
     git clone https://github.com/rbrugaro/GenAIComps.git && cd GenAIComps && git checkout "${opea_branch:-"graphRAG_LI"}" && cd ../
 
     echo "Build all the images with --no-cache, check docker_image_build.log for details..."
-    #service_list="chatqna-without-rerank chatqna-ui dataprep-redis retriever-redis nginx"
-    service_list="graphrag-without-rerank dataprep-neo4j retriever-neo4j chatqna-gaudi-ui-server chatqna-gaudi-nginx-server"
+    service_list="graphrag dataprep-neo4j retriever-neo4j chatqna-gaudi-ui-server chatqna-gaudi-nginx-server"
     docker compose -f build.yaml build ${service_list} --no-cache > ${LOG_PATH}/docker_image_build.log
 
     docker pull ghcr.io/huggingface/tgi-gaudi:2.0.5
@@ -35,12 +34,11 @@ function start_services() {
     cd $WORKPATH/docker_compose/intel/hpu/gaudi
     export EMBEDDING_MODEL_ID="BAAI/bge-base-en-v1.5"
     export LLM_MODEL_ID="Intel/neural-chat-7b-v3-3"
-    #export INDEX_NAME="rag-redis"
     export HUGGINGFACEHUB_API_TOKEN=${HUGGINGFACEHUB_API_TOKEN}
     #this will need to be updated with the set_env variables and how about the required from private????
 
     # Start Docker Containers
-    docker compose -f compose_without_rerank.yaml up -d > ${LOG_PATH}/start_services_with_compose.log
+    docker compose -f compose.yaml up -d > ${LOG_PATH}/start_services_with_compose.log
 
     n=0
     until [[ "$n" -ge 100 ]]; do
@@ -65,10 +63,6 @@ function validate_service() {
         HTTP_RESPONSE=$(curl --silent --write-out "HTTPSTATUS:%{http_code}" -X POST -F 'files=@./dataprep_file.txt' -H 'Content-Type: multipart/form-data' "$URL")
     elif [[ $SERVICE_NAME == *"neo4j-apoc"* ]]; then
          HTTP_RESPONSE=$(curl --silent --write-out "HTTPSTATUS:%{http_code}" "$URL")
-    # elif [[ $SERVICE_NAME == *"dataprep_get"* ]]; then
-    #     HTTP_RESPONSE=$(curl --silent --write-out "HTTPSTATUS:%{http_code}" -X POST -H 'Content-Type: application/json' "$URL")
-    # elif [[ $SERVICE_NAME == *"dataprep_del"* ]]; then
-    #     HTTP_RESPONSE=$(curl --silent --write-out "HTTPSTATUS:%{http_code}" -X POST -d '{"file_path": "all"}' -H 'Content-Type: application/json' "$URL")
     else
         HTTP_RESPONSE=$(curl --silent --write-out "HTTPSTATUS:%{http_code}" -X POST -d "$INPUT_DATA" -H 'Content-Type: application/json' "$URL")
     fi
@@ -186,7 +180,7 @@ function validate_frontend() {
 
 function stop_docker() {
     cd $WORKPATH/docker_compose/intel/hpu/gaudi
-    docker compose  -f compose_without_rerank.yaml stop && docker compose -f compose_without_rerank.yaml rm -f
+    docker compose  -f compose.yaml stop && docker compose -f compose.yaml rm -f
 }
 
 function main() {

From 50c594dc3a9f67396c0d92ee9dcdf7fc1d07b4c2 Mon Sep 17 00:00:00 2001
From: "pre-commit-ci[bot]"
 <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Date: Wed, 23 Oct 2024 17:08:29 +0000
Subject: [PATCH 05/26] [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci
---
 GraphRAG/graphrag.py | 1 -
 1 file changed, 1 deletion(-)

diff --git a/GraphRAG/graphrag.py b/GraphRAG/graphrag.py
index e1fabdd495..d838360537 100644
--- a/GraphRAG/graphrag.py
+++ b/GraphRAG/graphrag.py
@@ -149,4 +149,3 @@ def add_remote_service(self):
 if __name__ == "__main__":
     graphrag = GraphRAGService(host=MEGA_SERVICE_HOST_IP, port=MEGA_SERVICE_PORT)
     graphrag.add_remote_service()
-

From d8f791c7209977a83d39dbde6deb4a107ade8236 Mon Sep 17 00:00:00 2001
From: Rita Brugarolas <rita.brugarolas.brufau@intel.com>
Date: Wed, 23 Oct 2024 20:06:36 +0000
Subject: [PATCH 06/26] add README

Signed-off-by: Rita Brugarolas <rita.brugarolas.brufau@intel.com>
---
 GraphRAG/README.md                            | 250 ++++++++++++++++++
 GraphRAG/assets/8microservices.png            | Bin 0 -> 176826 bytes
 ...out_rerank_on_gaudi.sh => test_compose.sh} |   0
 3 files changed, 250 insertions(+)
 create mode 100644 GraphRAG/README.md
 create mode 100644 GraphRAG/assets/8microservices.png
 rename GraphRAG/tests/{test_compose_without_rerank_on_gaudi.sh => test_compose.sh} (100%)

diff --git a/GraphRAG/README.md b/GraphRAG/README.md
new file mode 100644
index 0000000000..5caefac044
--- /dev/null
+++ b/GraphRAG/README.md
@@ -0,0 +1,250 @@
+# ChatQnA Application
+
+While naive RAG works well in fetching precise information it fails on global questions directed at an entire text corpus, such as "What are the main themes in the dataset?". 
+GraphRAG was introduced by Microsoft paper "From Local to Global: A Graph RAG Approach to Query-Focused Summarization". The key elements are:
+- Uses LLM to derive an entity knowledge graph from the source documents
+- Uses hierarchichal leiden algorithm to identify communities of closely-related entities and summaries are extracted for each community
+- For an input query the relevant communities are identified and partial answers are generated from each of the community summaries (query-focused summarization (QFS))
+- There is a final generation stage that responds to the query based on the intermediate community answers.
+
+
+## Deploy ChatQnA Service
+
+The ChatQnA service can be effortlessly deployed on Intel Gaudi2, Intel Xeon Scalable Processors.
+
+Quick Start Deployment Steps:
+
+1. Set up the environment variables.
+2. Run Docker Compose.
+3. Consume the ChatQnA Service.
+
+Note: If you do not have docker installed you can run this script to install docker : `bash docker_compose/install_docker.sh`
+
+### Quick Start: 1.Setup Environment Variable
+
+To set up environment variables for deploying ChatQnA services, follow these steps:
+
+1. Set the required private environment variables:
+
+    ```bash
+    export host_ip=${your_hostname IP} #local IP, i.e "192.168.1.1"
+    export NEO4J_URI=${your_neo4j_url}
+    export NEO4J_USERNAME=${your_neo4j_username}
+    export NEO4J_PASSWORD=${your_neo4j_password}
+    export PYTHONPATH=${path_to_comps}
+    export OPENAI_KEY=${your_openai_api_key} #optional, when not provided will use smaller models TGI/TEI
+    export HUGGINGFACEHUB_API_TOKEN=${your_hf_token} #needed for TGI/TEI models
+    ```
+
+2. If you are in a proxy environment, also set the proxy-related environment variables:
+
+    ```bash
+    export http_proxy="Your_HTTP_Proxy"
+    export https_proxy="Your_HTTPs_Proxy"
+    export no_proxy=$no_proxy,${host_ip} #important to add {host_ip} for containers communication
+    ```
+
+3. Set up other environment variables:
+
+   ```bash
+   # on Gaudi
+   source ./docker_compose/intel/hpu/gaudi/set_env.sh
+   ```
+
+### Quick Start: 2.Run Docker Compose
+
+If the microservice images are available in Docker Hub they will be pulled, otherwise you will need to build the container images manually. Please refer to the 'Build Docker Images' in [Guide](docker_compose/intel/cpu/xeon/README.md). [test_compose.sh](tests/test_compose.sh) can be a good resource as it shows how to do image build, starting services, validated each microservices and megaservices. This is what is used in CI/CD. 
+
+Docker compose will start 8 services: ![8 servicesi in GraphRAG](assets/8microservices.png)
+
+```bash
+cd GraphRAG/docker_compose/intel/hpu/gaudi
+docker compose -f compose.yaml up -d
+```
+
+### QuickStart: 3.Upload RAG Files and Consume the GraphRAG Service
+
+To chat with retrieved information, you need to upload a file using `Dataprep` service.
+
+Here is an example of `Nike 2023` pdf.
+
+```bash
+# download pdf file
+wget https://raw.githubusercontent.com/opea-project/GenAIComps/main/comps/retrievers/redis/data/nke-10k-2023.pdf
+# upload pdf file with dataprep
+curl -X POST "http://${host_ip}:6004/v1/dataprep" \
+    -H "Content-Type: multipart/form-data" \
+    -F "files=@./nke-10k-2023.pdf"
+```
+
+```bash
+curl http://${host_ip}:8888/v1/graphrag \
+    -H "Content-Type: application/json"  \
+    -d '{
+        "model": "gpt-4o-mini","messages": [{"role": "user","content": "What is the revenue of Nike in 2023?     
+    "}]}'
+```
+
+## Architecture and Deploy details
+
+GraphQnA architecture shows below:
+![architecture](./assets/img/chatqna_architecture.png)
+
+The ChatQnA example is implemented using the component-level microservices defined in [GenAIComps](https://github.com/opea-project/GenAIComps). The flow chart below shows the information flow between different microservices for this example.
+
+```mermaid
+---
+config:
+  flowchart:
+    nodeSpacing: 400
+    rankSpacing: 100
+    curve: linear
+  themeVariables:
+    fontSize: 50px
+---
+flowchart LR
+    %% Colors %%
+    classDef blue fill:#ADD8E6,stroke:#ADD8E6,stroke-width:2px,fill-opacity:0.5
+    classDef orange fill:#FBAA60,stroke:#ADD8E6,stroke-width:2px,fill-opacity:0.5
+    classDef orchid fill:#C26DBC,stroke:#ADD8E6,stroke-width:2px,fill-opacity:0.5
+    classDef invisible fill:transparent,stroke:transparent;
+    style GraphRAG-MegaService stroke:#000000
+
+    %% Subgraphs %%
+    subgraph GraphRAG-MegaService["GraphRAG MegaService "]
+        direction LR
+        RET([Retrieval MicroService]):::blue
+        LLM([LLM MicroService]):::blue
+    end
+    subgraph UserInterface[" User Interface "]
+        direction LR
+        a([User Input Query]):::orchid
+        Ingest([Ingest data]):::orchid
+        UI([UI server<br>]):::orchid
+    end
+
+
+
+    GDB{{Graph DB<br><br>}}
+    R_RET{{Retriever service <br>}}
+    DP([Data Preparation MicroService]):::blue
+    LLM_gen{{LLM Service <br>}}
+    GW([GraphRAG GateWay<br>]):::orange
+
+    %% Data Preparation flow
+    %% Ingest data flow
+    direction LR
+    Ingest[Ingest data] --> UI
+    UI --> DP
+    DP <-.-> EM
+
+
+    %% Questions interaction
+    direction LR
+    a[User Input Query] --> UI
+    UI --> GW
+    GW <==> GraphRAG-MegaService
+    RET ==> LLM
+
+
+    direction TB
+    %% Graph DB interaction
+    R_RET <-.->|d|GDB
+    DP <-.->|d|GDB
+
+```
+
+> **Note**: The Dataprep and Retriever microservices use the LLM Microservice and Embedding Microservice in their implementation. For example, Dataprep uses LLM to extract entities and relationships from text to build graph and Retriever uses LLM to summarize communities (these are clusters of similar entities and their properties). Those endpoint interactions with respective prompts are buried in the microservice implementation thus not managed by the megaservice orchestrator scheduler and not exposed in the megaservice.
+
+
+This GraphRAG use case performs RAG using Llama-index, Neo4J Graph Property Store and Text Generation Inference on [Intel Gaudi2](https://www.intel.com/content/www/us/en/products/details/processors/ai-accelerators/gaudi-overview.html) or [Intel Xeon Scalable Processors](https://www.intel.com/content/www/us/en/products/details/processors/xeon.html).
+In the below, we provide a table that describes for each microservice component in the ChatQnA architecture, the default configuration of the open source project, hardware, port, and endpoint.
+
+Gaudi default compose.yaml
+| MicroService | Open Source Project | HW | Port | Endpoint |
+| ------------ | ------------------- | ----- | ---- | -------------------- |
+| Embedding | Llama-index | Xeon | 6006 | /v1/embaddings |
+| Retriever | Llama-index, Neo4j | Xeon | 6009 | /v1/retrieval |
+| LLM | Llama-index, TGI | Gaudi | 6005 | /v1/chat/completions |
+| Dataprep | Neo4j, LlamaIndex | Xeon | 6004 | /v1/dataprep |
+
+### Models Selection
+
+GraphRAG quality dependents heavily on the ability to extract a high quality graph. We highly recommend using the best model availableto you. Table below shows default models specified in the codebase when OPENAI_API_KEY is available and for local inference w TEI/TGI. The local models are small since those will be used in CI/CD but  users should improve upon these by changing the `xxx_MODEL_ID` in `docker_compose/xxx/set_env.sh`.
+
+Working on a table comparison of various model sizes vs. naive RAG with a dataset that reflects well the benefits of GraphRAG. Stay tunned!
+
+| Service   | Model                     |
+| --------- | ------------------------- |
+| Embedding | BAAI/bge-base-en-v1.5     |
+| Embedding | "text-embedding-3-small"     |
+| LLM       | gpt-4o |
+| LLM       | "meta-llama/Meta-Llama-3-8B-Instruct" |
+
+
+## Consume GraphRAG Service with RAG
+
+### Check Service Status
+
+Before consuming GraphRAG Service, make sure each microservice is ready by checking the docker logs of each microservice. [test_compose.sh](tests/test_compose.sh) can be a good resource as it shows how CI/CD validated each microservices based on returned HTTP status and response body.
+
+```bash
+docker logs container_name 
+```
+
+
+### Upload RAG Files
+
+To chat with retrieved information, you need to upload a file using `Dataprep` service.
+
+Here is an example of `Nike 2023` pdf. 
+
+```bash
+# download pdf file
+wget https://raw.githubusercontent.com/opea-project/GenAIComps/main/comps/retrievers/redis/data/nke-10k-2023.pdf
+# upload pdf file with dataprep
+curl -X POST "http://${host_ip}:6007/v1/dataprep" \
+    -H "Content-Type: multipart/form-data" \
+    -F "files=@./nke-10k-2023.pdf"
+```
+
+### Consume GraphRAG Service
+
+Two ways of consuming ChatQnA Service:
+
+1. Use cURL command on terminal
+
+```bash
+curl http://${host_ip}:8888/v1/graphrag \
+    -H "Content-Type: application/json"  \
+    -d '{
+        "model": "gpt-4o-mini","messages": [{"role": "user","content": "Who is John Brady and has he had any confrontations?     
+    "}]}'
+```
+
+2. Access via frontend
+
+   To access the frontend, open the following URL in your browser: `http://{host_ip}:5173`
+
+   By default, the UI runs on port 5173 internally.
+
+   If you choose conversational UI, use this URL: `http://{host_ip}:5174`
+
+## Troubleshooting
+
+1. If you get errors like "Access Denied", [validate micro service](https://github.com/opea-project/GenAIExamples/tree/main/ChatQnA/docker_compose/intel/cpu/xeon/README.md#validate-microservices) first. A simple example:
+
+   ```bash
+   http_proxy="" curl ${host_ip}:6006/embed -X POST  -d '{"inputs":"What is Deep Learning?"}' -H 'Content-Type: application/json'
+   ```
+
+2. (Docker only) If all microservices work well, check the port ${host_ip}:8888, the port may be allocated by other users, you can modify the `compose.yaml`.
+
+3. (Docker only) If you get errors like "The container name is in use", change container name in `compose.yaml`.
+
+## Monitoring OPEA Service with Prometheus and Grafana dashboard
+
+OPEA microservice deployment can easily be monitored through Grafana dashboards in conjunction with Prometheus data collection. Follow the [README](https://github.com/opea-project/GenAIEval/blob/main/evals/benchmark/grafana/README.md) to setup Prometheus and Grafana servers and import dashboards to monitor the OPEA service.
+
+![chatqna dashboards](./assets/img/chatqna_dashboards.png)
+![tgi dashboard](./assets/img/tgi_dashboard.png)
diff --git a/GraphRAG/assets/8microservices.png b/GraphRAG/assets/8microservices.png
new file mode 100644
index 0000000000000000000000000000000000000000..f11037a8bb7b9dfa9de55a863e3f2caf313d9538
GIT binary patch
diff --git a/GraphRAG/tests/test_compose_without_rerank_on_gaudi.sh b/GraphRAG/tests/test_compose.sh
similarity index 100%
rename from GraphRAG/tests/test_compose_without_rerank_on_gaudi.sh
rename to GraphRAG/tests/test_compose.sh

From ca3b0a024707fa6959be5d997604890411938d9f Mon Sep 17 00:00:00 2001
From: "pre-commit-ci[bot]"
 <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Date: Wed, 23 Oct 2024 20:01:12 +0000
Subject: [PATCH 07/26] [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci
---
 GraphRAG/README.md | 61 ++++++++++++++++++++++------------------------
 1 file changed, 29 insertions(+), 32 deletions(-)

diff --git a/GraphRAG/README.md b/GraphRAG/README.md
index 5caefac044..a3573e5ac7 100644
--- a/GraphRAG/README.md
+++ b/GraphRAG/README.md
@@ -1,13 +1,13 @@
 # ChatQnA Application
 
-While naive RAG works well in fetching precise information it fails on global questions directed at an entire text corpus, such as "What are the main themes in the dataset?". 
+While naive RAG works well in fetching precise information it fails on global questions directed at an entire text corpus, such as "What are the main themes in the dataset?".
 GraphRAG was introduced by Microsoft paper "From Local to Global: A Graph RAG Approach to Query-Focused Summarization". The key elements are:
+
 - Uses LLM to derive an entity knowledge graph from the source documents
-- Uses hierarchichal leiden algorithm to identify communities of closely-related entities and summaries are extracted for each community
+- Uses hierarchical leiden algorithm to identify communities of closely-related entities and summaries are extracted for each community
 - For an input query the relevant communities are identified and partial answers are generated from each of the community summaries (query-focused summarization (QFS))
 - There is a final generation stage that responds to the query based on the intermediate community answers.
 
-
 ## Deploy ChatQnA Service
 
 The ChatQnA service can be effortlessly deployed on Intel Gaudi2, Intel Xeon Scalable Processors.
@@ -26,23 +26,23 @@ To set up environment variables for deploying ChatQnA services, follow these ste
 
 1. Set the required private environment variables:
 
-    ```bash
-    export host_ip=${your_hostname IP} #local IP, i.e "192.168.1.1"
-    export NEO4J_URI=${your_neo4j_url}
-    export NEO4J_USERNAME=${your_neo4j_username}
-    export NEO4J_PASSWORD=${your_neo4j_password}
-    export PYTHONPATH=${path_to_comps}
-    export OPENAI_KEY=${your_openai_api_key} #optional, when not provided will use smaller models TGI/TEI
-    export HUGGINGFACEHUB_API_TOKEN=${your_hf_token} #needed for TGI/TEI models
-    ```
+   ```bash
+   export host_ip=${your_hostname IP} #local IP, i.e "192.168.1.1"
+   export NEO4J_URI=${your_neo4j_url}
+   export NEO4J_USERNAME=${your_neo4j_username}
+   export NEO4J_PASSWORD=${your_neo4j_password}
+   export PYTHONPATH=${path_to_comps}
+   export OPENAI_KEY=${your_openai_api_key} #optional, when not provided will use smaller models TGI/TEI
+   export HUGGINGFACEHUB_API_TOKEN=${your_hf_token} #needed for TGI/TEI models
+   ```
 
 2. If you are in a proxy environment, also set the proxy-related environment variables:
 
-    ```bash
-    export http_proxy="Your_HTTP_Proxy"
-    export https_proxy="Your_HTTPs_Proxy"
-    export no_proxy=$no_proxy,${host_ip} #important to add {host_ip} for containers communication
-    ```
+   ```bash
+   export http_proxy="Your_HTTP_Proxy"
+   export https_proxy="Your_HTTPs_Proxy"
+   export no_proxy=$no_proxy,${host_ip} #important to add {host_ip} for containers communication
+   ```
 
 3. Set up other environment variables:
 
@@ -53,7 +53,7 @@ To set up environment variables for deploying ChatQnA services, follow these ste
 
 ### Quick Start: 2.Run Docker Compose
 
-If the microservice images are available in Docker Hub they will be pulled, otherwise you will need to build the container images manually. Please refer to the 'Build Docker Images' in [Guide](docker_compose/intel/cpu/xeon/README.md). [test_compose.sh](tests/test_compose.sh) can be a good resource as it shows how to do image build, starting services, validated each microservices and megaservices. This is what is used in CI/CD. 
+If the microservice images are available in Docker Hub they will be pulled, otherwise you will need to build the container images manually. Please refer to the 'Build Docker Images' in [Guide](docker_compose/intel/cpu/xeon/README.md). [test_compose.sh](tests/test_compose.sh) can be a good resource as it shows how to do image build, starting services, validated each microservices and megaservices. This is what is used in CI/CD.
 
 Docker compose will start 8 services: ![8 servicesi in GraphRAG](assets/8microservices.png)
 
@@ -81,7 +81,7 @@ curl -X POST "http://${host_ip}:6004/v1/dataprep" \
 curl http://${host_ip}:8888/v1/graphrag \
     -H "Content-Type: application/json"  \
     -d '{
-        "model": "gpt-4o-mini","messages": [{"role": "user","content": "What is the revenue of Nike in 2023?     
+        "model": "gpt-4o-mini","messages": [{"role": "user","content": "What is the revenue of Nike in 2023?
     "}]}'
 ```
 
@@ -156,7 +156,6 @@ flowchart LR
 
 > **Note**: The Dataprep and Retriever microservices use the LLM Microservice and Embedding Microservice in their implementation. For example, Dataprep uses LLM to extract entities and relationships from text to build graph and Retriever uses LLM to summarize communities (these are clusters of similar entities and their properties). Those endpoint interactions with respective prompts are buried in the microservice implementation thus not managed by the megaservice orchestrator scheduler and not exposed in the megaservice.
 
-
 This GraphRAG use case performs RAG using Llama-index, Neo4J Graph Property Store and Text Generation Inference on [Intel Gaudi2](https://www.intel.com/content/www/us/en/products/details/processors/ai-accelerators/gaudi-overview.html) or [Intel Xeon Scalable Processors](https://www.intel.com/content/www/us/en/products/details/processors/xeon.html).
 In the below, we provide a table that describes for each microservice component in the ChatQnA architecture, the default configuration of the open source project, hardware, port, and endpoint.
 
@@ -170,18 +169,17 @@ Gaudi default compose.yaml
 
 ### Models Selection
 
-GraphRAG quality dependents heavily on the ability to extract a high quality graph. We highly recommend using the best model availableto you. Table below shows default models specified in the codebase when OPENAI_API_KEY is available and for local inference w TEI/TGI. The local models are small since those will be used in CI/CD but  users should improve upon these by changing the `xxx_MODEL_ID` in `docker_compose/xxx/set_env.sh`.
+GraphRAG quality dependents heavily on the ability to extract a high quality graph. We highly recommend using the best model availableto you. Table below shows default models specified in the codebase when OPENAI_API_KEY is available and for local inference w TEI/TGI. The local models are small since those will be used in CI/CD but users should improve upon these by changing the `xxx_MODEL_ID` in `docker_compose/xxx/set_env.sh`.
 
-Working on a table comparison of various model sizes vs. naive RAG with a dataset that reflects well the benefits of GraphRAG. Stay tunned!
+Working on a table comparison of various model sizes vs. naive RAG with a dataset that reflects well the benefits of GraphRAG. Stay tuned!
 
-| Service   | Model                     |
-| --------- | ------------------------- |
-| Embedding | BAAI/bge-base-en-v1.5     |
-| Embedding | "text-embedding-3-small"     |
-| LLM       | gpt-4o |
+| Service   | Model                                 |
+| --------- | ------------------------------------- |
+| Embedding | BAAI/bge-base-en-v1.5                 |
+| Embedding | "text-embedding-3-small"              |
+| LLM       | gpt-4o                                |
 | LLM       | "meta-llama/Meta-Llama-3-8B-Instruct" |
 
-
 ## Consume GraphRAG Service with RAG
 
 ### Check Service Status
@@ -189,15 +187,14 @@ Working on a table comparison of various model sizes vs. naive RAG with a datase
 Before consuming GraphRAG Service, make sure each microservice is ready by checking the docker logs of each microservice. [test_compose.sh](tests/test_compose.sh) can be a good resource as it shows how CI/CD validated each microservices based on returned HTTP status and response body.
 
 ```bash
-docker logs container_name 
+docker logs container_name
 ```
 
-
 ### Upload RAG Files
 
 To chat with retrieved information, you need to upload a file using `Dataprep` service.
 
-Here is an example of `Nike 2023` pdf. 
+Here is an example of `Nike 2023` pdf.
 
 ```bash
 # download pdf file
@@ -218,7 +215,7 @@ Two ways of consuming ChatQnA Service:
 curl http://${host_ip}:8888/v1/graphrag \
     -H "Content-Type: application/json"  \
     -d '{
-        "model": "gpt-4o-mini","messages": [{"role": "user","content": "Who is John Brady and has he had any confrontations?     
+        "model": "gpt-4o-mini","messages": [{"role": "user","content": "Who is John Brady and has he had any confrontations?
     "}]}'
 ```
 

From 4f07a4c12cdb14ab435050ce8c5f25aa8be55e5a Mon Sep 17 00:00:00 2001
From: Rita Brugarolas <rita.brugarolas.brufau@intel.com>
Date: Wed, 23 Oct 2024 20:15:43 +0000
Subject: [PATCH 08/26] README fixes

Signed-off-by: Rita Brugarolas <rita.brugarolas.brufau@intel.com>
---
 GraphRAG/README.md | 22 ++++++++++++----------
 1 file changed, 12 insertions(+), 10 deletions(-)

diff --git a/GraphRAG/README.md b/GraphRAG/README.md
index a3573e5ac7..65cfb5dd7e 100644
--- a/GraphRAG/README.md
+++ b/GraphRAG/README.md
@@ -1,4 +1,4 @@
-# ChatQnA Application
+# GraphRAG Application
 
 While naive RAG works well in fetching precise information it fails on global questions directed at an entire text corpus, such as "What are the main themes in the dataset?".
 GraphRAG was introduced by Microsoft paper "From Local to Global: A Graph RAG Approach to Query-Focused Summarization". The key elements are:
@@ -8,21 +8,26 @@ GraphRAG was introduced by Microsoft paper "From Local to Global: A Graph RAG Ap
 - For an input query the relevant communities are identified and partial answers are generated from each of the community summaries (query-focused summarization (QFS))
 - There is a final generation stage that responds to the query based on the intermediate community answers.
 
+<<<<<<< Updated upstream
 ## Deploy ChatQnA Service
+=======
 
-The ChatQnA service can be effortlessly deployed on Intel Gaudi2, Intel Xeon Scalable Processors.
+## Deploy GraphRAG Service
+>>>>>>> Stashed changes
+
+The GraphRAG service can be effortlessly deployed on Intel Gaudi2, Intel Xeon Scalable Processors.
 
 Quick Start Deployment Steps:
 
 1. Set up the environment variables.
 2. Run Docker Compose.
-3. Consume the ChatQnA Service.
+3. Consume the GraphRAG Service.
 
 Note: If you do not have docker installed you can run this script to install docker : `bash docker_compose/install_docker.sh`
 
 ### Quick Start: 1.Setup Environment Variable
 
-To set up environment variables for deploying ChatQnA services, follow these steps:
+To set up environment variables for deploying GraphRAG services, follow these steps:
 
 1. Set the required private environment variables:
 
@@ -87,10 +92,7 @@ curl http://${host_ip}:8888/v1/graphrag \
 
 ## Architecture and Deploy details
 
-GraphQnA architecture shows below:
-![architecture](./assets/img/chatqna_architecture.png)
-
-The ChatQnA example is implemented using the component-level microservices defined in [GenAIComps](https://github.com/opea-project/GenAIComps). The flow chart below shows the information flow between different microservices for this example.
+The GraphRAG example is implemented using the component-level microservices defined in [GenAIComps](https://github.com/opea-project/GenAIComps). The flow chart below shows the information flow between different microservices for this example.
 
 ```mermaid
 ---
@@ -157,7 +159,7 @@ flowchart LR
 > **Note**: The Dataprep and Retriever microservices use the LLM Microservice and Embedding Microservice in their implementation. For example, Dataprep uses LLM to extract entities and relationships from text to build graph and Retriever uses LLM to summarize communities (these are clusters of similar entities and their properties). Those endpoint interactions with respective prompts are buried in the microservice implementation thus not managed by the megaservice orchestrator scheduler and not exposed in the megaservice.
 
 This GraphRAG use case performs RAG using Llama-index, Neo4J Graph Property Store and Text Generation Inference on [Intel Gaudi2](https://www.intel.com/content/www/us/en/products/details/processors/ai-accelerators/gaudi-overview.html) or [Intel Xeon Scalable Processors](https://www.intel.com/content/www/us/en/products/details/processors/xeon.html).
-In the below, we provide a table that describes for each microservice component in the ChatQnA architecture, the default configuration of the open source project, hardware, port, and endpoint.
+In the below, we provide a table that describes for each microservice component in the GraphRAG architecture, the default configuration of the open source project, hardware, port, and endpoint.
 
 Gaudi default compose.yaml
 | MicroService | Open Source Project | HW | Port | Endpoint |
@@ -207,7 +209,7 @@ curl -X POST "http://${host_ip}:6007/v1/dataprep" \
 
 ### Consume GraphRAG Service
 
-Two ways of consuming ChatQnA Service:
+Two ways of consuming GraphRAG Service:
 
 1. Use cURL command on terminal
 

From 3c2b11fe8def28d92168e12de403e28655e9a488 Mon Sep 17 00:00:00 2001
From: "pre-commit-ci[bot]"
 <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Date: Wed, 23 Oct 2024 20:10:21 +0000
Subject: [PATCH 09/26] [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci
---
 GraphRAG/README.md | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/GraphRAG/README.md b/GraphRAG/README.md
index 65cfb5dd7e..94ada0424e 100644
--- a/GraphRAG/README.md
+++ b/GraphRAG/README.md
@@ -9,11 +9,14 @@ GraphRAG was introduced by Microsoft paper "From Local to Global: A Graph RAG Ap
 - There is a final generation stage that responds to the query based on the intermediate community answers.
 
 <<<<<<< Updated upstream
+
 ## Deploy ChatQnA Service
+
 =======
 
 ## Deploy GraphRAG Service
->>>>>>> Stashed changes
+
+> > > > > > > Stashed changes
 
 The GraphRAG service can be effortlessly deployed on Intel Gaudi2, Intel Xeon Scalable Processors.
 

From b894a846d5e6201e4f9cee401a3cdaf3ec5afeec Mon Sep 17 00:00:00 2001
From: Rita Brugarolas <rita.brugarolas.brufau@intel.com>
Date: Wed, 23 Oct 2024 22:16:15 +0000
Subject: [PATCH 10/26] readme relative path fix

Signed-off-by: Rita Brugarolas <rita.brugarolas.brufau@intel.com>
---
 GraphRAG/README.md | 11 ++---------
 1 file changed, 2 insertions(+), 9 deletions(-)

diff --git a/GraphRAG/README.md b/GraphRAG/README.md
index 94ada0424e..685f221194 100644
--- a/GraphRAG/README.md
+++ b/GraphRAG/README.md
@@ -8,16 +8,9 @@ GraphRAG was introduced by Microsoft paper "From Local to Global: A Graph RAG Ap
 - For an input query the relevant communities are identified and partial answers are generated from each of the community summaries (query-focused summarization (QFS))
 - There is a final generation stage that responds to the query based on the intermediate community answers.
 
-<<<<<<< Updated upstream
-
-## Deploy ChatQnA Service
-
-=======
 
 ## Deploy GraphRAG Service
 
-> > > > > > > Stashed changes
-
 The GraphRAG service can be effortlessly deployed on Intel Gaudi2, Intel Xeon Scalable Processors.
 
 Quick Start Deployment Steps:
@@ -248,5 +241,5 @@ curl http://${host_ip}:8888/v1/graphrag \
 
 OPEA microservice deployment can easily be monitored through Grafana dashboards in conjunction with Prometheus data collection. Follow the [README](https://github.com/opea-project/GenAIEval/blob/main/evals/benchmark/grafana/README.md) to setup Prometheus and Grafana servers and import dashboards to monitor the OPEA service.
 
-![chatqna dashboards](./assets/img/chatqna_dashboards.png)
-![tgi dashboard](./assets/img/tgi_dashboard.png)
+![chatqna dashboards](../ChatQnA/assets/img/chatqna_dashboards.png)
+![tgi dashboard](../ChatQnA//assets/img/tgi_dashboard.png)

From 623693ccfc4c42fa7c3e0ec91276671793564c12 Mon Sep 17 00:00:00 2001
From: "pre-commit-ci[bot]"
 <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Date: Wed, 23 Oct 2024 22:10:46 +0000
Subject: [PATCH 11/26] [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci
---
 GraphRAG/README.md | 1 -
 1 file changed, 1 deletion(-)

diff --git a/GraphRAG/README.md b/GraphRAG/README.md
index 685f221194..706a5f0ffd 100644
--- a/GraphRAG/README.md
+++ b/GraphRAG/README.md
@@ -8,7 +8,6 @@ GraphRAG was introduced by Microsoft paper "From Local to Global: A Graph RAG Ap
 - For an input query the relevant communities are identified and partial answers are generated from each of the community summaries (query-focused summarization (QFS))
 - There is a final generation stage that responds to the query based on the intermediate community answers.
 
-
 ## Deploy GraphRAG Service
 
 The GraphRAG service can be effortlessly deployed on Intel Gaudi2, Intel Xeon Scalable Processors.

From dfb89f79300ac582202a1ed274e27642a58fcf55 Mon Sep 17 00:00:00 2001
From: "pre-commit-ci[bot]"
 <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Date: Wed, 23 Oct 2024 22:36:55 +0000
Subject: [PATCH 12/26] [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci
---
 GraphRAG/README.md | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/GraphRAG/README.md b/GraphRAG/README.md
index a2e1e87d2c..e68d927368 100644
--- a/GraphRAG/README.md
+++ b/GraphRAG/README.md
@@ -131,7 +131,7 @@ flowchart LR
     direction LR
     Ingest[Ingest data] --> UI
     UI --> DP
-    
+
     #interactions buried inside the DP and RET microservice implementations
     DP <-.-> EM
     DP <-.-> LLM

From 4021fb43832e88e6c3d5dea8180b6010909385e3 Mon Sep 17 00:00:00 2001
From: Rita Brugarolas <rita.brugarolas.brufau@intel.com>
Date: Wed, 23 Oct 2024 22:42:24 +0000
Subject: [PATCH 13/26] marmaid update

Signed-off-by: Rita Brugarolas <rita.brugarolas.brufau@intel.com>
---
 GraphRAG/README.md | 17 +++++++++++++----
 1 file changed, 13 insertions(+), 4 deletions(-)

diff --git a/GraphRAG/README.md b/GraphRAG/README.md
index 706a5f0ffd..a2e1e87d2c 100644
--- a/GraphRAG/README.md
+++ b/GraphRAG/README.md
@@ -121,19 +121,23 @@ flowchart LR
     end
 
 
-
     GDB{{Graph DB<br><br>}}
-    R_RET{{Retriever service <br>}}
     DP([Data Preparation MicroService]):::blue
-    LLM_gen{{LLM Service <br>}}
     GW([GraphRAG GateWay<br>]):::orange
+    EM([Embedding MicroService]):::blue
 
     %% Data Preparation flow
     %% Ingest data flow
     direction LR
     Ingest[Ingest data] --> UI
     UI --> DP
+    
+    #interactions buried inside the DP and RET microservice implementations
     DP <-.-> EM
+    DP <-.-> LLM
+    RET <-.-> EM
+    RE <-.-> LLM
+
 
 
     %% Questions interaction
@@ -146,9 +150,14 @@ flowchart LR
 
     direction TB
     %% Graph DB interaction
-    R_RET <-.->|d|GDB
+    RET <-.->|d|GDB
     DP <-.->|d|GDB
 
+    linkStyle 2 stroke:#00FF00,stroke-width:2px;  # DP -.-> EM
+    linkStyle 3 stroke:#00FF00,stroke-width:2px;  # DP -.-> LLM
+    linkStyle 4 stroke:#00FF00,stroke-width:2px;  # RET -.-> EM
+    linkStyle 5 stroke:#00FF00,stroke-width:2px;  # RET -.-> LLM
+
 ```
 
 > **Note**: The Dataprep and Retriever microservices use the LLM Microservice and Embedding Microservice in their implementation. For example, Dataprep uses LLM to extract entities and relationships from text to build graph and Retriever uses LLM to summarize communities (these are clusters of similar entities and their properties). Those endpoint interactions with respective prompts are buried in the microservice implementation thus not managed by the megaservice orchestrator scheduler and not exposed in the megaservice.

From 986b74b71249cb945d7f156613f75fb1bd111c05 Mon Sep 17 00:00:00 2001
From: Rita Brugarolas <rita.brugarolas.brufau@intel.com>
Date: Wed, 23 Oct 2024 22:44:04 +0000
Subject: [PATCH 14/26] marmaid update

Signed-off-by: Rita Brugarolas <rita.brugarolas.brufau@intel.com>
---
 GraphRAG/README.md | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/GraphRAG/README.md b/GraphRAG/README.md
index a2e1e87d2c..e5ce58a8e9 100644
--- a/GraphRAG/README.md
+++ b/GraphRAG/README.md
@@ -132,7 +132,7 @@ flowchart LR
     Ingest[Ingest data] --> UI
     UI --> DP
     
-    #interactions buried inside the DP and RET microservice implementations
+    %% interactions buried inside the DP and RET microservice implementations
     DP <-.-> EM
     DP <-.-> LLM
     RET <-.-> EM

From 43d6adc887ddf6f131821eb690a9ee7447428e55 Mon Sep 17 00:00:00 2001
From: Rita Brugarolas <rita.brugarolas.brufau@intel.com>
Date: Wed, 23 Oct 2024 23:09:23 +0000
Subject: [PATCH 15/26] marmaid update

Signed-off-by: Rita Brugarolas <rita.brugarolas.brufau@intel.com>
---
 GraphRAG/README.md | 23 ++++++++++++-----------
 1 file changed, 12 insertions(+), 11 deletions(-)

diff --git a/GraphRAG/README.md b/GraphRAG/README.md
index f595ef2b31..2eac4c6cfa 100644
--- a/GraphRAG/README.md
+++ b/GraphRAG/README.md
@@ -112,6 +112,7 @@ flowchart LR
         direction LR
         RET([Retrieval MicroService]):::blue
         LLM([LLM MicroService]):::blue
+        EM([Embedding MicroService]):::blue
     end
     subgraph UserInterface[" User Interface "]
         direction LR
@@ -124,7 +125,7 @@ flowchart LR
     GDB{{Graph DB<br><br>}}
     DP([Data Preparation MicroService]):::blue
     GW([GraphRAG GateWay<br>]):::orange
-    EM([Embedding MicroService]):::blue
+    
 
     %% Data Preparation flow
     %% Ingest data flow
@@ -136,9 +137,8 @@ flowchart LR
     DP <-.-> EM
     DP <-.-> LLM
     RET <-.-> EM
-    RE <-.-> LLM
-
-
+    RET <-.-> LLM
+   
 
     %% Questions interaction
     direction LR
@@ -150,17 +150,18 @@ flowchart LR
 
     direction TB
     %% Graph DB interaction
-    RET <-.->|d|GDB
-    DP <-.->|d|GDB
+    RET <-.-> |d|GDB
+    DP <-.-> |d|GDB
+
+    linkStyle 2 stroke:#000000,stroke-width:2px;
+    linkStyle 3 stroke:#000000,stroke-width:2px;
+    linkStyle 4 stroke:#000000,stroke-width:2px;
+    linkStyle 5 stroke:#000000,stroke-width:2px;
 
-    linkStyle 2 stroke:#00FF00,stroke-width:2px;  # DP -.-> EM
-    linkStyle 3 stroke:#00FF00,stroke-width:2px;  # DP -.-> LLM
-    linkStyle 4 stroke:#00FF00,stroke-width:2px;  # RET -.-> EM
-    linkStyle 5 stroke:#00FF00,stroke-width:2px;  # RET -.-> LLM
 
 ```
 
-> **Note**: The Dataprep and Retriever microservices use the LLM Microservice and Embedding Microservice in their implementation. For example, Dataprep uses LLM to extract entities and relationships from text to build graph and Retriever uses LLM to summarize communities (these are clusters of similar entities and their properties). Those endpoint interactions with respective prompts are buried in the microservice implementation thus not managed by the megaservice orchestrator scheduler and not exposed in the megaservice.
+> **Note**: The Dataprep and Retriever microservices use the LLM Microservice and Embedding Microservice in their implementation. For example, Dataprep uses LLM to extract entities and relationships from text to build graph and Retriever uses LLM to summarize communities (these are clusters of similar entities and their properties). Those endpoint interactions with the corresponding prompt templates are buried in the microservice implementation thus not managed by the megaservice orchestrator scheduler and not exposed in the megaservice. Shown as thin black lines in diagram.
 
 This GraphRAG use case performs RAG using Llama-index, Neo4J Graph Property Store and Text Generation Inference on [Intel Gaudi2](https://www.intel.com/content/www/us/en/products/details/processors/ai-accelerators/gaudi-overview.html) or [Intel Xeon Scalable Processors](https://www.intel.com/content/www/us/en/products/details/processors/xeon.html).
 In the below, we provide a table that describes for each microservice component in the GraphRAG architecture, the default configuration of the open source project, hardware, port, and endpoint.

From 66eff3136fca5bef353e6de89b4ac42a87caa78d Mon Sep 17 00:00:00 2001
From: "pre-commit-ci[bot]"
 <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Date: Wed, 23 Oct 2024 23:03:49 +0000
Subject: [PATCH 16/26] [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci
---
 GraphRAG/README.md | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/GraphRAG/README.md b/GraphRAG/README.md
index 2eac4c6cfa..3838c23922 100644
--- a/GraphRAG/README.md
+++ b/GraphRAG/README.md
@@ -125,7 +125,7 @@ flowchart LR
     GDB{{Graph DB<br><br>}}
     DP([Data Preparation MicroService]):::blue
     GW([GraphRAG GateWay<br>]):::orange
-    
+
 
     %% Data Preparation flow
     %% Ingest data flow
@@ -138,7 +138,7 @@ flowchart LR
     DP <-.-> LLM
     RET <-.-> EM
     RET <-.-> LLM
-   
+
 
     %% Questions interaction
     direction LR

From 493e68191803b66f67def6960372388925ee3152 Mon Sep 17 00:00:00 2001
From: Rita Brugarolas <rita.brugarolas.brufau@intel.com>
Date: Thu, 24 Oct 2024 04:20:20 +0000
Subject: [PATCH 17/26] fix readme link

Signed-off-by: Rita Brugarolas <rita.brugarolas.brufau@intel.com>
---
 GraphRAG/README.md | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/GraphRAG/README.md b/GraphRAG/README.md
index 3838c23922..e9bb10370c 100644
--- a/GraphRAG/README.md
+++ b/GraphRAG/README.md
@@ -236,7 +236,7 @@ curl http://${host_ip}:8888/v1/graphrag \
 
 ## Troubleshooting
 
-1. If you get errors like "Access Denied", [validate micro service](https://github.com/opea-project/GenAIExamples/tree/main/ChatQnA/docker_compose/intel/cpu/xeon/README.md#validate-microservices) first. A simple example:
+1. If you get errors like "Access Denied", [validate micro service](https://github.com/opea-project/GenAIExamples/blob/main/ChatQnA/docker_compose/intel/cpu/xeon/README.md#validate-microservices) first. A simple example:
 
    ```bash
    http_proxy="" curl ${host_ip}:6006/embed -X POST  -d '{"inputs":"What is Deep Learning?"}' -H 'Content-Type: application/json'

From b0c774bf1163038eb86d69c890fd219636ed8206 Mon Sep 17 00:00:00 2001
From: Rita Brugarolas <rita.brugarolas.brufau@intel.com>
Date: Thu, 24 Oct 2024 04:44:30 +0000
Subject: [PATCH 18/26] fix readme cicd error

Signed-off-by: Rita Brugarolas <rita.brugarolas.brufau@intel.com>
---
 GraphRAG/README.md | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/GraphRAG/README.md b/GraphRAG/README.md
index e9bb10370c..2e43425ae7 100644
--- a/GraphRAG/README.md
+++ b/GraphRAG/README.md
@@ -53,7 +53,7 @@ To set up environment variables for deploying GraphRAG services, follow these st
 
 ### Quick Start: 2.Run Docker Compose
 
-If the microservice images are available in Docker Hub they will be pulled, otherwise you will need to build the container images manually. Please refer to the 'Build Docker Images' in [Guide](docker_compose/intel/cpu/xeon/README.md). [test_compose.sh](tests/test_compose.sh) can be a good resource as it shows how to do image build, starting services, validated each microservices and megaservices. This is what is used in CI/CD.
+If the microservice images are available in Docker Hub they will be pulled, otherwise you will need to build the container images manually. Please refer to the 'Build Docker Images' in [Guide](../ChatQnA/docker_compose/intel/cpu/xeon/README.md). [test_compose.sh](tests/test_compose.sh) can be a good resource as it shows how to do image build, starting services, validated each microservices and megaservices. This is what is used in CI/CD.
 
 Docker compose will start 8 services: ![8 servicesi in GraphRAG](assets/8microservices.png)
 

From 8cbf08cc94169693e45b06297ba0047d35dbee6a Mon Sep 17 00:00:00 2001
From: Rita Brugarolas <rita.brugarolas.brufau@intel.com>
Date: Thu, 24 Oct 2024 06:41:12 +0000
Subject: [PATCH 19/26] update comp image names

Signed-off-by: Rita Brugarolas <rita.brugarolas.brufau@intel.com>
---
 .../docker_compose/intel/hpu/gaudi/compose.yaml    | 14 +++++++-------
 GraphRAG/docker_image_build/build.yaml             |  8 ++++----
 GraphRAG/tests/test_compose.sh                     |  2 +-
 3 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/GraphRAG/docker_compose/intel/hpu/gaudi/compose.yaml b/GraphRAG/docker_compose/intel/hpu/gaudi/compose.yaml
index f691ecd79b..b285dbf884 100644
--- a/GraphRAG/docker_compose/intel/hpu/gaudi/compose.yaml
+++ b/GraphRAG/docker_compose/intel/hpu/gaudi/compose.yaml
@@ -65,8 +65,8 @@ services:
       - SYS_NICE
     ipc: host
     command: --model-id ${LLM_MODEL_ID} --max-input-length 2048 --max-total-tokens 4096
-  dataprep-neo4j:
-    image: opea/dataprep-neo4j-llama_index:latest
+  dataprep-neo4j-llamaindex:
+    image: opea/dataprep-neo4j-llamaindex:latest
     container_name: dataprep-neo4j-server
     depends_on:
       - neo4j-apoc
@@ -92,8 +92,8 @@ services:
       LLM_MODEL_ID: ${LLM_MODEL_ID}
       LOGFLAG: ${LOGFLAG}
     restart: unless-stopped
-  retriever-neo4j:
-    image: opea/retriever-neo4j-llama_index:latest
+  retriever-neo4j-llamaindex:
+    image: opea/retriever-neo4j-llamaindex:latest
     container_name: retriever-neo4j-server
     depends_on:
       - neo4j-apoc
@@ -125,7 +125,7 @@ services:
     depends_on:
       - neo4j-apoc
       - tei-embedding-service
-      - retriever-neo4j
+      - retriever-neo4j-llamaindex
       - tgi-gaudi-service
     ports:
       - "8888:8888"
@@ -136,7 +136,7 @@ services:
       - MEGA_SERVICE_HOST_IP=graphrag-gaudi-backend-server
 #      - EMBEDDING_SERVER_HOST_IP=tei-embedding-service
 #      - EMBEDDING_SERVER_PORT=${EMBEDDING_SERVER_PORT:-80}
-      - RETRIEVER_SERVICE_HOST_IP=retriever-neo4j
+      - RETRIEVER_SERVICE_HOST_IP=retriever-neo4j-llamaindex
       - RETRIEVER_SERVICE_PORT=6009
       - RETRIEVER_SERVICE_PORT=${RETRIEVER_SERVICE_PORT:-80}
       - LLM_SERVER_HOST_IP=tgi-gaudi-service
@@ -174,7 +174,7 @@ services:
       - BACKEND_SERVICE_NAME=graphrag
       - BACKEND_SERVICE_IP=graphrag-gaudi-backend-server
       - BACKEND_SERVICE_PORT=8888
-      - DATAPREP_SERVICE_IP=dataprep-neo4j
+      - DATAPREP_SERVICE_IP=dataprep-neo4j-llamaindex
       - DATAPREP_SERVICE_PORT=6004
     ipc: host
     restart: always
diff --git a/GraphRAG/docker_image_build/build.yaml b/GraphRAG/docker_image_build/build.yaml
index f0471c8be4..3187e7cee9 100644
--- a/GraphRAG/docker_image_build/build.yaml
+++ b/GraphRAG/docker_image_build/build.yaml
@@ -11,7 +11,7 @@ services:
       context: ../
       dockerfile: ./Dockerfile
     image: ${REGISTRY:-opea}/graphrag:${TAG:-latest}
-  retriever-neo4j:
+  retriever-neo4j-llamaindex:
     build:
       args:
         http_proxy: ${http_proxy}
@@ -19,8 +19,8 @@ services:
         no_proxy: ${no_proxy}
       context: GenAIComps
       dockerfile: comps/retrievers/neo4j/llama_index/Dockerfile
-    image: ${REGISTRY:-opea}/retriever-neo4j:${TAG:-latest}
-  dataprep-neo4j:
+    image: ${REGISTRY:-opea}/retriever-neo4j-llamaindex:${TAG:-latest}
+  dataprep-neo4j-llamaindex:
     build:
       args:
         http_proxy: ${http_proxy}
@@ -28,7 +28,7 @@ services:
         no_proxy: ${no_proxy}
       context: GenAIComps
       dockerfile: comps/dataprep/neo4j/llama_index/Dockerfile
-    image: ${REGISTRY:-opea}/dataprep-neo4j:${TAG:-latest}
+    image: ${REGISTRY:-opea}/dataprep-neo4j-llamaindex:${TAG:-latest}
   chatqna-gaudi-nginx-server:
     build:
       args:
diff --git a/GraphRAG/tests/test_compose.sh b/GraphRAG/tests/test_compose.sh
index eb7816a66d..c916596e78 100755
--- a/GraphRAG/tests/test_compose.sh
+++ b/GraphRAG/tests/test_compose.sh
@@ -21,7 +21,7 @@ function build_docker_images() {
     git clone https://github.com/rbrugaro/GenAIComps.git && cd GenAIComps && git checkout "${opea_branch:-"graphRAG_LI"}" && cd ../
 
     echo "Build all the images with --no-cache, check docker_image_build.log for details..."
-    service_list="graphrag dataprep-neo4j retriever-neo4j chatqna-gaudi-ui-server chatqna-gaudi-nginx-server"
+    service_list="graphrag dataprep-neo4j-llamaindex retriever-neo4j-llamaindex chatqna-gaudi-ui-server chatqna-gaudi-nginx-server"
     docker compose -f build.yaml build ${service_list} --no-cache > ${LOG_PATH}/docker_image_build.log
 
     docker pull ghcr.io/huggingface/tgi-gaudi:2.0.5

From 110bb6d7461a2e207de63e82af41999f53b834b4 Mon Sep 17 00:00:00 2001
From: Rita Brugarolas <rita.brugarolas.brufau@intel.com>
Date: Fri, 25 Oct 2024 16:55:22 +0000
Subject: [PATCH 20/26] add UI folder, install docker script and renabled
 frontend from test script

Signed-off-by: Rita Brugarolas <rita.brugarolas.brufau@intel.com>
---
 GraphRAG/docker_compose/install_docker.sh     |  35 ++
 GraphRAG/tests/test_compose.sh                |   5 +-
 GraphRAG/ui/docker/Dockerfile                 |  26 ++
 GraphRAG/ui/docker/Dockerfile.react           |  21 ++
 GraphRAG/ui/react/.env                        |   2 +
 GraphRAG/ui/react/.env.production             |   2 +
 GraphRAG/ui/react/.eslintrc.cjs               |  11 +
 GraphRAG/ui/react/.gitignore                  |  24 ++
 GraphRAG/ui/react/README.md                   |  32 ++
 GraphRAG/ui/react/env.sh                      |  15 +
 GraphRAG/ui/react/index.html                  |  18 +
 GraphRAG/ui/react/nginx.conf                  |  20 ++
 GraphRAG/ui/react/package.json                |  47 +++
 GraphRAG/ui/react/postcss.config.cjs          |  14 +
 GraphRAG/ui/react/public/vite.svg             |   1 +
 GraphRAG/ui/react/src/App.scss                |  42 +++
 GraphRAG/ui/react/src/App.tsx                 |  34 ++
 GraphRAG/ui/react/src/__tests__/util.test.ts  |  14 +
 .../ui/react/src/assets/opea-icon-black.svg   |  39 +++
 .../ui/react/src/assets/opea-icon-color.svg   |  40 +++
 GraphRAG/ui/react/src/assets/react.svg        |   1 +
 GraphRAG/ui/react/src/common/client.ts        |   8 +
 GraphRAG/ui/react/src/common/util.ts          |  12 +
 .../components/Conversation/Conversation.tsx  | 156 +++++++++
 .../Conversation/ConversationSideBar.tsx      |  45 +++
 .../components/Conversation/DataSource.tsx    |  71 ++++
 .../Conversation/conversation.module.scss     |  65 ++++
 .../Message/conversationMessage.module.scss   |  15 +
 .../Message/conversationMessage.tsx           |  55 ++++
 .../UserInfoModal/UserInfoModal.tsx           |  48 +++
 .../components/sidebar/sidebar.module.scss    |  84 +++++
 .../react/src/components/sidebar/sidebar.tsx  |  70 ++++
 GraphRAG/ui/react/src/config.ts               |   5 +
 GraphRAG/ui/react/src/index.scss              |  20 ++
 GraphRAG/ui/react/src/main.tsx                |  17 +
 .../src/redux/Conversation/Conversation.ts    |  32 ++
 .../redux/Conversation/ConversationSlice.ts   | 221 +++++++++++++
 GraphRAG/ui/react/src/redux/User/user.d.ts    |   6 +
 GraphRAG/ui/react/src/redux/User/userSlice.ts |  26 ++
 GraphRAG/ui/react/src/redux/store.ts          |  49 +++
 GraphRAG/ui/react/src/redux/thunkUtil.ts      |  25 ++
 .../react/src/styles/components/_context.scss |   0
 .../react/src/styles/components/_sidebar.scss |   8 +
 .../react/src/styles/components/content.scss  |   5 +
 .../src/styles/components/context.module.scss |  67 ++++
 .../ui/react/src/styles/layout/_basics.scss   |   7 +
 .../ui/react/src/styles/layout/_flex.scss     |   6 +
 GraphRAG/ui/react/src/styles/styles.scss      |   5 +
 GraphRAG/ui/react/src/vite-env.d.ts           |   4 +
 GraphRAG/ui/react/tsconfig.json               |  23 ++
 GraphRAG/ui/react/tsconfig.node.json          |  11 +
 GraphRAG/ui/react/vite.config.ts              |  27 ++
 GraphRAG/ui/svelte/.editorconfig              |  10 +
 GraphRAG/ui/svelte/.env                       |   7 +
 GraphRAG/ui/svelte/.eslintignore              |  13 +
 GraphRAG/ui/svelte/.eslintrc.cjs              |  34 ++
 GraphRAG/ui/svelte/.prettierignore            |  13 +
 GraphRAG/ui/svelte/.prettierrc                |   1 +
 GraphRAG/ui/svelte/README.md                  |  42 +++
 GraphRAG/ui/svelte/package.json               |  61 ++++
 GraphRAG/ui/svelte/playwright.config.ts       |  87 +++++
 GraphRAG/ui/svelte/postcss.config.cjs         |  27 ++
 GraphRAG/ui/svelte/src/app.d.ts               |  19 ++
 GraphRAG/ui/svelte/src/app.html               |  28 ++
 GraphRAG/ui/svelte/src/app.postcss            |  86 +++++
 .../DocManagement/LinkfolderIcon.svelte       |  36 ++
 .../lib/assets/DocManagement/fileIcon.svelte  |  30 ++
 .../assets/DocManagement/folderIcon.svelte    |  30 ++
 .../lib/assets/avatar/svelte/Delete.svelte    |  30 ++
 .../lib/assets/chat/svelte/Assistant.svelte   |  44 +++
 .../assets/chat/svelte/PaperAirplane.svelte   |  68 ++++
 .../assets/chat/svelte/PersonOutlined.svelte  |  26 ++
 .../src/lib/assets/layout/css/driver.css      |  94 ++++++
 .../src/lib/assets/upload/deleteIcon.svelte   |  22 ++
 .../lib/assets/upload/loading-button.svelte   |  25 ++
 .../svelte/src/lib/assets/upload/next.svelte  |  31 ++
 .../src/lib/assets/upload/no-file.svelte      |  37 +++
 .../src/lib/assets/upload/previous.svelte     |  31 ++
 .../svelte/src/lib/assets/voice/svg/paste.svg |   1 +
 .../src/lib/assets/voice/svg/uploadFile.svg   |   1 +
 .../src/lib/modules/chat/ChatMessage.svelte   |  70 ++++
 .../src/lib/modules/chat/MessageAvatar.svelte |  30 ++
 .../src/lib/modules/chat/MessageTimer.svelte  |  67 ++++
 .../src/lib/modules/frame/Layout.svelte       |  48 +++
 .../ui/svelte/src/lib/network/chat/Network.ts |  35 ++
 .../svelte/src/lib/network/upload/Network.ts  |  82 +++++
 GraphRAG/ui/svelte/src/lib/shared/Utils.ts    |  54 +++
 .../lib/shared/components/chat/gallery.svelte | 156 +++++++++
 .../components/doc_management/docCard.svelte  | 150 +++++++++
 .../treeView/svelte-tree.svelte               |  35 ++
 .../treeView/tree-branch.svelte               |  46 +++
 .../doc_management/treeView/tree-node.svelte  | 111 +++++++
 .../shared/components/loading/Loading.svelte  |  48 +++
 .../components/scrollbar/Scrollbar.svelte     |  48 +++
 .../components/upload/PasteKnowledge.svelte   |  52 +++
 .../components/upload/upload-knowledge.svelte |  49 +++
 .../components/upload/uploadFile.svelte       | 184 +++++++++++
 .../src/lib/shared/constant/Interface.ts      |  47 +++
 .../src/lib/shared/stores/common/Store.ts     |  41 +++
 GraphRAG/ui/svelte/src/routes/+layout.svelte  |  48 +++
 GraphRAG/ui/svelte/src/routes/+page.svelte    | 311 ++++++++++++++++++
 GraphRAG/ui/svelte/src/routes/+page.ts        |  26 ++
 GraphRAG/ui/svelte/static/favicon.png         | Bin 0 -> 70954 bytes
 GraphRAG/ui/svelte/svelte.config.js           |  38 +++
 GraphRAG/ui/svelte/tailwind.config.cjs        |  43 +++
 GraphRAG/ui/svelte/tests/chatQnA.spec.ts      |  82 +++++
 GraphRAG/ui/svelte/tests/test_file.txt        | 104 ++++++
 GraphRAG/ui/svelte/tsconfig.json              |  16 +
 GraphRAG/ui/svelte/vite.config.ts             |  23 ++
 109 files changed, 4612 insertions(+), 2 deletions(-)
 create mode 100644 GraphRAG/docker_compose/install_docker.sh
 create mode 100644 GraphRAG/ui/docker/Dockerfile
 create mode 100644 GraphRAG/ui/docker/Dockerfile.react
 create mode 100644 GraphRAG/ui/react/.env
 create mode 100644 GraphRAG/ui/react/.env.production
 create mode 100644 GraphRAG/ui/react/.eslintrc.cjs
 create mode 100644 GraphRAG/ui/react/.gitignore
 create mode 100644 GraphRAG/ui/react/README.md
 create mode 100644 GraphRAG/ui/react/env.sh
 create mode 100644 GraphRAG/ui/react/index.html
 create mode 100644 GraphRAG/ui/react/nginx.conf
 create mode 100644 GraphRAG/ui/react/package.json
 create mode 100644 GraphRAG/ui/react/postcss.config.cjs
 create mode 100644 GraphRAG/ui/react/public/vite.svg
 create mode 100644 GraphRAG/ui/react/src/App.scss
 create mode 100644 GraphRAG/ui/react/src/App.tsx
 create mode 100644 GraphRAG/ui/react/src/__tests__/util.test.ts
 create mode 100644 GraphRAG/ui/react/src/assets/opea-icon-black.svg
 create mode 100644 GraphRAG/ui/react/src/assets/opea-icon-color.svg
 create mode 100644 GraphRAG/ui/react/src/assets/react.svg
 create mode 100644 GraphRAG/ui/react/src/common/client.ts
 create mode 100644 GraphRAG/ui/react/src/common/util.ts
 create mode 100644 GraphRAG/ui/react/src/components/Conversation/Conversation.tsx
 create mode 100644 GraphRAG/ui/react/src/components/Conversation/ConversationSideBar.tsx
 create mode 100644 GraphRAG/ui/react/src/components/Conversation/DataSource.tsx
 create mode 100644 GraphRAG/ui/react/src/components/Conversation/conversation.module.scss
 create mode 100644 GraphRAG/ui/react/src/components/Message/conversationMessage.module.scss
 create mode 100644 GraphRAG/ui/react/src/components/Message/conversationMessage.tsx
 create mode 100644 GraphRAG/ui/react/src/components/UserInfoModal/UserInfoModal.tsx
 create mode 100644 GraphRAG/ui/react/src/components/sidebar/sidebar.module.scss
 create mode 100644 GraphRAG/ui/react/src/components/sidebar/sidebar.tsx
 create mode 100644 GraphRAG/ui/react/src/config.ts
 create mode 100644 GraphRAG/ui/react/src/index.scss
 create mode 100644 GraphRAG/ui/react/src/main.tsx
 create mode 100644 GraphRAG/ui/react/src/redux/Conversation/Conversation.ts
 create mode 100644 GraphRAG/ui/react/src/redux/Conversation/ConversationSlice.ts
 create mode 100644 GraphRAG/ui/react/src/redux/User/user.d.ts
 create mode 100644 GraphRAG/ui/react/src/redux/User/userSlice.ts
 create mode 100644 GraphRAG/ui/react/src/redux/store.ts
 create mode 100644 GraphRAG/ui/react/src/redux/thunkUtil.ts
 create mode 100644 GraphRAG/ui/react/src/styles/components/_context.scss
 create mode 100644 GraphRAG/ui/react/src/styles/components/_sidebar.scss
 create mode 100644 GraphRAG/ui/react/src/styles/components/content.scss
 create mode 100644 GraphRAG/ui/react/src/styles/components/context.module.scss
 create mode 100644 GraphRAG/ui/react/src/styles/layout/_basics.scss
 create mode 100644 GraphRAG/ui/react/src/styles/layout/_flex.scss
 create mode 100644 GraphRAG/ui/react/src/styles/styles.scss
 create mode 100644 GraphRAG/ui/react/src/vite-env.d.ts
 create mode 100644 GraphRAG/ui/react/tsconfig.json
 create mode 100644 GraphRAG/ui/react/tsconfig.node.json
 create mode 100644 GraphRAG/ui/react/vite.config.ts
 create mode 100644 GraphRAG/ui/svelte/.editorconfig
 create mode 100644 GraphRAG/ui/svelte/.env
 create mode 100644 GraphRAG/ui/svelte/.eslintignore
 create mode 100644 GraphRAG/ui/svelte/.eslintrc.cjs
 create mode 100644 GraphRAG/ui/svelte/.prettierignore
 create mode 100644 GraphRAG/ui/svelte/.prettierrc
 create mode 100644 GraphRAG/ui/svelte/README.md
 create mode 100644 GraphRAG/ui/svelte/package.json
 create mode 100644 GraphRAG/ui/svelte/playwright.config.ts
 create mode 100644 GraphRAG/ui/svelte/postcss.config.cjs
 create mode 100644 GraphRAG/ui/svelte/src/app.d.ts
 create mode 100644 GraphRAG/ui/svelte/src/app.html
 create mode 100644 GraphRAG/ui/svelte/src/app.postcss
 create mode 100644 GraphRAG/ui/svelte/src/lib/assets/DocManagement/LinkfolderIcon.svelte
 create mode 100644 GraphRAG/ui/svelte/src/lib/assets/DocManagement/fileIcon.svelte
 create mode 100644 GraphRAG/ui/svelte/src/lib/assets/DocManagement/folderIcon.svelte
 create mode 100644 GraphRAG/ui/svelte/src/lib/assets/avatar/svelte/Delete.svelte
 create mode 100644 GraphRAG/ui/svelte/src/lib/assets/chat/svelte/Assistant.svelte
 create mode 100644 GraphRAG/ui/svelte/src/lib/assets/chat/svelte/PaperAirplane.svelte
 create mode 100644 GraphRAG/ui/svelte/src/lib/assets/chat/svelte/PersonOutlined.svelte
 create mode 100644 GraphRAG/ui/svelte/src/lib/assets/layout/css/driver.css
 create mode 100644 GraphRAG/ui/svelte/src/lib/assets/upload/deleteIcon.svelte
 create mode 100644 GraphRAG/ui/svelte/src/lib/assets/upload/loading-button.svelte
 create mode 100644 GraphRAG/ui/svelte/src/lib/assets/upload/next.svelte
 create mode 100644 GraphRAG/ui/svelte/src/lib/assets/upload/no-file.svelte
 create mode 100644 GraphRAG/ui/svelte/src/lib/assets/upload/previous.svelte
 create mode 100644 GraphRAG/ui/svelte/src/lib/assets/voice/svg/paste.svg
 create mode 100644 GraphRAG/ui/svelte/src/lib/assets/voice/svg/uploadFile.svg
 create mode 100644 GraphRAG/ui/svelte/src/lib/modules/chat/ChatMessage.svelte
 create mode 100644 GraphRAG/ui/svelte/src/lib/modules/chat/MessageAvatar.svelte
 create mode 100644 GraphRAG/ui/svelte/src/lib/modules/chat/MessageTimer.svelte
 create mode 100644 GraphRAG/ui/svelte/src/lib/modules/frame/Layout.svelte
 create mode 100644 GraphRAG/ui/svelte/src/lib/network/chat/Network.ts
 create mode 100644 GraphRAG/ui/svelte/src/lib/network/upload/Network.ts
 create mode 100644 GraphRAG/ui/svelte/src/lib/shared/Utils.ts
 create mode 100644 GraphRAG/ui/svelte/src/lib/shared/components/chat/gallery.svelte
 create mode 100644 GraphRAG/ui/svelte/src/lib/shared/components/doc_management/docCard.svelte
 create mode 100644 GraphRAG/ui/svelte/src/lib/shared/components/doc_management/treeView/svelte-tree.svelte
 create mode 100644 GraphRAG/ui/svelte/src/lib/shared/components/doc_management/treeView/tree-branch.svelte
 create mode 100644 GraphRAG/ui/svelte/src/lib/shared/components/doc_management/treeView/tree-node.svelte
 create mode 100644 GraphRAG/ui/svelte/src/lib/shared/components/loading/Loading.svelte
 create mode 100644 GraphRAG/ui/svelte/src/lib/shared/components/scrollbar/Scrollbar.svelte
 create mode 100644 GraphRAG/ui/svelte/src/lib/shared/components/upload/PasteKnowledge.svelte
 create mode 100644 GraphRAG/ui/svelte/src/lib/shared/components/upload/upload-knowledge.svelte
 create mode 100644 GraphRAG/ui/svelte/src/lib/shared/components/upload/uploadFile.svelte
 create mode 100644 GraphRAG/ui/svelte/src/lib/shared/constant/Interface.ts
 create mode 100644 GraphRAG/ui/svelte/src/lib/shared/stores/common/Store.ts
 create mode 100644 GraphRAG/ui/svelte/src/routes/+layout.svelte
 create mode 100644 GraphRAG/ui/svelte/src/routes/+page.svelte
 create mode 100644 GraphRAG/ui/svelte/src/routes/+page.ts
 create mode 100644 GraphRAG/ui/svelte/static/favicon.png
 create mode 100644 GraphRAG/ui/svelte/svelte.config.js
 create mode 100644 GraphRAG/ui/svelte/tailwind.config.cjs
 create mode 100644 GraphRAG/ui/svelte/tests/chatQnA.spec.ts
 create mode 100644 GraphRAG/ui/svelte/tests/test_file.txt
 create mode 100644 GraphRAG/ui/svelte/tsconfig.json
 create mode 100644 GraphRAG/ui/svelte/vite.config.ts

diff --git a/GraphRAG/docker_compose/install_docker.sh b/GraphRAG/docker_compose/install_docker.sh
new file mode 100644
index 0000000000..8774c5756d
--- /dev/null
+++ b/GraphRAG/docker_compose/install_docker.sh
@@ -0,0 +1,35 @@
+#!/bin/bash
+
+# Copyright (C) 2024 Intel Corporation
+# SPDX-License-Identifier: Apache-2.0
+
+# Update the package index
+sudo apt-get -y update
+
+# Install prerequisites
+sudo apt-get -y install ca-certificates curl
+
+# Create the directory for the Docker GPG key
+sudo install -m 0755 -d /etc/apt/keyrings
+
+# Add Docker's official GPG key
+sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
+
+# Set permissions for the GPG key
+sudo chmod a+r /etc/apt/keyrings/docker.asc
+
+# Add Docker repository to the sources list
+echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \
+  $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
+
+# Update the package index with Docker packages
+sudo apt-get -y update
+
+# Install Docker packages
+sudo apt-get -y install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
+
+# add existing user
+sudo usermod -aG docker $USER
+
+# Optional: Verify that Docker is installed correctly
+sudo docker --version
diff --git a/GraphRAG/tests/test_compose.sh b/GraphRAG/tests/test_compose.sh
index c916596e78..85fced2515 100755
--- a/GraphRAG/tests/test_compose.sh
+++ b/GraphRAG/tests/test_compose.sh
@@ -11,6 +11,7 @@ export REGISTRY=${IMAGE_REPO}
 export TAG=${IMAGE_TAG}
 
 WORKPATH=$(dirname "$PWD")
+WORKPATH=/home/rbrugaro/GenAIExamples/GraphRAG
 LOG_PATH="$WORKPATH/tests"
 ip_address=$(hostname -I | awk '{print $1}')
 
@@ -33,7 +34,7 @@ function build_docker_images() {
 function start_services() {
     cd $WORKPATH/docker_compose/intel/hpu/gaudi
     export EMBEDDING_MODEL_ID="BAAI/bge-base-en-v1.5"
-    export LLM_MODEL_ID="Intel/neural-chat-7b-v3-3"
+    export LLM_MODEL_ID="meta-llama/Meta-Llama-3-8B-Instruct"
     export HUGGINGFACEHUB_API_TOKEN=${HUGGINGFACEHUB_API_TOKEN}
     #this will need to be updated with the set_env variables and how about the required from private????
 
@@ -198,7 +199,7 @@ function main() {
     elif [ "${mode}" == "" ]; then
         validate_microservices
         validate_megaservice
-        #validate_frontend
+        validate_frontend
     fi
 
     stop_docker
diff --git a/GraphRAG/ui/docker/Dockerfile b/GraphRAG/ui/docker/Dockerfile
new file mode 100644
index 0000000000..ac2bb7da31
--- /dev/null
+++ b/GraphRAG/ui/docker/Dockerfile
@@ -0,0 +1,26 @@
+# Copyright (C) 2024 Intel Corporation
+# SPDX-License-Identifier: Apache-2.0
+
+# Use node 20.11.1 as the base image
+FROM node:20.11.1
+
+# Update package manager and install Git
+RUN apt-get update -y && apt-get install -y git
+
+# Copy the front-end code repository
+COPY svelte /home/user/svelte
+
+# Set the working directory
+WORKDIR /home/user/svelte
+
+# Install front-end dependencies
+RUN npm install
+
+# Build the front-end application
+RUN npm run build
+
+# Expose the port of the front-end application
+EXPOSE 5173
+
+# Run the front-end application in preview mode
+CMD ["npm", "run", "preview", "--", "--port", "5173", "--host", "0.0.0.0"]
\ No newline at end of file
diff --git a/GraphRAG/ui/docker/Dockerfile.react b/GraphRAG/ui/docker/Dockerfile.react
new file mode 100644
index 0000000000..49bc13124c
--- /dev/null
+++ b/GraphRAG/ui/docker/Dockerfile.react
@@ -0,0 +1,21 @@
+# Copyright (C) 2024 Intel Corporation
+# SPDX-License-Identifier: Apache-2.0
+
+# Use node 20.11.1 as the base image
+FROM node:20.11.1 as vite-app
+ 
+COPY react /usr/app/react
+WORKDIR /usr/app/react
+
+
+RUN ["npm", "install"]
+RUN ["npm", "run", "build"]
+
+
+FROM nginx:alpine
+
+COPY --from=vite-app /usr/app/react/dist /usr/share/nginx/html
+COPY ./react/env.sh /docker-entrypoint.d/env.sh
+
+COPY ./react/nginx.conf /etc/nginx/conf.d/default.conf
+RUN chmod +x /docker-entrypoint.d/env.sh
\ No newline at end of file
diff --git a/GraphRAG/ui/react/.env b/GraphRAG/ui/react/.env
new file mode 100644
index 0000000000..e5d52f4213
--- /dev/null
+++ b/GraphRAG/ui/react/.env
@@ -0,0 +1,2 @@
+VITE_BACKEND_SERVICE_ENDPOINT=http://backend_address:8888/v1/chatqna
+VITE_DATA_PREP_SERVICE_URL=http://backend_address:6007/v1/dataprep
\ No newline at end of file
diff --git a/GraphRAG/ui/react/.env.production b/GraphRAG/ui/react/.env.production
new file mode 100644
index 0000000000..a46e1e3850
--- /dev/null
+++ b/GraphRAG/ui/react/.env.production
@@ -0,0 +1,2 @@
+VITE_BACKEND_SERVICE_ENDPOINT=APP_BACKEND_SERVICE_ENDPOINT
+VITE_DATA_PREP_SERVICE_URL=APP_DATA_PREP_SERVICE_URL
\ No newline at end of file
diff --git a/GraphRAG/ui/react/.eslintrc.cjs b/GraphRAG/ui/react/.eslintrc.cjs
new file mode 100644
index 0000000000..78174f6836
--- /dev/null
+++ b/GraphRAG/ui/react/.eslintrc.cjs
@@ -0,0 +1,11 @@
+module.exports = {
+  root: true,
+  env: { browser: true, es2020: true },
+  extends: ["eslint:recommended", "plugin:@typescript-eslint/recommended", "plugin:react-hooks/recommended"],
+  ignorePatterns: ["dist", ".eslintrc.cjs"],
+  parser: "@typescript-eslint/parser",
+  plugins: ["react-refresh"],
+  rules: {
+    "react-refresh/only-export-components": ["warn", { allowConstantExport: true }],
+  },
+};
diff --git a/GraphRAG/ui/react/.gitignore b/GraphRAG/ui/react/.gitignore
new file mode 100644
index 0000000000..a547bf36d8
--- /dev/null
+++ b/GraphRAG/ui/react/.gitignore
@@ -0,0 +1,24 @@
+# Logs
+logs
+*.log
+npm-debug.log*
+yarn-debug.log*
+yarn-error.log*
+pnpm-debug.log*
+lerna-debug.log*
+
+node_modules
+dist
+dist-ssr
+*.local
+
+# Editor directories and files
+.vscode/*
+!.vscode/extensions.json
+.idea
+.DS_Store
+*.suo
+*.ntvs*
+*.njsproj
+*.sln
+*.sw?
diff --git a/GraphRAG/ui/react/README.md b/GraphRAG/ui/react/README.md
new file mode 100644
index 0000000000..3477828eaa
--- /dev/null
+++ b/GraphRAG/ui/react/README.md
@@ -0,0 +1,32 @@
+# ChatQnA Conversational UI
+
+## 📸 Project Screenshots
+
+![project-screenshot](../../assets/img/conversation_ui_init.png)
+![project-screenshot](../../assets/img/conversation_ui_response.png)
+![project-screenshot](../../assets/img/conversation_ui_upload.png)
+
+## 🧐 Features
+
+Here're some of the project's features:
+
+- Start a Text Chat：Initiate a text chat with the ability to input written conversations, where the dialogue content can also be customized based on uploaded files.
+- Context Awareness: The AI assistant maintains the context of the conversation, understanding references to previous statements or questions. This allows for more natural and coherent exchanges.
+- Upload File: The choice between uploading locally or copying a remote link. Chat according to uploaded knowledge base.
+- Clear: Clear the record of the current dialog box without retaining the contents of the dialog box.
+- Chat history: Historical chat records can still be retained after refreshing, making it easier for users to view the context.
+- Conversational Chat : The application maintains a history of the conversation, allowing users to review previous messages and the AI to refer back to earlier points in the dialogue when necessary.
+
+## 🛠️ Get it Running
+
+1. Clone the repo.
+
+2. cd command to the current folder.
+
+3. Modify the required .env variables.
+   ```
+   DOC_BASE_URL = ''
+   ```
+4. Execute `npm install` to install the corresponding dependencies.
+
+5. Execute `npm run dev` in both environments
diff --git a/GraphRAG/ui/react/env.sh b/GraphRAG/ui/react/env.sh
new file mode 100644
index 0000000000..ce1372ea68
--- /dev/null
+++ b/GraphRAG/ui/react/env.sh
@@ -0,0 +1,15 @@
+#!/bin/sh
+# Copyright (C) 2024 Intel Corporation
+# SPDX-License-Identifier: Apache-2.0
+
+for i in $(env | grep APP_) #// Make sure to use the prefix MY_APP_ if you have any other prefix in env.production file variable name replace it with MY_APP_
+do
+    key=$(echo $i | cut -d '=' -f 1)
+    value=$(echo $i | cut -d '=' -f 2-)
+    echo $key=$value
+    # sed All files
+    # find /usr/share/nginx/html -type f -exec sed -i "s|${key}|${value}|g" '{}' +
+
+    # sed JS and CSS only
+    find /usr/share/nginx/html -type f \( -name '*.js' -o -name '*.css' \) -exec sed -i "s|${key}|${value}|g" '{}' +
+done
diff --git a/GraphRAG/ui/react/index.html b/GraphRAG/ui/react/index.html
new file mode 100644
index 0000000000..fbe87e0fd5
--- /dev/null
+++ b/GraphRAG/ui/react/index.html
@@ -0,0 +1,18 @@
+<!--
+  Copyright (C) 2024 Intel Corporation
+  SPDX-License-Identifier: Apache-2.0
+-->
+
+<!doctype html>
+<html lang="en">
+  <head>
+    <meta charset="UTF-8" />
+    <link rel="icon" type="image/svg+xml" href="/src/assets/opea-icon-color.svg" />
+    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
+    <title>Conversations UI</title>
+  </head>
+  <body>
+    <div id="root"></div>
+    <script type="module" src="/src/main.tsx"></script>
+  </body>
+</html>
diff --git a/GraphRAG/ui/react/nginx.conf b/GraphRAG/ui/react/nginx.conf
new file mode 100644
index 0000000000..00433fcda7
--- /dev/null
+++ b/GraphRAG/ui/react/nginx.conf
@@ -0,0 +1,20 @@
+server {
+  listen 80;
+
+  gzip on;
+  gzip_proxied any;
+  gzip_comp_level 6;
+  gzip_buffers 16 8k;
+  gzip_http_version 1.1;
+  gzip_types font/woff2 text/css application/javascript application/json application/font-woff application/font-tff image/gif image/png image/svg+xml application/octet-stream;
+
+  location / {
+    root /usr/share/nginx/html;
+    index index.html index.htm;
+    try_files $uri $uri/ /index.html =404;
+
+    location ~* \.(gif|jpe?g|png|webp|ico|svg|css|js|mp4|woff2)$ {
+      expires 1d;
+    }
+  }
+}
\ No newline at end of file
diff --git a/GraphRAG/ui/react/package.json b/GraphRAG/ui/react/package.json
new file mode 100644
index 0000000000..3760ed909b
--- /dev/null
+++ b/GraphRAG/ui/react/package.json
@@ -0,0 +1,47 @@
+{
+  "name": "ui",
+  "private": true,
+  "version": "0.0.0",
+  "type": "module",
+  "scripts": {
+    "dev": "vite",
+    "build": "tsc && vite build",
+    "lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
+    "preview": "vite preview",
+    "test": "vitest"
+  },
+  "dependencies": {
+    "@mantine/core": "^7.10.0",
+    "@mantine/hooks": "^7.10.0",
+    "@mantine/notifications": "^7.10.2",
+    "@microsoft/fetch-event-source": "^2.0.1",
+    "@reduxjs/toolkit": "^2.2.5",
+    "@tabler/icons-react": "^3.5.0",
+    "axios": "^1.7.2",
+    "luxon": "^3.4.4",
+    "react": "^18.2.0",
+    "react-dom": "^18.2.0",
+    "react-redux": "^9.1.2"
+  },
+  "devDependencies": {
+    "@testing-library/react": "^16.0.0",
+    "@types/luxon": "^3.4.2",
+    "@types/node": "^20.12.12",
+    "@types/react": "^18.2.66",
+    "@types/react-dom": "^18.2.22",
+    "@typescript-eslint/eslint-plugin": "^7.2.0",
+    "@typescript-eslint/parser": "^7.2.0",
+    "@vitejs/plugin-react": "^4.2.1",
+    "eslint": "^8.57.0",
+    "eslint-plugin-react-hooks": "^4.6.0",
+    "eslint-plugin-react-refresh": "^0.4.6",
+    "jsdom": "^24.1.0",
+    "postcss": "^8.4.38",
+    "postcss-preset-mantine": "^1.15.0",
+    "postcss-simple-vars": "^7.0.1",
+    "sass": "1.64.2",
+    "typescript": "^5.2.2",
+    "vite": "^5.2.13",
+    "vitest": "^1.6.0"
+  }
+}
diff --git a/GraphRAG/ui/react/postcss.config.cjs b/GraphRAG/ui/react/postcss.config.cjs
new file mode 100644
index 0000000000..e817f567be
--- /dev/null
+++ b/GraphRAG/ui/react/postcss.config.cjs
@@ -0,0 +1,14 @@
+module.exports = {
+  plugins: {
+    "postcss-preset-mantine": {},
+    "postcss-simple-vars": {
+      variables: {
+        "mantine-breakpoint-xs": "36em",
+        "mantine-breakpoint-sm": "48em",
+        "mantine-breakpoint-md": "62em",
+        "mantine-breakpoint-lg": "75em",
+        "mantine-breakpoint-xl": "88em",
+      },
+    },
+  },
+};
diff --git a/GraphRAG/ui/react/public/vite.svg b/GraphRAG/ui/react/public/vite.svg
new file mode 100644
index 0000000000..e7b8dfb1b2
--- /dev/null
+++ b/GraphRAG/ui/react/public/vite.svg
@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>
\ No newline at end of file
diff --git a/GraphRAG/ui/react/src/App.scss b/GraphRAG/ui/react/src/App.scss
new file mode 100644
index 0000000000..187764a179
--- /dev/null
+++ b/GraphRAG/ui/react/src/App.scss
@@ -0,0 +1,42 @@
+// Copyright (C) 2024 Intel Corporation
+// SPDX-License-Identifier: Apache-2.0
+
+@import "./styles/styles";
+
+.root {
+  @include flex(row, nowrap, flex-start, flex-start);
+}
+
+.layout-wrapper {
+  @include absolutes;
+
+  display: grid;
+
+  width: 100%;
+  height: 100%;
+
+  grid-template-columns: 80px auto;
+  grid-template-rows: 1fr;
+}
+
+/* ===== Scrollbar CSS ===== */
+/* Firefox */
+* {
+  scrollbar-width: thin;
+  scrollbar-color: #d6d6d6 #ffffff;
+}
+
+/* Chrome, Edge, and Safari */
+*::-webkit-scrollbar {
+  width: 8px;
+}
+
+*::-webkit-scrollbar-track {
+  background: #ffffff;
+}
+
+*::-webkit-scrollbar-thumb {
+  background-color: #d6d6d6;
+  border-radius: 16px;
+  border: 4px double #dedede;
+}
diff --git a/GraphRAG/ui/react/src/App.tsx b/GraphRAG/ui/react/src/App.tsx
new file mode 100644
index 0000000000..4be4fa5bb5
--- /dev/null
+++ b/GraphRAG/ui/react/src/App.tsx
@@ -0,0 +1,34 @@
+// Copyright (C) 2024 Intel Corporation
+// SPDX-License-Identifier: Apache-2.0
+
+import "./App.scss"
+import { MantineProvider } from "@mantine/core"
+import '@mantine/notifications/styles.css';
+import { SideNavbar, SidebarNavList } from "./components/sidebar/sidebar"
+import { IconMessages } from "@tabler/icons-react"
+import UserInfoModal from "./components/UserInfoModal/UserInfoModal"
+import Conversation from "./components/Conversation/Conversation"
+import { Notifications } from '@mantine/notifications';
+
+const title = "Chat QnA"
+const navList: SidebarNavList = [
+  { icon: IconMessages, label: title }
+]
+
+function App() {
+  
+  return (
+    <MantineProvider>
+      <Notifications position="top-right" />
+      <UserInfoModal />
+      <div className="layout-wrapper">
+        <SideNavbar navList={navList} />
+        <div className="content">
+          <Conversation title={title} />
+        </div>
+      </div>
+    </MantineProvider>
+  )
+}
+
+export default App
diff --git a/GraphRAG/ui/react/src/__tests__/util.test.ts b/GraphRAG/ui/react/src/__tests__/util.test.ts
new file mode 100644
index 0000000000..e67ba2c86a
--- /dev/null
+++ b/GraphRAG/ui/react/src/__tests__/util.test.ts
@@ -0,0 +1,14 @@
+// Copyright (C) 2024 Intel Corporation
+// SPDX-License-Identifier: Apache-2.0
+
+import { describe, expect, test } from "vitest";
+import { getCurrentTimeStamp, uuidv4 } from "../common/util";
+
+describe("unit tests", () => {
+  test("check UUID is of length 36", () => {
+    expect(uuidv4()).toHaveLength(36);
+  });
+  test("check TimeStamp generated is of unix", () => {
+    expect(getCurrentTimeStamp()).toBe(Math.floor(Date.now() / 1000));
+  });
+});
diff --git a/GraphRAG/ui/react/src/assets/opea-icon-black.svg b/GraphRAG/ui/react/src/assets/opea-icon-black.svg
new file mode 100644
index 0000000000..5c96dc7622
--- /dev/null
+++ b/GraphRAG/ui/react/src/assets/opea-icon-black.svg
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Generator: Adobe Illustrator 28.4.1, SVG Export Plug-In . SVG Version: 6.00 Build 0)  -->
+<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
+	 width="800px" height="800px" viewBox="0 0 800 800" style="enable-background:new 0 0 800 800;" xml:space="preserve">
+<style type="text/css">
+	.Drop_x0020_Shadow{fill:none;}
+	.Outer_x0020_Glow_x0020_5_x0020_pt{fill:none;}
+	.Blue_x0020_Neon{fill:none;stroke:#8AACDA;stroke-width:7;stroke-linecap:round;stroke-linejoin:round;}
+	.Chrome_x0020_Highlight{fill:url(#SVGID_1_);stroke:#FFFFFF;stroke-width:0.3629;stroke-miterlimit:1;}
+	.Jive_GS{fill:#FFDD00;}
+	.Alyssa_GS{fill:#A6D0E4;}
+	.st0{fill:#FF6900;}
+	.st1{fill:#FFB500;}
+	.st2{fill:#FFFFFF;}
+</style>
+<linearGradient id="SVGID_1_" gradientUnits="userSpaceOnUse" x1="-1640" y1="-1640" x2="-1640" y2="-1641">
+	<stop  offset="0" style="stop-color:#656565"/>
+	<stop  offset="0.618" style="stop-color:#1B1B1B"/>
+	<stop  offset="0.6292" style="stop-color:#545454"/>
+	<stop  offset="0.9831" style="stop-color:#3E3E3E"/>
+</linearGradient>
+<g>
+	<polygon points="400,0 737.5,181.7 607.3,252.8 269.7,71.1 	"/>
+	<path d="M708.3,414.7l29.2,15.7l-130.3,71.1l-44.9-24.2v-31.7l40,21.5c1.5,0.8,3.2,1.2,4.9,1.2c1.7,0,3.4-0.4,5-1.3l0,0
+		L708.3,414.7z"/>
+	<path d="M557.3,532.1c-0.1-0.1-0.3-0.1-0.4-0.2l0,0l-34.2-18.4l31.2-17l42.9,23.1v169.9l-34.5-18.6V541
+		C562.4,537.3,560.4,533.9,557.3,532.1z"/>
+	<polygon points="410.4,381.3 541.6,309.7 541.6,479.5 410.4,551.2 	"/>
+	<path d="M258.4,88.5l338.6,182.3v169.9l-34.5-18.6V292.2c0-3.7-1.9-7-5.1-8.9c-0.1-0.1-0.3-0.1-0.4-0.2l0,0L258.4,122.3V88.5z"/>
+	<polygon points="192.7,110.6 530.3,292.3 400,363.4 62.5,181.6 	"/>
+	<polygon points="51.1,369 51.1,199 389.6,381.3 389.6,551.3 96.6,393.5 	"/>
+	<path d="M91.7,414.4l303.4,163.3c1.5,0.8,3.2,1.2,4.9,1.2c1.7,0,3.4-0.4,5-1.3l0,0l96.1-52.4l29.2,15.7L400,612.1L62.5,430.4
+		L91.7,414.4z"/>
+	<polygon points="51.1,447.8 389.6,630.1 389.6,800 51.1,617.7 	"/>
+	<polygon points="541.6,728.3 410.4,799.9 410.4,630 541.6,558.4 	"/>
+	<polygon points="748.9,617.7 617.6,689.3 617.6,519.5 748.9,447.9 	"/>
+	<polygon points="748.9,369 617.6,440.6 617.6,270.7 748.9,199.1 	"/>
+</g>
+</svg>
diff --git a/GraphRAG/ui/react/src/assets/opea-icon-color.svg b/GraphRAG/ui/react/src/assets/opea-icon-color.svg
new file mode 100644
index 0000000000..790151171e
--- /dev/null
+++ b/GraphRAG/ui/react/src/assets/opea-icon-color.svg
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Generator: Adobe Illustrator 28.4.1, SVG Export Plug-In . SVG Version: 6.00 Build 0)  -->
+<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
+	 width="800px" height="800px" viewBox="0 0 800 800" style="enable-background:new 0 0 800 800;" xml:space="preserve">
+<style type="text/css">
+	.Drop_x0020_Shadow{fill:none;}
+	.Outer_x0020_Glow_x0020_5_x0020_pt{fill:none;}
+	.Blue_x0020_Neon{fill:none;stroke:#8AACDA;stroke-width:7;stroke-linecap:round;stroke-linejoin:round;}
+	.Chrome_x0020_Highlight{fill:url(#SVGID_1_);stroke:#FFFFFF;stroke-width:0.3629;stroke-miterlimit:1;}
+	.Jive_GS{fill:#FFDD00;}
+	.Alyssa_GS{fill:#A6D0E4;}
+	.st0{fill:#FF6900;}
+	.st1{fill:#FFB500;}
+	.st2{fill:#FFFFFF;}
+</style>
+<linearGradient id="SVGID_1_" gradientUnits="userSpaceOnUse" x1="-820" y1="-1640" x2="-820" y2="-1641">
+	<stop  offset="0" style="stop-color:#656565"/>
+	<stop  offset="0.618" style="stop-color:#1B1B1B"/>
+	<stop  offset="0.6292" style="stop-color:#545454"/>
+	<stop  offset="0.9831" style="stop-color:#3E3E3E"/>
+</linearGradient>
+<g>
+	<polygon class="st0" points="400,0 737.5,181.7 607.3,252.8 269.7,71.1 	"/>
+	<path class="st1" d="M708.3,414.7l29.2,15.7l-130.3,71.1l-44.9-24.2v-31.7l40,21.5c1.5,0.8,3.2,1.2,4.9,1.2c1.7,0,3.4-0.4,5-1.3
+		l0,0L708.3,414.7z"/>
+	<path class="st1" d="M557.3,532.1c-0.1-0.1-0.3-0.1-0.4-0.2l0,0l-34.2-18.4l31.2-17l42.9,23.1v169.9l-34.5-18.6V541
+		C562.4,537.3,560.4,533.9,557.3,532.1z"/>
+	<polygon class="st1" points="410.4,381.3 541.6,309.7 541.6,479.5 410.4,551.2 	"/>
+	<path class="st0" d="M258.4,88.5l338.6,182.3v169.9l-34.5-18.6V292.2c0-3.7-1.9-7-5.1-8.9c-0.1-0.1-0.3-0.1-0.4-0.2l0,0
+		L258.4,122.3V88.5z"/>
+	<polygon class="st1" points="192.7,110.6 530.3,292.3 400,363.4 62.5,181.6 	"/>
+	<polygon class="st1" points="51.1,369 51.1,199 389.6,381.3 389.6,551.3 96.6,393.5 	"/>
+	<path class="st0" d="M91.7,414.4l303.4,163.3c1.5,0.8,3.2,1.2,4.9,1.2c1.7,0,3.4-0.4,5-1.3l0,0l96.1-52.4l29.2,15.7L400,612.1
+		L62.5,430.4L91.7,414.4z"/>
+	<polygon class="st0" points="51.1,447.8 389.6,630.1 389.6,800 51.1,617.7 	"/>
+	<polygon class="st0" points="541.6,728.3 410.4,799.9 410.4,630 541.6,558.4 	"/>
+	<polygon class="st1" points="748.9,617.7 617.6,689.3 617.6,519.5 748.9,447.9 	"/>
+	<polygon class="st0" points="748.9,369 617.6,440.6 617.6,270.7 748.9,199.1 	"/>
+</g>
+</svg>
diff --git a/GraphRAG/ui/react/src/assets/react.svg b/GraphRAG/ui/react/src/assets/react.svg
new file mode 100644
index 0000000000..6c87de9bb3
--- /dev/null
+++ b/GraphRAG/ui/react/src/assets/react.svg
@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="35.93" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 228"><path fill="#00D8FF" d="M210.483 73.824a171.49 171.49 0 0 0-8.24-2.597c.465-1.9.893-3.777 1.273-5.621c6.238-30.281 2.16-54.676-11.769-62.708c-13.355-7.7-35.196.329-57.254 19.526a171.23 171.23 0 0 0-6.375 5.848a155.866 155.866 0 0 0-4.241-3.917C100.759 3.829 77.587-4.822 63.673 3.233C50.33 10.957 46.379 33.89 51.995 62.588a170.974 170.974 0 0 0 1.892 8.48c-3.28.932-6.445 1.924-9.474 2.98C17.309 83.498 0 98.307 0 113.668c0 15.865 18.582 31.778 46.812 41.427a145.52 145.52 0 0 0 6.921 2.165a167.467 167.467 0 0 0-2.01 9.138c-5.354 28.2-1.173 50.591 12.134 58.266c13.744 7.926 36.812-.22 59.273-19.855a145.567 145.567 0 0 0 5.342-4.923a168.064 168.064 0 0 0 6.92 6.314c21.758 18.722 43.246 26.282 56.54 18.586c13.731-7.949 18.194-32.003 12.4-61.268a145.016 145.016 0 0 0-1.535-6.842c1.62-.48 3.21-.974 4.76-1.488c29.348-9.723 48.443-25.443 48.443-41.52c0-15.417-17.868-30.326-45.517-39.844Zm-6.365 70.984c-1.4.463-2.836.91-4.3 1.345c-3.24-10.257-7.612-21.163-12.963-32.432c5.106-11 9.31-21.767 12.459-31.957c2.619.758 5.16 1.557 7.61 2.4c23.69 8.156 38.14 20.213 38.14 29.504c0 9.896-15.606 22.743-40.946 31.14Zm-10.514 20.834c2.562 12.94 2.927 24.64 1.23 33.787c-1.524 8.219-4.59 13.698-8.382 15.893c-8.067 4.67-25.32-1.4-43.927-17.412a156.726 156.726 0 0 1-6.437-5.87c7.214-7.889 14.423-17.06 21.459-27.246c12.376-1.098 24.068-2.894 34.671-5.345a134.17 134.17 0 0 1 1.386 6.193ZM87.276 214.515c-7.882 2.783-14.16 2.863-17.955.675c-8.075-4.657-11.432-22.636-6.853-46.752a156.923 156.923 0 0 1 1.869-8.499c10.486 2.32 22.093 3.988 34.498 4.994c7.084 9.967 14.501 19.128 21.976 27.15a134.668 134.668 0 0 1-4.877 4.492c-9.933 8.682-19.886 14.842-28.658 17.94ZM50.35 144.747c-12.483-4.267-22.792-9.812-29.858-15.863c-6.35-5.437-9.555-10.836-9.555-15.216c0-9.322 13.897-21.212 37.076-29.293c2.813-.98 5.757-1.905 8.812-2.773c3.204 10.42 7.406 21.315 12.477 32.332c-5.137 11.18-9.399 22.249-12.634 32.792a134.718 134.718 0 0 1-6.318-1.979Zm12.378-84.26c-4.811-24.587-1.616-43.134 6.425-47.789c8.564-4.958 27.502 2.111 47.463 19.835a144.318 144.318 0 0 1 3.841 3.545c-7.438 7.987-14.787 17.08-21.808 26.988c-12.04 1.116-23.565 2.908-34.161 5.309a160.342 160.342 0 0 1-1.76-7.887Zm110.427 27.268a347.8 347.8 0 0 0-7.785-12.803c8.168 1.033 15.994 2.404 23.343 4.08c-2.206 7.072-4.956 14.465-8.193 22.045a381.151 381.151 0 0 0-7.365-13.322Zm-45.032-43.861c5.044 5.465 10.096 11.566 15.065 18.186a322.04 322.04 0 0 0-30.257-.006c4.974-6.559 10.069-12.652 15.192-18.18ZM82.802 87.83a323.167 323.167 0 0 0-7.227 13.238c-3.184-7.553-5.909-14.98-8.134-22.152c7.304-1.634 15.093-2.97 23.209-3.984a321.524 321.524 0 0 0-7.848 12.897Zm8.081 65.352c-8.385-.936-16.291-2.203-23.593-3.793c2.26-7.3 5.045-14.885 8.298-22.6a321.187 321.187 0 0 0 7.257 13.246c2.594 4.48 5.28 8.868 8.038 13.147Zm37.542 31.03c-5.184-5.592-10.354-11.779-15.403-18.433c4.902.192 9.899.29 14.978.29c5.218 0 10.376-.117 15.453-.343c-4.985 6.774-10.018 12.97-15.028 18.486Zm52.198-57.817c3.422 7.8 6.306 15.345 8.596 22.52c-7.422 1.694-15.436 3.058-23.88 4.071a382.417 382.417 0 0 0 7.859-13.026a347.403 347.403 0 0 0 7.425-13.565Zm-16.898 8.101a358.557 358.557 0 0 1-12.281 19.815a329.4 329.4 0 0 1-23.444.823c-7.967 0-15.716-.248-23.178-.732a310.202 310.202 0 0 1-12.513-19.846h.001a307.41 307.41 0 0 1-10.923-20.627a310.278 310.278 0 0 1 10.89-20.637l-.001.001a307.318 307.318 0 0 1 12.413-19.761c7.613-.576 15.42-.876 23.31-.876H128c7.926 0 15.743.303 23.354.883a329.357 329.357 0 0 1 12.335 19.695a358.489 358.489 0 0 1 11.036 20.54a329.472 329.472 0 0 1-11 20.722Zm22.56-122.124c8.572 4.944 11.906 24.881 6.52 51.026c-.344 1.668-.73 3.367-1.15 5.09c-10.622-2.452-22.155-4.275-34.23-5.408c-7.034-10.017-14.323-19.124-21.64-27.008a160.789 160.789 0 0 1 5.888-5.4c18.9-16.447 36.564-22.941 44.612-18.3ZM128 90.808c12.625 0 22.86 10.235 22.86 22.86s-10.235 22.86-22.86 22.86s-22.86-10.235-22.86-22.86s10.235-22.86 22.86-22.86Z"></path></svg>
\ No newline at end of file
diff --git a/GraphRAG/ui/react/src/common/client.ts b/GraphRAG/ui/react/src/common/client.ts
new file mode 100644
index 0000000000..7512f73e33
--- /dev/null
+++ b/GraphRAG/ui/react/src/common/client.ts
@@ -0,0 +1,8 @@
+// Copyright (C) 2024 Intel Corporation
+// SPDX-License-Identifier: Apache-2.0
+
+import axios from "axios";
+
+//add iterceptors to add any request headers
+
+export default axios;
diff --git a/GraphRAG/ui/react/src/common/util.ts b/GraphRAG/ui/react/src/common/util.ts
new file mode 100644
index 0000000000..df65b2d8e0
--- /dev/null
+++ b/GraphRAG/ui/react/src/common/util.ts
@@ -0,0 +1,12 @@
+// Copyright (C) 2024 Intel Corporation
+// SPDX-License-Identifier: Apache-2.0
+
+export const getCurrentTimeStamp = () => {
+  return Math.floor(Date.now() / 1000);
+};
+
+export const uuidv4 = () => {
+  return "10000000-1000-4000-8000-100000000000".replace(/[018]/g, (c) =>
+    (+c ^ (crypto.getRandomValues(new Uint8Array(1))[0] & (15 >> (+c / 4)))).toString(16),
+  );
+};
diff --git a/GraphRAG/ui/react/src/components/Conversation/Conversation.tsx b/GraphRAG/ui/react/src/components/Conversation/Conversation.tsx
new file mode 100644
index 0000000000..02736d8bd6
--- /dev/null
+++ b/GraphRAG/ui/react/src/components/Conversation/Conversation.tsx
@@ -0,0 +1,156 @@
+// Copyright (C) 2024 Intel Corporation
+// SPDX-License-Identifier: Apache-2.0
+
+import { KeyboardEventHandler, SyntheticEvent, useEffect, useRef, useState } from 'react'
+import styleClasses from "./conversation.module.scss"
+import { ActionIcon, Group, Textarea, Title, rem } from '@mantine/core'
+import { IconArrowRight, IconFilePlus, IconMessagePlus } from '@tabler/icons-react'
+import { conversationSelector, doConversation, newConversation } from '../../redux/Conversation/ConversationSlice'
+import { ConversationMessage } from '../Message/conversationMessage'
+import { useAppDispatch, useAppSelector } from '../../redux/store'
+import { Message, MessageRole } from '../../redux/Conversation/Conversation'
+import { getCurrentTimeStamp } from '../../common/util'
+import { useDisclosure } from '@mantine/hooks'
+import DataSource from './DataSource'
+import { ConversationSideBar } from './ConversationSideBar'
+
+type ConversationProps = {
+  title:string
+}
+
+const Conversation = ({ title }: ConversationProps) => {
+
+  const [prompt, setPrompt] = useState<string>("")
+  const promptInputRef = useRef<HTMLTextAreaElement>(null)
+  const [fileUploadOpened, { open: openFileUpload, close: closeFileUpload }] = useDisclosure(false);
+
+  const { conversations, onGoingResult, selectedConversationId } = useAppSelector(conversationSelector)
+  const dispatch = useAppDispatch();
+  const selectedConversation = conversations.find(x=>x.conversationId===selectedConversationId)
+
+  const scrollViewport = useRef<HTMLDivElement>(null)
+
+  const toSend = "Enter"
+
+  const systemPrompt: Partial<Message> = {
+    role: MessageRole.System,
+    content: "You are helpful assistant",
+  };
+
+
+  const handleSubmit = () => {
+
+    const userPrompt: Message = {
+      role: MessageRole.User,
+      content: prompt,
+      time: getCurrentTimeStamp()
+    };
+    let messages: Partial<Message>[] = [];
+    if(selectedConversation){
+      messages  = selectedConversation.Messages.map(message => {
+        return {role:message.role, content:message.content}
+      })
+    }
+    
+    messages = [systemPrompt, ...messages]
+
+    doConversation({
+      conversationId: selectedConversationId,
+      userPrompt,
+      messages,
+      model: "Intel/neural-chat-7b-v3-3",
+    })
+    setPrompt("")
+  }
+
+  const scrollToBottom = () => {
+    scrollViewport.current!.scrollTo({ top: scrollViewport.current!.scrollHeight })
+  }
+
+  useEffect(() => {
+    scrollToBottom()
+  }, [onGoingResult, selectedConversation?.Messages])
+
+  const handleKeyDown: KeyboardEventHandler = (event) => {
+    if (!event.shiftKey && event.key === toSend) {
+      handleSubmit()
+      setTimeout(() => {
+        setPrompt("")
+      }, 1)
+    }
+  }
+
+
+
+  const handleNewConversation = () => {
+    dispatch(newConversation())
+  }
+
+  const handleChange = (event: SyntheticEvent) => {
+    event.preventDefault()
+    setPrompt((event.target as HTMLTextAreaElement).value)
+  }
+  return (
+    <div className={styleClasses.conversationWrapper}>
+      <ConversationSideBar title={title}/>
+      <div className={styleClasses.conversationContent}>
+        <div className={styleClasses.conversationContentMessages}>
+          <div className={styleClasses.conversationTitle}>
+            <Title order={3}>{selectedConversation?.title || ""} </Title>
+            <span className={styleClasses.spacer}></span>
+            <Group>
+              {selectedConversation && selectedConversation?.Messages.length > 0 && (
+                <ActionIcon onClick={handleNewConversation} disabled={onGoingResult != ""} size={32} variant="default">
+                  <IconMessagePlus />
+                </ActionIcon>
+              )}
+              <ActionIcon onClick={openFileUpload} size={32} variant="default">
+                <IconFilePlus />
+              </ActionIcon>
+            </Group>
+          </div>
+
+          <div className={styleClasses.historyContainer} ref={scrollViewport}>
+
+            {!selectedConversation && (
+              <>
+                <div className="infoMessage">Start by asking a question</div>
+                <div className="infoMessage">You can also upload your Document by clicking on Document icon on top right corner</div>
+              </>
+            )}
+
+            {selectedConversation?.Messages.map((message) => {
+              return (<ConversationMessage key={`_ai`} date={message.time * 1000} human={message.role == MessageRole.User} message={message.content} />)
+            })
+            }
+
+            {onGoingResult && (
+              <ConversationMessage key={`_ai`} date={Date.now()} human={false} message={onGoingResult} />
+            )}
+          </div>
+
+          <div className={styleClasses.conversationActions}>
+            <Textarea
+              radius="xl"
+              size="md"
+              placeholder="Ask a question"
+              ref={promptInputRef}
+              onKeyDown={handleKeyDown}
+              onChange={handleChange}
+              value={prompt}
+              rightSectionWidth={42}
+              rightSection={
+                <ActionIcon onClick={handleSubmit} size={32} radius="xl" variant="filled">
+                  <IconArrowRight style={{ width: rem(18), height: rem(18) }} stroke={1.5} />
+                </ActionIcon>
+              }
+            // {...props}
+            />
+          </div>
+        </div>
+      </div>
+      <DataSource opened={fileUploadOpened} onClose={closeFileUpload} />
+    </div >
+  )
+}
+export default Conversation;
diff --git a/GraphRAG/ui/react/src/components/Conversation/ConversationSideBar.tsx b/GraphRAG/ui/react/src/components/Conversation/ConversationSideBar.tsx
new file mode 100644
index 0000000000..12591ad763
--- /dev/null
+++ b/GraphRAG/ui/react/src/components/Conversation/ConversationSideBar.tsx
@@ -0,0 +1,45 @@
+// Copyright (C) 2024 Intel Corporation
+// SPDX-License-Identifier: Apache-2.0
+
+import { ScrollAreaAutosize, Title } from "@mantine/core"
+
+import contextStyles from "../../styles/components/context.module.scss"
+import { useAppDispatch, useAppSelector } from "../../redux/store"
+import { conversationSelector, setSelectedConversationId } from "../../redux/Conversation/ConversationSlice"
+// import { userSelector } from "../../redux/User/userSlice"
+
+export interface ConversationContextProps {
+    title: string
+}
+
+export function ConversationSideBar({ title }: ConversationContextProps) {
+    const { conversations, selectedConversationId } = useAppSelector(conversationSelector)
+    // const user = useAppSelector(userSelector)
+    const dispatch = useAppDispatch()
+
+    const conversationList = conversations?.map((curr) => (
+        <div
+            className={contextStyles.contextListItem}
+            data-active={selectedConversationId === curr.conversationId || undefined}
+            onClick={(event) => {
+                event.preventDefault()
+                dispatch(setSelectedConversationId(curr.conversationId))
+                // dispatch(getConversationById({ user, conversationId: curr.conversationId }))
+            }}
+            key={curr.conversationId}
+        >
+            <div className={contextStyles.contextItemName} title={curr.title}>{curr.title}</div>
+        </div>
+    ))
+
+    return (
+        <div className={contextStyles.contextWrapper}>
+            <Title order={3} className={contextStyles.contextTitle}>
+                {title}
+            </Title>
+            <ScrollAreaAutosize type="hover" scrollHideDelay={0}>
+                <div className={contextStyles.contextList}>{conversationList}</div>
+            </ScrollAreaAutosize>
+        </div>
+    )
+}
diff --git a/GraphRAG/ui/react/src/components/Conversation/DataSource.tsx b/GraphRAG/ui/react/src/components/Conversation/DataSource.tsx
new file mode 100644
index 0000000000..cb7b326c9b
--- /dev/null
+++ b/GraphRAG/ui/react/src/components/Conversation/DataSource.tsx
@@ -0,0 +1,71 @@
+// Copyright (C) 2024 Intel Corporation
+// SPDX-License-Identifier: Apache-2.0
+
+import { Button, Container, Drawer, FileInput, Text, TextInput } from '@mantine/core'
+import { SyntheticEvent, useState } from 'react'
+import { useAppDispatch } from '../../redux/store'
+import { submitDataSourceURL, uploadFile } from '../../redux/Conversation/ConversationSlice'
+
+type Props = {
+  opened: boolean
+  onClose: () => void
+}
+
+export default function DataSource({ opened, onClose }: Props) {
+  const title = "Data Source"
+  const [file, setFile] = useState<File | null>();
+  const [isFile, setIsFile] = useState<boolean>(true);
+  const [url, setURL] = useState<string>("");
+  const dispatch = useAppDispatch()
+  const handleFileUpload = () => {
+    if (file)
+      dispatch(uploadFile({ file }))
+  }
+
+  const handleChange = (event: SyntheticEvent) => {
+    event.preventDefault()
+    setURL((event.target as HTMLTextAreaElement).value)
+  }
+
+  const handleSubmit = () => {
+    dispatch(submitDataSourceURL({ link_list: url.split(";") }))
+  }
+
+  return (
+    <Drawer title={title} position="right" opened={opened} onClose={onClose} withOverlay={false}>
+      <Text size="sm">
+        Please upload your local file or paste a remote file link, and Chat will respond based on the content of the uploaded file.
+      </Text>
+
+
+      <Container styles={{
+        root: { paddingTop: '40px', display:'flex', flexDirection:'column', alignItems:'center' }
+      }}>
+        <Button.Group styles={{ group:{alignSelf:'center'}}} >
+          <Button variant={isFile ? 'filled' : 'default'} onClick={() => setIsFile(true)}>Upload FIle</Button>
+          <Button variant={!isFile ? 'filled' : 'default'} onClick={() => setIsFile(false)}>Use Link</Button>
+        </Button.Group>
+      </Container>
+
+      <Container styles={{root:{paddingTop: '40px'}}}>
+        <div>
+          {isFile ? (
+            <>
+              <FileInput value={file} onChange={setFile} placeholder="Choose File" description={"choose a file to upload for RAG"}/>
+              <Button style={{marginTop:'5px'}} onClick={handleFileUpload} disabled={!file}>Upload</Button>
+            </>
+          ) : (
+            <>
+              <TextInput value={url} onChange={handleChange} placeholder='URL' description={"Use semicolons (;) to separate multiple URLs."} />
+                <Button style={{ marginTop: '5px' }} onClick={handleSubmit} disabled={!url}>Upload</Button>
+            </>
+          )}
+        </div>
+        
+
+
+
+      </Container>
+    </Drawer>
+  )
+}
\ No newline at end of file
diff --git a/GraphRAG/ui/react/src/components/Conversation/conversation.module.scss b/GraphRAG/ui/react/src/components/Conversation/conversation.module.scss
new file mode 100644
index 0000000000..c637d5e11f
--- /dev/null
+++ b/GraphRAG/ui/react/src/components/Conversation/conversation.module.scss
@@ -0,0 +1,65 @@
+// Copyright (C) 2024 Intel Corporation
+// SPDX-License-Identifier: Apache-2.0
+
+@import "../../styles/styles";
+
+.spacer {
+  flex: 1 1 auto;
+}
+
+.conversationWrapper {
+  @include flex(row, nowrap, flex-start, flex-start);
+  flex: 1 1 auto;
+  height: 100%;
+  & > * {
+    height: 100%;
+  }
+  .conversationContent {
+    flex: 1 1 auto;
+    position: relative;
+    .conversationContentMessages {
+      @include absolutes;
+      // @include flex(column, nowrap, flex-start, flex-start);
+
+      display: grid;
+      grid-template-areas:
+        "header"
+        "messages"
+        "inputs";
+
+      grid-template-columns: auto;
+      grid-template-rows: 60px auto 100px;
+
+      .conversationTitle {
+        grid-area: header;
+        @include flex(row, nowrap, center, flex-start);
+        height: 60px;
+        padding: 8px 24px;
+        border-bottom: 1px solid light-dark(var(--mantine-color-gray-3), var(--mantine-color-dark-4));
+      }
+
+      .historyContainer {
+        grid-area: messages;
+        overflow: auto;
+        width: 100%;
+        padding: 16px 32px;
+        & > * {
+          width: 100%;
+        }
+      }
+
+      .conversationActions {
+        // padding: --var()
+        grid-area: inputs;
+        padding: 18px;
+        border-top: 1px solid light-dark(var(--mantine-color-gray-3), var(--mantine-color-dark-4));
+      }
+    }
+
+    .conversationSplash {
+      @include absolutes;
+      @include flex(column, nowrap, center, center);
+      font-size: 32px;
+    }
+  }
+}
diff --git a/GraphRAG/ui/react/src/components/Message/conversationMessage.module.scss b/GraphRAG/ui/react/src/components/Message/conversationMessage.module.scss
new file mode 100644
index 0000000000..b006495530
--- /dev/null
+++ b/GraphRAG/ui/react/src/components/Message/conversationMessage.module.scss
@@ -0,0 +1,15 @@
+// Copyright (C) 2024 Intel Corporation
+// SPDX-License-Identifier: Apache-2.0
+
+@import "../../styles/styles";
+
+.conversationMessage {
+  @include flex(column, nowrap, flex-start, flex-start);
+  margin-top: 16px;
+  padding: 0 32px;
+  width: 100%;
+
+  & > * {
+    width: 100%;
+  }
+}
diff --git a/GraphRAG/ui/react/src/components/Message/conversationMessage.tsx b/GraphRAG/ui/react/src/components/Message/conversationMessage.tsx
new file mode 100644
index 0000000000..10e7858533
--- /dev/null
+++ b/GraphRAG/ui/react/src/components/Message/conversationMessage.tsx
@@ -0,0 +1,55 @@
+// Copyright (C) 2024 Intel Corporation
+// SPDX-License-Identifier: Apache-2.0
+
+import { IconAi, IconUser } from "@tabler/icons-react"
+import style from "./conversationMessage.module.scss"
+import { Group, Text } from "@mantine/core"
+import { DateTime } from "luxon"
+
+export interface ConversationMessageProps {
+  message: string
+  human: boolean
+  date: number
+}
+
+export function ConversationMessage({ human, message, date }: ConversationMessageProps) {
+  const dateFormat = () => {
+    // console.log(date)
+    // console.log(new Date(date))
+    return DateTime.fromJSDate(new Date(date)).toLocaleString(DateTime.DATETIME_MED)
+  }
+
+  return (
+    <div className={style.conversationMessage}>
+      <Group>
+        {/* <Avatar
+          src="https://raw.githubusercontent.com/mantinedev/mantine/master/.demo/avatars/avatar-1.png"
+          alt="Jacob Warnhalter"
+          radius="xl"
+        /> */}
+
+        {human && <IconUser />}
+        {!human && <IconAi />}
+
+        <div>
+          <Text size="sm">
+            {human && "You"} {!human && "Assistant"}
+          </Text>
+          <Text size="xs" c="dimmed">
+            {dateFormat()}
+          </Text>
+        </div>
+      </Group>
+      <Text pl={54} pt="sm" size="sm">
+        {message}
+      </Text>
+
+      {/* <div className={style.header}>
+        {human && <IconUser />}
+        {!human && <IconAi />}
+      </div>
+
+      <div className={style.message}>{message}</div> */}
+    </div>
+  )
+}
diff --git a/GraphRAG/ui/react/src/components/UserInfoModal/UserInfoModal.tsx b/GraphRAG/ui/react/src/components/UserInfoModal/UserInfoModal.tsx
new file mode 100644
index 0000000000..4d54180a45
--- /dev/null
+++ b/GraphRAG/ui/react/src/components/UserInfoModal/UserInfoModal.tsx
@@ -0,0 +1,48 @@
+// Copyright (C) 2024 Intel Corporation
+// SPDX-License-Identifier: Apache-2.0
+
+import { SyntheticEvent, useEffect, useState } from 'react'
+import { useDisclosure } from '@mantine/hooks';
+import { TextInput, Button, Modal } from '@mantine/core';
+import { useDispatch, useSelector } from 'react-redux';
+import { userSelector, setUser } from '../../redux/User/userSlice';
+
+
+const UserInfoModal = () => {
+    const [opened, { open, close }] = useDisclosure(false);
+    const { name } = useSelector(userSelector);
+    const [username, setUsername] = useState(name || "");
+    const dispatch = useDispatch();
+    const handleSubmit = (event: SyntheticEvent) => {
+        event.preventDefault()
+        if(username){
+            close();
+            dispatch(setUser(username));
+            setUsername("")
+        }
+        
+    }
+    useEffect(() => {
+        if (!name) {
+            open();
+        }
+    }, [name])
+    return (
+        <>
+            <Modal opened={opened} withCloseButton={false} onClose={()=>handleSubmit} title="Tell us who you are ?" centered>
+                <>
+                    <form onSubmit={handleSubmit} >
+                        <TextInput label="Username" placeholder="Username" onChange={(event)=> setUsername(event?.currentTarget.value)} value={username} data-autofocus />
+                        <Button fullWidth onClick={handleSubmit} mt="md">
+                            Submit
+                        </Button>
+                    </form>
+                    
+                </>
+            </Modal>
+        </>
+
+    )
+}
+
+export default UserInfoModal
\ No newline at end of file
diff --git a/GraphRAG/ui/react/src/components/sidebar/sidebar.module.scss b/GraphRAG/ui/react/src/components/sidebar/sidebar.module.scss
new file mode 100644
index 0000000000..b58a253c27
--- /dev/null
+++ b/GraphRAG/ui/react/src/components/sidebar/sidebar.module.scss
@@ -0,0 +1,84 @@
+/**
+  Copyright (c) 2024 Intel Corporation
+
+  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 "../../styles/styles";
+
+.navbar {
+  width: 100%;
+  @include flex(column, nowrap, center, flex-start);
+  padding: var(--mantine-spacing-md);
+  background-color: var(--mantine-color-blue-filled);
+  // background-color: light-dark(var(--mantine-color-white), var(--mantine-color-dark-6));
+  // border-right: 1px solid light-dark(var(--mantine-color-gray-3), var(--mantine-color-dark-4));
+}
+
+.navbarMain {
+  flex: 1;
+}
+
+.navbarLogo {
+  width: 100%;
+  display: flex;
+  justify-content: center;
+  padding-top: var(--mantine-spacing-md);
+  margin-bottom: var(--mantine-spacing-xl);
+}
+
+.link {
+  width: 44px;
+  height: 44px;
+  border-radius: var(--mantine-radius-md);
+  display: flex;
+  align-items: center;
+  justify-content: center;
+  color: var(--mantine-color-white);
+
+  &:hover {
+    background-color: var(--mantine-color-blue-7);
+  }
+
+  &[data-active] {
+    &,
+    &:hover {
+      box-shadow: var(--mantine-shadow-sm);
+      background-color: var(--mantine-color-white);
+      color: var(--mantine-color-blue-6);
+    }
+  }
+}
+
+.aside {
+  flex: 0 0 60px;
+  background-color: var(--mantine-color-body);
+  display: flex;
+  flex-direction: column;
+  align-items: center;
+  border-right: 1px solid light-dark(var(--mantine-color-gray-3), var(--mantine-color-dark-7));
+}
+
+.logo {
+  width: 100%;
+  display: flex;
+  justify-content: center;
+  height: 60px;
+  padding-top: var(--mantine-spacing-s);
+  border-bottom: 1px solid light-dark(var(--mantine-color-gray-3), var(--mantine-color-dark-7));
+  margin-bottom: var(--mantine-spacing-xl);
+}
+.logoImg {
+  width: 30px;
+}
diff --git a/GraphRAG/ui/react/src/components/sidebar/sidebar.tsx b/GraphRAG/ui/react/src/components/sidebar/sidebar.tsx
new file mode 100644
index 0000000000..e5e9349e4f
--- /dev/null
+++ b/GraphRAG/ui/react/src/components/sidebar/sidebar.tsx
@@ -0,0 +1,70 @@
+// Copyright (C) 2024 Intel Corporation
+// SPDX-License-Identifier: Apache-2.0
+
+import { useState } from "react"
+import { Tooltip, UnstyledButton, Stack, rem } from "@mantine/core"
+import { IconHome2, IconLogout } from "@tabler/icons-react"
+import classes from "./sidebar.module.scss"
+import OpeaLogo from "../../assets/opea-icon-black.svg"
+import { useAppDispatch } from "../../redux/store"
+import { removeUser } from "../../redux/User/userSlice"
+import { logout } from "../../redux/Conversation/ConversationSlice"
+
+interface NavbarLinkProps {
+  icon: typeof IconHome2
+  label: string
+  active?: boolean
+  onClick?(): void
+}
+
+function NavbarLink({ icon: Icon, label, active, onClick }: NavbarLinkProps) {
+  return (
+    <Tooltip label={label} position="right" transitionProps={{ duration: 0 }}>
+      <UnstyledButton onClick={onClick} className={classes.link} data-active={active || undefined}>
+        <Icon style={{ width: rem(20), height: rem(20) }} stroke={1.5} />
+      </UnstyledButton>
+    </Tooltip>
+  )
+}
+
+export interface SidebarNavItem {
+  icon: typeof IconHome2
+  label: string
+}
+
+export type SidebarNavList = SidebarNavItem[]
+
+export interface SideNavbarProps {
+  navList: SidebarNavList
+}
+
+export function SideNavbar({ navList }: SideNavbarProps) {
+  const dispatch =useAppDispatch()
+  const [active, setActive] = useState(0)
+
+  const handleLogout = () => {
+    dispatch(logout())
+    dispatch(removeUser())
+  }
+
+  const links = navList.map((link, index) => (
+    <NavbarLink {...link} key={link.label} active={index === active} onClick={() => setActive(index)} />
+  ))
+
+  return (
+    <nav className={classes.navbar}>
+      <div className={classes.navbarLogo}>
+        <img className={classes.logoImg} src={OpeaLogo} alt="opea logo" />
+      </div>
+
+      <div className={classes.navbarMain}>
+        <Stack justify="center" gap={0}>
+          {links}
+        </Stack>
+      </div>
+      <Stack justify="center" gap={0}>
+        <NavbarLink icon={IconLogout} label="Logout" onClick={handleLogout} />
+      </Stack>
+    </nav>
+  )
+}
diff --git a/GraphRAG/ui/react/src/config.ts b/GraphRAG/ui/react/src/config.ts
new file mode 100644
index 0000000000..f004165a2b
--- /dev/null
+++ b/GraphRAG/ui/react/src/config.ts
@@ -0,0 +1,5 @@
+// Copyright (C) 2024 Intel Corporation
+// SPDX-License-Identifier: Apache-2.0
+
+export const DATA_PREP_URL = import.meta.env.VITE_DATA_PREP_SERVICE_URL;
+export const CHAT_QNA_URL = import.meta.env.VITE_BACKEND_SERVICE_ENDPOINT;
diff --git a/GraphRAG/ui/react/src/index.scss b/GraphRAG/ui/react/src/index.scss
new file mode 100644
index 0000000000..53e71621ea
--- /dev/null
+++ b/GraphRAG/ui/react/src/index.scss
@@ -0,0 +1,20 @@
+// Copyright (C) 2024 Intel Corporation
+// SPDX-License-Identifier: Apache-2.0
+
+@import "@mantine/core/styles.css";
+
+:root {
+  font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif;
+  line-height: 1.5;
+  font-weight: 400;
+}
+
+html,
+body {
+  position: absolute;
+  top: 0;
+  left: 0;
+  width: 100%;
+  height: 100%;
+  overflow: hidden;
+}
diff --git a/GraphRAG/ui/react/src/main.tsx b/GraphRAG/ui/react/src/main.tsx
new file mode 100644
index 0000000000..3d9c91578b
--- /dev/null
+++ b/GraphRAG/ui/react/src/main.tsx
@@ -0,0 +1,17 @@
+// Copyright (C) 2024 Intel Corporation
+// SPDX-License-Identifier: Apache-2.0
+
+import React from "react"
+import ReactDOM from "react-dom/client"
+import App from "./App.tsx"
+import "./index.scss"
+import { Provider } from 'react-redux'
+import { store } from "./redux/store.ts"
+
+ReactDOM.createRoot(document.getElementById("root")!).render(
+  <React.StrictMode>
+    <Provider store={store} >
+      <App />
+    </Provider>
+  </React.StrictMode>
+)
diff --git a/GraphRAG/ui/react/src/redux/Conversation/Conversation.ts b/GraphRAG/ui/react/src/redux/Conversation/Conversation.ts
new file mode 100644
index 0000000000..47ea988a64
--- /dev/null
+++ b/GraphRAG/ui/react/src/redux/Conversation/Conversation.ts
@@ -0,0 +1,32 @@
+// Copyright (C) 2024 Intel Corporation
+// SPDX-License-Identifier: Apache-2.0
+
+export type ConversationRequest = {
+  conversationId: string;
+  userPrompt: Message;
+  messages: Partial<Message>[];
+  model: string;
+};
+export enum MessageRole {
+  Assistant = "assistant",
+  User = "user",
+  System = "system",
+}
+
+export interface Message {
+  role: MessageRole;
+  content: string;
+  time: number;
+}
+
+export interface Conversation {
+  conversationId: string;
+  title?: string;
+  Messages: Message[];
+}
+
+export interface ConversationReducer {
+  selectedConversationId: string;
+  conversations: Conversation[];
+  onGoingResult: string;
+}
diff --git a/GraphRAG/ui/react/src/redux/Conversation/ConversationSlice.ts b/GraphRAG/ui/react/src/redux/Conversation/ConversationSlice.ts
new file mode 100644
index 0000000000..63d9e562b0
--- /dev/null
+++ b/GraphRAG/ui/react/src/redux/Conversation/ConversationSlice.ts
@@ -0,0 +1,221 @@
+// Copyright (C) 2024 Intel Corporation
+// SPDX-License-Identifier: Apache-2.0
+
+import { PayloadAction, createSlice } from "@reduxjs/toolkit";
+import { RootState, store } from "../store";
+import { fetchEventSource } from "@microsoft/fetch-event-source";
+import { Message, MessageRole, ConversationReducer, ConversationRequest } from "./Conversation";
+import { getCurrentTimeStamp, uuidv4 } from "../../common/util";
+import { createAsyncThunkWrapper } from "../thunkUtil";
+import client from "../../common/client";
+import { notifications } from "@mantine/notifications";
+import { CHAT_QNA_URL, DATA_PREP_URL } from "../../config";
+
+const initialState: ConversationReducer = {
+  conversations: [],
+  selectedConversationId: "",
+  onGoingResult: "",
+};
+
+export const ConversationSlice = createSlice({
+  name: "Conversation",
+  initialState,
+  reducers: {
+    logout: (state) => {
+      state.conversations = [];
+      state.selectedConversationId = "";
+      state.onGoingResult = "";
+    },
+    setOnGoingResult: (state, action: PayloadAction<string>) => {
+      state.onGoingResult = action.payload;
+    },
+    addMessageToMessages: (state, action: PayloadAction<Message>) => {
+      const selectedConversation = state.conversations.find((x) => x.conversationId === state.selectedConversationId);
+      selectedConversation?.Messages?.push(action.payload);
+    },
+    newConversation: (state) => {
+      (state.selectedConversationId = ""), (state.onGoingResult = "");
+    },
+    createNewConversation: (state, action: PayloadAction<{ title: string; id: string; message: Message }>) => {
+      state.conversations.push({
+        title: action.payload.title,
+        conversationId: action.payload.id,
+        Messages: [action.payload.message],
+      });
+    },
+    setSelectedConversationId: (state, action: PayloadAction<string>) => {
+      state.selectedConversationId = action.payload;
+    },
+  },
+  extraReducers(builder) {
+    builder.addCase(uploadFile.fulfilled, () => {
+      notifications.update({
+        id: "upload-file",
+        message: "File Uploaded Successfully",
+        loading: false,
+        autoClose: 3000,
+      });
+    }),
+      builder.addCase(uploadFile.rejected, () => {
+        notifications.update({
+          color: "red",
+          id: "upload-file",
+          message: "Failed to Upload file",
+          loading: false,
+        });
+      });
+    builder.addCase(submitDataSourceURL.fulfilled, () => {
+      notifications.show({
+        message: "Submitted Successfully",
+      });
+    });
+    builder.addCase(submitDataSourceURL.rejected, () => {
+      notifications.show({
+        color: "red",
+        message: "Submit Failed",
+      });
+    });
+  },
+});
+
+export const submitDataSourceURL = createAsyncThunkWrapper(
+  "conversation/submitDataSourceURL",
+  async ({ link_list }: { link_list: string[] }, {}) => {
+    const body = new FormData();
+    body.append("link_list", JSON.stringify(link_list));
+    const response = await client.post(DATA_PREP_URL, body);
+    return response.data;
+  },
+);
+export const uploadFile = createAsyncThunkWrapper("conversation/uploadFile", async ({ file }: { file: File }, {}) => {
+  const body = new FormData();
+  body.append("files", file);
+
+  notifications.show({
+    id: "upload-file",
+    message: "uploading File",
+    loading: true,
+  });
+  const response = await client.post(DATA_PREP_URL, body);
+  return response.data;
+});
+export const {
+  logout,
+  setOnGoingResult,
+  newConversation,
+  addMessageToMessages,
+  setSelectedConversationId,
+  createNewConversation,
+} = ConversationSlice.actions;
+export const conversationSelector = (state: RootState) => state.conversationReducer;
+export default ConversationSlice.reducer;
+
+export const doConversation = (conversationRequest: ConversationRequest) => {
+  const { conversationId, userPrompt, messages, model } = conversationRequest;
+  if (!conversationId) {
+    //newConversation
+    const id = uuidv4();
+    store.dispatch(
+      createNewConversation({
+        title: userPrompt.content,
+        id,
+        message: userPrompt,
+      }),
+    );
+    store.dispatch(setSelectedConversationId(id));
+  } else {
+    store.dispatch(addMessageToMessages(userPrompt));
+  }
+  const userPromptWithoutTime = {
+    role: userPrompt.role,
+    content: userPrompt.content,
+  };
+  const body = {
+    messages: [...messages, userPromptWithoutTime],
+    model,
+  };
+
+  //   let conversation: Conversation;
+  let result = "";
+  try {
+    fetchEventSource(CHAT_QNA_URL, {
+      method: "POST",
+      headers: {
+        "Content-Type": "application/json",
+      },
+      body: JSON.stringify(body),
+      openWhenHidden: true,
+      async onopen(response) {
+        if (response.ok) {
+          return;
+        } else if (response.status >= 400 && response.status < 500 && response.status !== 429) {
+          const e = await response.json();
+          console.log(e);
+          throw Error(e.error.message);
+        } else {
+          console.log("error", response);
+        }
+      },
+      onmessage(msg) {
+        if (msg?.data != "[DONE]") {
+          try {
+            const match = msg.data.match(/b'([^']*)'/);
+            if (match && match[1] != "</s>") {
+              const extractedText = match[1];
+
+              // Check for the presence of \x hexadecimal
+              if (extractedText.includes("\\x")) {
+                // Decode Chinese (or other non-ASCII characters)
+                const decodedText = decodeEscapedBytes(extractedText);
+                result += decodedText;
+              } else {
+                result += extractedText;
+              }
+            } else if (!match) {
+              // Return data without pattern
+              result += msg?.data;
+            }
+            // Store back result if it is not null
+            if (result) {
+              store.dispatch(setOnGoingResult(result));
+            }
+          } catch (e) {
+            console.log("something wrong in msg", e);
+            throw e;
+          }
+        }
+      },
+      onerror(err) {
+        console.log("error", err);
+        store.dispatch(setOnGoingResult(""));
+        //notify here
+        throw err;
+        //handle error
+      },
+      onclose() {
+        //handle close
+        store.dispatch(setOnGoingResult(""));
+
+        store.dispatch(
+          addMessageToMessages({
+            role: MessageRole.Assistant,
+            content: result,
+            time: getCurrentTimeStamp(),
+          }),
+        );
+      },
+    });
+  } catch (err) {
+    console.log(err);
+  }
+};
+
+// decode \x hexadecimal encoding
+function decodeEscapedBytes(str: string): string {
+  // Convert the byte portion separated by \x into a byte array and decode it into a UTF-8 string
+  const byteArray: number[] = str
+    .split("\\x")
+    .slice(1)
+    .map((byte: string) => parseInt(byte, 16));
+  return new TextDecoder("utf-8").decode(new Uint8Array(byteArray));
+}
diff --git a/GraphRAG/ui/react/src/redux/User/user.d.ts b/GraphRAG/ui/react/src/redux/User/user.d.ts
new file mode 100644
index 0000000000..69c4db4ab1
--- /dev/null
+++ b/GraphRAG/ui/react/src/redux/User/user.d.ts
@@ -0,0 +1,6 @@
+// Copyright (C) 2024 Intel Corporation
+// SPDX-License-Identifier: Apache-2.0
+
+export interface User {
+  name: string | null;
+}
diff --git a/GraphRAG/ui/react/src/redux/User/userSlice.ts b/GraphRAG/ui/react/src/redux/User/userSlice.ts
new file mode 100644
index 0000000000..48d22fe2e6
--- /dev/null
+++ b/GraphRAG/ui/react/src/redux/User/userSlice.ts
@@ -0,0 +1,26 @@
+// Copyright (C) 2024 Intel Corporation
+// SPDX-License-Identifier: Apache-2.0
+
+import { createSlice, PayloadAction } from "@reduxjs/toolkit";
+import { RootState } from "../store";
+import { User } from "./user";
+
+const initialState: User = {
+  name: localStorage.getItem("user"),
+};
+
+export const userSlice = createSlice({
+  name: "user",
+  initialState,
+  reducers: {
+    setUser: (state, action: PayloadAction<string>) => {
+      state.name = action.payload;
+    },
+    removeUser: (state) => {
+      state.name = null;
+    },
+  },
+});
+export const { setUser, removeUser } = userSlice.actions;
+export const userSelector = (state: RootState) => state.userReducer;
+export default userSlice.reducer;
diff --git a/GraphRAG/ui/react/src/redux/store.ts b/GraphRAG/ui/react/src/redux/store.ts
new file mode 100644
index 0000000000..2603909266
--- /dev/null
+++ b/GraphRAG/ui/react/src/redux/store.ts
@@ -0,0 +1,49 @@
+// Copyright (C) 2024 Intel Corporation
+// SPDX-License-Identifier: Apache-2.0
+
+import { combineReducers, configureStore } from "@reduxjs/toolkit";
+import userReducer from "./User/userSlice";
+import conversationReducer from "./Conversation/ConversationSlice";
+import { TypedUseSelectorHook, useDispatch, useSelector } from "react-redux";
+
+export const store = configureStore({
+  reducer: combineReducers({
+    userReducer,
+    conversationReducer,
+  }),
+  devTools: import.meta.env.PROD || true,
+  preloadedState: loadFromLocalStorage(),
+  middleware: (getDefaultMiddleware) =>
+    getDefaultMiddleware({
+      serializableCheck: false,
+    }),
+});
+
+function saveToLocalStorage(state: ReturnType<typeof store.getState>) {
+  try {
+    const serialState = JSON.stringify(state);
+    localStorage.setItem("reduxStore", serialState);
+  } catch (e) {
+    console.warn(e);
+  }
+}
+
+function loadFromLocalStorage() {
+  try {
+    const serialisedState = localStorage.getItem("reduxStore");
+    if (serialisedState === null) return undefined;
+    return JSON.parse(serialisedState);
+  } catch (e) {
+    console.warn(e);
+    return undefined;
+  }
+}
+
+store.subscribe(() => saveToLocalStorage(store.getState()));
+console.log(store);
+export default store;
+export type AppDispatch = typeof store.dispatch;
+export type RootState = ReturnType<typeof store.getState>;
+
+export const useAppDispatch: () => AppDispatch = useDispatch;
+export const useAppSelector: TypedUseSelectorHook<RootState> = useSelector;
diff --git a/GraphRAG/ui/react/src/redux/thunkUtil.ts b/GraphRAG/ui/react/src/redux/thunkUtil.ts
new file mode 100644
index 0000000000..5df362fd3d
--- /dev/null
+++ b/GraphRAG/ui/react/src/redux/thunkUtil.ts
@@ -0,0 +1,25 @@
+// Copyright (C) 2024 Intel Corporation
+// SPDX-License-Identifier: Apache-2.0
+
+import { createAsyncThunk, AsyncThunkPayloadCreator, AsyncThunk } from "@reduxjs/toolkit";
+
+interface ThunkAPIConfig {}
+
+export const createAsyncThunkWrapper = <Returned, ThunkArg = any>(
+  type: string,
+  thunk: AsyncThunkPayloadCreator<Returned, ThunkArg>, // <-- very unsure of this - have tried many things here
+): AsyncThunk<Returned, ThunkArg, ThunkAPIConfig> => {
+  return createAsyncThunk<Returned, ThunkArg, ThunkAPIConfig>(
+    type,
+    // @ts-ignore
+    async (arg, thunkAPI) => {
+      try {
+        // do some stuff here that happens on every action
+        return await thunk(arg, thunkAPI);
+      } catch (err) {
+        // do some stuff here that happens on every error
+        return thunkAPI.rejectWithValue(err);
+      }
+    },
+  );
+};
diff --git a/GraphRAG/ui/react/src/styles/components/_context.scss b/GraphRAG/ui/react/src/styles/components/_context.scss
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/GraphRAG/ui/react/src/styles/components/_sidebar.scss b/GraphRAG/ui/react/src/styles/components/_sidebar.scss
new file mode 100644
index 0000000000..23018ee1f0
--- /dev/null
+++ b/GraphRAG/ui/react/src/styles/components/_sidebar.scss
@@ -0,0 +1,8 @@
+// Copyright (C) 2024 Intel Corporation
+// SPDX-License-Identifier: Apache-2.0
+
+@import "../layout/flex";
+
+@mixin sidebar {
+  @include flex(column, nowrap, flex-start, flex-start);
+}
diff --git a/GraphRAG/ui/react/src/styles/components/content.scss b/GraphRAG/ui/react/src/styles/components/content.scss
new file mode 100644
index 0000000000..9a230f2493
--- /dev/null
+++ b/GraphRAG/ui/react/src/styles/components/content.scss
@@ -0,0 +1,5 @@
+@mixin textWrapEllipsis {
+  text-overflow: ellipsis;
+  white-space: nowrap;
+  overflow: hidden;
+}
diff --git a/GraphRAG/ui/react/src/styles/components/context.module.scss b/GraphRAG/ui/react/src/styles/components/context.module.scss
new file mode 100644
index 0000000000..17f37ba907
--- /dev/null
+++ b/GraphRAG/ui/react/src/styles/components/context.module.scss
@@ -0,0 +1,67 @@
+@import "../layout/flex";
+@import "../components/content.scss";
+
+.contextWrapper {
+  background-color: light-dark(var(--mantine-color-gray-0), var(--mantine-color-dark-6));
+  border-right: 1px solid light-dark(var(--mantine-color-gray-3), var(--mantine-color-dark-4));
+  width: 180px;
+  overflow-y: hidden;
+  overflow-x: hidden;
+  // overflow-y: auto;
+
+  .contextTitle {
+    position: sticky;
+    top: 0;
+    font-family:
+      Greycliff CF,
+      var(--mantine-font-family);
+    margin-bottom: var(--mantine-spacing-xl);
+    background-color: var(--mantine-color-body);
+    padding: var(--mantine-spacing-md);
+    padding-top: 18px;
+    width: 100%;
+    height: 60px;
+    border-bottom: 1px solid light-dark(var(--mantine-color-gray-3), var(--mantine-color-dark-7));
+  }
+
+  .contextList {
+    height: 90vh;
+    // display: flex();
+
+    .contextListItem {
+      display: block;
+      text-decoration: none;
+      border-top-right-radius: var(--mantine-radius-md);
+      border-bottom-right-radius: var(--mantine-radius-md);
+      color: light-dark(var(--mantine-color-gray-7), var(--mantine-color-dark-0));
+      padding: 0 var(--mantine-spacing-md);
+      font-size: var(--mantine-font-size-sm);
+      margin-right: var(--mantine-spacing-md);
+      font-weight: 500;
+      height: 44px;
+      width: 100%;
+      line-height: 44px;
+      cursor: pointer;
+
+      .contextItemName {
+        flex: 1 1 auto;
+        width: 130px;
+        @include textWrapEllipsis;
+      }
+
+      &:hover {
+        background-color: light-dark(var(--mantine-color-gray-1), var(--mantine-color-dark-5));
+        color: light-dark(var(--mantine-color-dark), var(--mantine-color-light));
+      }
+
+      &[data-active] {
+        &,
+        &:hover {
+          border-left-color: var(--mantine-color-blue-filled);
+          background-color: var(--mantine-color-blue-filled);
+          color: var(--mantine-color-white);
+        }
+      }
+    }
+  }
+}
diff --git a/GraphRAG/ui/react/src/styles/layout/_basics.scss b/GraphRAG/ui/react/src/styles/layout/_basics.scss
new file mode 100644
index 0000000000..d11b1ef215
--- /dev/null
+++ b/GraphRAG/ui/react/src/styles/layout/_basics.scss
@@ -0,0 +1,7 @@
+@mixin absolutes {
+  position: absolute;
+  top: 0;
+  left: 0;
+  width: 100%;
+  height: 100%;
+}
diff --git a/GraphRAG/ui/react/src/styles/layout/_flex.scss b/GraphRAG/ui/react/src/styles/layout/_flex.scss
new file mode 100644
index 0000000000..18d2ce8ecb
--- /dev/null
+++ b/GraphRAG/ui/react/src/styles/layout/_flex.scss
@@ -0,0 +1,6 @@
+@mixin flex($direction: row, $wrap: nowrap, $alignItems: center, $justifyContent: center) {
+  display: flex;
+  flex-flow: $direction $wrap;
+  align-items: $alignItems;
+  justify-content: $justifyContent;
+}
diff --git a/GraphRAG/ui/react/src/styles/styles.scss b/GraphRAG/ui/react/src/styles/styles.scss
new file mode 100644
index 0000000000..8028d8ad6d
--- /dev/null
+++ b/GraphRAG/ui/react/src/styles/styles.scss
@@ -0,0 +1,5 @@
+// Copyright (C) 2024 Intel Corporation
+// SPDX-License-Identifier: Apache-2.0
+
+@import "layout/flex";
+@import "layout/basics";
diff --git a/GraphRAG/ui/react/src/vite-env.d.ts b/GraphRAG/ui/react/src/vite-env.d.ts
new file mode 100644
index 0000000000..4260915f75
--- /dev/null
+++ b/GraphRAG/ui/react/src/vite-env.d.ts
@@ -0,0 +1,4 @@
+// Copyright (C) 2024 Intel Corporation
+// SPDX-License-Identifier: Apache-2.0
+
+/// <reference types="vite/client" />
diff --git a/GraphRAG/ui/react/tsconfig.json b/GraphRAG/ui/react/tsconfig.json
new file mode 100644
index 0000000000..f50b75c5f0
--- /dev/null
+++ b/GraphRAG/ui/react/tsconfig.json
@@ -0,0 +1,23 @@
+{
+  "compilerOptions": {
+    "target": "ES2020",
+    "useDefineForClassFields": true,
+    "lib": ["ES2020", "DOM", "DOM.Iterable"],
+    "module": "ESNext",
+    "skipLibCheck": true,
+
+    "moduleResolution": "bundler",
+    "allowImportingTsExtensions": true,
+    "resolveJsonModule": true,
+    "isolatedModules": true,
+    "noEmit": true,
+    "jsx": "react-jsx",
+
+    "strict": true,
+    "noUnusedLocals": true,
+    "noUnusedParameters": true,
+    "noFallthroughCasesInSwitch": true
+  },
+  "include": ["src"],
+  "references": [{ "path": "./tsconfig.node.json" }]
+}
diff --git a/GraphRAG/ui/react/tsconfig.node.json b/GraphRAG/ui/react/tsconfig.node.json
new file mode 100644
index 0000000000..97ede7ee6f
--- /dev/null
+++ b/GraphRAG/ui/react/tsconfig.node.json
@@ -0,0 +1,11 @@
+{
+  "compilerOptions": {
+    "composite": true,
+    "skipLibCheck": true,
+    "module": "ESNext",
+    "moduleResolution": "bundler",
+    "allowSyntheticDefaultImports": true,
+    "strict": true
+  },
+  "include": ["vite.config.ts"]
+}
diff --git a/GraphRAG/ui/react/vite.config.ts b/GraphRAG/ui/react/vite.config.ts
new file mode 100644
index 0000000000..b7c7150c4c
--- /dev/null
+++ b/GraphRAG/ui/react/vite.config.ts
@@ -0,0 +1,27 @@
+// Copyright (C) 2024 Intel Corporation
+// SPDX-License-Identifier: Apache-2.0
+
+import { defineConfig } from "vitest/config";
+import react from "@vitejs/plugin-react";
+
+// https://vitejs.dev/config/
+export default defineConfig({
+  css: {
+    preprocessorOptions: {
+      scss: {
+        additionalData: `@import "./src/styles/styles.scss";`,
+      },
+    },
+  },
+  plugins: [react()],
+  server: {
+    port: 80,
+  },
+  test: {
+    globals: true,
+    environment: "jsdom",
+  },
+  define: {
+    "import.meta.env": process.env,
+  },
+});
diff --git a/GraphRAG/ui/svelte/.editorconfig b/GraphRAG/ui/svelte/.editorconfig
new file mode 100644
index 0000000000..2b7a6637f7
--- /dev/null
+++ b/GraphRAG/ui/svelte/.editorconfig
@@ -0,0 +1,10 @@
+[*]
+indent_style = tab
+
+[package.json]
+indent_style = space
+indent_size = 2
+
+[*.md]
+indent_style = space
+indent_size = 2
diff --git a/GraphRAG/ui/svelte/.env b/GraphRAG/ui/svelte/.env
new file mode 100644
index 0000000000..d6f7643b62
--- /dev/null
+++ b/GraphRAG/ui/svelte/.env
@@ -0,0 +1,7 @@
+CHAT_BASE_URL = '/v1/chatqna'
+
+UPLOAD_FILE_BASE_URL = '/v1/dataprep'
+
+GET_FILE = '/v1/dataprep/get_file'
+
+DELETE_FILE = '/v1/dataprep/delete_file'
diff --git a/GraphRAG/ui/svelte/.eslintignore b/GraphRAG/ui/svelte/.eslintignore
new file mode 100644
index 0000000000..38972655fa
--- /dev/null
+++ b/GraphRAG/ui/svelte/.eslintignore
@@ -0,0 +1,13 @@
+.DS_Store
+node_modules
+/build
+/.svelte-kit
+/package
+.env
+.env.*
+!.env.example
+
+# Ignore files for PNPM, NPM and YARN
+pnpm-lock.yaml
+package-lock.json
+yarn.lock
diff --git a/GraphRAG/ui/svelte/.eslintrc.cjs b/GraphRAG/ui/svelte/.eslintrc.cjs
new file mode 100644
index 0000000000..a6592d11f7
--- /dev/null
+++ b/GraphRAG/ui/svelte/.eslintrc.cjs
@@ -0,0 +1,34 @@
+// Copyright (c) 2024 Intel Corporation
+//
+// 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.
+
+module.exports = {
+	root: true,
+	parser: "@typescript-eslint/parser",
+	extends: ["eslint:recommended", "plugin:@typescript-eslint/recommended", "prettier"],
+	plugins: ["svelte3", "@typescript-eslint", "neverthrow"],
+	ignorePatterns: ["*.cjs"],
+	overrides: [{ files: ["*.svelte"], processor: "svelte3/svelte3" }],
+	settings: {
+		"svelte3/typescript": () => require("typescript"),
+	},
+	parserOptions: {
+		sourceType: "module",
+		ecmaVersion: 2020,
+	},
+	env: {
+		browser: true,
+		es2017: true,
+		node: true,
+	},
+};
diff --git a/GraphRAG/ui/svelte/.prettierignore b/GraphRAG/ui/svelte/.prettierignore
new file mode 100644
index 0000000000..38972655fa
--- /dev/null
+++ b/GraphRAG/ui/svelte/.prettierignore
@@ -0,0 +1,13 @@
+.DS_Store
+node_modules
+/build
+/.svelte-kit
+/package
+.env
+.env.*
+!.env.example
+
+# Ignore files for PNPM, NPM and YARN
+pnpm-lock.yaml
+package-lock.json
+yarn.lock
diff --git a/GraphRAG/ui/svelte/.prettierrc b/GraphRAG/ui/svelte/.prettierrc
new file mode 100644
index 0000000000..c932dd178f
--- /dev/null
+++ b/GraphRAG/ui/svelte/.prettierrc
@@ -0,0 +1 @@
+{"pluginSearchDirs": ["."], "overrides": [{"files": "*.svelte", "options": {"parser": "svelte"}}]}
diff --git a/GraphRAG/ui/svelte/README.md b/GraphRAG/ui/svelte/README.md
new file mode 100644
index 0000000000..d3c26b8f0f
--- /dev/null
+++ b/GraphRAG/ui/svelte/README.md
@@ -0,0 +1,42 @@
+# ChatQnA Customized UI
+
+## 📸 Project Screenshots
+
+![project-screenshot](../../assets/img/chat_ui_init.png)
+![project-screenshot](../../assets/img/chat_ui_response.png)
+![project-screenshot](../../assets/img/chat_ui_upload.png)
+
+## 🧐 Features
+
+Here're some of the project's features:
+
+- Start a Text Chat：Initiate a text chat with the ability to input written conversations, where the dialogue content can also be customized based on uploaded files.
+- Clear: Clear the record of the current dialog box without retaining the contents of the dialog box.
+- Chat history: Historical chat records can still be retained after refreshing, making it easier for users to view the context.
+- Scroll to Bottom / Top: The chat automatically slides to the bottom. Users can also click the top icon to slide to the top of the chat record.
+- End to End Time: Shows the time spent on the current conversation.
+- Upload File: The choice between uploading locally or copying a remote link. Chat according to uploaded knowledge base.
+- Delete File: Delete a certain uploaded file.
+
+## 🛠️ Get it Running
+
+1. Clone the repo.
+
+2. cd command to the current folder.
+
+3. Modify the required .env variables.
+
+   ```
+   CHAT_BASE_URL = ''
+
+   UPLOAD_FILE_BASE_URL = ''
+
+   GET_FILE = ''
+
+   DELETE_FILE = ''
+
+   ```
+
+4. Execute `npm install` to install the corresponding dependencies.
+
+5. Execute `npm run dev` in both environments
diff --git a/GraphRAG/ui/svelte/package.json b/GraphRAG/ui/svelte/package.json
new file mode 100644
index 0000000000..e2a39a2c4d
--- /dev/null
+++ b/GraphRAG/ui/svelte/package.json
@@ -0,0 +1,61 @@
+{
+  "name": "sveltekit-auth-example",
+  "version": "0.0.1",
+  "private": true,
+  "scripts": {
+    "dev": "vite dev",
+    "build": "vite build",
+    "preview": "vite preview",
+    "check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
+    "check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
+    "lint": "prettier --check . && eslint .",
+    "format": "prettier --write ."
+  },
+  "devDependencies": {
+    "@fortawesome/free-solid-svg-icons": "6.2.0",
+    "@playwright/test": "^1.33.0",
+    "@sveltejs/adapter-auto": "1.0.0-next.75",
+    "@sveltejs/kit": "^1.30.4",
+    "@tailwindcss/typography": "0.5.7",
+    "@types/debug": "4.1.7",
+    "@types/node": "^20.12.13",
+    "@typescript-eslint/eslint-plugin": "^5.27.0",
+    "@typescript-eslint/parser": "^5.27.0",
+    "autoprefixer": "^10.4.7",
+    "daisyui": "3.5.1",
+    "date-picker-svelte": "^2.6.0",
+    "debug": "4.3.4",
+    "eslint": "^8.16.0",
+    "eslint-config-prettier": "^8.3.0",
+    "eslint-plugin-neverthrow": "1.1.4",
+    "eslint-plugin-svelte3": "^4.0.0",
+    "postcss": "^8.4.31",
+    "postcss-load-config": "^4.0.1",
+    "postcss-preset-env": "^8.3.2",
+    "prettier": "^2.8.8",
+    "prettier-plugin-svelte": "^2.7.0",
+    "prettier-plugin-tailwindcss": "^0.3.0",
+    "svelte": "^3.59.1",
+    "svelte-check": "^2.7.1",
+    "svelte-fa": "3.0.3",
+    "svelte-preprocess": "^4.10.7",
+    "tailwindcss": "^3.1.5",
+    "tslib": "^2.3.1",
+    "typescript": "^4.7.4",
+    "vite": "^4.5.2"
+  },
+  "type": "module",
+  "dependencies": {
+    "date-fns": "^2.30.0",
+    "driver.js": "^1.3.0",
+    "flowbite-svelte": "^0.38.5",
+    "flowbite-svelte-icons": "^1.4.0",
+    "fuse.js": "^6.6.2",
+    "lodash": "^4.17.21",
+    "playwright": "^1.44.0",
+    "ramda": "^0.29.0",
+    "sse.js": "^0.6.1",
+    "svelte-notifications": "^0.9.98",
+    "svrollbar": "^0.12.0"
+  }
+}
diff --git a/GraphRAG/ui/svelte/playwright.config.ts b/GraphRAG/ui/svelte/playwright.config.ts
new file mode 100644
index 0000000000..d1e3390edf
--- /dev/null
+++ b/GraphRAG/ui/svelte/playwright.config.ts
@@ -0,0 +1,87 @@
+// Copyright (C) 2024 Intel Corporation
+// SPDX-License-Identifier: Apache-2.0
+
+import { defineConfig, devices } from "@playwright/test";
+
+/**
+ * Read environment variables from file.
+ * https://github.com/motdotla/dotenv
+ */
+// require('dotenv').config();
+
+/**
+ * See https://playwright.dev/docs/test-configuration.
+ */
+export default defineConfig({
+	testDir: "./tests",
+	/* Maximum time one test can run for. */
+	timeout: 30 * 1000,
+	expect: {
+		/**
+		 * Maximum time expect() should wait for the condition to be met.
+		 * For example in `await expect(locator).toHaveText();`
+		 */
+		timeout: 5000,
+	},
+	/* Run tests in files in parallel */
+	fullyParallel: true,
+	/* Fail the build on CI if you accidentally left test.only in the source code. */
+	forbidOnly: !!process.env.CI,
+	/* Retry on CI only */
+	retries: process.env.CI ? 2 : 0,
+	/* Opt out of parallel tests on CI. */
+	workers: process.env.CI ? 1 : undefined,
+	/* Reporter to use. See https://playwright.dev/docs/test-reporters */
+	reporter: [["html", { open: "never" }]],
+	/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
+	use: {
+		/* Maximum time each action such as `click()` can take. Defaults to 0 (no limit). */
+		actionTimeout: 0,
+		/* Base URL to use in actions like `await page.goto('/')`. */
+		baseURL: "http://10.7.4.57:80",
+
+		/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
+		trace: "on-first-retry",
+	},
+
+	/* Configure projects for major browsers */
+	projects: [
+		// {
+		// 	name: "chromium",
+		// 	use: { ...devices["Desktop Chrome"] },
+		// },
+
+		/* Test against mobile viewports. */
+		// {
+		//   name: 'Mobile Chrome',
+		//   use: { ...devices['Pixel 5'] },
+		// },
+		// {
+		//   name: 'Mobile Safari',
+		//   use: { ...devices['iPhone 12'] },
+		// },
+
+		/* Test against branded browsers. */
+		// {
+		//   name: 'Microsoft Edge',
+		//   use: { channel: 'msedge' },
+		// },
+		{
+			name: "webkit",
+			use: { ...devices["Desktop Safari"] },
+		},
+		// {
+		//   name: 'Google Chrome',
+		//   use: { channel: 'chrome' },
+		// },
+	],
+
+	/* Folder for test artifacts such as screenshots, videos, traces, etc. */
+	// outputDir: 'test-results/',
+
+	/* Run your local dev server before starting the tests */
+	// webServer: {
+	//   command: 'npm run start',
+	//   port: 3000,
+	// },
+});
diff --git a/GraphRAG/ui/svelte/postcss.config.cjs b/GraphRAG/ui/svelte/postcss.config.cjs
new file mode 100644
index 0000000000..b384b43ebe
--- /dev/null
+++ b/GraphRAG/ui/svelte/postcss.config.cjs
@@ -0,0 +1,27 @@
+// Copyright (c) 2024 Intel Corporation
+//
+// 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.
+
+const tailwindcss = require("tailwindcss");
+const autoprefixer = require("autoprefixer");
+
+const config = {
+	plugins: [
+		//Some plugins, like tailwindcss/nesting, need to run before Tailwind,
+		tailwindcss(),
+		//But others, like autoprefixer, need to run after,
+		autoprefixer,
+	],
+};
+
+module.exports = config;
diff --git a/GraphRAG/ui/svelte/src/app.d.ts b/GraphRAG/ui/svelte/src/app.d.ts
new file mode 100644
index 0000000000..fa6a0abf77
--- /dev/null
+++ b/GraphRAG/ui/svelte/src/app.d.ts
@@ -0,0 +1,19 @@
+// Copyright (c) 2024 Intel Corporation
+//
+// 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.
+
+// See: https://kit.svelte.dev/docs/types#app
+// import { Result} from "neverthrow";
+interface Window {
+	deviceType: string;
+}
diff --git a/GraphRAG/ui/svelte/src/app.html b/GraphRAG/ui/svelte/src/app.html
new file mode 100644
index 0000000000..db69926ea8
--- /dev/null
+++ b/GraphRAG/ui/svelte/src/app.html
@@ -0,0 +1,28 @@
+<!--
+  Copyright (c) 2024 Intel Corporation
+
+  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.
+-->
+
+<!doctype html>
+<html lang="en">
+	<head>
+		<meta charset="utf-8" />
+		<link rel="icon" href="%sveltekit.assets%/favicon.png" />
+		<meta name="viewport" content="width=device-width" />
+		%sveltekit.head%
+	</head>
+	<body>
+		<div class="h-full w-full">%sveltekit.body%</div>
+	</body>
+</html>
diff --git a/GraphRAG/ui/svelte/src/app.postcss b/GraphRAG/ui/svelte/src/app.postcss
new file mode 100644
index 0000000000..1bb14630c8
--- /dev/null
+++ b/GraphRAG/ui/svelte/src/app.postcss
@@ -0,0 +1,86 @@
+/* Write your global styles here, in PostCSS syntax */
+@tailwind base;
+@tailwind components;
+@tailwind utilities;
+
+html, body {
+    height: 100%;
+}
+
+.btn {
+	@apply flex-nowrap;
+}
+a.btn {
+	@apply no-underline;
+}
+.input {
+	@apply text-base;
+}
+
+.bg-dark-blue {
+	background-color: #004a86;
+}
+
+.bg-light-blue {
+	background-color: #0068b5;
+}
+
+.bg-turquoise {
+	background-color: #00a3f6;
+}
+
+.bg-header {
+	background-color: #ffffff;
+}
+
+.bg-button {
+	background-color: #0068b5;
+}
+
+.bg-title {
+	background-color: #f7f7f7;
+}
+
+.text-header {
+	color: #0068b5;
+}
+
+.text-button {
+	color: #252e47;
+}
+
+.text-title-color {
+	color: rgb(38,38,38);
+}
+
+.font-intel {
+	font-family: "intel-clear","tahoma",Helvetica,"helvetica",Arial,sans-serif;
+}
+
+.font-title-intel {
+	font-family: "intel-one","intel-clear",Helvetica,Arial,sans-serif;
+}
+
+.bg-footer {
+	background-color: #e7e7e7;
+}
+
+.bg-light-green {
+	background-color: #d7f3a1;
+}
+
+.bg-purple {
+	background-color: #653171;
+}
+
+.bg-dark-blue {
+	background-color: #224678;
+}
+
+.border-input-color {
+	border-color: #605e5c;
+}
+
+.w-12\/12 {
+	width: 100%
+}
\ No newline at end of file
diff --git a/GraphRAG/ui/svelte/src/lib/assets/DocManagement/LinkfolderIcon.svelte b/GraphRAG/ui/svelte/src/lib/assets/DocManagement/LinkfolderIcon.svelte
new file mode 100644
index 0000000000..66d1b006a5
--- /dev/null
+++ b/GraphRAG/ui/svelte/src/lib/assets/DocManagement/LinkfolderIcon.svelte
@@ -0,0 +1,36 @@
+<!--
+  Copyright (C) 2024 Intel Corporation
+  SPDX-License-Identifier: Apache-2.0
+-->
+
+<script>
+	export let className = "w-16 h-16";
+</script>
+
+<svg
+	t="1713775351763"
+	class="icon {className}"
+	viewBox="0 0 1024 1024"
+	version="1.1"
+	xmlns="http://www.w3.org/2000/svg"
+	p-id="12834"
+	width="32"
+	height="32"
+	><path
+		d="M192 160h253.728a64 64 0 0 1 53.312 28.576l25.824 38.848A64 64 0 0 0 578.176 256H832a64 64 0 0 1 64 64v480a64 64 0 0 1-64 64H192a64 64 0 0 1-64-64V224a64 64 0 0 1 64-64z"
+		fill="#1989FA"
+		p-id="12835"
+	/><path
+		d="M192 352h640a64 64 0 0 1 64 64v384a64 64 0 0 1-64 64H192a64 64 0 0 1-64-64V416a64 64 0 0 1 64-64z"
+		fill="#8BC4FC"
+		p-id="12836"
+	/><path
+		d="M422.624 768a70.656 70.656 0 0 1-49.888-120.672l30.112-30.112a7.488 7.488 0 0 1 5.28-2.208c5.152 1.28 7.104 3.616 7.552 6.4a93.76 93.76 0 0 0 5.472 22.144 7.68 7.68 0 0 1-1.696 8.032l-21.312 21.312a34.912 34.912 0 0 0 0 48.928 34.24 34.24 0 0 0 24.352 10.08 34.944 34.944 0 0 0 24.544-10.08l89.312-89.376a34.688 34.688 0 0 0 0-48.896 7.488 7.488 0 0 1 0-10.56l15.008-15.04a7.488 7.488 0 0 1 5.344-2.208 7.616 7.616 0 0 1 5.312 2.144 70.688 70.688 0 0 1 0 100.032l-89.312 89.28a70.4 70.4 0 0 1-49.76 20.736z"
+		fill="#FFFFFF"
+		p-id="12837"
+	/><path
+		d="M467.168 660.128a7.456 7.456 0 0 1-5.12-2.112 70.72 70.72 0 0 1 0-100l89.312-89.312a70.656 70.656 0 1 1 99.904 99.968l-30.112 30.112a7.488 7.488 0 0 1-5.248 2.208c-5.184-1.28-7.136-3.616-7.552-6.4a97.504 97.504 0 0 0-5.504-22.176 7.648 7.648 0 0 1 1.696-8l21.312-21.312a34.848 34.848 0 0 0 0-48.928 34.24 34.24 0 0 0-24.352-10.08 34.944 34.944 0 0 0-24.544 10.08l-89.312 89.344a34.752 34.752 0 0 0 0 48.896 7.584 7.584 0 0 1 0 10.688l-14.848 14.912a7.52 7.52 0 0 1-5.248 2.176z"
+		fill="#FFFFFF"
+		p-id="12838"
+	/></svg
+>
diff --git a/GraphRAG/ui/svelte/src/lib/assets/DocManagement/fileIcon.svelte b/GraphRAG/ui/svelte/src/lib/assets/DocManagement/fileIcon.svelte
new file mode 100644
index 0000000000..39b204bbfd
--- /dev/null
+++ b/GraphRAG/ui/svelte/src/lib/assets/DocManagement/fileIcon.svelte
@@ -0,0 +1,30 @@
+<!--
+  Copyright (C) 2024 Intel Corporation
+  SPDX-License-Identifier: Apache-2.0
+-->
+
+<script>
+    export let className = "w-16 h-16";
+</script>
+
+<svg
+	t="1711440565760"
+	class="icon {className}"
+	viewBox="0 0 1024 1024"
+	version="1.1"
+	xmlns="http://www.w3.org/2000/svg"
+	p-id="23643"
+	><path
+		d="M913.29536 941.04064c0.0256 24.82688-16.54784 44.96384-37.0176 44.98432l-708.23936 0.6912c-20.46464 0.02048-37.07904-20.08576-37.10464-44.91264l-0.83968-859.02848c-0.0256-24.82688 16.54784-44.96384 37.0176-44.98432l521.10848-0.50688 224.39424 210.50368 0.68096 693.25312z"
+		fill="#E6E4E2"
+		p-id="23644"
+	/><path
+		d="M913.29536 253.26592l-189.11744 0.18432c-20.46464 0.02048-37.07904-20.08576-37.10464-44.91264l-0.16384-165.77024 226.38592 210.49856z"
+		fill="#C4BCB1"
+		p-id="23645"
+	/><path
+		d="M720.72192 396.84096a22.54848 22.54848 0 0 1-22.54848 22.54848H326.13376a22.54848 22.54848 0 0 1 0-45.09696h372.0448a22.54848 22.54848 0 0 1 22.54336 22.54848zM720.72192 565.95456a22.54848 22.54848 0 0 1-22.54848 22.54848H326.13376a22.54848 22.54848 0 0 1 0-45.09696h372.0448a22.54848 22.54848 0 0 1 22.54336 22.54848zM720.72192 746.33728a22.54848 22.54848 0 0 1-22.54848 22.54848H326.13376a22.54848 22.54848 0 0 1 0-45.09696h372.0448a22.54848 22.54848 0 0 1 22.54336 22.54848z"
+		fill="#C4BCB1"
+		p-id="23646"
+	/></svg
+>
diff --git a/GraphRAG/ui/svelte/src/lib/assets/DocManagement/folderIcon.svelte b/GraphRAG/ui/svelte/src/lib/assets/DocManagement/folderIcon.svelte
new file mode 100644
index 0000000000..5fd4e14fa9
--- /dev/null
+++ b/GraphRAG/ui/svelte/src/lib/assets/DocManagement/folderIcon.svelte
@@ -0,0 +1,30 @@
+<!--
+  Copyright (C) 2024 Intel Corporation
+  SPDX-License-Identifier: Apache-2.0
+-->
+
+<script>
+    export let className = "w-16 h-16";
+</script>
+
+<svg
+	t="1711440048470"
+	class="icon {className}"
+	viewBox="0 0 1024 1024"
+	version="1.1"
+	xmlns="http://www.w3.org/2000/svg"
+	p-id="7455"
+	><path
+		d="M848.8576 199.1936H415.7568c0-26.5728-21.5424-48.128-48.128-48.128H175.1424c-26.5728 0-48.128 21.5424-48.128 48.128V343.5648c0 26.5984 21.5424 48.1408 48.128 48.1408h673.728c26.5728 0 48.128-21.5424 48.128-48.1408v-96.2432c-0.0128-26.5856-21.5552-48.128-48.1408-48.128z"
+		fill="#CCA352"
+		p-id="7456"
+	/><path
+		d="M800.7424 247.3088H223.2576c-26.5728 0-48.128 21.5424-48.128 48.128v48.128c0 26.5984 21.5424 48.1408 48.128 48.1408h577.472c26.5728 0 48.128-21.5424 48.128-48.1408v-48.128c0-26.5728-21.5424-48.128-48.1152-48.128z"
+		fill="#FFFFFF"
+		p-id="7457"
+	/><path
+		d="M848.8576 295.4368H175.1424c-26.5728 0-48.128 21.5424-48.128 48.128v481.2544c0 26.5472 21.5424 48.128 48.128 48.128h673.728c26.5728 0 48.128-21.568 48.128-48.128V343.552c-0.0128-26.5728-21.5552-48.1152-48.1408-48.1152z"
+		fill="#FFCC66"
+		p-id="7458"
+	/></svg
+>
diff --git a/GraphRAG/ui/svelte/src/lib/assets/avatar/svelte/Delete.svelte b/GraphRAG/ui/svelte/src/lib/assets/avatar/svelte/Delete.svelte
new file mode 100644
index 0000000000..8847a22275
--- /dev/null
+++ b/GraphRAG/ui/svelte/src/lib/assets/avatar/svelte/Delete.svelte
@@ -0,0 +1,30 @@
+<!--
+  Copyright (c) 2024 Intel Corporation
+
+  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.
+-->
+
+<script lang="ts">
+	import { createEventDispatcher } from "svelte";
+
+	let dispatch = createEventDispatcher();
+</script>
+
+<!-- svelte-ignore a11y-click-events-have-key-events -->
+<svg
+class="absolute top-0 right-0 hover:opacity-70"
+on:click={() => {
+	dispatch('DeleteAvatar') }}
+viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" width="20" height="20">
+<path d="M512 832c-176.448 0-320-143.552-320-320S335.552 192 512 192s320 143.552 320 320-143.552 320-320 320m0-704C300.256 128 128 300.256 128 512s172.256 384 384 384 384-172.256 384-384S723.744 128 512 128" fill="#bbbbbb"></path><path d="M649.824 361.376a31.968 31.968 0 0 0-45.248 0L505.6 460.352l-98.976-98.976a31.968 31.968 0 1 0-45.248 45.248l98.976 98.976-98.976 98.976a32 32 0 0 0 45.248 45.248l98.976-98.976 98.976 98.976a31.904 31.904 0 0 0 45.248 0 31.968 31.968 0 0 0 0-45.248L550.848 505.6l98.976-98.976a31.968 31.968 0 0 0 0-45.248" fill="#bbbbbb"></path>
+</svg>
diff --git a/GraphRAG/ui/svelte/src/lib/assets/chat/svelte/Assistant.svelte b/GraphRAG/ui/svelte/src/lib/assets/chat/svelte/Assistant.svelte
new file mode 100644
index 0000000000..b68d2a08cd
--- /dev/null
+++ b/GraphRAG/ui/svelte/src/lib/assets/chat/svelte/Assistant.svelte
@@ -0,0 +1,44 @@
+<!--
+  Copyright (c) 2024 Intel Corporation
+
+  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.
+-->
+
+	<!-- <svg
+		width="35"
+		height="35"
+		viewBox="0 0 48 48"
+		fill="none"
+		xmlns="http://www.w3.org/2000/svg"
+	>
+		<g clip-path="url(#clip0_16_93)">
+			<rect x="0.5" y="0.238312" width="47" height="47" fill="#0068B5" />
+			<path
+				d="M39.51 0.238312H8.49C4.0955 0.238312 0.5 3.83381 0.5 8.22831V39.2483C0.5 43.6428 4.0955 47.2383 8.49 47.2383H39.51C43.9045 47.2383 47.5 43.6428 47.5 39.2483V8.22831C47.5 3.83381 43.9045 0.238312 39.51 0.238312ZM44.915 39.2483C44.915 42.2328 42.4945 44.6533 39.51 44.6533H8.49C5.5055 44.6533 3.085 42.2328 3.085 39.2483V8.22831C3.085 5.24381 5.5055 2.82331 8.49 2.82331H39.51C42.4945 2.82331 44.915 5.24381 44.915 8.22831V39.2483Z"
+				fill="#0068B5"
+			/>
+			<path
+				d="M9.52393 21.3178H11.7094L11.7094 29.3548H9.52393V21.3178ZM20.3574 22.2108C20.1694 21.9523 19.8874 21.7408 19.4879 21.5763C19.1119 21.4118 18.6889 21.3178 18.2424 21.3178C17.2084 21.3178 16.3389 21.7643 15.6574 22.6338V21.4823H13.7304V29.3078H15.7984V25.7593C15.7984 24.8898 15.8454 24.2788 15.9629 23.9498C16.0569 23.6208 16.2684 23.3623 16.5504 23.1743C16.8324 22.9863 17.1614 22.8688 17.5139 22.8688C17.7959 22.8688 18.0309 22.9393 18.2424 23.0803C18.4304 23.2213 18.5949 23.4093 18.6654 23.6678C18.7594 23.9263 18.8064 24.4668 18.8064 25.3128V29.3078H20.8744V24.4433C20.8744 23.8323 20.8274 23.3858 20.7569 23.0568C20.6864 22.7513 20.5689 22.4693 20.3574 22.2108ZM25.7389 27.8038C25.5979 27.8038 25.4804 27.7803 25.3864 27.7098C25.2924 27.6393 25.2219 27.5453 25.1984 27.4513C25.1749 27.3573 25.1514 26.9813 25.1514 26.3233V23.1508H26.5614V21.5058H25.1514V18.7563L23.0834 19.9548V21.5058V23.1508V26.5583C23.0834 27.2868 23.1069 27.7803 23.1539 28.0153C23.2009 28.3443 23.2949 28.6263 23.4359 28.8143C23.5769 29.0023 23.7884 29.1668 24.0939 29.3078C24.3994 29.4253 24.7284 29.4958 25.1044 29.4958C25.7154 29.4958 26.2559 29.4018 26.7494 29.1903L26.5614 27.5923C26.2089 27.7333 25.9269 27.8038 25.7389 27.8038ZM33.7524 22.4928C33.0709 21.7173 32.1544 21.3413 31.0029 21.3413C29.9689 21.3413 29.0994 21.7173 28.4414 22.4458C27.7599 23.1743 27.4309 24.1848 27.4309 25.5008C27.4309 26.5818 27.6894 27.4748 28.2064 28.2033C28.8644 29.0963 29.8749 29.5428 31.2379 29.5428C32.1074 29.5428 32.8124 29.3548 33.3764 28.9553C33.9404 28.5558 34.3634 27.9918 34.6219 27.2163L32.5539 26.8638C32.4364 27.2633 32.2719 27.5453 32.0604 27.7098C31.8489 27.8743 31.5669 27.9683 31.2379 27.9683C30.7679 27.9683 30.3684 27.8038 30.0394 27.4513C29.7104 27.0988 29.5459 26.6288 29.5459 26.0178H34.7394C34.7394 24.4433 34.4339 23.2448 33.7524 22.4928ZM29.5694 24.7488C29.5694 24.1848 29.7104 23.7383 29.9924 23.4093C30.2979 23.0803 30.6504 22.9158 31.1204 22.9158C31.5434 22.9158 31.8959 23.0803 32.2014 23.3858C32.5069 23.6913 32.6479 24.1613 32.6714 24.7488H29.5694ZM36.4079 18.5448H38.4759V29.3548H36.4079V18.5448Z"
+				fill="white"
+			/>
+			<path
+				d="M9.52393 18.5448H11.7094L11.7094 20.5654H9.52393V18.5448ZM39.2058 53.1889C59.7131 70.5741 37.9465 53.1367 37.547 52.9722C60.5267 71.228 41.5876 53.1889 41.1411 53.1889C40.1071 53.1889 54.2638 57.2959 53.5823 58.1654L44.3775 54.0099L42.8 56.0803L44.9335 56.0763L43.617 55.1029L49.2888 57.4321C49.2888 56.5626 69.0838 68.5409 41.665 52.9722C67.9574 69.2353 48.7539 58.3534 49.0359 58.1654C49.3179 57.9774 72.2331 77.3305 48.0529 59.0448C73.8431 77.373 40.6532 52.2185 40.8647 52.3595C64.5928 69.3279 66.2469 69.734 44.0477 53.3531C68.4587 70.8049 45.1808 54.42 45.1808 55.266L49.6436 57.6191L50.8176 56.2254L46.645 54.7317C46.645 54.1207 47.0599 55.184 46.9894 54.855C46.9189 54.5495 63.0924 72.6928 39.2058 53.1889ZM45.3834 56.0442C45.2424 56.0442 60.49 64.1373 43.0764 53.1889C59.6606 67.1938 58.0346 62.1756 40.8647 50.7007C58.8678 64.6804 43.7296 53.3942 43.7296 52.7362L43.617 55.1029L43.3529 52.3595L44.7353 53.7418L43.0764 53.1889L44.244 54.855L46.1176 55.6771L42.8 57.336L45.5647 53.1889L41.9705 49.5948L46.1176 55.1029L46.3941 55.6771C46.3941 56.4056 44.3403 54.3363 44.3873 54.5713C65.2775 66.4664 68.0297 70.4029 45.348 56.6803C69.965 73.7705 43.9793 55.5361 44.2848 55.6771C44.5903 55.7946 60.4832 66.2088 41.9705 53.7418C42.5815 53.7418 44.8545 53.1837 45.348 52.9722L43.7511 52.3595C43.3986 52.5005 45.5714 56.0442 45.3834 56.0442ZM44.0342 56.5108C43.3527 55.7353 45.3338 56.783 44.1823 56.783C43.1483 56.783 44.9043 55.6048 44.2463 56.3333C43.5648 57.0618 43.7511 51.0435 43.7511 52.3595C43.7511 53.4405 43.6653 53.0133 44.1823 53.7418C44.8403 54.6348 41.7134 54.2598 43.0764 54.2598C43.9459 54.2598 43.4702 56.9103 44.0342 56.5108C44.5982 56.1113 44.1288 57.5428 44.3873 56.7673L43.7511 56.2254C55.3795 71.8986 44.3938 54.9384 44.1823 55.1029C43.9708 55.2674 44.0801 54.2598 43.7511 54.2598C56.2643 69.3767 58.4567 71.4935 44.1823 55.1029C57.894 68.7712 44.3873 57.3783 44.3873 56.7673L44.1823 56.945C44.1823 55.3705 44.7157 57.2628 44.0342 56.5108ZM44.3873 54.5713C44.3873 54.0073 43.7522 56.8398 44.0342 56.5108C44.3397 56.1818 43.495 56.2254 43.965 56.2254C44.388 56.2254 55.4258 75.7185 43.7511 56.2254C44.0566 56.5309 44.1588 56.1955 44.1823 56.783L44.3873 54.5713Z"
+				fill="#00C7FD"
+			/>
+		</g>
+		<defs>
+			<clipPath id="clip0_16_93">
+				<rect x="0.5" y="0.238312" width="47" height="47" fill="white" />
+			</clipPath>
+		</defs>
+	</svg> -->
diff --git a/GraphRAG/ui/svelte/src/lib/assets/chat/svelte/PaperAirplane.svelte b/GraphRAG/ui/svelte/src/lib/assets/chat/svelte/PaperAirplane.svelte
new file mode 100644
index 0000000000..d1d14077f2
--- /dev/null
+++ b/GraphRAG/ui/svelte/src/lib/assets/chat/svelte/PaperAirplane.svelte
@@ -0,0 +1,68 @@
+<!--
+  Copyright (c) 2024 Intel Corporation
+
+  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.
+-->
+
+<script lang="ts">
+	export let overrideClasses = "";
+
+	const classes = overrideClasses ? overrideClasses : `w-5 h-5 text-gray-400`;
+</script>
+
+<!-- <svg
+	class={classes}
+	width="10"
+	height="10"
+	fill="none"
+	viewBox="0 0 18 18"
+	style="min-width: 18px; min-height: 18px;"
+	><g
+		><path
+			fill="#3369FF"
+			d="M15.71 8.019 3.835 1.368a1.125 1.125 0 0 0-1.61 1.36l2.04 5.71h5.298a.562.562 0 1 1 0 1.125H4.264l-2.04 5.71a1.128 1.128 0 0 0 1.058 1.506c.194 0 .384-.05.552-.146l11.877-6.65a1.125 1.125 0 0 0 0-1.964Z"
+		/></g
+	></svg
+> -->
+<!--
+<svg
+	class={classes}
+	xmlns="http://www.w3.org/2000/svg"
+	fill="none"
+	viewBox="0 0 24 24"
+	stroke-width="1.5"
+	stroke="currentColor"
+>
+	<path
+		stroke-linecap="round"
+		stroke-linejoin="round"
+		d="M6 12L3.269 3.126A59.768 59.768 0 0121.485 12 59.77 59.77 0 013.27 20.876L5.999 12zm0 0h7.5"
+	/>
+</svg> -->
+
+<svg
+	t="1708926517502"
+	class={classes}
+	viewBox="0 0 1024 1024"
+	version="1.1"
+	xmlns="http://www.w3.org/2000/svg"
+	p-id="4586"
+	id="mx_n_1708926517503"
+	width="200"
+	height="200"
+	><path
+		d="M0 1024l106.496-474.112 588.8-36.864-588.8-39.936-106.496-473.088 1024 512z"
+		p-id="4587"
+		fill="#0068b5"
+	/></svg
+>
diff --git a/GraphRAG/ui/svelte/src/lib/assets/chat/svelte/PersonOutlined.svelte b/GraphRAG/ui/svelte/src/lib/assets/chat/svelte/PersonOutlined.svelte
new file mode 100644
index 0000000000..dd2f9fdb78
--- /dev/null
+++ b/GraphRAG/ui/svelte/src/lib/assets/chat/svelte/PersonOutlined.svelte
@@ -0,0 +1,26 @@
+<!--
+  Copyright (c) 2024 Intel Corporation
+
+  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.
+-->
+
+<!-- <svg
+	viewBox="0 0 1024 1024"
+	version="1.1"
+	xmlns="http://www.w3.org/2000/svg"
+	width="32"
+	height="32"
+>
+<path d="M512 512c93.866667 0 170.666667-76.8 170.666667-170.666667 0-93.866667-76.8-170.666667-170.666667-170.666667C418.133333 170.666667 341.333333 247.466667 341.333333 341.333333 341.333333 435.2 418.133333 512 512 512zM512 597.333333c-115.2 0-341.333333 55.466667-341.333333 170.666667l0 85.333333 682.666667 0 0-85.333333C853.333333 652.8 627.2 597.333333 512 597.333333z" p-id="4050" fill="#ffffff"></path></svg> -->
+
+<svg t="1708914168912" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1581" width="200" height="200"><path d="M447.13 46.545h101.818v930.91H447.13V46.545z" fill="#0068b5" p-id="1582" data-spm-anchor-id="a313x.search_index.0.i0.12a13a81x9rPe6" class="selected"></path></svg>
diff --git a/GraphRAG/ui/svelte/src/lib/assets/layout/css/driver.css b/GraphRAG/ui/svelte/src/lib/assets/layout/css/driver.css
new file mode 100644
index 0000000000..453db6082a
--- /dev/null
+++ b/GraphRAG/ui/svelte/src/lib/assets/layout/css/driver.css
@@ -0,0 +1,94 @@
+.driverjs-theme {
+	background: transparent;
+	color: #fff;
+	box-shadow: none;
+	padding: 0;
+}
+
+.driver-popover-arrow {
+	border: 10px solid transparent;
+	animation: blink 1s 3 steps(1);
+}
+
+@keyframes blink {
+	0% {
+		opacity: 1;
+	}
+	50% {
+		opacity: 0.2;
+	}
+	100% {
+		opacity: 1;
+	}
+}
+
+.driver-popover.driverjs-theme .driver-popover-arrow-side-left.driver-popover-arrow {
+	border-left-color: #174ed1;
+}
+
+.driver-popover.driverjs-theme .driver-popover-arrow-side-right.driver-popover-arrow {
+	border-right-color: #174ed1;
+}
+
+.driver-popover.driverjs-theme .driver-popover-arrow-side-top.driver-popover-arrow {
+	border-top-color: #174ed1;
+}
+
+.driver-popover.driverjs-theme .driver-popover-arrow-side-bottom.driver-popover-arrow {
+	border-bottom-color: #174ed1;
+}
+
+.driver-popover-footer {
+	background: transparent;
+	color: #fff;
+}
+.driver-popover-title {
+	border-top-left-radius: 5px;
+	border-top-right-radius: 5px;
+}
+
+.driver-popover-title,
+.driver-popover-description {
+	display: block;
+	padding: 15px 15px 7px 15px;
+	background: #174ed1;
+	border: none;
+}
+
+.driver-popover-close-btn {
+	color: #fff;
+}
+
+.driver-popover-footer button:hover,
+.driver-popover-footer button:focus {
+	background: #174ed1;
+	color: #fff;
+}
+
+.driver-popover-description {
+	padding: 5px 15px;
+	border-bottom-left-radius: 5px;
+	border-bottom-right-radius: 5px;
+}
+
+.driver-popover-title[style*="block"] + .driver-popover-description {
+	margin: 0;
+}
+.driver-popover-progress-text {
+	color: #fff;
+}
+
+.driver-popover-footer button {
+	background: #174ed1;
+	border: 2px #174ed1 dashed;
+	color: #fff;
+	border-radius: 50%;
+	text-shadow: none;
+}
+.driver-popover-close-btn:hover,
+.driver-popover-close-btn:focus {
+	color: #fff;
+}
+.driver-popover-navigation-btns button + button {
+	margin-left: 10px;
+}
diff --git a/GraphRAG/ui/svelte/src/lib/assets/upload/deleteIcon.svelte b/GraphRAG/ui/svelte/src/lib/assets/upload/deleteIcon.svelte
new file mode 100644
index 0000000000..2ca57ed8aa
--- /dev/null
+++ b/GraphRAG/ui/svelte/src/lib/assets/upload/deleteIcon.svelte
@@ -0,0 +1,22 @@
+<!--
+  Copyright (C) 2024 Intel Corporation
+  SPDX-License-Identifier: Apache-2.0
+-->
+
+<svg
+	t="1711440930029"
+	class="icon w-5 h-5"
+	viewBox="0 0 1024 1024"
+	version="1.1"
+	xmlns="http://www.w3.org/2000/svg"
+	p-id="4255"
+	><path
+		d="M668.8 896h-320c-48.64 0-88.32-37.76-92.8-87.68L211.2 403.2c-1.92-17.28 10.88-33.28 28.16-35.2 17.28-1.92 33.28 10.88 35.2 28.16l44.16 405.76c1.28 17.28 14.08 30.08 28.8 30.08h320c14.72 0 27.52-12.8 28.8-29.44l44.16-406.4c1.92-17.28 17.92-30.08 35.2-28.16 17.28 1.92 30.08 17.92 28.16 35.2l-44.16 405.76c-2.56 49.28-42.88 87.04-90.88 87.04zM826.24 321.28H190.72c-17.92 0-32-14.08-32-32s14.08-32 32-32h636.16c17.92 0 32 14.08 32 32s-14.72 32-32.64 32z"
+		fill="#a6adbb"
+		p-id="4256"
+	/><path
+		d="M424.96 789.12c-16.64 0-30.72-12.8-32-29.44l-27.52-347.52c-1.28-17.92 11.52-33.28 29.44-34.56 17.92-1.28 33.28 11.52 34.56 29.44l27.52 347.52c1.28 17.92-11.52 33.28-29.44 34.56h-2.56zM580.48 789.12h-2.56c-17.92-1.28-30.72-16.64-29.44-34.56L576 407.04c1.28-17.92 16.64-30.72 34.56-29.44 17.92 1.28 30.72 16.64 29.44 34.56l-27.52 347.52c-1.92 16.64-15.36 29.44-32 29.44zM581.76 244.48c-17.92 0-32-14.08-32-32 0-23.68-19.2-43.52-43.52-43.52s-43.52 19.2-43.52 43.52c0 17.92-14.08 32-32 32s-32-14.08-32-32c0-59.52 48-107.52 107.52-107.52s107.52 48 107.52 107.52c0 17.28-14.08 32-32 32z"
+		fill="#a6adbb"
+		p-id="4257"
+	/></svg
+>
diff --git a/GraphRAG/ui/svelte/src/lib/assets/upload/loading-button.svelte b/GraphRAG/ui/svelte/src/lib/assets/upload/loading-button.svelte
new file mode 100644
index 0000000000..6310d81f6c
--- /dev/null
+++ b/GraphRAG/ui/svelte/src/lib/assets/upload/loading-button.svelte
@@ -0,0 +1,25 @@
+<!--
+  Copyright (C) 2024 Intel Corporation
+  SPDX-License-Identifier: Apache-2.0
+-->
+
+<svg
+  class="animate-spin -ml-1 mr-3 h-5 w-5 text-gray-500"
+  xmlns="http://www.w3.org/2000/svg"
+  fill="none"
+  viewBox="0 0 24 24"
+>
+  <circle
+    class="opacity-25"
+    cx="12"
+    cy="12"
+    r="10"
+    stroke="#0597ff"
+    stroke-width="4"
+  />
+  <path
+    class="opacity-75"
+    fill="#0597ff"
+    d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"
+  />
+</svg>
diff --git a/GraphRAG/ui/svelte/src/lib/assets/upload/next.svelte b/GraphRAG/ui/svelte/src/lib/assets/upload/next.svelte
new file mode 100644
index 0000000000..70f4fe25e8
--- /dev/null
+++ b/GraphRAG/ui/svelte/src/lib/assets/upload/next.svelte
@@ -0,0 +1,31 @@
+<!--
+  Copyright (c) 2024 Intel Corporation
+
+  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.
+-->
+
+<svg
+	class="h-4 w-4 text-white rtl:rotate-180 dark:text-white-800"
+	aria-hidden="true"
+	xmlns="http://www.w3.org/2000/svg"
+	fill="none"
+	viewBox="0 0 6 10"
+>
+	<path
+		stroke="currentColor"
+		stroke-linecap="round"
+		stroke-linejoin="round"
+		stroke-width="2"
+		d="m1 9 4-4-4-4"
+	/>
+</svg>
diff --git a/GraphRAG/ui/svelte/src/lib/assets/upload/no-file.svelte b/GraphRAG/ui/svelte/src/lib/assets/upload/no-file.svelte
new file mode 100644
index 0000000000..f89f7aafbb
--- /dev/null
+++ b/GraphRAG/ui/svelte/src/lib/assets/upload/no-file.svelte
@@ -0,0 +1,37 @@
+<!--
+  Copyright (C) 2024 Intel Corporation
+  SPDX-License-Identifier: Apache-2.0
+-->
+
+<svg
+	t="1697618332186"
+	class="w-16 h-16"
+	viewBox="0 0 1024 1024"
+	version="1.1"
+	xmlns="http://www.w3.org/2000/svg"
+	p-id="7984"
+	width="16"
+	height="16"
+	><path
+		d="M146.285714 146.285714a97.52381 97.52381 0 0 1 97.52381-97.523809h341.333333l292.571429 292.571428v536.380953a97.52381 97.52381 0 0 1-97.52381 97.523809H243.809524a97.52381 97.52381 0 0 1-97.52381-97.523809V146.285714z"
+		fill="#D1DDE5"
+		p-id="7985"
+	/><path
+		d="M585.142857 48.761905l292.571429 292.571428h-195.047619a97.52381 97.52381 0 0 1-97.52381-97.523809V48.761905z"
+		fill="#ABBBC7"
+		p-id="7986"
+	/><path
+		d="M73.142857 609.52381m48.761905 0l365.714286 0q48.761905 0 48.761904 48.761904l0 121.904762q0 48.761905-48.761904 48.761905l-365.714286 0q-48.761905 0-48.761905-48.761905l0-121.904762q0-48.761905 48.761905-48.761904Z"
+		fill="#ABBBC7"
+		p-id="7987"
+	/><path
+		d="M162.06019 674.133333v34.572191h51.321905v22.186666H162.06019v55.637334H136.533333v-134.582857h85.430857v22.186666H162.06019zM238.640762 651.946667h25.502476v134.582857H238.665143v-134.582857zM288.353524 651.946667h25.502476v112.39619h58.953143v22.186667h-84.455619v-134.582857zM414.427429 674.133333v33.426286h51.151238v22.186667h-51.151238v34.57219h59.928381v22.186667h-85.430858V651.946667h85.430858v22.186666h-59.904z"
+		fill="#FFFFFF"
+		p-id="7988"
+	/><path
+		d="M329.142857 231.619048m-60.952381 0a60.952381 60.952381 0 1 0 121.904762 0 60.952381 60.952381 0 1 0-121.904762 0Z"
+		fill="#FFFFFF"
+		opacity=".6"
+		p-id="7989"
+	/></svg
+>
diff --git a/GraphRAG/ui/svelte/src/lib/assets/upload/previous.svelte b/GraphRAG/ui/svelte/src/lib/assets/upload/previous.svelte
new file mode 100644
index 0000000000..c47d9c49da
--- /dev/null
+++ b/GraphRAG/ui/svelte/src/lib/assets/upload/previous.svelte
@@ -0,0 +1,31 @@
+<!--
+  Copyright (c) 2024 Intel Corporation
+
+  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.
+-->
+
+<svg
+	class="h-4 w-4 text-white rtl:rotate-180 dark:text-white-800"
+	aria-hidden="true"
+	xmlns="http://www.w3.org/2000/svg"
+	fill="none"
+	viewBox="0 0 6 10"
+>
+	<path
+		stroke="currentColor"
+		stroke-linecap="round"
+		stroke-linejoin="round"
+		stroke-width="2"
+		d="M5 1 1 5l4 4"
+	/>
+</svg>
diff --git a/GraphRAG/ui/svelte/src/lib/assets/voice/svg/paste.svg b/GraphRAG/ui/svelte/src/lib/assets/voice/svg/paste.svg
new file mode 100644
index 0000000000..9fe89acc1f
--- /dev/null
+++ b/GraphRAG/ui/svelte/src/lib/assets/voice/svg/paste.svg
@@ -0,0 +1 @@
+<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1699596229588" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="20460" xmlns:xlink="http://www.w3.org/1999/xlink" width="32" height="32"><path d="M576 128a96 96 0 0 1 96 96v128h-224a96 96 0 0 0-95.84 90.368L352 448v224H224a96 96 0 0 1-96-96V224a96 96 0 0 1 96-96h352z" fill="#CCD9FF" p-id="20461"></path><path d="M576 96a128 128 0 0 1 128 128v128h-64V224a64 64 0 0 0-59.2-63.84L576 160H224a64 64 0 0 0-64 64v352a64 64 0 0 0 64 64h128v64H224a128 128 0 0 1-128-128V224a128 128 0 0 1 128-128z" fill="#3671FD" p-id="20462"></path><path d="M800 320H448a128 128 0 0 0-128 128v352a128 128 0 0 0 128 128h352a128 128 0 0 0 128-128V448a128 128 0 0 0-128-128z m-352 64h352a64 64 0 0 1 64 64v352a64 64 0 0 1-64 64H448a64 64 0 0 1-64-64V448a64 64 0 0 1 64-64z" fill="#3671FD" p-id="20463"></path><path d="M128 736a32 32 0 0 1 32 32 96 96 0 0 0 90.368 95.84L256 864a32 32 0 0 1 0 64 160 160 0 0 1-160-160 32 32 0 0 1 32-32z" fill="#FE9C23" p-id="20464"></path></svg>
\ No newline at end of file
diff --git a/GraphRAG/ui/svelte/src/lib/assets/voice/svg/uploadFile.svg b/GraphRAG/ui/svelte/src/lib/assets/voice/svg/uploadFile.svg
new file mode 100644
index 0000000000..362a6994eb
--- /dev/null
+++ b/GraphRAG/ui/svelte/src/lib/assets/voice/svg/uploadFile.svg
@@ -0,0 +1 @@
+<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg height="480" node-id="1" sillyvg="true" template-height="480" template-width="480" version="1.1" viewBox="0 0 480 480" width="480" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><defs node-id="21"><linearGradient gradientUnits="objectBoundingBox" id="linearGradient-1" node-id="7" spreadMethod="pad" x1="0.5" x2="0.5" y1="1" y2="0.054371078"><stop offset="0" stop-color="#eeeeee" stop-opacity="0.19006774"></stop><stop offset="1" stop-color="#ffffff"></stop></linearGradient></defs><g node-id="28"><g node-id="29"><g node-id="30"><path d="M 251.86 431.42 L 258.68 432.65 L 265.55 433.47 L 272.49 433.88 L 279.51 433.89 L 286.61 433.48 L 295.40 432.44 L 304.22 430.82 L 313.07 428.63 L 321.98 425.84 L 330.68 422.57 L 339.31 418.79 L 347.87 414.49 L 356.38 409.64 L 364.61 404.41 L 372.65 398.73 L 380.52 392.60 L 388.22 386.00 L 395.58 379.08 L 402.65 371.78 L 409.42 364.11 L 415.91 356.04 L 422.00 347.70 L 427.69 339.07 L 432.97 330.13 L 437.86 320.89 L 442.27 311.42 L 446.18 301.74 L 449.58 291.82 L 452.49 281.66 L 454.82 271.38 L 456.55 260.93 L 457.68 250.31 L 458.20 239.48 L 457.28 227.35 L 455.75 215.45 L 453.62 203.78 L 450.88 192.31 L 447.53 180.97 L 443.63 169.93 L 439.19 159.19 L 434.19 148.71 L 428.65 138.50 L 422.61 128.66 L 416.08 119.18 L 409.05 110.05 L 401.55 101.30 L 393.60 93.00 L 385.22 85.13 L 376.37 77.69 L 369.02 72.09 L 361.42 66.83 L 353.56 61.89 L 345.44 57.28 L 337.05 52.98 L 328.52 49.10 L 319.76 45.58 L 310.76 42.44 L 301.51 39.68 L 292.00 37.30 L 282.49 35.38 L 272.76 33.88 L 262.80 32.81 L 252.60 32.18 L 242.14 32.01 L 233.00 32.31 L 224.10 33.02 L 215.42 34.14 L 206.95 35.65 L 198.68 37.56 L 188.40 40.51 L 178.46 43.97 L 168.83 47.95 L 159.49 52.45 L 150.38 57.45 L 141.60 62.86 L 133.13 68.68 L 124.96 74.91 L 117.08 81.54 L 109.55 88.45 L 102.35 95.67 L 95.48 103.20 L 88.92 111.02 L 82.73 119.02 L 76.90 127.20 L 71.44 135.56 L 66.28 144.15 L 61.53 152.80 L 57.18 161.48 L 53.22 170.23 L 49.58 179.17 L 46.37 188.02 L 43.58 196.78 L 41.21 205.45 L 39.19 214.31 L 37.63 222.92 L 36.50 231.31 L 35.80 239.48 L 35.54 248.08 L 35.77 256.51 L 36.49 264.80 L 37.69 272.96 L 39.36 281.00 L 41.50 288.96 L 44.07 296.77 L 47.07 304.44 L 50.51 311.98 L 54.39 319.40 L 58.62 326.58 L 63.24 333.59 L 68.24 340.45 L 73.64 347.16 L 79.45 353.72 L 87.06 361.49 L 95.20 368.97 L 103.89 376.15 L 113.15 383.03 L 122.68 389.41 L 132.66 395.43 L 143.12 401.09 L 154.06 406.38 L 165.17 411.14 L 176.65 415.48 L 188.51 419.37 L 200.77 422.82 L 213.11 425.73 L 225.72 428.14 L 238.63 430.04 L 251.86 431.42 Z" fill="#909efc" fill-opacity="0.2" fill-rule="evenodd" group-id="1,2,3" id="1" node-id="13" stroke="none" target-height="401.88" target-width="422.66" target-x="35.54" target-y="32.01"></path></g><g node-id="31"><path d="M 214.12 447.32 L 223.10 447.45 L 231.95 447.13 L 240.68 446.36 L 249.31 445.14 L 257.84 443.47 L 268.40 440.80 L 278.71 437.54 L 288.78 433.71 L 298.63 429.28 L 308.23 424.32 L 317.49 418.90 L 326.42 413.03 L 335.04 406.68 L 343.34 399.90 L 351.20 392.80 L 358.63 385.37 L 365.64 377.61 L 372.28 369.48 L 378.37 361.17 L 383.94 352.68 L 389.00 344.00 L 393.60 335.00 L 397.56 325.98 L 400.92 316.91 L 403.68 307.78 L 405.47 300.31 L 406.82 292.89 L 407.72 285.53 L 408.19 278.20 L 408.24 270.90 L 406.91 259.68 L 405.17 248.72 L 403.02 238.03 L 400.48 227.58 L 397.53 217.37 L 394.12 207.20 L 390.35 197.37 L 386.23 187.87 L 381.74 178.69 L 376.91 169.81 L 371.62 161.10 L 366.01 152.79 L 360.10 144.89 L 353.86 137.36 L 347.31 130.21 L 340.35 123.37 L 333.12 117.00 L 325.60 111.09 L 317.79 105.61 L 309.68 100.56 L 301.30 96.00 L 292.65 91.96 L 283.73 88.42 L 274.51 85.39 L 264.97 82.86 L 255.40 80.94 L 245.56 79.59 L 235.41 78.82 L 224.94 78.65 L 214.12 79.10 L 202.62 80.21 L 191.38 81.84 L 180.38 83.97 L 169.61 86.59 L 158.93 89.74 L 148.57 93.32 L 138.51 97.32 L 128.75 101.76 L 119.17 106.67 L 109.98 111.93 L 101.16 117.55 L 92.71 123.53 L 84.52 129.94 L 76.79 136.63 L 69.50 143.60 L 62.65 150.85 L 56.15 158.49 L 50.18 166.33 L 44.71 174.38 L 39.73 182.66 L 35.23 191.24 L 31.30 199.96 L 27.94 208.84 L 25.13 217.90 L 22.90 227.12 L 21.31 236.45 L 20.34 245.91 L 20.00 255.51 L 20.50 262.17 L 21.47 269.08 L 22.94 276.28 L 24.92 283.79 L 27.26 291.07 L 30.04 298.51 L 33.28 306.13 L 37.00 313.92 L 42.41 324.00 L 48.54 334.14 L 55.42 344.37 L 62.78 354.27 L 70.76 364.00 L 79.37 373.60 L 88.42 382.78 L 97.97 391.59 L 108.03 400.05 L 115.85 406.06 L 123.87 411.75 L 132.12 417.12 L 140.59 422.18 L 149.26 426.88 L 158.09 431.15 L 167.07 435.01 L 176.22 438.45 L 185.53 441.44 L 194.94 443.91 L 204.46 445.87 L 214.12 447.32 Z" fill="#909efc" fill-opacity="0.3" fill-rule="evenodd" group-id="1,2,4" id="2" node-id="14" stroke="none" target-height="368.80002" target-width="388.24" target-x="20" target-y="78.65"></path></g><g node-id="32"><path d="M 227.92 410.45 L 238.47 411.99 L 248.68 412.98 L 258.56 413.44 L 268.15 413.39 L 277.45 412.85 L 286.89 411.80 L 296.00 410.31 L 304.80 408.38 L 313.32 406.03 L 321.57 403.27 L 329.74 400.03 L 337.61 396.44 L 345.17 392.49 L 352.45 388.19 L 359.45 383.53 L 366.24 378.48 L 372.71 373.16 L 378.87 367.55 L 384.72 361.64 L 390.29 355.43 L 396.81 347.30 L 402.81 338.83 L 408.29 330.01 L 413.27 320.81 L 417.69 311.34 L 421.55 301.64 L 424.84 291.68 L 427.57 281.46 L 429.70 271.11 L 431.21 260.63 L 432.11 250.00 L 432.39 239.20 L 432.71 232.07 L 432.60 224.95 L 432.06 217.81 L 431.09 210.65 L 429.67 203.45 L 427.37 194.63 L 424.48 185.84 L 420.99 177.08 L 416.89 168.32 L 412.34 159.85 L 407.28 151.50 L 401.72 143.27 L 395.62 135.14 L 389.18 127.33 L 382.34 119.75 L 375.08 112.38 L 367.41 105.23 L 359.45 98.42 L 351.21 91.93 L 342.66 85.77 L 333.81 79.93 L 324.72 74.46 L 315.46 69.41 L 306.02 64.79 L 296.39 60.57 L 286.56 56.79 L 276.68 53.53 L 266.73 50.76 L 256.70 48.50 L 246.55 46.76 L 236.44 45.60 L 226.37 45.03 L 216.31 45.03 L 204.95 45.35 L 194.05 46.20 L 183.58 47.57 L 173.50 49.44 L 163.81 51.80 L 154.08 54.73 L 144.78 58.08 L 135.89 61.84 L 127.37 66.01 L 119.22 70.58 L 111.25 75.64 L 103.69 81.03 L 96.52 86.73 L 89.74 92.75 L 83.33 99.11 L 77.23 105.84 L 71.55 112.79 L 66.27 119.99 L 61.39 127.43 L 56.90 135.12 L 52.81 143.05 L 49.14 151.13 L 45.91 159.36 L 43.10 167.76 L 40.71 176.34 L 38.77 185.02 L 37.28 193.76 L 36.25 202.58 L 35.67 211.49 L 35.54 220.50 L 36.72 228.95 L 38.50 239.23 L 40.78 249.96 L 43.91 262.03 L 46.36 270.12 L 49.28 278.58 L 52.69 287.41 L 56.47 296.08 L 60.82 304.90 L 65.77 313.89 L 71.17 322.60 L 77.26 331.29 L 84.07 339.96 L 89.48 346.17 L 95.34 352.26 L 101.68 358.26 L 108.51 364.15 L 115.54 369.63 L 123.12 374.93 L 131.27 380.04 L 140.02 384.95 L 148.87 389.35 L 158.37 393.48 L 168.58 397.33 L 179.52 400.88 L 190.39 403.86 L 202.05 406.46 L 214.55 408.66 L 227.92 410.45 Z" fill="#909efc" fill-opacity="0.4" fill-rule="evenodd" group-id="1,2,5" id="3" node-id="15" stroke="none" target-height="368.41" target-width="397.16998" target-x="35.54" target-y="45.03"></path></g><g node-id="33"><path d="M 213.18 406.50 L 224.92 408.67 L 236.29 410.39 L 247.31 411.67 L 257.99 412.52 L 268.84 412.93 L 279.24 412.81 L 289.23 412.18 L 298.83 411.05 L 306.54 409.72 L 313.96 408.00 L 321.10 405.90 L 327.97 403.44 L 334.59 400.60 L 341.03 397.32 L 347.20 393.61 L 353.11 389.43 L 358.77 384.80 L 364.20 379.68 L 369.15 374.28 L 373.87 368.33 L 378.34 361.79 L 382.57 354.63 L 386.55 346.80 L 389.91 339.05 L 393.01 330.60 L 395.83 321.39 L 398.35 311.36 L 400.56 300.48 L 402.19 290.05 L 403.50 278.76 L 404.44 266.57 L 405.00 253.41 L 405.13 239.22 L 402.23 226.31 L 398.92 214.24 L 395.23 202.95 L 391.16 192.41 L 386.48 181.91 L 381.51 172.13 L 376.25 163.01 L 370.71 154.53 L 364.64 146.27 L 358.37 138.61 L 351.89 131.52 L 345.21 124.98 L 338.13 118.76 L 330.92 113.06 L 323.59 107.86 L 316.13 103.14 L 308.39 98.78 L 300.61 94.87 L 292.79 91.41 L 284.92 88.38 L 276.86 85.71 L 268.87 83.45 L 260.92 81.58 L 253.02 80.10 L 242.36 78.66 L 231.99 77.86 L 221.88 77.67 L 208.81 78.44 L 196.53 79.62 L 185.01 81.18 L 174.21 83.10 L 164.08 85.36 L 153.69 88.18 L 143.96 91.32 L 134.87 94.75 L 126.37 98.48 L 118.44 102.48 L 110.54 107.03 L 103.17 111.83 L 96.31 116.88 L 89.93 122.18 L 84.02 127.73 L 78.37 133.68 L 73.15 139.86 L 68.33 146.27 L 63.91 152.91 L 59.87 159.80 L 55.36 168.70 L 51.39 177.92 L 47.95 187.48 L 45.06 197.40 L 42.73 207.42 L 40.88 217.72 L 39.51 228.31 L 38.63 239.22 L 39.87 245.65 L 41.59 252.78 L 43.84 260.67 L 46.42 268.42 L 49.53 276.63 L 53.21 285.33 L 57.24 293.84 L 61.83 302.57 L 67.03 311.51 L 72.61 320.21 L 78.79 328.88 L 85.59 337.54 L 92.82 345.83 L 100.68 353.90 L 109.20 361.73 L 115.85 367.26 L 122.88 372.55 L 130.30 377.60 L 138.13 382.41 L 146.12 386.79 L 154.54 390.84 L 163.38 394.54 L 172.70 397.89 L 182.07 400.72 L 191.92 403.10 L 202.28 405.04 L 213.18 406.50 Z" fill="#909efc" fill-opacity="0.4" fill-rule="evenodd" group-id="1,2,6" id="4" node-id="16" stroke="none" target-height="335.26" target-width="366.5" target-x="38.63" target-y="77.67"></path></g><path d="M 215.43 367.61 L 228.38 365.58 L 240.79 363.09 L 252.69 360.15 L 264.10 356.78 L 275.47 352.85 L 286.26 348.54 L 296.50 343.88 L 306.21 338.86 L 315.75 333.30 L 324.68 327.46 L 333.02 321.34 L 340.80 314.94 L 348.27 308.04 L 355.10 300.94 L 361.31 293.63 L 366.93 286.11 L 371.11 279.78 L 374.85 273.36 L 378.18 266.84 L 381.11 260.21 L 383.65 253.47 L 385.78 246.57 L 387.48 239.59 L 388.75 232.53 L 389.59 225.38 L 389.99 218.11 L 390.99 207.41 L 391.38 197.25 L 391.20 187.58 L 390.47 178.38 L 389.22 169.61 L 387.37 160.72 L 385.03 152.29 L 382.23 144.28 L 378.97 136.68 L 375.25 129.45 L 370.99 122.43 L 366.33 115.79 L 361.27 109.53 L 355.78 103.62 L 349.86 98.06 L 343.61 92.91 L 337.01 88.12 L 330.03 83.68 L 322.65 79.60 L 314.86 75.87 L 306.97 72.62 L 298.77 69.73 L 290.22 67.21 L 281.32 65.07 L 272.04 63.32 L 262.85 62.02 L 253.38 61.11 L 243.63 60.60 L 233.57 60.51 L 223.20 60.84 L 211.53 63.82 L 200.46 67.12 L 189.97 70.74 L 180.02 74.66 L 170.60 78.87 L 161.68 83.38 L 152.72 88.45 L 144.27 93.80 L 136.32 99.43 L 128.83 105.32 L 121.80 111.50 L 115.20 117.95 L 108.89 124.82 L 103.01 131.95 L 97.56 139.36 L 92.51 147.04 L 87.86 155.01 L 83.62 163.28 L 79.84 171.70 L 76.44 180.38 L 73.43 189.35 L 70.81 198.62 L 68.58 208.20 L 66.75 218.11 L 66.59 242.02 L 66.69 254.60 L 67.16 267.49 L 67.76 276.10 L 68.68 284.62 L 69.93 293.06 L 71.60 301.41 L 73.75 309.48 L 76.38 317.28 L 78.74 322.99 L 81.46 328.46 L 84.54 333.70 L 87.99 338.72 L 91.81 343.43 L 96.10 347.86 L 100.90 352.02 L 106.23 355.92 L 111.77 359.29 L 117.97 362.34 L 124.88 365.06 L 132.56 367.43 L 140.16 369.19 L 148.63 370.53 L 158.03 371.42 L 168.47 371.81 L 178.53 371.66 L 189.65 370.95 L 201.92 369.62 L 215.43 367.61 Z" fill="#909efc" fill-opacity="0.6" fill-rule="evenodd" group-id="1,2,7" id="5" node-id="17" stroke="none" target-height="311.3" target-width="324.79" target-x="66.59" target-y="60.51"></path></g><path d="M 193.00 208.00 L 281.00 208.00 L 281.00 291.00 L 193.00 291.00 Z" fill="url(#linearGradient-1)" fill-rule="evenodd" group-id="1" id="矩形" node-id="18" stroke="none" target-height="83" target-width="88" target-x="193" target-y="208"></path><path d="M 204.34 187.40 L 205.82 184.30 L 207.42 181.42 L 209.93 177.40 L 212.87 173.22 L 216.68 168.52 L 221.00 163.96 L 226.13 159.47 L 229.84 156.76 L 233.89 154.30 L 238.30 152.10 L 242.89 150.34 L 247.86 149.04 L 253.23 148.21 L 257.26 147.99 L 261.54 148.14 L 266.10 148.68 L 270.96 149.65 L 275.71 151.04 L 280.04 152.70 L 283.99 154.61 L 287.59 156.76 L 292.14 160.10 L 296.15 163.69 L 299.67 167.56 L 302.85 171.73 L 305.60 175.97 L 307.94 180.29 L 310.91 186.93 L 313.11 193.22 L 314.81 199.39 L 315.91 204.60 L 316.69 209.44 L 317.06 212.71 L 317.29 215.80 L 320.19 216.75 L 323.18 217.90 L 327.40 219.80 L 331.79 222.15 L 336.64 225.29 L 339.75 227.69 L 342.75 230.44 L 345.64 233.56 L 348.18 236.94 L 350.35 240.71 L 352.13 244.92 L 353.09 248.17 L 353.71 251.69 L 353.97 255.53 L 353.85 259.71 L 353.08 265.18 L 351.88 270.02 L 350.29 274.31 L 348.26 278.41 L 346.02 282.02 L 343.58 285.18 L 340.85 288.13 L 338.12 290.66 L 335.39 292.82 L 331.16 295.64 L 327.45 297.68 L 323.90 299.30 L 321.43 300.25 L 319.05 301.00 L 319.05 301.00 L 251.99 301.00 L 251.99 301.00 L 263.46 301.00 L 263.46 290.63 L 251.99 290.63 L 251.99 260.46 L 268.27 260.46 L 268.27 260.39 L 268.34 260.43 L 269.03 260.29 L 269.57 259.91 L 269.94 259.36 L 270.08 258.68 L 269.82 257.84 L 269.82 257.84 L 269.92 257.84 L 269.63 257.54 L 269.48 257.40 L 269.48 257.40 L 239.43 225.61 L 238.65 224.96 L 237.66 224.72 L 236.69 224.94 L 235.94 225.52 L 235.94 225.52 L 205.66 257.57 L 205.17 258.11 L 204.98 258.82 L 205.11 259.44 L 205.43 259.93 L 205.91 260.25 L 206.51 260.38 L 206.51 260.38 L 206.51 260.45 L 223.60 260.45 L 223.60 290.63 L 211.72 290.63 L 211.72 300.98 L 149.72 300.98 L 147.36 300.29 L 141.43 298.02 L 137.76 296.26 L 133.63 293.89 L 129.60 291.08 L 125.67 287.63 L 123.28 285.04 L 121.15 282.15 L 119.25 278.95 L 117.77 275.54 L 116.71 271.77 L 116.09 267.57 L 116.03 263.33 L 116.60 258.57 L 117.89 253.21 L 118.25 252.08 L 120.57 245.82 L 122.94 240.56 L 125.36 236.19 L 128.13 232.00 L 130.82 228.57 L 133.44 225.80 L 136.31 223.27 L 138.99 221.28 L 141.49 219.76 L 145.33 217.95 L 148.49 216.90 L 151.46 216.26 L 153.44 216.03 L 155.31 216.01 L 154.82 213.95 L 154.48 211.78 L 154.26 208.66 L 154.37 205.32 L 155.00 201.50 L 155.74 198.98 L 156.87 196.42 L 158.41 193.81 L 160.28 191.44 L 162.73 189.15 L 165.85 186.93 L 170.12 184.73 L 174.13 183.25 L 177.93 182.41 L 181.82 182.04 L 185.38 182.08 L 188.64 182.49 L 193.30 183.66 L 196.92 185.10 L 200.02 186.82 L 201.70 188.13 L 202.29 188.24 L 203.46 188.19 L 203.98 187.92 L 204.34 187.40 Z" fill="#ffffff" fill-rule="nonzero" group-id="1" id="形状结合" node-id="19" stroke="none" target-height="153.01" target-width="237.94" target-x="116.03" target-y="147.99"></path></g></svg>
\ No newline at end of file
diff --git a/GraphRAG/ui/svelte/src/lib/modules/chat/ChatMessage.svelte b/GraphRAG/ui/svelte/src/lib/modules/chat/ChatMessage.svelte
new file mode 100644
index 0000000000..b136997083
--- /dev/null
+++ b/GraphRAG/ui/svelte/src/lib/modules/chat/ChatMessage.svelte
@@ -0,0 +1,70 @@
+<!--
+  Copyright (c) 2024 Intel Corporation
+
+  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.
+-->
+
+<script lang="ts">
+	import MessageAvatar from "$lib/modules/chat/MessageAvatar.svelte";
+	import type { Message } from "$lib/shared/constant/Interface";
+	import MessageTimer from "./MessageTimer.svelte";
+	import { createEventDispatcher } from "svelte";
+
+	let dispatch = createEventDispatcher();
+
+	export let msg: Message;
+	export let time: string = "";
+</script>
+
+<div
+	class={msg.role === 0
+		? "flex w-full gap-3"
+		: "flex w-full items-center gap-3"}
+	data-testid={msg.role === 0
+		? "display-answer"
+		: "display-question"}
+>
+	<div
+		class={msg.role === 0
+			? "flex aspect-square w-[3px]  items-center justify-center rounded bg-[#0597ff] max-sm:hidden"
+			: "flex aspect-square h-10 w-[3px] items-center justify-center rounded bg-[#000] max-sm:hidden"}
+	>
+		<MessageAvatar role={msg.role} />
+	</div>
+	<div class="group relative items-center">
+		<div>
+			<p
+				class=" max-w-[60vw] items-center whitespace-pre-line break-keep text-[0.8rem] leading-5 sm:max-w-[60rem]"
+			>
+				{@html msg.content}
+			</p>
+		</div>
+	</div>
+</div>
+{#if time}
+	<div>
+		<MessageTimer
+			{time}
+			on:handleTop={() => {
+				dispatch("scrollTop");
+			}}
+		/>
+	</div>
+{/if}
+
+<style>
+	.wrap-style {
+		word-wrap: break-word;
+		word-break: break-all;
+	}
+</style>
diff --git a/GraphRAG/ui/svelte/src/lib/modules/chat/MessageAvatar.svelte b/GraphRAG/ui/svelte/src/lib/modules/chat/MessageAvatar.svelte
new file mode 100644
index 0000000000..0f6a24b96d
--- /dev/null
+++ b/GraphRAG/ui/svelte/src/lib/modules/chat/MessageAvatar.svelte
@@ -0,0 +1,30 @@
+<!--
+  Copyright (c) 2024 Intel Corporation
+
+  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.
+-->
+
+<script lang="ts">
+	import AssistantIcon from "$lib/assets/chat/svelte/Assistant.svelte";
+	import PersonOutlined from "$lib/assets/chat/svelte/PersonOutlined.svelte";
+	import { MessageRole } from "$lib/shared/constant/Interface";
+	export let role: MessageRole;
+
+
+</script>
+
+{#if role === MessageRole.User}
+	<PersonOutlined />
+{:else}
+	<AssistantIcon />
+{/if}
diff --git a/GraphRAG/ui/svelte/src/lib/modules/chat/MessageTimer.svelte b/GraphRAG/ui/svelte/src/lib/modules/chat/MessageTimer.svelte
new file mode 100644
index 0000000000..0f441226db
--- /dev/null
+++ b/GraphRAG/ui/svelte/src/lib/modules/chat/MessageTimer.svelte
@@ -0,0 +1,67 @@
+<!--
+  Copyright (c) 2024 Intel Corporation
+
+  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.
+-->
+
+<script lang="ts">
+	export let time: string;
+	import { createEventDispatcher } from "svelte";
+
+	let dispatch = createEventDispatcher();
+</script>
+
+<div class="ml-2 flex flex-col">
+	<div class="my-4 flex items-center justify-end gap-2 space-x-2">
+		<div class="ml-2 w-min cursor-pointer" data-state="closed">
+			<!-- svelte-ignore a11y-click-events-have-key-events -->
+			<svg
+				xmlns="http://www.w3.org/2000/svg"
+				xml:space="preserve"
+				viewBox="0 0 21.6 21.6"
+				width="24"
+				height="24"
+				class="w-5 fill-[#0597ff] hover:fill-[#0597ff]"
+				on:click={() => {
+					dispatch("handleTop");
+				}}
+				><path
+					d="M2.2 3.6V.8h17.2v2.8zm7.2 17.2V10.4L5.8 14l-1.9-1.9 6.9-6.9 6.9 6.9-1.9 1.9-3.6-3.6v10.4z"
+				/></svg
+			>
+		</div>
+		<div
+			class="inline-block w-0.5 self-stretch bg-gray-300 opacity-100 dark:opacity-50"
+		/>
+		<div class="w-min cursor-pointer" data-state="closed">
+			<svg
+				xmlns="http://www.w3.org/2000/svg"
+				xml:space="preserve"
+				viewBox="0 0 21.6 21.6"
+				width="24"
+				height="24"
+				class="w-5 fill-[#0597ff] hover:fill-[#0597ff]"
+				><path d="M12.3 17.1V7.6H7.6v2.8h1.9v6.7H6.4v2.7h8.8v-2.7z" /><circle
+					cx="10.8"
+					cy="3.6"
+					r="1.9"
+				/></svg
+			>
+		</div>
+		<div class="flex items-center space-x-1 text-base text-gray-800"  data-testid='msg-time'>
+			<strong>End to End Time: </strong>
+			<p>{time}s</p>
+		</div>
+	</div>
+	<div class="ml-2 flex flex-col" />
+</div>
diff --git a/GraphRAG/ui/svelte/src/lib/modules/frame/Layout.svelte b/GraphRAG/ui/svelte/src/lib/modules/frame/Layout.svelte
new file mode 100644
index 0000000000..0c5b997d28
--- /dev/null
+++ b/GraphRAG/ui/svelte/src/lib/modules/frame/Layout.svelte
@@ -0,0 +1,48 @@
+<!--
+  Copyright (c) 2024 Intel Corporation
+
+  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.
+-->
+
+<script lang="ts">
+	import { onMount } from "svelte";
+	import { page } from "$app/stores";
+	import { browser } from "$app/environment";
+	import { open } from "$lib/shared/stores/common/Store";
+	import Scrollbar from "$lib/shared/components/scrollbar/Scrollbar.svelte";
+
+	let root: HTMLElement
+	onMount(() => {
+		document.getElementsByTagName("body").item(0)!.removeAttribute("tabindex");
+		// root.style.height = document.documentElement.clientHeight + 'px'
+	});
+
+	if (browser) {
+		page.subscribe(() => {
+			// close side navigation when route changes
+			if (window.innerWidth > 768) {
+				$open = true;
+			}
+		});
+	}
+</script>
+
+<div bind:this={root} class='h-full overflow-hidden relative'>
+	<div class="h-full flex items-start">
+		<div class='relative flex flex-col h-full pl-0 w-full  bg-white'>
+			<Scrollbar className="h-0 grow " classLayout="h-full" alwaysVisible={false}>
+				<slot />
+			</Scrollbar>
+		</div>
+	</div>
+</div>
diff --git a/GraphRAG/ui/svelte/src/lib/network/chat/Network.ts b/GraphRAG/ui/svelte/src/lib/network/chat/Network.ts
new file mode 100644
index 0000000000..64ce8e8f79
--- /dev/null
+++ b/GraphRAG/ui/svelte/src/lib/network/chat/Network.ts
@@ -0,0 +1,35 @@
+// Copyright (c) 2024 Intel Corporation
+//
+// 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 { env } from "$env/dynamic/public";
+import { SSE } from "sse.js";
+
+const CHAT_BASE_URL = env.CHAT_BASE_URL;
+
+export async function fetchTextStream(query: string) {
+	let payload = {};
+	let url = "";
+
+	payload = {
+		model: "Intel/neural-chat-7b-v3-3",
+		messages: query,
+	};
+	url = `${CHAT_BASE_URL}`;
+	console.log("fetchTextStream", url);
+
+	return new SSE(url, {
+		headers: { "Content-Type": "application/json" },
+		payload: JSON.stringify(payload),
+	});
+}
diff --git a/GraphRAG/ui/svelte/src/lib/network/upload/Network.ts b/GraphRAG/ui/svelte/src/lib/network/upload/Network.ts
new file mode 100644
index 0000000000..a9c76462a5
--- /dev/null
+++ b/GraphRAG/ui/svelte/src/lib/network/upload/Network.ts
@@ -0,0 +1,82 @@
+// Copyright (c) 2024 Intel Corporation
+//
+// 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 { env } from "$env/dynamic/public";
+
+const UPLOAD_FILE_BASE_URL = env.UPLOAD_FILE_BASE_URL;
+const GET_FILE = env.GET_FILE;
+const DELETE_FILE = env.DELETE_FILE;
+
+async function fetchFunc(url, init) {
+	try {
+		const response = await fetch(url, init);
+		if (!response.ok) throw response.status;
+
+		return await response.json();
+	} catch (error) {
+		console.error("network error: ", error);
+
+		return undefined;
+	}
+}
+
+export async function fetchKnowledgeBaseId(file: Blob, fileName: string) {
+	const url = `${UPLOAD_FILE_BASE_URL}`;
+	const formData = new FormData();
+	formData.append("files", file, fileName);
+	const init: RequestInit = {
+		method: "POST",
+		body: formData,
+	};
+
+	return fetchFunc(url, init);
+}
+
+export async function fetchKnowledgeBaseIdByPaste(pasteUrlList: any) {
+	const url = `${UPLOAD_FILE_BASE_URL}`;
+	const formData = new FormData();
+	formData.append("link_list", JSON.stringify(pasteUrlList));
+	const init: RequestInit = {
+		method: "POST",
+		body: formData,
+	};
+
+	return fetchFunc(url, init);
+}
+
+export async function fetchAllFile() {
+	const url = `${GET_FILE}`;
+	const init: RequestInit = {
+		method: "POST",
+		headers: { "Content-Type": "application/json" },
+	};
+
+	return fetchFunc(url, init);
+}
+
+export async function deleteFiles(path) {
+	const UploadKnowledge_URL = DELETE_FILE;
+
+	const data = {
+		file_path: path,
+	};
+
+	const init: RequestInit = {
+		method: "POST",
+		headers: { "Content-Type": "application/json" },
+		body: JSON.stringify(data),
+	};
+
+	return fetchFunc(UploadKnowledge_URL, init);
+}
diff --git a/GraphRAG/ui/svelte/src/lib/shared/Utils.ts b/GraphRAG/ui/svelte/src/lib/shared/Utils.ts
new file mode 100644
index 0000000000..fb182cef67
--- /dev/null
+++ b/GraphRAG/ui/svelte/src/lib/shared/Utils.ts
@@ -0,0 +1,54 @@
+// Copyright (c) 2024 Intel Corporation
+//
+// 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.
+
+export function scrollToBottom(scrollToDiv: HTMLElement) {
+	if (scrollToDiv) {
+		setTimeout(
+			() =>
+				scrollToDiv.scroll({
+					behavior: "auto",
+					top: scrollToDiv.scrollHeight,
+				}),
+			100,
+		);
+	}
+}
+
+export function scrollToTop(scrollToDiv: HTMLElement) {
+	if (scrollToDiv) {
+		setTimeout(
+			() =>
+				scrollToDiv.scroll({
+					behavior: "auto",
+					top: 0,
+				}),
+			100,
+		);
+	}
+}
+
+export function getCurrentTimeStamp() {
+	return Math.floor(new Date().getTime());
+}
+
+export function fromTimeStampToTime(timeStamp: number) {
+	return new Date(timeStamp * 1000).toTimeString().slice(0, 8);
+}
+
+export function formatTime(seconds) {
+	const hours = String(Math.floor(seconds / 3600)).padStart(2, "0");
+	const minutes = String(Math.floor((seconds % 3600) / 60)).padStart(2, "0");
+	const remainingSeconds = String(seconds % 60).padStart(2, "0");
+	return `${hours}:${minutes}:${remainingSeconds}`;
+}
diff --git a/GraphRAG/ui/svelte/src/lib/shared/components/chat/gallery.svelte b/GraphRAG/ui/svelte/src/lib/shared/components/chat/gallery.svelte
new file mode 100644
index 0000000000..a89e857b6b
--- /dev/null
+++ b/GraphRAG/ui/svelte/src/lib/shared/components/chat/gallery.svelte
@@ -0,0 +1,156 @@
+<!--
+  Copyright (c) 2024 Intel Corporation
+
+  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.
+-->
+
+<script lang="ts">
+	import Scrollbar from "$lib/shared/components/scrollbar/Scrollbar.svelte";
+	import ChatMessage from "$lib/modules/chat/ChatMessage.svelte";
+	import "driver.js/dist/driver.css";
+	import "$lib/assets/layout/css/driver.css";
+	import Previous from "$lib/assets/upload/previous.svelte";
+	import Next from "$lib/assets/upload/next.svelte";
+	import { scrollToBottom } from "$lib/shared/Utils";
+	import { onMount } from "svelte";
+
+	let scrollToDiv: HTMLDivElement;
+
+	export let items;
+	export let label: string;
+	export let scrollName: string;
+
+	onMount(async () => {
+		scrollToDiv = document
+			.querySelector(scrollName)
+			?.querySelector(".svlr-viewport")!;
+		console.log(
+			"scrollToDiv",
+			scrollName,
+			document,
+			document.querySelector("chat-scrollbar1")
+		);
+	});
+	// gallery
+	let currentIndex = 0;
+
+	function nextItem() {
+		currentIndex = (currentIndex + 1) % items.length;
+		console.log("nextItem", currentIndex);
+	}
+
+	function prevItem() {
+		currentIndex = (currentIndex - 1 + items.length) % items.length;
+		console.log("prevItem", currentIndex);
+	}
+
+	$: currentItem = items[currentIndex];
+
+	$: {
+		if (items) {
+			scrollToBottom(scrollToDiv);
+		}
+	}
+	// gallery
+</script>
+
+<div
+	id="custom-controls-gallery"
+	class="relative mb-8 h-0 w-full w-full grow px-2 {scrollName}"
+	data-carousel="slide"
+>
+	<!-- Carousel wrapper -->
+	<!-- Display current item -->
+	{#if currentItem}
+		<Scrollbar
+			classLayout="flex flex-col gap-5"
+			className="  h-0 w-full grow px-2 mt-3 ml-10"
+		>
+			{#each currentItem.content as message, i}
+				<ChatMessage msg={message} />
+			{/each}
+		</Scrollbar>
+		<!-- Loading text -->
+	{/if}
+
+	<div class="radius absolute left-0 p-2">
+		<!-- Display end to end time -->
+		<label for="" class="mr-2 text-xs font-bold text-blue-700">{label} </label>
+	</div>
+	{#if currentItem.time !== "0s"}
+		<div class="radius absolute right-0 p-2">
+			<!-- Display end to end time -->
+			<label for="" class="mr-2 text-xs font-bold text-blue-700"
+				>End to End Time:
+			</label>
+			<label for="" class="text-xs">{currentItem.time}</label>
+		</div>
+	{/if}
+	<div class="flex items-center justify-between">
+		<div class="justify-left ml-2 flex items-center">
+			<!-- Previous button -->
+			<button
+				type="button"
+				class="group absolute start-0 top-0 z-30 flex h-full
+									cursor-pointer items-center justify-center
+									focus:outline-none"
+				on:click={prevItem}
+			>
+				<span
+					class="group-focus:ring-gray dark:group-hover:bg-[#000]-800/60 dark:group-focus:ring-[#000]-800/70 inline-flex h-7
+										 w-7 items-center justify-center
+										 rounded-full bg-[#000]/10
+										 group-hover:bg-[#000]/50 group-focus:bg-[#000]/50
+										 group-focus:outline-none
+										 group-focus:ring-4 dark:bg-gray-800/30"
+				>
+					<Previous />
+					<span class="sr-only">Previous</span>
+				</span>
+			</button>
+			<!-- Next button -->
+
+			<button
+				type="button"
+				class="group absolute end-0 top-0 z-30 flex h-full cursor-pointer items-center justify-center focus:outline-none"
+				on:click={nextItem}
+			>
+				<span
+					class="group-focus:ring-gray dark:group-hover:bg-[#000]-800/60 dark:group-focus:ring-[#000]-800/70 inline-flex h-7
+									w-7 items-center justify-center
+									rounded-full bg-[#000]/10
+									group-hover:bg-[#000]/50 group-focus:bg-[#000]/50
+									group-focus:outline-none
+									group-focus:ring-4 dark:bg-gray-800/30"
+				>
+					<Next />
+					<span class="sr-only">Next</span>
+				</span>
+			</button>
+		</div>
+	</div>
+</div>
+
+<style>
+	.row::-webkit-scrollbar {
+		display: none;
+	}
+
+	.row {
+		scrollbar-width: none;
+	}
+
+	.row {
+		-ms-overflow-style: none;
+	}
+</style>
diff --git a/GraphRAG/ui/svelte/src/lib/shared/components/doc_management/docCard.svelte b/GraphRAG/ui/svelte/src/lib/shared/components/doc_management/docCard.svelte
new file mode 100644
index 0000000000..451ee8e3ca
--- /dev/null
+++ b/GraphRAG/ui/svelte/src/lib/shared/components/doc_management/docCard.svelte
@@ -0,0 +1,150 @@
+<!--
+  Copyright (C) 2024 Intel Corporation
+  SPDX-License-Identifier: Apache-2.0
+-->
+
+<script lang="ts">
+	import FolderIcon from "$lib/assets/DocManagement/folderIcon.svelte";
+	import LinkfolderIcon from "$lib/assets/DocManagement/LinkfolderIcon.svelte";
+	import { Button, Modal } from "flowbite-svelte";
+	import SvelteTree from "$lib/shared/components/doc_management/treeView/svelte-tree.svelte";
+	import FileIcon from "$lib/assets/DocManagement/fileIcon.svelte";
+	import { createEventDispatcher } from "svelte";
+	import DeleteIcon from "$lib/assets/upload/deleteIcon.svelte";
+	import { deleteFiles } from "$lib/network/upload/Network";
+	import { storageFiles } from "$lib/shared/stores/common/Store";
+	import { getNotificationsContext } from "svelte-notifications";
+
+	const { addNotification } = getNotificationsContext();
+
+	let dispatch = createEventDispatcher();
+	let showDirectory = false;
+	let chooseDir = undefined;
+	let currentIdx = 0;
+	let deleteModal = false;
+	/**
+	 * @type {any}
+	 */
+	let currentFile;
+	/**
+	 * @type {number}
+	 */
+	let currentFileIdx;
+
+
+	export let files = [];
+
+	console.log("files", files);
+
+	function handleDirClick(file, index) {
+		chooseDir = file;
+		showDirectory = true;
+		currentIdx = index;
+		console.log("chooseDir", chooseDir);
+	}
+
+	async function deleteCurrentFolder() {
+
+		const res = await deleteFiles(currentFile);
+		// succeed
+		if (res.status) {
+			$storageFiles = $storageFiles.filter((_, index) => index !== currentFileIdx);
+			files = $storageFiles;
+			showNotification("Deleted successfully", "success");
+
+		} else {
+			showNotification("Deletion failed", "success");
+
+		}
+	}
+
+	function showNotification(text: string, type: string) {
+		addNotification({
+			text: text,
+			position: "top-left",
+			type: type,
+			removeAfter: 3000,
+		});
+	}
+
+	function deleteFileIdx(file, index) {
+		currentFile = file;
+		currentFileIdx = index;
+		deleteModal = true;
+
+	}
+</script>
+
+<Modal
+	bind:open={showDirectory}
+	size="xs"
+	autoclose={true}
+	class="z-50 w-full"
+	outsideclose
+>
+	<hr class="my-8 h-px border-0 bg-gray-200 dark:bg-gray-700" />
+	<SvelteTree data={chooseDir.children} {currentIdx} />
+</Modal>
+
+<Modal bind:open={deleteModal} size="xs" autoclose>
+	<div class="text-center">
+		<h3 class="mb-5 text-lg font-normal text-gray-500">Confirm file deletion?</h3>
+		<Button
+			color="red"
+			class="mr-2"
+			on:click={() => { deleteCurrentFolder() }}>Yes, I'm sure</Button
+		>
+		<Button color="alternative"
+			on:click={() => { deleteModal = false; }}
+		>No, cancel</Button>
+	</div>
+</Modal>
+
+<div class="grid max-h-[35rem] grid-cols-2 gap-5 overflow-auto mt-6">
+	{#each files as file, index}
+		<div
+			class="group relative flex w-full flex-col items-center justify-center p-2 px-12 text-center hover:bg-[#d9eeff] focus:bg-[#d9eeff]"
+		>
+			{#if file.type === "File"}
+				<div class="flex-shrink-0">
+					<FileIcon />
+				</div>
+				<p class="w-[6rem] truncate">
+					{file.name}
+				</p>
+			{:else if file.type === "Directory" && file.id === "uploaded_links"}
+				<button
+					class="flex flex-col items-center"
+					on:click={() => handleDirClick(file, index)}
+				>
+					<div class="flex-shrink-0">
+						<LinkfolderIcon />
+					</div>
+					<p class="truncate">
+						{file.name}
+					</p>
+				</button>
+			{:else}
+				<button
+					class="flex flex-col items-center"
+					on:click={() => handleDirClick(file, index)}
+				>
+					<div class="flex-shrink-0">
+						<FolderIcon />
+					</div>
+					<p class="truncate">
+						{file.name}
+					</p>
+				</button>
+			{/if}
+
+			<!-- svelte-ignore a11y-click-events-have-key-events -->
+			<div
+				class="absolute right-0 top-0 hidden group-hover:block"
+				on:click={() => { deleteFileIdx(file.id, index)  }}
+			>
+				<DeleteIcon />
+			</div>
+		</div>
+	{/each}
+</div>
diff --git a/GraphRAG/ui/svelte/src/lib/shared/components/doc_management/treeView/svelte-tree.svelte b/GraphRAG/ui/svelte/src/lib/shared/components/doc_management/treeView/svelte-tree.svelte
new file mode 100644
index 0000000000..66dae55bef
--- /dev/null
+++ b/GraphRAG/ui/svelte/src/lib/shared/components/doc_management/treeView/svelte-tree.svelte
@@ -0,0 +1,35 @@
+<!--
+  Copyright (C) 2024 Intel Corporation
+  SPDX-License-Identifier: Apache-2.0
+-->
+
+<script lang="ts">
+	import TreeBranch from "./tree-branch.svelte";
+	import { createEventDispatcher } from "svelte";
+
+	let dispatch = createEventDispatcher();
+	type IData = {
+		name: string;
+		id: string;
+		type: string;
+		children: never[];
+	};
+
+	export let currentIdx;
+
+	export let collapse = false,
+		data: IData[] = [],
+		onClick = "";
+
+	console.log("data", data);
+</script>
+
+<div>
+	{#if data && data.length > 0}
+		<ul>
+			<TreeBranch {data} {collapse} {onClick} {currentIdx} />
+		</ul>
+	{:else}
+		<p>Folder is empty. Please upload a file.</p>
+	{/if}
+</div>
diff --git a/GraphRAG/ui/svelte/src/lib/shared/components/doc_management/treeView/tree-branch.svelte b/GraphRAG/ui/svelte/src/lib/shared/components/doc_management/treeView/tree-branch.svelte
new file mode 100644
index 0000000000..27e9d276b9
--- /dev/null
+++ b/GraphRAG/ui/svelte/src/lib/shared/components/doc_management/treeView/tree-branch.svelte
@@ -0,0 +1,46 @@
+<!--
+  Copyright (C) 2024 Intel Corporation
+  SPDX-License-Identifier: Apache-2.0
+-->
+
+<script lang="ts">
+	import { storageFiles } from "$lib/shared/stores/common/Store";
+	import TreeNode from "./tree-node.svelte";
+	import { createEventDispatcher } from "svelte";
+
+	let dispatch = createEventDispatcher();
+	type IData = {
+		name: string;
+		id: string;
+		type: string;
+		children: never[];
+	};
+	export let data: IData[] = [],
+		collapse = false,
+		onClick = "";
+
+	export let currentIdx;
+
+	function changeData() {
+		console.log('change', $storageFiles);
+
+		data = $storageFiles[currentIdx].children;
+	}
+
+	$: $storageFiles ? changeData() : console.log('No change', $storageFiles);
+
+	console.log(data);
+</script>
+
+{#if data && data.length > 0}
+	{#each data as item}
+		<TreeNode
+			bind:node={item}
+			{collapse}
+			{onClick}
+			{currentIdx}
+		/>
+	{/each}
+{:else}
+	<p>Folder is empty. Please upload a file.</p>
+{/if}
diff --git a/GraphRAG/ui/svelte/src/lib/shared/components/doc_management/treeView/tree-node.svelte b/GraphRAG/ui/svelte/src/lib/shared/components/doc_management/treeView/tree-node.svelte
new file mode 100644
index 0000000000..eac311df83
--- /dev/null
+++ b/GraphRAG/ui/svelte/src/lib/shared/components/doc_management/treeView/tree-node.svelte
@@ -0,0 +1,111 @@
+<!--
+  Copyright (C) 2024 Intel Corporation
+  SPDX-License-Identifier: Apache-2.0
+-->
+
+<script lang="ts">
+	import FileIcon from "$lib/assets/DocManagement/fileIcon.svelte";
+	import FolderIcon from "$lib/assets/DocManagement/folderIcon.svelte";
+	import LinkfolderIcon from "$lib/assets/DocManagement/LinkfolderIcon.svelte";
+	import { createEventDispatcher } from "svelte";
+
+	import { onMount } from "svelte";
+	type IData = {
+		name: string;
+		id: string;
+		type: string;
+		children: never[];
+		parent: IData;
+		currentIdx: number;
+	};
+	export let node: IData,
+		collapse = false,
+		onClick = "",
+		parent = "";
+
+	export let currentIdx;
+
+	let open = collapse;
+
+	function toggleOpen() {
+		open = !open;
+	}
+
+	function handleClickOpen() {
+		toggleOpen();
+	}
+
+	onMount(() => {
+		if (node) {
+			node.parent = parent;
+		}
+	});
+
+
+</script>
+
+<li class="relative ml-5">
+	<div
+		class="my-2 flex items-center gap-4 {node.type === 'File' ? 'ml-5' : ''}"
+	>
+		<!-- link -->
+		{#if node.type === "Directory"}
+			{#if open}
+				<!-- svelte-ignore a11y-click-events-have-key-events -->
+				<svg
+					on:click={handleClickOpen}
+					data-testid="caret-down-node"
+					xmlns="http://www.w3.org/2000/svg"
+					class="h-5 w-5 cursor-pointer"
+					viewBox="0 0 20 20"
+					fill="currentColor"
+				>
+					<path
+						fill-rule="evenodd"
+						d="M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z"
+						clip-rule="evenodd"
+					/>
+				</svg>
+			{:else}
+				<!-- svelte-ignore a11y-click-events-have-key-events -->
+				<svg
+					on:click={handleClickOpen}
+					data-testid="caret-up-node"
+					xmlns="http://www.w3.org/2000/svg"
+					class="h-5 w-5 cursor-pointer"
+					viewBox="0 0 20 20"
+					fill="currentColor"
+				>
+					<path
+						fill-rule="evenodd"
+						d="M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z"
+						clip-rule="evenodd"
+					/>
+				</svg>
+			{/if}
+			{#if node.id === "uploaded_links"}
+				<LinkfolderIcon className={"w-12 h-12"} />
+			{:else}
+				<FolderIcon className={"w-12 h-12"} />
+			{/if}
+		{:else}
+			<FileIcon className={"w-10 h-10"} />
+		{/if}
+		<!-- link -->
+
+		<span>{node?.name}</span>
+	</div>
+
+	{#if open && node.type === "Directory"}
+		<ul>
+			{#each node.children as child}
+				<svelte:self
+					bind:node={child}
+					bind:parent={node}
+					{collapse}
+					{onClick}
+				/>
+			{/each}
+		</ul>
+	{/if}
+</li>
diff --git a/GraphRAG/ui/svelte/src/lib/shared/components/loading/Loading.svelte b/GraphRAG/ui/svelte/src/lib/shared/components/loading/Loading.svelte
new file mode 100644
index 0000000000..51e89cfe7e
--- /dev/null
+++ b/GraphRAG/ui/svelte/src/lib/shared/components/loading/Loading.svelte
@@ -0,0 +1,48 @@
+<!--
+  Copyright (c) 2024 Intel Corporation
+
+  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.
+-->
+
+<div
+	class="mb-6 flex items-center justify-center self-center bg-black text-sm text-gray-500"
+/>
+<div class="flex items-center justify-center gap-3">
+	<div class="relative inline-flex">
+		<div class="h-2 w-2 rounded-full bg-blue-600" />
+		<div
+			class="absolute left-0 top-0 h-2 w-2 animate-[ping_1s_infinite_100ms] rounded-full bg-blue-600"
+		/>
+		<div
+			class="duration-800 absolute left-0 top-0 h-2 w-2 animate-pulse rounded-full bg-blue-600"
+		/>
+	</div>
+	<div class="relative inline-flex">
+		<div class="h-2 w-2 rounded-full bg-blue-600" />
+		<div
+			class="absolute left-0 top-0 h-2 w-2 animate-[ping_1s_infinite_300ms] rounded-full bg-blue-600"
+		/>
+		<div
+			class="absolute left-0 top-0 h-2 w-2 animate-pulse rounded-full bg-blue-600"
+		/>
+	</div>
+	<div class="relative inline-flex">
+		<div class="h-2 w-2 rounded-full bg-blue-600" />
+		<div
+			class="absolute left-0 top-0 h-2 w-2 animate-[ping_1s_infinite_500ms] rounded-full bg-blue-600"
+		/>
+		<div
+			class="absolute left-0 top-0 h-2 w-2 animate-pulse rounded-full bg-blue-600"
+		/>
+	</div>
+</div>
diff --git a/GraphRAG/ui/svelte/src/lib/shared/components/scrollbar/Scrollbar.svelte b/GraphRAG/ui/svelte/src/lib/shared/components/scrollbar/Scrollbar.svelte
new file mode 100644
index 0000000000..f18e23e690
--- /dev/null
+++ b/GraphRAG/ui/svelte/src/lib/shared/components/scrollbar/Scrollbar.svelte
@@ -0,0 +1,48 @@
+<!--
+  Copyright (c) 2024 Intel Corporation
+
+  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.
+-->
+
+<script lang="ts">
+	import { Svroller } from "svrollbar";
+    export let className: string = "";
+    export let classLayout: string = "";
+    export let alwaysVisible = true;
+</script>
+
+<div class={className}>
+    <Svroller height="100%" width="100%" {alwaysVisible}>
+        <div class={classLayout}>
+            <slot></slot>
+        </div>
+    </Svroller>
+</div>
+
+<style>
+    :global(.svlr-contents) {
+        height: 100%;
+    }
+
+    .row::-webkit-scrollbar {
+		display: none;
+	}
+
+	.row {
+		scrollbar-width: none;
+	}
+
+	.row {
+		-ms-overflow-style: none;
+	}
+</style>
diff --git a/GraphRAG/ui/svelte/src/lib/shared/components/upload/PasteKnowledge.svelte b/GraphRAG/ui/svelte/src/lib/shared/components/upload/PasteKnowledge.svelte
new file mode 100644
index 0000000000..d0758e770c
--- /dev/null
+++ b/GraphRAG/ui/svelte/src/lib/shared/components/upload/PasteKnowledge.svelte
@@ -0,0 +1,52 @@
+<!--
+  Copyright (c) 2024 Intel Corporation
+
+  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.
+-->
+
+<script lang="ts">
+	import { Button, Helper, Input, Label, Modal } from "flowbite-svelte";
+	import { createEventDispatcher } from "svelte";
+
+	const dispatch = createEventDispatcher();
+	let formModal = false;
+	let urlValue = "";
+
+	function handelPasteURL() {
+		const pasteUrlList = urlValue.split(";").map((url) => url.trim());
+		dispatch("paste", { pasteUrlList });
+		formModal = false;
+	}
+</script>
+
+<Label class="space-y-1">
+	<div class="grid grid-cols-3">
+		<Input
+			class="col-span-2 rounded-none rounded-l-lg focus:border-blue-700 focus:ring-blue-700"
+			type="text"
+			name="text"
+			placeholder="URL"
+			bind:value={urlValue}
+			data-testid="paste-link"
+		/>
+		<Button
+			type="submit"
+			class="w-full rounded-none rounded-r-lg bg-blue-700"
+			data-testid="paste-click"
+
+			on:click={() => handelPasteURL()}>Confirm</Button
+		>
+	</div>
+
+	<Helper>Use semicolons (;) to separate multiple URLs.</Helper>
+</Label>
diff --git a/GraphRAG/ui/svelte/src/lib/shared/components/upload/upload-knowledge.svelte b/GraphRAG/ui/svelte/src/lib/shared/components/upload/upload-knowledge.svelte
new file mode 100644
index 0000000000..09a22a6ba7
--- /dev/null
+++ b/GraphRAG/ui/svelte/src/lib/shared/components/upload/upload-knowledge.svelte
@@ -0,0 +1,49 @@
+<!--
+  Copyright (c) 2024 Intel Corporation
+
+  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.
+-->
+
+<script lang="ts">
+	import { Fileupload, Label } from "flowbite-svelte";
+	import { createEventDispatcher } from "svelte";
+
+	const dispatch = createEventDispatcher();
+	let value;
+
+	function handleInput(event: Event) {
+	  const file = (event.target as HTMLInputElement).files![0];
+
+	  if (!file) return;
+
+	  const reader = new FileReader();
+	  reader.onloadend = () => {
+		if (!reader.result) return;
+		const src = reader.result.toString();
+		dispatch("upload", { src: src, fileName: file.name });
+	  };
+	  reader.readAsDataURL(file);
+	}
+  </script>
+
+  <div>
+	<Label class="space-y-2 mb-2">
+	  <Fileupload
+		bind:value
+		on:change={handleInput}
+		class="focus:border-blue-700 focus:ring-0"
+		data-testid="file-upload"
+		accept=".txt,.pdf,.json,.md"
+	  />
+	</Label>
+  </div>
diff --git a/GraphRAG/ui/svelte/src/lib/shared/components/upload/uploadFile.svelte b/GraphRAG/ui/svelte/src/lib/shared/components/upload/uploadFile.svelte
new file mode 100644
index 0000000000..541e115599
--- /dev/null
+++ b/GraphRAG/ui/svelte/src/lib/shared/components/upload/uploadFile.svelte
@@ -0,0 +1,184 @@
+<!--
+  Copyright (c) 2024 Intel Corporation
+
+  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.
+-->
+
+<script lang="ts">
+	import { Drawer, Button, CloseButton, Tabs, TabItem } from "flowbite-svelte";
+	import { InfoCircleSolid } from "flowbite-svelte-icons";
+	import { sineIn } from "svelte/easing";
+	import UploadFile from "./upload-knowledge.svelte";
+	import PasteURL from "./PasteKnowledge.svelte";
+	import {
+		knowledge1,
+		knowledgeName,
+		storageFiles,
+	} from "$lib/shared/stores/common/Store";
+	import { getNotificationsContext } from "svelte-notifications";
+	import {
+		fetchAllFile,
+		fetchKnowledgeBaseId,
+		fetchKnowledgeBaseIdByPaste,
+	} from "$lib/network/upload/Network";
+	import DocCard from "../doc_management/docCard.svelte";
+	import NoFile from "$lib/assets/upload/no-file.svelte";
+	import LoadingButton from "$lib/assets/upload/loading-button.svelte";
+
+	const { addNotification } = getNotificationsContext();
+
+	$: files = $storageFiles ? $storageFiles : [];
+	let hidden6 = true;
+	let uploading = false;
+
+	let transitionParamsRight = {
+		x: 320,
+		duration: 200,
+		easing: sineIn,
+	};
+
+	async function handleKnowledgePaste(
+		e: CustomEvent<{ pasteUrlList: string[] }>
+	) {
+		uploading = true;
+		try {
+			const pasteUrlList = e.detail.pasteUrlList;
+			const res = await fetchKnowledgeBaseIdByPaste(pasteUrlList);
+			handleUploadResult(res, "knowledge_base");
+		} catch {
+			handleUploadError();
+		}
+	}
+
+	async function handleKnowledgeUpload(e: CustomEvent<any>) {
+		uploading = true;
+		try {
+			const blob = await fetch(e.detail.src).then((r) => r.blob());
+			const fileName = e.detail.fileName;
+			const res = await fetchKnowledgeBaseId(blob, fileName);
+			handleUploadResult(res, fileName);
+		} catch {
+			handleUploadError();
+		}
+	}
+
+	async function handleUploadResult(res: Response, fileName: string) {
+		if (res.status === 200) {
+			knowledge1.set({ id: "default" });
+			knowledgeName.set(fileName);
+			showNotification("Uploaded successfully", "success");
+			// update fileStructure
+			const res = await fetchAllFile();
+			uploading = false;
+			console.log('handleUploadResult', res);
+
+			if (res) {
+				storageFiles.set(res);
+				files = $storageFiles;
+			}
+		} else {
+			showNotification("Uploaded failed", "error");
+		}
+	}
+
+	function handleUploadError() {
+		showNotification("Uploaded failed", "error");
+	}
+
+	function showNotification(text: string, type: string) {
+		addNotification({
+			text: text,
+			position: "top-left",
+			type: type,
+			removeAfter: 3000,
+		});
+	}
+</script>
+
+<div class="text-center">
+	<Button
+		on:click={() => (hidden6 = false)}
+		class="bg-transparent focus-within:ring-gray-300 hover:bg-transparent focus:ring-0"
+		data-testid="open-upload"
+	>
+		<svg
+			aria-hidden="true"
+			class="h-7 w-7 text-blue-700"
+			fill="none"
+			stroke="currentColor"
+			viewBox="0 0 24 24"
+			xmlns="http://www.w3.org/2000/svg"
+			><path
+				stroke-linecap="round"
+				stroke-linejoin="round"
+				stroke-width="2"
+				d="M7 16a4 4 0 01-.88-7.903A5 5 0 1115.9 6L16 6a5 5 0 011 9.9M15 13l-3-3m0 0l-3 3m3-3v12"
+			/></svg
+		>
+	</Button>
+</div>
+
+<Drawer
+	backdrop={false}
+	placement="right"
+	transitionType="fly"
+	transitionParams={transitionParamsRight}
+	bind:hidden={hidden6}
+	class=" border-2 border-b-0 border-r-0 shadow"
+	id="sidebar6"
+>
+	<div class="flex items-center">
+		<h5
+			id="drawer-label"
+			class="mb-4 inline-flex items-center text-base font-semibold text-gray-500 dark:text-gray-400"
+		>
+			<InfoCircleSolid class="me-2.5 h-4 w-4" />Data Source
+		</h5>
+		<CloseButton
+			on:click={() => (hidden6 = true)}
+			class="mb-4 dark:text-white"
+		/>
+	</div>
+	<p class="mb-6 text-sm text-gray-500 dark:text-gray-400">
+		Please upload your local file or paste a remote file link, and Chat will
+		respond based on the content of the uploaded file.
+	</p>
+
+	<Tabs
+		style="full"
+		defaultClass="flex rounded-lg divide-x rtl:divide-x-reverse divide-gray-200 shadow dark:divide-gray-700 focus:ring-0"
+	>
+		<TabItem class="w-full" open>
+			<span slot="title">Upload File</span>
+			<UploadFile on:upload={handleKnowledgeUpload} />
+		</TabItem>
+		<TabItem class="w-full" data-testid="exchange-paste">
+			<span slot="title">Paste Link</span>
+			<PasteURL on:paste={handleKnowledgePaste} />
+		</TabItem>
+	</Tabs>
+	{#if uploading}
+		<div class="flex flex-col items-center justify-center my-6">
+			<LoadingButton />
+		</div>
+	{/if}
+
+	{#if files.length > 0}
+		<DocCard {files} />
+	{:else}
+		<div class="flex flex-col items-center justify-center mt-6">
+			<NoFile />
+			<p class=" text-sm opacity-70">No files uploaded</p>
+		</div>
+	{/if}
+</Drawer>
diff --git a/GraphRAG/ui/svelte/src/lib/shared/constant/Interface.ts b/GraphRAG/ui/svelte/src/lib/shared/constant/Interface.ts
new file mode 100644
index 0000000000..221f17a263
--- /dev/null
+++ b/GraphRAG/ui/svelte/src/lib/shared/constant/Interface.ts
@@ -0,0 +1,47 @@
+// Copyright (c) 2024 Intel Corporation
+//
+// 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.
+
+export enum MessageRole {
+	Assistant,
+	User,
+}
+
+export enum MessageType {
+	Text,
+	SingleAudio,
+	AudioList,
+	SingleImage,
+	ImageList,
+	singleVideo,
+}
+
+type Map<T> = T extends MessageType.Text | MessageType.SingleAudio
+	? string
+	: T extends MessageType.AudioList
+		? string[]
+		: T extends MessageType.SingleImage
+			? { imgSrc: string; imgId: string }
+			: { imgSrc: string; imgId: string }[];
+
+export interface Message {
+	role: MessageRole;
+	type: MessageType;
+	content: Map<Message["type"]>;
+	time: number;
+}
+
+export enum LOCAL_STORAGE_KEY {
+	STORAGE_CHAT_KEY = "chatMessages",
+	STORAGE_TIME_KEY = "initTime",
+}
diff --git a/GraphRAG/ui/svelte/src/lib/shared/stores/common/Store.ts b/GraphRAG/ui/svelte/src/lib/shared/stores/common/Store.ts
new file mode 100644
index 0000000000..7316e803a1
--- /dev/null
+++ b/GraphRAG/ui/svelte/src/lib/shared/stores/common/Store.ts
@@ -0,0 +1,41 @@
+// Copyright (c) 2024 Intel Corporation
+//
+// 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 { writable } from "svelte/store";
+
+export let open = writable(true);
+
+export let knowledgeAccess = writable(true);
+
+export let showTemplate = writable(false);
+
+export let showSidePage = writable(false);
+
+export let droppedObj = writable({});
+
+export let isLoading = writable(false);
+
+export let newUploadNum = writable(0);
+
+export let ifStoreMsg = writable(true);
+
+export const resetControl = writable(false);
+
+export const knowledge1 = writable<{
+	id: string;
+}>();
+
+export const knowledgeName = writable("");
+
+export const storageFiles = writable([]);
diff --git a/GraphRAG/ui/svelte/src/routes/+layout.svelte b/GraphRAG/ui/svelte/src/routes/+layout.svelte
new file mode 100644
index 0000000000..8141177d4a
--- /dev/null
+++ b/GraphRAG/ui/svelte/src/routes/+layout.svelte
@@ -0,0 +1,48 @@
+<!--
+  Copyright (c) 2024 Intel Corporation
+
+  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.
+-->
+
+<script>
+	import "tailwindcss/tailwind.css";
+	import "../app.postcss";
+	import Notifications from "svelte-notifications";
+	import Layout from "$lib/modules/frame/Layout.svelte";
+	import { onMount } from "svelte";
+
+	onMount(() => {
+		window.deviceType = window.innerWidth > 640 ? "pc" : "mobile";
+		window.onresize = () => {
+			window.deviceType = window.innerWidth > 640 ? "pc" : "mobile";
+		};
+		window.addEventListener("load", function () {
+			setTimeout(function () {
+				// This hides the address bar:
+				window.scrollTo(0, 1);
+			}, 0);
+		});
+
+	});
+</script>
+
+<Notifications>
+	<Layout>
+		<div class="flex h-full flex-col">
+			<div class="h-0 grow bg-white  lg:rounded-tl-3xl">
+				<slot />
+			</div>
+		</div>
+
+	</Layout>
+</Notifications>
diff --git a/GraphRAG/ui/svelte/src/routes/+page.svelte b/GraphRAG/ui/svelte/src/routes/+page.svelte
new file mode 100644
index 0000000000..b6f6d9c334
--- /dev/null
+++ b/GraphRAG/ui/svelte/src/routes/+page.svelte
@@ -0,0 +1,311 @@
+<!--
+  Copyright (c) 2024 Intel Corporation
+
+  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.
+-->
+
+<script lang="ts">
+	export let data;
+	import { knowledge1, storageFiles } from "$lib/shared/stores/common/Store";
+	import { onMount } from "svelte";
+	import {
+		LOCAL_STORAGE_KEY,
+		MessageRole,
+		MessageType,
+		type Message,
+	} from "$lib/shared/constant/Interface";
+	import {
+		getCurrentTimeStamp,
+		scrollToBottom,
+		scrollToTop,
+	} from "$lib/shared/Utils";
+	import { fetchTextStream } from "$lib/network/chat/Network";
+	import LoadingAnimation from "$lib/shared/components/loading/Loading.svelte";
+	import "driver.js/dist/driver.css";
+	import "$lib/assets/layout/css/driver.css";
+	import UploadFile from "$lib/shared/components/upload/uploadFile.svelte";
+	import PaperAirplane from "$lib/assets/chat/svelte/PaperAirplane.svelte";
+	import Scrollbar from "$lib/shared/components/scrollbar/Scrollbar.svelte";
+	import ChatMessage from "$lib/modules/chat/ChatMessage.svelte";
+	import { fetchAllFile } from "$lib/network/upload/Network.js";
+	import { getNotificationsContext } from "svelte-notifications";
+
+	let query: string = "";
+	let loading: boolean = false;
+	let scrollToDiv: HTMLDivElement;
+	// ·········
+	let chatMessages: Message[] = data.chatMsg ? data.chatMsg : [];
+	const { addNotification } = getNotificationsContext();
+
+	// ··············
+
+	$: knowledge_1 = $knowledge1?.id ? $knowledge1.id : "default";
+
+	onMount(async () => {
+		scrollToDiv = document
+			.querySelector(".chat-scrollbar")
+			?.querySelector(".svlr-viewport")!;
+
+		const res = await fetchAllFile();
+		if (res) {
+			storageFiles.set(res);
+		}
+	});
+
+	function showNotification(text: string, type: string) {
+		addNotification({
+			text: text,
+			position: "top-left",
+			type: type,
+			removeAfter: 3000,
+		});
+	}
+
+	function handleTop() {
+		scrollToTop(scrollToDiv);
+	}
+
+	function storeMessages() {
+		localStorage.setItem(
+			LOCAL_STORAGE_KEY.STORAGE_CHAT_KEY,
+			JSON.stringify(chatMessages)
+		);
+	}
+
+	function decodeEscapedBytes(str: string): string {
+		const byteArray = str
+			.split("\\x")
+			.slice(1)
+			.map((byte) => parseInt(byte, 16));
+		const decoded = new TextDecoder("utf-8").decode(new Uint8Array(byteArray));
+
+		return decoded;
+	}
+
+	function decodeUnicode(str: string): string {
+		const decoded = str.replace(/\\u[\dA-Fa-f]{4}/g, (match) => {
+			return String.fromCharCode(parseInt(match.replace(/\\u/g, ""), 16));
+		});
+
+		return decoded;
+	}
+
+	const callTextStream = async (query: string, startSendTime: number) => {
+		try {
+			const eventSource = await fetchTextStream(query);
+			eventSource.addEventListener("error", (e: any) => {
+				if (e.type === "error") {
+					showNotification("Failed to load chat content.", "error");
+					loading = false;
+				}
+			});
+
+			eventSource.addEventListener("message", (e: any) => {
+				let msg = e.data;
+				console.log("msg", msg);
+
+				const handleDecodedMessage = (decodedMsg: string) => {
+					if (decodedMsg !== "</s>") {
+						decodedMsg = decodedMsg.replace(/\\n/g, "\n");
+					}
+
+					if (chatMessages[chatMessages.length - 1].role === MessageRole.User) {
+						chatMessages.push({
+							role: MessageRole.Assistant,
+							type: MessageType.Text,
+							content: decodedMsg,
+							time: startSendTime,
+						});
+					} else {
+						chatMessages[chatMessages.length - 1].content += decodedMsg;
+					}
+
+					scrollToBottom(scrollToDiv);
+				};
+
+				if (msg.startsWith("b")) {
+					let currentMsg = msg.slice(2, -1);
+
+					if (/\\x[\dA-Fa-f]{2}/.test(currentMsg)) {
+						currentMsg = decodeEscapedBytes(currentMsg);
+					} else if (/\\u[\dA-Fa-f]{4}/.test(currentMsg)) {
+						currentMsg = decodeUnicode(currentMsg);
+					}
+
+					handleDecodedMessage(currentMsg);
+				} else if (msg === "[DONE]") {
+					console.log("Done");
+
+					let startTime = chatMessages[chatMessages.length - 1].time;
+					loading = false;
+					let totalTime = parseFloat(
+						((getCurrentTimeStamp() - startTime) / 1000).toFixed(2)
+					);
+
+					if (chatMessages.length - 1 !== -1) {
+						chatMessages[chatMessages.length - 1].time = totalTime;
+					}
+
+					storeMessages();
+				} else {
+					if (/\\x[\dA-Fa-f]{2}/.test(msg)) {
+						msg = decodeEscapedBytes(msg);
+					} else if (/\\u[\dA-Fa-f]{4}/.test(msg)) {
+						msg = decodeUnicode(msg);
+					}
+
+					let currentMsg = msg.replace(/"/g, "").replace(/\\n/g, "\n");
+
+					handleDecodedMessage(currentMsg);
+				}
+			});
+
+			eventSource.stream();
+		} catch (error: any) {
+			showNotification("Failed to load chat content.", "error");
+			loading = false;
+		}
+	};
+
+	const handleTextSubmit = async () => {
+		loading = true;
+		const newMessage = {
+			role: MessageRole.User,
+			type: MessageType.Text,
+			content: query,
+			time: 0,
+		};
+		chatMessages = [...chatMessages, newMessage];
+		scrollToBottom(scrollToDiv);
+		storeMessages();
+		query = "";
+
+		await callTextStream(newMessage.content, getCurrentTimeStamp());
+
+		scrollToBottom(scrollToDiv);
+		storeMessages();
+	};
+
+	function handelClearHistory() {
+		localStorage.removeItem(LOCAL_STORAGE_KEY.STORAGE_CHAT_KEY);
+		chatMessages = [];
+	}
+</script>
+
+<!-- <DropZone on:drop={handleImageSubmit}> -->
+<div
+	class="h-full items-center gap-5 bg-white sm:flex sm:pb-2 lg:rounded-tl-3xl"
+>
+	<div class="mx-auto flex h-full w-full flex-col sm:mt-0 sm:w-[72%]">
+		<div class="flex justify-between p-2">
+			<p class="text-[1.7rem] font-bold tracking-tight">ChatQnA</p>
+			<UploadFile />
+		</div>
+		<div
+			class="fixed relative flex w-full flex-col items-center justify-between bg-white p-2 pb-0"
+		>
+			<div class="relative my-4 flex w-full flex-row justify-center">
+				<div class="relative w-full focus:border-none">
+					<input
+						class="text-md block w-full border-0 border-b-2 border-gray-300 px-1 py-4
+						text-gray-900 focus:border-gray-300 focus:ring-0 dark:border-gray-600 dark:bg-gray-700 dark:text-white dark:placeholder-gray-400 dark:focus:border-blue-500 dark:focus:ring-blue-500"
+						type="text"
+						data-testid="chat-input"
+						placeholder="Enter prompt here"
+						disabled={loading}
+						maxlength="1200"
+						bind:value={query}
+						on:keydown={(event) => {
+							if (event.key === "Enter" && !event.shiftKey && query) {
+								event.preventDefault();
+								handleTextSubmit();
+							}
+						}}
+					/>
+					<button
+						on:click={() => {
+							if (query) {
+								handleTextSubmit();
+							}
+						}}
+						type="submit"
+						id="send"
+						class="absolute bottom-2.5 end-2.5 px-4 py-2 text-sm font-medium text-white dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800"
+						><PaperAirplane /></button
+					>
+				</div>
+			</div>
+		</div>
+
+		<!-- clear -->
+		{#if Array.isArray(chatMessages) && chatMessages.length > 0 && !loading}
+			<div class="flex w-full justify-between pr-5">
+				<div class="flex items-center">
+					<button
+						class="bg-primary text-primary-foreground hover:bg-primary/90 group flex items-center justify-center space-x-2 p-2"
+						type="button"
+						data-testid="clear-chat"
+						on:click={() => handelClearHistory()}
+						><svg
+							xmlns="http://www.w3.org/2000/svg"
+							viewBox="0 0 20 20"
+							width="24"
+							height="24"
+							class="fill-[#0597ff] group-hover:fill-[#0597ff]"
+							><path
+								d="M12.6 12 10 9.4 7.4 12 6 10.6 8.6 8 6 5.4 7.4 4 10 6.6 12.6 4 14 5.4 11.4 8l2.6 2.6zm7.4 8V2q0-.824-.587-1.412A1.93 1.93 0 0 0 18 0H2Q1.176 0 .588.588A1.93 1.93 0 0 0 0 2v12q0 .825.588 1.412Q1.175 16 2 16h14zm-3.15-6H2V2h16v13.125z"
+							/></svg
+						><span class="font-medium text-[#0597ff]">CLEAR</span></button
+					>
+				</div>
+			</div>
+		{/if}
+		<!-- clear -->
+
+		<div class="mx-auto flex h-full w-full flex-col" data-testid="chat-message">
+			<Scrollbar
+				classLayout="flex flex-col gap-1 mr-4"
+				className="chat-scrollbar h-0 w-full grow px-2 pt-2 mt-3 mr-5"
+			>
+				{#each chatMessages as message, i}
+					<ChatMessage
+						on:scrollTop={() => handleTop()}
+						msg={message}
+						time={i === 0 || (message.time > 0 && message.time < 100)
+							? message.time
+							: ""}
+					/>
+				{/each}
+			</Scrollbar>
+			<!-- Loading text -->
+			{#if loading}
+				<LoadingAnimation />
+			{/if}
+		</div>
+		<!-- gallery -->
+	</div>
+</div>
+
+<style>
+	.row::-webkit-scrollbar {
+		display: none;
+	}
+
+	.row {
+		scrollbar-width: none;
+	}
+
+	.row {
+		-ms-overflow-style: none;
+	}
+</style>
diff --git a/GraphRAG/ui/svelte/src/routes/+page.ts b/GraphRAG/ui/svelte/src/routes/+page.ts
new file mode 100644
index 0000000000..f4de8d6760
--- /dev/null
+++ b/GraphRAG/ui/svelte/src/routes/+page.ts
@@ -0,0 +1,26 @@
+// Copyright (c) 2024 Intel Corporation
+//
+// 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 { browser } from "$app/environment";
+import { LOCAL_STORAGE_KEY } from "$lib/shared/constant/Interface";
+
+export const load = async () => {
+	if (browser) {
+		const chat = localStorage.getItem(LOCAL_STORAGE_KEY.STORAGE_CHAT_KEY);
+
+		return {
+			chatMsg: JSON.parse(chat || "[]"),
+		};
+	}
+};
diff --git a/GraphRAG/ui/svelte/static/favicon.png b/GraphRAG/ui/svelte/static/favicon.png
new file mode 100644
index 0000000000000000000000000000000000000000..75b997f8156c09d1c72026d98c80d0227210da38
GIT binary patch
diff --git a/GraphRAG/ui/svelte/svelte.config.js b/GraphRAG/ui/svelte/svelte.config.js
new file mode 100644
index 0000000000..0f2977ecce
--- /dev/null
+++ b/GraphRAG/ui/svelte/svelte.config.js
@@ -0,0 +1,38 @@
+// Copyright (c) 2024 Intel Corporation
+//
+// 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 adapter from "@sveltejs/adapter-auto";
+import preprocess from "svelte-preprocess";
+import postcssPresetEnv from "postcss-preset-env";
+
+/** @type {import('@sveltejs/kit').Config} */
+const config = {
+	// Consult https://github.com/sveltejs/svelte-preprocess
+	// for more information about preprocessors
+	preprocess: preprocess({
+		sourceMap: true,
+		postcss: {
+			plugins: [postcssPresetEnv({ features: { "nesting-rules": true } })],
+		},
+	}),
+
+	kit: {
+		adapter: adapter(),
+		env: {
+			publicPrefix: "",
+		},
+	},
+};
+
+export default config;
diff --git a/GraphRAG/ui/svelte/tailwind.config.cjs b/GraphRAG/ui/svelte/tailwind.config.cjs
new file mode 100644
index 0000000000..6cc3a8b951
--- /dev/null
+++ b/GraphRAG/ui/svelte/tailwind.config.cjs
@@ -0,0 +1,43 @@
+// Copyright (c) 2024 Intel Corporation
+//
+// 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.
+
+const config = {
+	content: ["./src/**/*.{html,js,svelte,ts}", "./node_modules/flowbite-svelte/**/*.{html,js,svelte,ts}"],
+
+	plugins: [require("flowbite/plugin")],
+
+	darkMode: "class",
+
+	theme: {
+		extend: {
+			colors: {
+				// flowbite-svelte
+				primary: {
+					50: "#FFF5F2",
+					100: "#FFF1EE",
+					200: "#FFE4DE",
+					300: "#FFD5CC",
+					400: "#FFBCAD",
+					500: "#FE795D",
+					600: "#EF562F",
+					700: "#EB4F27",
+					800: "#CC4522",
+					900: "#A5371B",
+				},
+			},
+		},
+	},
+};
+
+module.exports = config;
diff --git a/GraphRAG/ui/svelte/tests/chatQnA.spec.ts b/GraphRAG/ui/svelte/tests/chatQnA.spec.ts
new file mode 100644
index 0000000000..1c7f308e7a
--- /dev/null
+++ b/GraphRAG/ui/svelte/tests/chatQnA.spec.ts
@@ -0,0 +1,82 @@
+// Copyright (C) 2024 Intel Corporation
+// SPDX-License-Identifier: Apache-2.0
+
+import { test, expect, type Page } from "@playwright/test";
+import { fileURLToPath } from "url";
+import path from "path";
+
+// Get the path of the current file
+const __filename = fileURLToPath(import.meta.url);
+// Get the directory path of the current file
+const __dirname = path.dirname(__filename);
+
+// Define the file path
+const FILE_PATH = path.resolve(__dirname, "test_file.txt");
+
+// Initialization before each test
+test.beforeEach(async ({ page }) => {
+	await page.goto("/");
+});
+
+// Constants definition
+const CHAT_ITEMS = ["What is the total revenue of Nike in 2023?"];
+const UPLOAD_LINK = ["https://www.ces.tech/"];
+
+// Helper function: Check notification text
+async function checkNotificationText(page: Page, expectedText: string) {
+	const notification = await page.waitForSelector(".notification");
+	const notificationText = await notification.textContent();
+	expect(notificationText).toContain(expectedText);
+}
+
+// Helper function: Enter message to chat
+async function enterMessageToChat(page: Page, message: string) {
+	await page.getByTestId("chat-input").click();
+	await page.getByTestId("chat-input").fill(message);
+	await page.getByTestId("chat-input").press("Enter");
+	await page.waitForTimeout(10000);
+	await expect(page.getByTestId("display-answer")).toBeVisible();
+}
+
+// Helper function: Upload file
+async function uploadFile(page: Page, filePath: string) {
+	const fileUpload = page.getByTestId("file-upload");
+	await fileUpload.setInputFiles(filePath);
+	await checkNotificationText(page, "Uploaded successfully");
+}
+
+// Helper function: Paste link
+async function pasteLink(page: Page, link: string) {
+	await page.getByTestId("paste-link").fill(link);
+	const pasteClick = page.getByTestId("paste-click");
+	await pasteClick.click();
+	await checkNotificationText(page, "Uploaded successfully");
+}
+
+// Test description: New Chat
+test.describe("New Chat", () => {
+	// Test: Enter message to chat
+	test("should enter message to chat", async ({ page }) => {
+		await enterMessageToChat(page, CHAT_ITEMS[0]);
+	});
+});
+
+// Test description: Upload file
+test.describe("Upload file", () => {
+	// Test: Upload file
+	test("should upload a file", async ({ page }) => {
+		await page.waitForTimeout(10000);
+		await page.getByTestId("open-upload").click();
+		await page.waitForTimeout(10000);
+		await uploadFile(page, FILE_PATH);
+	});
+
+	// Test: Paste link
+	test("should paste link", async ({ page }) => {
+		await page.waitForTimeout(10000);
+		await page.getByTestId("open-upload").click();
+		await page.waitForTimeout(10000);
+		await page.getByTestId("exchange-paste").click();
+		await pasteLink(page, UPLOAD_LINK[0]);
+	});
+});
diff --git a/GraphRAG/ui/svelte/tests/test_file.txt b/GraphRAG/ui/svelte/tests/test_file.txt
new file mode 100644
index 0000000000..93fc5da94e
--- /dev/null
+++ b/GraphRAG/ui/svelte/tests/test_file.txt
@@ -0,0 +1,104 @@
+Follow CES
+EXHIBIT
+REGISTER
+All together. All ON.
+Registration is now open for CES® 2024 — taking place Jan. 9-12, in Las Vegas.
+Flip the switch on global business opportunity with CES, where you can meet with partners, customers, media, investors, and policymakers from across the industry and the world all in one place.
+Don't miss your chance to be a part of the most powerful tech event in the world.
+KEYNOTE ANNOUNCEMENT
+Qualcomm CEO to Keynote CES 2024
+ Cristiano Amon
+ President and CEO, Qualcomm
+Anticipated Numbers for CES 2024
+130K+
+attendees
+1000+
+startups within Eureka Park 
+3500+
+exhibitors and a sold-out West Hall 
+ Learn more
+ arrow-black
+Featured Podcast
+Li-Fi Unleashes the Future of Esports
+Listen Nowarrow-black
+Featured Event
+Apply Today for CTA Match
+Learn Morearrow-black
+CES 2024 is ALL ON
+×
+Vehicle Technology
+With features like adaptive cruise control, collision prevention and lane guidance, technology is paving the way to safer roads. Discover what’s driving the innovations behind concept cars, connected vehicles and autonomous mobility. 
+Learn Morearrow-black
+ 
+Featured Podcast
+On the Fast Track to Autonomous Driving: Mobileye
+Read Morearrow-black
+Brunswick Boating Tech Smooths Rough Waters
+Register for CES 2024
+See the next generation of innovation at CES 2024.
+ Register Now
+Featured Exhibitors
+See the companies from across the globe that will be showcasing the latest in digital health, food tech, automotive tech, NFTs, gaming, smart home and more.
+ 
+ 
+ 
+ View 2024 Featured Exhibitors
+ arrow-black
+Apply for Eureka Park™️
+Eureka Park is the buzzworthy startup arena that provides a unique opportunity to launch a new product, service or idea. If you’re looking for your big break in the tech industry, Eureka Park is the place for you.
+ Apply Now
+Exhibit at CES
+CES is where business gets done.
+CASE STUDY
+VW
+Over a busy four days in Las Vegas, Volkswagen showed the world and media that its accomplishments transcend the legacy auto sector. It’s ID.7 sedan promises stellar performance and efficiency with a 435-mile range plus impressive features.
+Read Morearrow-black
+600K
+interactions on social media
+CES is a great opportunity, both from a business perspective in the networking sense and seeing what's going on in the tech field, and also it's a great opportunity from a media perspective because we see massive media attendance and we see a great deal of coverage.
+MARK GILLIES
+DIRECTOR OF PUBLIC RELATIONS AND REPUTATION, VOLKSWAGEN
+CES Success Stories 2023: Volkswagon
+×
+Want to Exhibit at CES 2024?
+Showcase your brand, launch your latest products and win business at the ultimate platform for innovation.
+ Contact Us
+Latest Articles
+ CES 2024 Sector Trends: Digital Health
+Read more
+arrow-black
+Nasdaq Keynote, CES 2024: Finance Taps Tech for Humanity
+Read more
+arrow-black
+Walmart Keynote at CES 2024: Disruptive Retail Tech
+Read more
+arrow-black
+Press Releases
+Qualcomm CEO Cristiano Amon to Highlight How We Will Interact with Our Devices in the AI Age During CES 2024 Keynote
+HD Hyundai to Keynote CES 2024 
+Elevance Health’s Gail Boudreaux to Keynote CES 2024
+ View all press releases
+ arrow-black
+CES is owned and produced by the Consumer Technology Association, which provides the ultimate platform for technology leaders to connect, collaborate, and propel consumer technology forward.
+ Become a CTA Member
+About CES
+CES Events
+Innovation Awards
+CES Tech Talk Podcast
+Promote Your Brand
+Topics
+Articles
+CES Success Stories
+Schedule
+Our Partners
+Information for:
+Exhibitors
+Media
+International
+Follow CES
+Code of Conduct
+Terms of Use
+Privacy
+Sitemap
+Copyright © 2003 - 2023. All rights reserved.
+CTATECH-PROD2
\ No newline at end of file
diff --git a/GraphRAG/ui/svelte/tsconfig.json b/GraphRAG/ui/svelte/tsconfig.json
new file mode 100644
index 0000000000..b0135d48eb
--- /dev/null
+++ b/GraphRAG/ui/svelte/tsconfig.json
@@ -0,0 +1,16 @@
+{
+	"extends": "./.svelte-kit/tsconfig.json",
+	"compilerOptions": {
+		"allowJs": true,
+		"checkJs": true,
+		"esModuleInterop": true,
+		"forceConsistentCasingInFileNames": true,
+		"resolveJsonModule": true,
+		"skipLibCheck": true,
+		"sourceMap": true,
+		"strict": true,
+		"module": "ESNext",
+		"target": "ES6",
+		"outDir": "./dist"
+	}
+}
diff --git a/GraphRAG/ui/svelte/vite.config.ts b/GraphRAG/ui/svelte/vite.config.ts
new file mode 100644
index 0000000000..1166165dca
--- /dev/null
+++ b/GraphRAG/ui/svelte/vite.config.ts
@@ -0,0 +1,23 @@
+// Copyright (c) 2024 Intel Corporation
+//
+// 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 { sveltekit } from "@sveltejs/kit/vite";
+import type { UserConfig } from "vite";
+
+const config: UserConfig = {
+	plugins: [sveltekit()],
+	server: {},
+};
+
+export default config;

From 3cd7179767d0a766355d78dff3f9e39cab71cf3a Mon Sep 17 00:00:00 2001
From: Rita Brugarolas <rita.brugarolas.brufau@intel.com>
Date: Fri, 25 Oct 2024 17:09:37 +0000
Subject: [PATCH 21/26] added missing assets for UI

Signed-off-by: Rita Brugarolas <rita.brugarolas.brufau@intel.com>
---
 GraphRAG/assets/img/chat_ui_init.png           | Bin 0 -> 15118 bytes
 GraphRAG/assets/img/chat_ui_response.png       | Bin 0 -> 76033 bytes
 GraphRAG/assets/img/chat_ui_upload.png         | Bin 0 -> 87990 bytes
 GraphRAG/assets/img/chatqna_architecture.png   | Bin 0 -> 513283 bytes
 GraphRAG/assets/img/chatqna_dashboards.png     | Bin 0 -> 102817 bytes
 GraphRAG/assets/img/chatqna_flow_chart.png     | Bin 0 -> 117275 bytes
 GraphRAG/assets/img/conversation_ui_init.png   | Bin 0 -> 54802 bytes
 .../assets/img/conversation_ui_response.png    | Bin 0 -> 94972 bytes
 GraphRAG/assets/img/conversation_ui_upload.png | Bin 0 -> 63097 bytes
 GraphRAG/assets/img/tgi_dashboard.png          | Bin 0 -> 423754 bytes
 10 files changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 GraphRAG/assets/img/chat_ui_init.png
 create mode 100644 GraphRAG/assets/img/chat_ui_response.png
 create mode 100644 GraphRAG/assets/img/chat_ui_upload.png
 create mode 100644 GraphRAG/assets/img/chatqna_architecture.png
 create mode 100644 GraphRAG/assets/img/chatqna_dashboards.png
 create mode 100644 GraphRAG/assets/img/chatqna_flow_chart.png
 create mode 100644 GraphRAG/assets/img/conversation_ui_init.png
 create mode 100644 GraphRAG/assets/img/conversation_ui_response.png
 create mode 100644 GraphRAG/assets/img/conversation_ui_upload.png
 create mode 100644 GraphRAG/assets/img/tgi_dashboard.png

diff --git a/GraphRAG/assets/img/chat_ui_init.png b/GraphRAG/assets/img/chat_ui_init.png
new file mode 100644
index 0000000000000000000000000000000000000000..392228d5ae6d29bc42bd4d5c7416589c3368cf25
GIT binary patch
diff --git a/GraphRAG/assets/img/chat_ui_response.png b/GraphRAG/assets/img/chat_ui_response.png
new file mode 100644
index 0000000000000000000000000000000000000000..c65c5d1c21226d1f9c27a5c487f0d9268d651f04
GIT binary patch
diff --git a/GraphRAG/assets/img/chat_ui_upload.png b/GraphRAG/assets/img/chat_ui_upload.png
new file mode 100644
index 0000000000000000000000000000000000000000..1e1ba85d4151aa78e5dc5a3616e52d27bbdbce95
GIT binary patch
diff --git a/GraphRAG/assets/img/chatqna_architecture.png b/GraphRAG/assets/img/chatqna_architecture.png
new file mode 100644
index 0000000000000000000000000000000000000000..1392fca5b757f59989830f36b0316d2639528ecf
GIT binary patch
diff --git a/GraphRAG/assets/img/chatqna_dashboards.png b/GraphRAG/assets/img/chatqna_dashboards.png
new file mode 100644
index 0000000000000000000000000000000000000000..24abb6533b9fc3e1e709b402e62a9c1476640efa
GIT binary patch
diff --git a/GraphRAG/assets/img/chatqna_flow_chart.png b/GraphRAG/assets/img/chatqna_flow_chart.png
new file mode 100644
index 0000000000000000000000000000000000000000..7966497b12ecf106ec699fee1349e3e3c37e5ad0
GIT binary patch
diff --git a/GraphRAG/assets/img/conversation_ui_init.png b/GraphRAG/assets/img/conversation_ui_init.png
new file mode 100644
index 0000000000000000000000000000000000000000..6bd5f244725de87df23ccd347c2b9dc23f53ae91
GIT binary patch
diff --git a/GraphRAG/assets/img/conversation_ui_response.png b/GraphRAG/assets/img/conversation_ui_response.png
new file mode 100644
index 0000000000000000000000000000000000000000..be9ed60457af59aef426e467de92cde6786245e5
GIT binary patch
diff --git a/GraphRAG/assets/img/conversation_ui_upload.png b/GraphRAG/assets/img/conversation_ui_upload.png
new file mode 100644
index 0000000000000000000000000000000000000000..b05c33819a08c0c9bac1347b23af52df86e8eb33
GIT binary patch
diff --git a/GraphRAG/assets/img/tgi_dashboard.png b/GraphRAG/assets/img/tgi_dashboard.png
new file mode 100644
index 0000000000000000000000000000000000000000..8fcd3ac568b350ab5f935e06527dd379219e0875
GIT binary patch

From f74e4be9fcd12c971435275e0f5884b1e7c633d8 Mon Sep 17 00:00:00 2001
From: Rita Brugarolas <rita.brugarolas.brufau@intel.com>
Date: Tue, 29 Oct 2024 21:59:56 +0000
Subject: [PATCH 22/26] PR bkm feedback minor fixes

Signed-off-by: Rita Brugarolas <rita.brugarolas.brufau@intel.com>
---
 GraphRAG/Dockerfile                                 |  2 --
 GraphRAG/README.md                                  | 13 ++++++++++++-
 GraphRAG/docker_compose/install_docker.sh           |  4 ++--
 .../docker_compose/intel/hpu/gaudi/compose.yaml     |  2 --
 GraphRAG/docker_compose/intel/hpu/gaudi/set_env.sh  |  5 +++--
 GraphRAG/graphrag.py                                |  1 -
 GraphRAG/tests/test_compose.sh                      |  3 +--
 7 files changed, 18 insertions(+), 12 deletions(-)

diff --git a/GraphRAG/Dockerfile b/GraphRAG/Dockerfile
index a7cda7d29c..eb2d7caf41 100644
--- a/GraphRAG/Dockerfile
+++ b/GraphRAG/Dockerfile
@@ -1,5 +1,3 @@
-
-
 # Copyright (C) 2024 Intel Corporation
 # SPDX-License-Identifier: Apache-2.0
 
diff --git a/GraphRAG/README.md b/GraphRAG/README.md
index 2e43425ae7..9fd0e1338b 100644
--- a/GraphRAG/README.md
+++ b/GraphRAG/README.md
@@ -8,6 +8,7 @@ GraphRAG was introduced by Microsoft paper "From Local to Global: A Graph RAG Ap
 - For an input query the relevant communities are identified and partial answers are generated from each of the community summaries (query-focused summarization (QFS))
 - There is a final generation stage that responds to the query based on the intermediate community answers.
 
+
 ## Deploy GraphRAG Service
 
 The GraphRAG service can be effortlessly deployed on Intel Gaudi2, Intel Xeon Scalable Processors.
@@ -20,6 +21,7 @@ Quick Start Deployment Steps:
 
 Note: If you do not have docker installed you can run this script to install docker : `bash docker_compose/install_docker.sh`
 
+
 ### Quick Start: 1.Setup Environment Variable
 
 To set up environment variables for deploying GraphRAG services, follow these steps:
@@ -51,6 +53,7 @@ To set up environment variables for deploying GraphRAG services, follow these st
    source ./docker_compose/intel/hpu/gaudi/set_env.sh
    ```
 
+
 ### Quick Start: 2.Run Docker Compose
 
 If the microservice images are available in Docker Hub they will be pulled, otherwise you will need to build the container images manually. Please refer to the 'Build Docker Images' in [Guide](../ChatQnA/docker_compose/intel/cpu/xeon/README.md). [test_compose.sh](tests/test_compose.sh) can be a good resource as it shows how to do image build, starting services, validated each microservices and megaservices. This is what is used in CI/CD.
@@ -62,6 +65,7 @@ cd GraphRAG/docker_compose/intel/hpu/gaudi
 docker compose -f compose.yaml up -d
 ```
 
+
 ### QuickStart: 3.Upload RAG Files and Consume the GraphRAG Service
 
 To chat with retrieved information, you need to upload a file using `Dataprep` service.
@@ -85,6 +89,7 @@ curl http://${host_ip}:8888/v1/graphrag \
     "}]}'
 ```
 
+
 ## Architecture and Deploy details
 
 The GraphRAG example is implemented using the component-level microservices defined in [GenAIComps](https://github.com/opea-project/GenAIComps). The flow chart below shows the information flow between different microservices for this example.
@@ -174,9 +179,10 @@ Gaudi default compose.yaml
 | LLM | Llama-index, TGI | Gaudi | 6005 | /v1/chat/completions |
 | Dataprep | Neo4j, LlamaIndex | Xeon | 6004 | /v1/dataprep |
 
+
 ### Models Selection
 
-GraphRAG quality dependents heavily on the ability to extract a high quality graph. We highly recommend using the best model availableto you. Table below shows default models specified in the codebase when OPENAI_API_KEY is available and for local inference w TEI/TGI. The local models are small since those will be used in CI/CD but users should improve upon these by changing the `xxx_MODEL_ID` in `docker_compose/xxx/set_env.sh`.
+GraphRAG quality dependents heavily on the ability to extract a high quality graph. We highly recommend using the best model available to you. Table below shows default models specified in the codebase when OPENAI_API_KEY is available and for local inference w TEI/TGI. The local models are small since those will be used in CI/CD but users should improve upon these by changing the `xxx_MODEL_ID` in `docker_compose/xxx/set_env.sh`.
 
 Working on a table comparison of various model sizes vs. naive RAG with a dataset that reflects well the benefits of GraphRAG. Stay tuned!
 
@@ -187,6 +193,7 @@ Working on a table comparison of various model sizes vs. naive RAG with a datase
 | LLM       | gpt-4o                                |
 | LLM       | "meta-llama/Meta-Llama-3-8B-Instruct" |
 
+
 ## Consume GraphRAG Service with RAG
 
 ### Check Service Status
@@ -197,6 +204,7 @@ Before consuming GraphRAG Service, make sure each microservice is ready by check
 docker logs container_name
 ```
 
+
 ### Upload RAG Files
 
 To chat with retrieved information, you need to upload a file using `Dataprep` service.
@@ -212,6 +220,7 @@ curl -X POST "http://${host_ip}:6007/v1/dataprep" \
     -F "files=@./nke-10k-2023.pdf"
 ```
 
+
 ### Consume GraphRAG Service
 
 Two ways of consuming GraphRAG Service:
@@ -234,6 +243,7 @@ curl http://${host_ip}:8888/v1/graphrag \
 
    If you choose conversational UI, use this URL: `http://{host_ip}:5174`
 
+
 ## Troubleshooting
 
 1. If you get errors like "Access Denied", [validate micro service](https://github.com/opea-project/GenAIExamples/blob/main/ChatQnA/docker_compose/intel/cpu/xeon/README.md#validate-microservices) first. A simple example:
@@ -246,6 +256,7 @@ curl http://${host_ip}:8888/v1/graphrag \
 
 3. (Docker only) If you get errors like "The container name is in use", change container name in `compose.yaml`.
 
+
 ## Monitoring OPEA Service with Prometheus and Grafana dashboard
 
 OPEA microservice deployment can easily be monitored through Grafana dashboards in conjunction with Prometheus data collection. Follow the [README](https://github.com/opea-project/GenAIEval/blob/main/evals/benchmark/grafana/README.md) to setup Prometheus and Grafana servers and import dashboards to monitor the OPEA service.
diff --git a/GraphRAG/docker_compose/install_docker.sh b/GraphRAG/docker_compose/install_docker.sh
index 8774c5756d..a372e580b4 100644
--- a/GraphRAG/docker_compose/install_docker.sh
+++ b/GraphRAG/docker_compose/install_docker.sh
@@ -7,7 +7,7 @@
 sudo apt-get -y update
 
 # Install prerequisites
-sudo apt-get -y install ca-certificates curl
+sudo apt-get -y install ca-certificates curl --no-install-recommends --fix-missing
 
 # Create the directory for the Docker GPG key
 sudo install -m 0755 -d /etc/apt/keyrings
@@ -26,7 +26,7 @@ echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.
 sudo apt-get -y update
 
 # Install Docker packages
-sudo apt-get -y install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
+sudo apt-get -y install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin --no-install-recommends --fix-missing
 
 # add existing user
 sudo usermod -aG docker $USER
diff --git a/GraphRAG/docker_compose/intel/hpu/gaudi/compose.yaml b/GraphRAG/docker_compose/intel/hpu/gaudi/compose.yaml
index b285dbf884..b03cba56ab 100644
--- a/GraphRAG/docker_compose/intel/hpu/gaudi/compose.yaml
+++ b/GraphRAG/docker_compose/intel/hpu/gaudi/compose.yaml
@@ -134,8 +134,6 @@ services:
       - https_proxy=${https_proxy}
       - http_proxy=${http_proxy}
       - MEGA_SERVICE_HOST_IP=graphrag-gaudi-backend-server
-#      - EMBEDDING_SERVER_HOST_IP=tei-embedding-service
-#      - EMBEDDING_SERVER_PORT=${EMBEDDING_SERVER_PORT:-80}
       - RETRIEVER_SERVICE_HOST_IP=retriever-neo4j-llamaindex
       - RETRIEVER_SERVICE_PORT=6009
       - RETRIEVER_SERVICE_PORT=${RETRIEVER_SERVICE_PORT:-80}
diff --git a/GraphRAG/docker_compose/intel/hpu/gaudi/set_env.sh b/GraphRAG/docker_compose/intel/hpu/gaudi/set_env.sh
index 59c400466b..1d4e8d7d5c 100644
--- a/GraphRAG/docker_compose/intel/hpu/gaudi/set_env.sh
+++ b/GraphRAG/docker_compose/intel/hpu/gaudi/set_env.sh
@@ -3,8 +3,9 @@
 # Copyright (C) 2024 Intel Corporation
 # SPDX-License-Identifier: Apache-2.0
 
-#Remember to set your private variables mentioned in README
-#host_ip, OPENAI_API_KEY, HUGGINGFACEHUB_API_TOKEN, proxies...
+# Remember to set your private variables mentioned in README
+
+# host_ip, OPENAI_API_KEY, HUGGINGFACEHUB_API_TOKEN, proxies...
 
 export EMBEDDING_MODEL_ID="BAAI/bge-base-en-v1.5"
 export OPENAI_EMBEDDING_MODEL="text-embedding-3-small"
diff --git a/GraphRAG/graphrag.py b/GraphRAG/graphrag.py
index d838360537..022a3aad31 100644
--- a/GraphRAG/graphrag.py
+++ b/GraphRAG/graphrag.py
@@ -123,7 +123,6 @@ def __init__(self, host="0.0.0.0", port=8000):
         self.megaservice = ServiceOrchestrator()
 
     def add_remote_service(self):
-
         retriever = MicroService(
             name="retriever",
             host=RETRIEVER_SERVICE_HOST_IP,
diff --git a/GraphRAG/tests/test_compose.sh b/GraphRAG/tests/test_compose.sh
index 85fced2515..4ab87eeb19 100755
--- a/GraphRAG/tests/test_compose.sh
+++ b/GraphRAG/tests/test_compose.sh
@@ -36,7 +36,6 @@ function start_services() {
     export EMBEDDING_MODEL_ID="BAAI/bge-base-en-v1.5"
     export LLM_MODEL_ID="meta-llama/Meta-Llama-3-8B-Instruct"
     export HUGGINGFACEHUB_API_TOKEN=${HUGGINGFACEHUB_API_TOKEN}
-    #this will need to be updated with the set_env variables and how about the required from private????
 
     # Start Docker Containers
     docker compose -f compose.yaml up -d > ${LOG_PATH}/start_services_with_compose.log
@@ -91,7 +90,7 @@ function validate_service() {
         fi
     fi
 
-    sleep 1s
+    sleep 5s
 }
 
 function validate_microservices() {

From 3f256b9be103c33329d7fbd191b293f1ac8c6370 Mon Sep 17 00:00:00 2001
From: "pre-commit-ci[bot]"
 <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Date: Tue, 29 Oct 2024 21:54:28 +0000
Subject: [PATCH 23/26] [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci
---
 GraphRAG/README.md | 11 -----------
 1 file changed, 11 deletions(-)

diff --git a/GraphRAG/README.md b/GraphRAG/README.md
index 9fd0e1338b..10e281ae90 100644
--- a/GraphRAG/README.md
+++ b/GraphRAG/README.md
@@ -8,7 +8,6 @@ GraphRAG was introduced by Microsoft paper "From Local to Global: A Graph RAG Ap
 - For an input query the relevant communities are identified and partial answers are generated from each of the community summaries (query-focused summarization (QFS))
 - There is a final generation stage that responds to the query based on the intermediate community answers.
 
-
 ## Deploy GraphRAG Service
 
 The GraphRAG service can be effortlessly deployed on Intel Gaudi2, Intel Xeon Scalable Processors.
@@ -21,7 +20,6 @@ Quick Start Deployment Steps:
 
 Note: If you do not have docker installed you can run this script to install docker : `bash docker_compose/install_docker.sh`
 
-
 ### Quick Start: 1.Setup Environment Variable
 
 To set up environment variables for deploying GraphRAG services, follow these steps:
@@ -53,7 +51,6 @@ To set up environment variables for deploying GraphRAG services, follow these st
    source ./docker_compose/intel/hpu/gaudi/set_env.sh
    ```
 
-
 ### Quick Start: 2.Run Docker Compose
 
 If the microservice images are available in Docker Hub they will be pulled, otherwise you will need to build the container images manually. Please refer to the 'Build Docker Images' in [Guide](../ChatQnA/docker_compose/intel/cpu/xeon/README.md). [test_compose.sh](tests/test_compose.sh) can be a good resource as it shows how to do image build, starting services, validated each microservices and megaservices. This is what is used in CI/CD.
@@ -65,7 +62,6 @@ cd GraphRAG/docker_compose/intel/hpu/gaudi
 docker compose -f compose.yaml up -d
 ```
 
-
 ### QuickStart: 3.Upload RAG Files and Consume the GraphRAG Service
 
 To chat with retrieved information, you need to upload a file using `Dataprep` service.
@@ -89,7 +85,6 @@ curl http://${host_ip}:8888/v1/graphrag \
     "}]}'
 ```
 
-
 ## Architecture and Deploy details
 
 The GraphRAG example is implemented using the component-level microservices defined in [GenAIComps](https://github.com/opea-project/GenAIComps). The flow chart below shows the information flow between different microservices for this example.
@@ -179,7 +174,6 @@ Gaudi default compose.yaml
 | LLM | Llama-index, TGI | Gaudi | 6005 | /v1/chat/completions |
 | Dataprep | Neo4j, LlamaIndex | Xeon | 6004 | /v1/dataprep |
 
-
 ### Models Selection
 
 GraphRAG quality dependents heavily on the ability to extract a high quality graph. We highly recommend using the best model available to you. Table below shows default models specified in the codebase when OPENAI_API_KEY is available and for local inference w TEI/TGI. The local models are small since those will be used in CI/CD but users should improve upon these by changing the `xxx_MODEL_ID` in `docker_compose/xxx/set_env.sh`.
@@ -193,7 +187,6 @@ Working on a table comparison of various model sizes vs. naive RAG with a datase
 | LLM       | gpt-4o                                |
 | LLM       | "meta-llama/Meta-Llama-3-8B-Instruct" |
 
-
 ## Consume GraphRAG Service with RAG
 
 ### Check Service Status
@@ -204,7 +197,6 @@ Before consuming GraphRAG Service, make sure each microservice is ready by check
 docker logs container_name
 ```
 
-
 ### Upload RAG Files
 
 To chat with retrieved information, you need to upload a file using `Dataprep` service.
@@ -220,7 +212,6 @@ curl -X POST "http://${host_ip}:6007/v1/dataprep" \
     -F "files=@./nke-10k-2023.pdf"
 ```
 
-
 ### Consume GraphRAG Service
 
 Two ways of consuming GraphRAG Service:
@@ -243,7 +234,6 @@ curl http://${host_ip}:8888/v1/graphrag \
 
    If you choose conversational UI, use this URL: `http://{host_ip}:5174`
 
-
 ## Troubleshooting
 
 1. If you get errors like "Access Denied", [validate micro service](https://github.com/opea-project/GenAIExamples/blob/main/ChatQnA/docker_compose/intel/cpu/xeon/README.md#validate-microservices) first. A simple example:
@@ -256,7 +246,6 @@ curl http://${host_ip}:8888/v1/graphrag \
 
 3. (Docker only) If you get errors like "The container name is in use", change container name in `compose.yaml`.
 
-
 ## Monitoring OPEA Service with Prometheus and Grafana dashboard
 
 OPEA microservice deployment can easily be monitored through Grafana dashboards in conjunction with Prometheus data collection. Follow the [README](https://github.com/opea-project/GenAIEval/blob/main/evals/benchmark/grafana/README.md) to setup Prometheus and Grafana servers and import dashboards to monitor the OPEA service.

From 2b78b046b0b079a9acce40374d01019d75dce2b6 Mon Sep 17 00:00:00 2001
From: Rita Brugarolas <rita.brugarolas.brufau@intel.com>
Date: Wed, 30 Oct 2024 04:34:16 +0000
Subject: [PATCH 24/26] change component references to main branch instead of
 fork and minor readability fixes

Signed-off-by: Rita Brugarolas <rita.brugarolas.brufau@intel.com>
---
 GraphRAG/docker_compose/install_docker.sh | 2 +-
 GraphRAG/tests/test_compose.sh            | 4 +---
 GraphRAG/ui/docker/Dockerfile             | 2 +-
 GraphRAG/ui/docker/Dockerfile.react       | 2 --
 4 files changed, 3 insertions(+), 7 deletions(-)

diff --git a/GraphRAG/docker_compose/install_docker.sh b/GraphRAG/docker_compose/install_docker.sh
index a372e580b4..d2a495bde3 100644
--- a/GraphRAG/docker_compose/install_docker.sh
+++ b/GraphRAG/docker_compose/install_docker.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 # Copyright (C) 2024 Intel Corporation
 # SPDX-License-Identifier: Apache-2.0
diff --git a/GraphRAG/tests/test_compose.sh b/GraphRAG/tests/test_compose.sh
index 4ab87eeb19..0fc2278300 100755
--- a/GraphRAG/tests/test_compose.sh
+++ b/GraphRAG/tests/test_compose.sh
@@ -17,9 +17,7 @@ ip_address=$(hostname -I | awk '{print $1}')
 
 function build_docker_images() {
     cd $WORKPATH/docker_image_build
-    #TODO update the main when components are merged
-    #git clone https://github.com/opea-project/GenAIComps.git && cd GenAIComps && git checkout "${opea_branch:-"main"}" && cd ../
-    git clone https://github.com/rbrugaro/GenAIComps.git && cd GenAIComps && git checkout "${opea_branch:-"graphRAG_LI"}" && cd ../
+    git clone https://github.com/opea-project/GenAIComps.git && cd GenAIComps && git checkout "${opea_branch:-"main"}" && cd ../
 
     echo "Build all the images with --no-cache, check docker_image_build.log for details..."
     service_list="graphrag dataprep-neo4j-llamaindex retriever-neo4j-llamaindex chatqna-gaudi-ui-server chatqna-gaudi-nginx-server"
diff --git a/GraphRAG/ui/docker/Dockerfile b/GraphRAG/ui/docker/Dockerfile
index ac2bb7da31..ef034e67cc 100644
--- a/GraphRAG/ui/docker/Dockerfile
+++ b/GraphRAG/ui/docker/Dockerfile
@@ -5,7 +5,7 @@
 FROM node:20.11.1
 
 # Update package manager and install Git
-RUN apt-get update -y && apt-get install -y git
+RUN apt-get update -y && apt-get install -y git --no-install-recommends --fix-missing
 
 # Copy the front-end code repository
 COPY svelte /home/user/svelte
diff --git a/GraphRAG/ui/docker/Dockerfile.react b/GraphRAG/ui/docker/Dockerfile.react
index 49bc13124c..9c4eff8425 100644
--- a/GraphRAG/ui/docker/Dockerfile.react
+++ b/GraphRAG/ui/docker/Dockerfile.react
@@ -7,11 +7,9 @@ FROM node:20.11.1 as vite-app
 COPY react /usr/app/react
 WORKDIR /usr/app/react
 
-
 RUN ["npm", "install"]
 RUN ["npm", "run", "build"]
 
-
 FROM nginx:alpine
 
 COPY --from=vite-app /usr/app/react/dist /usr/share/nginx/html

From 52b7b807c093b208bd1c50a9a50dd18210354dcb Mon Sep 17 00:00:00 2001
From: Rita Brugarolas <rita.brugarolas.brufau@intel.com>
Date: Wed, 30 Oct 2024 04:39:02 +0000
Subject: [PATCH 25/26] fix repo link

Signed-off-by: Rita Brugarolas <rita.brugarolas.brufau@intel.com>
---
 GraphRAG/Dockerfile | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/GraphRAG/Dockerfile b/GraphRAG/Dockerfile
index eb2d7caf41..bf01c01b2e 100644
--- a/GraphRAG/Dockerfile
+++ b/GraphRAG/Dockerfile
@@ -13,8 +13,7 @@ RUN useradd -m -s /bin/bash user && \
     chown -R user /home/user/
 
 WORKDIR /home/user/
-#RUN git clone https://github.com/opea-project/GenAIComps.git
-RUN git clone --branch graphRAG_LI https://github.com/rbrugaro/GenAIComps.git
+RUN git clone https://github.com/opea-project/GenAIComps.git
 
 WORKDIR /home/user/GenAIComps
 RUN pip install --no-cache-dir --upgrade pip && \

From d36b2809079515b1b266bfc06be0c7406c0a671c Mon Sep 17 00:00:00 2001
From: Rita Brugarolas <rita.brugarolas.brufau@intel.com>
Date: Wed, 30 Oct 2024 06:26:13 +0000
Subject: [PATCH 26/26] updated license in svelte UI

Signed-off-by: Rita Brugarolas <rita.brugarolas.brufau@intel.com>
---
 .../src/components/sidebar/sidebar.module.scss    | 15 ++-------------
 GraphRAG/ui/svelte/.eslintrc.cjs                  | 15 ++-------------
 GraphRAG/ui/svelte/postcss.config.cjs             | 15 ++-------------
 GraphRAG/ui/svelte/src/app.d.ts                   | 15 ++-------------
 GraphRAG/ui/svelte/src/app.html                   | 15 ++-------------
 .../src/lib/assets/avatar/svelte/Delete.svelte    | 15 ++-------------
 .../src/lib/assets/chat/svelte/Assistant.svelte   | 15 ++-------------
 .../lib/assets/chat/svelte/PaperAirplane.svelte   | 15 ++-------------
 .../lib/assets/chat/svelte/PersonOutlined.svelte  | 15 ++-------------
 .../ui/svelte/src/lib/assets/upload/next.svelte   | 15 ++-------------
 .../svelte/src/lib/assets/upload/previous.svelte  | 15 ++-------------
 .../src/lib/modules/chat/ChatMessage.svelte       | 15 ++-------------
 .../src/lib/modules/chat/MessageAvatar.svelte     | 15 ++-------------
 .../src/lib/modules/chat/MessageTimer.svelte      | 15 ++-------------
 .../ui/svelte/src/lib/modules/frame/Layout.svelte | 15 ++-------------
 .../ui/svelte/src/lib/network/chat/Network.ts     | 15 ++-------------
 GraphRAG/ui/svelte/src/lib/shared/Utils.ts        | 15 ++-------------
 .../src/lib/shared/components/chat/gallery.svelte | 15 ++-------------
 .../lib/shared/components/loading/Loading.svelte  | 15 ++-------------
 .../shared/components/scrollbar/Scrollbar.svelte  | 15 ++-------------
 .../components/upload/PasteKnowledge.svelte       | 15 ++-------------
 .../components/upload/upload-knowledge.svelte     | 15 ++-------------
 .../shared/components/upload/uploadFile.svelte    | 15 ++-------------
 .../svelte/src/lib/shared/constant/Interface.ts   | 15 ++-------------
 .../svelte/src/lib/shared/stores/common/Store.ts  | 15 ++-------------
 GraphRAG/ui/svelte/src/routes/+layout.svelte      | 15 ++-------------
 GraphRAG/ui/svelte/src/routes/+page.svelte        | 15 ++-------------
 GraphRAG/ui/svelte/src/routes/+page.ts            | 15 ++-------------
 GraphRAG/ui/svelte/tailwind.config.cjs            | 15 ++-------------
 GraphRAG/ui/svelte/vite.config.ts                 | 15 ++-------------
 30 files changed, 60 insertions(+), 390 deletions(-)

diff --git a/GraphRAG/ui/react/src/components/sidebar/sidebar.module.scss b/GraphRAG/ui/react/src/components/sidebar/sidebar.module.scss
index b58a253c27..1ce0b33b3e 100644
--- a/GraphRAG/ui/react/src/components/sidebar/sidebar.module.scss
+++ b/GraphRAG/ui/react/src/components/sidebar/sidebar.module.scss
@@ -1,17 +1,6 @@
 /**
-  Copyright (c) 2024 Intel Corporation
-
-  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 Intel Corporation
+SPDX-License-Identifier: Apache-2.0
   
   **/
 
diff --git a/GraphRAG/ui/svelte/.eslintrc.cjs b/GraphRAG/ui/svelte/.eslintrc.cjs
index a6592d11f7..4667a6ce89 100644
--- a/GraphRAG/ui/svelte/.eslintrc.cjs
+++ b/GraphRAG/ui/svelte/.eslintrc.cjs
@@ -1,16 +1,5 @@
-// Copyright (c) 2024 Intel Corporation
-//
-// 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 Intel Corporation
+// SPDX-License-Identifier: Apache-2.0
 
 module.exports = {
 	root: true,
diff --git a/GraphRAG/ui/svelte/postcss.config.cjs b/GraphRAG/ui/svelte/postcss.config.cjs
index b384b43ebe..ca1386f9b4 100644
--- a/GraphRAG/ui/svelte/postcss.config.cjs
+++ b/GraphRAG/ui/svelte/postcss.config.cjs
@@ -1,16 +1,5 @@
-// Copyright (c) 2024 Intel Corporation
-//
-// 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 Intel Corporation
+// SPDX-License-Identifier: Apache-2.0
 
 const tailwindcss = require("tailwindcss");
 const autoprefixer = require("autoprefixer");
diff --git a/GraphRAG/ui/svelte/src/app.d.ts b/GraphRAG/ui/svelte/src/app.d.ts
index fa6a0abf77..b70d835b2c 100644
--- a/GraphRAG/ui/svelte/src/app.d.ts
+++ b/GraphRAG/ui/svelte/src/app.d.ts
@@ -1,16 +1,5 @@
-// Copyright (c) 2024 Intel Corporation
-//
-// 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 Intel Corporation
+// SPDX-License-Identifier: Apache-2.0
 
 // See: https://kit.svelte.dev/docs/types#app
 // import { Result} from "neverthrow";
diff --git a/GraphRAG/ui/svelte/src/app.html b/GraphRAG/ui/svelte/src/app.html
index db69926ea8..a676ff7f11 100644
--- a/GraphRAG/ui/svelte/src/app.html
+++ b/GraphRAG/ui/svelte/src/app.html
@@ -1,17 +1,6 @@
 <!--
-  Copyright (c) 2024 Intel Corporation
-
-  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 Intel Corporation
+  SPDX-License-Identifier: Apache-2.0
 -->
 
 <!doctype html>
diff --git a/GraphRAG/ui/svelte/src/lib/assets/avatar/svelte/Delete.svelte b/GraphRAG/ui/svelte/src/lib/assets/avatar/svelte/Delete.svelte
index 8847a22275..fb3f0ed654 100644
--- a/GraphRAG/ui/svelte/src/lib/assets/avatar/svelte/Delete.svelte
+++ b/GraphRAG/ui/svelte/src/lib/assets/avatar/svelte/Delete.svelte
@@ -1,17 +1,6 @@
 <!--
-  Copyright (c) 2024 Intel Corporation
-
-  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 Intel Corporation
+  SPDX-License-Identifier: Apache-2.0
 -->
 
 <script lang="ts">
diff --git a/GraphRAG/ui/svelte/src/lib/assets/chat/svelte/Assistant.svelte b/GraphRAG/ui/svelte/src/lib/assets/chat/svelte/Assistant.svelte
index b68d2a08cd..1c4642502b 100644
--- a/GraphRAG/ui/svelte/src/lib/assets/chat/svelte/Assistant.svelte
+++ b/GraphRAG/ui/svelte/src/lib/assets/chat/svelte/Assistant.svelte
@@ -1,17 +1,6 @@
 <!--
-  Copyright (c) 2024 Intel Corporation
-
-  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 Intel Corporation
+  SPDX-License-Identifier: Apache-2.0
 -->
 
 	<!-- <svg
diff --git a/GraphRAG/ui/svelte/src/lib/assets/chat/svelte/PaperAirplane.svelte b/GraphRAG/ui/svelte/src/lib/assets/chat/svelte/PaperAirplane.svelte
index d1d14077f2..efecfcf704 100644
--- a/GraphRAG/ui/svelte/src/lib/assets/chat/svelte/PaperAirplane.svelte
+++ b/GraphRAG/ui/svelte/src/lib/assets/chat/svelte/PaperAirplane.svelte
@@ -1,17 +1,6 @@
 <!--
-  Copyright (c) 2024 Intel Corporation
-
-  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 Intel Corporation
+  SPDX-License-Identifier: Apache-2.0
 -->
 
 <script lang="ts">
diff --git a/GraphRAG/ui/svelte/src/lib/assets/chat/svelte/PersonOutlined.svelte b/GraphRAG/ui/svelte/src/lib/assets/chat/svelte/PersonOutlined.svelte
index dd2f9fdb78..870e2ed5a8 100644
--- a/GraphRAG/ui/svelte/src/lib/assets/chat/svelte/PersonOutlined.svelte
+++ b/GraphRAG/ui/svelte/src/lib/assets/chat/svelte/PersonOutlined.svelte
@@ -1,17 +1,6 @@
 <!--
-  Copyright (c) 2024 Intel Corporation
-
-  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 Intel Corporation
+  SPDX-License-Identifier: Apache-2.0
 -->
 
 <!-- <svg
diff --git a/GraphRAG/ui/svelte/src/lib/assets/upload/next.svelte b/GraphRAG/ui/svelte/src/lib/assets/upload/next.svelte
index 70f4fe25e8..ecbd7ba6b3 100644
--- a/GraphRAG/ui/svelte/src/lib/assets/upload/next.svelte
+++ b/GraphRAG/ui/svelte/src/lib/assets/upload/next.svelte
@@ -1,17 +1,6 @@
 <!--
-  Copyright (c) 2024 Intel Corporation
-
-  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 Intel Corporation
+  SPDX-License-Identifier: Apache-2.0
 -->
 
 <svg
diff --git a/GraphRAG/ui/svelte/src/lib/assets/upload/previous.svelte b/GraphRAG/ui/svelte/src/lib/assets/upload/previous.svelte
index c47d9c49da..a1e4a19be5 100644
--- a/GraphRAG/ui/svelte/src/lib/assets/upload/previous.svelte
+++ b/GraphRAG/ui/svelte/src/lib/assets/upload/previous.svelte
@@ -1,17 +1,6 @@
 <!--
-  Copyright (c) 2024 Intel Corporation
-
-  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 Intel Corporation
+  SPDX-License-Identifier: Apache-2.0
 -->
 
 <svg
diff --git a/GraphRAG/ui/svelte/src/lib/modules/chat/ChatMessage.svelte b/GraphRAG/ui/svelte/src/lib/modules/chat/ChatMessage.svelte
index b136997083..a9f8c606ef 100644
--- a/GraphRAG/ui/svelte/src/lib/modules/chat/ChatMessage.svelte
+++ b/GraphRAG/ui/svelte/src/lib/modules/chat/ChatMessage.svelte
@@ -1,17 +1,6 @@
 <!--
-  Copyright (c) 2024 Intel Corporation
-
-  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 Intel Corporation
+  SPDX-License-Identifier: Apache-2.0
 -->
 
 <script lang="ts">
diff --git a/GraphRAG/ui/svelte/src/lib/modules/chat/MessageAvatar.svelte b/GraphRAG/ui/svelte/src/lib/modules/chat/MessageAvatar.svelte
index 0f6a24b96d..c308840c4c 100644
--- a/GraphRAG/ui/svelte/src/lib/modules/chat/MessageAvatar.svelte
+++ b/GraphRAG/ui/svelte/src/lib/modules/chat/MessageAvatar.svelte
@@ -1,17 +1,6 @@
 <!--
-  Copyright (c) 2024 Intel Corporation
-
-  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 Intel Corporation
+  SPDX-License-Identifier: Apache-2.0
 -->
 
 <script lang="ts">
diff --git a/GraphRAG/ui/svelte/src/lib/modules/chat/MessageTimer.svelte b/GraphRAG/ui/svelte/src/lib/modules/chat/MessageTimer.svelte
index 0f441226db..858e2c5726 100644
--- a/GraphRAG/ui/svelte/src/lib/modules/chat/MessageTimer.svelte
+++ b/GraphRAG/ui/svelte/src/lib/modules/chat/MessageTimer.svelte
@@ -1,17 +1,6 @@
 <!--
-  Copyright (c) 2024 Intel Corporation
-
-  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 Intel Corporation
+  SPDX-License-Identifier: Apache-2.0
 -->
 
 <script lang="ts">
diff --git a/GraphRAG/ui/svelte/src/lib/modules/frame/Layout.svelte b/GraphRAG/ui/svelte/src/lib/modules/frame/Layout.svelte
index 0c5b997d28..1922a081c5 100644
--- a/GraphRAG/ui/svelte/src/lib/modules/frame/Layout.svelte
+++ b/GraphRAG/ui/svelte/src/lib/modules/frame/Layout.svelte
@@ -1,17 +1,6 @@
 <!--
-  Copyright (c) 2024 Intel Corporation
-
-  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 Intel Corporation
+  SPDX-License-Identifier: Apache-2.0
 -->
 
 <script lang="ts">
diff --git a/GraphRAG/ui/svelte/src/lib/network/chat/Network.ts b/GraphRAG/ui/svelte/src/lib/network/chat/Network.ts
index 64ce8e8f79..d0ae7b701d 100644
--- a/GraphRAG/ui/svelte/src/lib/network/chat/Network.ts
+++ b/GraphRAG/ui/svelte/src/lib/network/chat/Network.ts
@@ -1,16 +1,5 @@
-// Copyright (c) 2024 Intel Corporation
-//
-// 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 Intel Corporation
+//  SPDX-License-Identifier: Apache-2.0
 
 import { env } from "$env/dynamic/public";
 import { SSE } from "sse.js";
diff --git a/GraphRAG/ui/svelte/src/lib/shared/Utils.ts b/GraphRAG/ui/svelte/src/lib/shared/Utils.ts
index fb182cef67..0921044072 100644
--- a/GraphRAG/ui/svelte/src/lib/shared/Utils.ts
+++ b/GraphRAG/ui/svelte/src/lib/shared/Utils.ts
@@ -1,16 +1,5 @@
-// Copyright (c) 2024 Intel Corporation
-//
-// 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 Intel Corporation
+//  SPDX-License-Identifier: Apache-2.0
 
 export function scrollToBottom(scrollToDiv: HTMLElement) {
 	if (scrollToDiv) {
diff --git a/GraphRAG/ui/svelte/src/lib/shared/components/chat/gallery.svelte b/GraphRAG/ui/svelte/src/lib/shared/components/chat/gallery.svelte
index a89e857b6b..6a3cc68f2c 100644
--- a/GraphRAG/ui/svelte/src/lib/shared/components/chat/gallery.svelte
+++ b/GraphRAG/ui/svelte/src/lib/shared/components/chat/gallery.svelte
@@ -1,17 +1,6 @@
 <!--
-  Copyright (c) 2024 Intel Corporation
-
-  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 Intel Corporation
+  SPDX-License-Identifier: Apache-2.0
 -->
 
 <script lang="ts">
diff --git a/GraphRAG/ui/svelte/src/lib/shared/components/loading/Loading.svelte b/GraphRAG/ui/svelte/src/lib/shared/components/loading/Loading.svelte
index 51e89cfe7e..40f76ddd05 100644
--- a/GraphRAG/ui/svelte/src/lib/shared/components/loading/Loading.svelte
+++ b/GraphRAG/ui/svelte/src/lib/shared/components/loading/Loading.svelte
@@ -1,17 +1,6 @@
 <!--
-  Copyright (c) 2024 Intel Corporation
-
-  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 Intel Corporation
+  SPDX-License-Identifier: Apache-2.0
 -->
 
 <div
diff --git a/GraphRAG/ui/svelte/src/lib/shared/components/scrollbar/Scrollbar.svelte b/GraphRAG/ui/svelte/src/lib/shared/components/scrollbar/Scrollbar.svelte
index f18e23e690..07c2c63078 100644
--- a/GraphRAG/ui/svelte/src/lib/shared/components/scrollbar/Scrollbar.svelte
+++ b/GraphRAG/ui/svelte/src/lib/shared/components/scrollbar/Scrollbar.svelte
@@ -1,17 +1,6 @@
 <!--
-  Copyright (c) 2024 Intel Corporation
-
-  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 Intel Corporation
+  SPDX-License-Identifier: Apache-2.0
 -->
 
 <script lang="ts">
diff --git a/GraphRAG/ui/svelte/src/lib/shared/components/upload/PasteKnowledge.svelte b/GraphRAG/ui/svelte/src/lib/shared/components/upload/PasteKnowledge.svelte
index d0758e770c..92c95105bc 100644
--- a/GraphRAG/ui/svelte/src/lib/shared/components/upload/PasteKnowledge.svelte
+++ b/GraphRAG/ui/svelte/src/lib/shared/components/upload/PasteKnowledge.svelte
@@ -1,17 +1,6 @@
 <!--
-  Copyright (c) 2024 Intel Corporation
-
-  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 Intel Corporation
+  SPDX-License-Identifier: Apache-2.0
 -->
 
 <script lang="ts">
diff --git a/GraphRAG/ui/svelte/src/lib/shared/components/upload/upload-knowledge.svelte b/GraphRAG/ui/svelte/src/lib/shared/components/upload/upload-knowledge.svelte
index 09a22a6ba7..18a7e44fa9 100644
--- a/GraphRAG/ui/svelte/src/lib/shared/components/upload/upload-knowledge.svelte
+++ b/GraphRAG/ui/svelte/src/lib/shared/components/upload/upload-knowledge.svelte
@@ -1,17 +1,6 @@
 <!--
-  Copyright (c) 2024 Intel Corporation
-
-  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 Intel Corporation
+  SPDX-License-Identifier: Apache-2.0
 -->
 
 <script lang="ts">
diff --git a/GraphRAG/ui/svelte/src/lib/shared/components/upload/uploadFile.svelte b/GraphRAG/ui/svelte/src/lib/shared/components/upload/uploadFile.svelte
index 541e115599..79297cdbaf 100644
--- a/GraphRAG/ui/svelte/src/lib/shared/components/upload/uploadFile.svelte
+++ b/GraphRAG/ui/svelte/src/lib/shared/components/upload/uploadFile.svelte
@@ -1,17 +1,6 @@
 <!--
-  Copyright (c) 2024 Intel Corporation
-
-  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 Intel Corporation
+  SPDX-License-Identifier: Apache-2.0
 -->
 
 <script lang="ts">
diff --git a/GraphRAG/ui/svelte/src/lib/shared/constant/Interface.ts b/GraphRAG/ui/svelte/src/lib/shared/constant/Interface.ts
index 221f17a263..758756d5c6 100644
--- a/GraphRAG/ui/svelte/src/lib/shared/constant/Interface.ts
+++ b/GraphRAG/ui/svelte/src/lib/shared/constant/Interface.ts
@@ -1,16 +1,5 @@
-// Copyright (c) 2024 Intel Corporation
-//
-// 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 Intel Corporation
+//  SPDX-License-Identifier: Apache-2.0
 
 export enum MessageRole {
 	Assistant,
diff --git a/GraphRAG/ui/svelte/src/lib/shared/stores/common/Store.ts b/GraphRAG/ui/svelte/src/lib/shared/stores/common/Store.ts
index 7316e803a1..a9d8045680 100644
--- a/GraphRAG/ui/svelte/src/lib/shared/stores/common/Store.ts
+++ b/GraphRAG/ui/svelte/src/lib/shared/stores/common/Store.ts
@@ -1,16 +1,5 @@
-// Copyright (c) 2024 Intel Corporation
-//
-// 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 Intel Corporation
+//  SPDX-License-Identifier: Apache-2.0
 
 import { writable } from "svelte/store";
 
diff --git a/GraphRAG/ui/svelte/src/routes/+layout.svelte b/GraphRAG/ui/svelte/src/routes/+layout.svelte
index 8141177d4a..ccd163714b 100644
--- a/GraphRAG/ui/svelte/src/routes/+layout.svelte
+++ b/GraphRAG/ui/svelte/src/routes/+layout.svelte
@@ -1,17 +1,6 @@
 <!--
-  Copyright (c) 2024 Intel Corporation
-
-  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 Intel Corporation
+  SPDX-License-Identifier: Apache-2.0
 -->
 
 <script>
diff --git a/GraphRAG/ui/svelte/src/routes/+page.svelte b/GraphRAG/ui/svelte/src/routes/+page.svelte
index b6f6d9c334..7fab3b42bf 100644
--- a/GraphRAG/ui/svelte/src/routes/+page.svelte
+++ b/GraphRAG/ui/svelte/src/routes/+page.svelte
@@ -1,17 +1,6 @@
 <!--
-  Copyright (c) 2024 Intel Corporation
-
-  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 Intel Corporation
+  SPDX-License-Identifier: Apache-2.0
 -->
 
 <script lang="ts">
diff --git a/GraphRAG/ui/svelte/src/routes/+page.ts b/GraphRAG/ui/svelte/src/routes/+page.ts
index f4de8d6760..a9da50726e 100644
--- a/GraphRAG/ui/svelte/src/routes/+page.ts
+++ b/GraphRAG/ui/svelte/src/routes/+page.ts
@@ -1,16 +1,5 @@
-// Copyright (c) 2024 Intel Corporation
-//
-// 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 Intel Corporation
+//  SPDX-License-Identifier: Apache-2.0
 
 import { browser } from "$app/environment";
 import { LOCAL_STORAGE_KEY } from "$lib/shared/constant/Interface";
diff --git a/GraphRAG/ui/svelte/tailwind.config.cjs b/GraphRAG/ui/svelte/tailwind.config.cjs
index 6cc3a8b951..67a1108096 100644
--- a/GraphRAG/ui/svelte/tailwind.config.cjs
+++ b/GraphRAG/ui/svelte/tailwind.config.cjs
@@ -1,16 +1,5 @@
-// Copyright (c) 2024 Intel Corporation
-//
-// 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 Intel Corporation
+//  SPDX-License-Identifier: Apache-2.0
 
 const config = {
 	content: ["./src/**/*.{html,js,svelte,ts}", "./node_modules/flowbite-svelte/**/*.{html,js,svelte,ts}"],
diff --git a/GraphRAG/ui/svelte/vite.config.ts b/GraphRAG/ui/svelte/vite.config.ts
index 1166165dca..62cc3f9a47 100644
--- a/GraphRAG/ui/svelte/vite.config.ts
+++ b/GraphRAG/ui/svelte/vite.config.ts
@@ -1,16 +1,5 @@
-// Copyright (c) 2024 Intel Corporation
-//
-// 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 Intel Corporation
+//  SPDX-License-Identifier: Apache-2.0
 
 import { sveltekit } from "@sveltejs/kit/vite";
 import type { UserConfig } from "vite";
