diff --git a/.github/workflows/_example-workflow.yml b/.github/workflows/_example-workflow.yml
index 6081ed9b1d..f66a2a323d 100644
--- a/.github/workflows/_example-workflow.yml
+++ b/.github/workflows/_example-workflow.yml
@@ -79,6 +79,7 @@ jobs:
fi
if [[ $(grep -c "vllm-gaudi:" ${docker_compose_path}) != 0 ]]; then
git clone https://github.com/HabanaAI/vllm-fork.git
+ cd vllm-fork && git checkout v0.6.4.post2+Gaudi-1.19.0 && cd ../
fi
git clone https://github.com/opea-project/GenAIComps.git
cd GenAIComps && git checkout ${{ inputs.opea_branch }} && git rev-parse HEAD && cd ../
diff --git a/AgentQnA/README.md b/AgentQnA/README.md
index de36805b11..d45b14ef55 100644
--- a/AgentQnA/README.md
+++ b/AgentQnA/README.md
@@ -2,8 +2,8 @@
## Overview
-This example showcases a hierarchical multi-agent system for question-answering applications. The architecture diagram is shown below. The supervisor agent interfaces with the user and dispatch tasks to the worker agent and other tools to gather information and come up with answers. The worker agent uses the retrieval tool to generate answers to the queries posted by the supervisor agent. Other tools used by the supervisor agent may include APIs to interface knowledge graphs, SQL databases, external knowledge bases, etc.
-![Architecture Overview](assets/agent_qna_arch.png)
+This example showcases a hierarchical multi-agent system for question-answering applications. The architecture diagram is shown below. The supervisor agent interfaces with the user and dispatch tasks to two worker agents to gather information and come up with answers. The worker RAG agent uses the retrieval tool to retrieve relevant documents from the knowledge base (a vector database). The worker SQL agent retrieve relevant data from the SQL database. Although not included in this example, but other tools such as a web search tool or a knowledge graph query tool can be used by the supervisor agent to gather information from additional sources.
+![Architecture Overview](assets/img/agent_qna_arch.png)
The AgentQnA 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.
@@ -38,6 +38,7 @@ flowchart LR
end
AG_REACT([Agent MicroService - react]):::blue
AG_RAG([Agent MicroService - rag]):::blue
+ AG_SQL([Agent MicroService - sql]):::blue
LLM_gen{{LLM Service }}
DP([Data Preparation MicroService]):::blue
TEI_RER{{Reranking service }}
@@ -51,6 +52,7 @@ flowchart LR
direction LR
a[User Input Query] --> AG_REACT
AG_REACT --> AG_RAG
+ AG_REACT --> AG_SQL
AG_RAG --> DocIndexRetriever-MegaService
EM ==> RET
RET ==> RER
@@ -59,6 +61,7 @@ flowchart LR
%% Embedding service flow
direction LR
AG_RAG <-.-> LLM_gen
+ AG_SQL <-.-> LLM_gen
AG_REACT <-.-> LLM_gen
EM <-.-> TEI_EM
RET <-.-> R_RET
@@ -75,11 +78,11 @@ flowchart LR
### Why Agent for question answering?
1. Improve relevancy of retrieved context.
- Agent can rephrase user queries, decompose user queries, and iterate to get the most relevant context for answering user's questions. Compared to conventional RAG, RAG agent can significantly improve the correctness and relevancy of the answer.
-2. Use tools to get additional knowledge.
- For example, knowledge graphs and SQL databases can be exposed as APIs for Agents to gather knowledge that may be missing in the retrieval vector database.
-3. Hierarchical agent can further improve performance.
- Expert worker agents, such as retrieval agent, knowledge graph agent, SQL agent, etc., can provide high-quality output for different aspects of a complex query, and the supervisor agent can aggregate the information together to provide a comprehensive answer.
+ RAG agent can rephrase user queries, decompose user queries, and iterate to get the most relevant context for answering user's questions. Compared to conventional RAG, RAG agent can significantly improve the correctness and relevancy of the answer.
+2. Expand scope of the agent.
+ The supervisor agent can interact with multiple worker agents that specialize in different domains with different skills (e.g., retrieve documents, write SQL queries, etc.), and thus can answer questions in multiple domains.
+3. Hierarchical multi-agents can improve performance.
+ Expert worker agents, such as RAG agent and SQL agent, can provide high-quality output for different aspects of a complex query, and the supervisor agent can aggregate the information together to provide a comprehensive answer. If we only use one agent and provide all the tools to this single agent, it may get overwhelmed and not able to provide accurate answers.
## Deployment with docker
@@ -148,28 +151,55 @@ docker build -t opea/agent:latest --build-arg https_proxy=$https_proxy --build-a
bash run_ingest_data.sh
```
-4. Launch other tools.
+4. Prepare SQL database
+ In this example, we will use the Chinook SQLite database. Run the commands below.
+
+ ```
+ # Download data
+ cd $WORKDIR
+ git clone https://github.com/lerocha/chinook-database.git
+ cp chinook-database/ChinookDatabase/DataSources/Chinook_Sqlite.sqlite $WORKDIR/GenAIExamples/AgentQnA/tests/
+ ```
+
+5. Launch other tools.
In this example, we will use some of the mock APIs provided in the Meta CRAG KDD Challenge to demonstrate the benefits of gaining additional context from mock knowledge graphs.
```
docker run -d -p=8080:8000 docker.io/aicrowd/kdd-cup-24-crag-mock-api:v0
```
-5. Launch agent services
- We provide two options for `llm_engine` of the agents: 1. open-source LLMs, 2. OpenAI models via API calls.
-
- Deploy it on Gaudi or Xeon respectively
+6. Launch multi-agent system.
+ We provide two options for `llm_engine` of the agents: 1. open-source LLMs on Intel Gaudi2, 2. OpenAI models via API calls.
::::{tab-set}
:::{tab-item} Gaudi
:sync: Gaudi
- To use open-source LLMs on Gaudi2, run commands below.
+ On Gaudi2 we will serve `meta-llama/Meta-Llama-3.1-70B-Instruct` using vllm.
+ First build vllm-gaudi docker image.
+
+ ```bash
+ cd $WORKDIR
+ git clone https://github.com/vllm-project/vllm.git
+ cd ./vllm
+ git checkout v0.6.6
+ docker build --no-cache -f Dockerfile.hpu -t opea/vllm-gaudi:latest --shm-size=128g . --build-arg https_proxy=$https_proxy --build-arg http_proxy=$http_proxy
```
- cd $WORKDIR/GenAIExamples/AgentQnA/docker_compose/intel/hpu/gaudi
- bash launch_tgi_gaudi.sh
- bash launch_agent_service_tgi_gaudi.sh
+
+ Then launch vllm on Gaudi2 with the command below.
+
+ ```bash
+ vllm_port=8086
+ model="meta-llama/Meta-Llama-3.1-70B-Instruct"
+ docker run -d --runtime=habana --rm --name "vllm-gaudi-server" -e HABANA_VISIBLE_DEVICES=0,1,2,3 -p $vllm_port:8000 -v $vllm_volume:/data -e HF_TOKEN=$HF_TOKEN -e HUGGING_FACE_HUB_TOKEN=$HF_TOKEN -e HF_HOME=/data -e OMPI_MCA_btl_vader_single_copy_mechanism=none -e PT_HPU_ENABLE_LAZY_COLLECTIVES=true -e http_proxy=$http_proxy -e https_proxy=$https_proxy -e no_proxy=$no_proxy -e VLLM_SKIP_WARMUP=true --cap-add=sys_nice --ipc=host opea/vllm-gaudi:latest --model ${model} --max-seq-len-to-capture 16384 --tensor-parallel-size 4
+ ```
+
+ Then launch Agent microservices.
+
+ ```bash
+ cd $WORKDIR/GenAIExamples/AgentQnA/docker_compose/intel/hpu/gaudi/
+ bash launch_agent_service_gaudi.sh
```
:::
@@ -179,6 +209,7 @@ docker build -t opea/agent:latest --build-arg https_proxy=$https_proxy --build-a
To use OpenAI models, run commands below.
```
+ export OPENAI_API_KEY=
cd $WORKDIR/GenAIExamples/AgentQnA/docker_compose/intel/cpu/xeon
bash launch_agent_service_openai.sh
```
@@ -195,8 +226,11 @@ Refer to the [AgentQnA helm chart](./kubernetes/helm/README.md) for instructions
First look at logs of the agent docker containers:
```
-# worker agent
+# worker RAG agent
docker logs rag-agent-endpoint
+
+# worker SQL agent
+docker logs sql-agent-endpoint
```
```
@@ -206,22 +240,36 @@ docker logs react-agent-endpoint
You should see something like "HTTP server setup successful" if the docker containers are started successfully.
-Second, validate worker agent:
+Second, validate worker RAG agent:
```
curl http://${host_ip}:9095/v1/chat/completions -X POST -H "Content-Type: application/json" -d '{
- "query": "Most recent album by Taylor Swift"
+ "messages": "Michael Jackson song Thriller"
}'
```
-Third, validate supervisor agent:
+Third, validate worker SQL agent:
+
+```
+curl http://${host_ip}:9096/v1/chat/completions -X POST -H "Content-Type: application/json" -d '{
+ "messages": "How many employees are in the company"
+ }'
+```
+
+Finally, validate supervisor agent:
```
curl http://${host_ip}:9090/v1/chat/completions -X POST -H "Content-Type: application/json" -d '{
- "query": "Most recent album by Taylor Swift"
+ "messages": "How many albums does Iron Maiden have?"
}'
```
+## Deploy AgentQnA UI
+
+The AgentQnA UI can be deployed locally or using Docker.
+
+For detailed instructions on deploying AgentQnA UI, refer to the [AgentQnA UI Guide](./ui/svelte/README.md).
+
## How to register your own tools with agent
You can take a look at the tools yaml and python files in this example. For more details, please refer to the "Provide your own tools" section in the instructions [here](https://github.com/opea-project/GenAIComps/tree/main/comps/agent/src/README.md).
diff --git a/AgentQnA/assets/agent_qna_arch.png b/AgentQnA/assets/agent_qna_arch.png
deleted file mode 100644
index 3bebb1d997..0000000000
Binary files a/AgentQnA/assets/agent_qna_arch.png and /dev/null differ
diff --git a/AgentQnA/assets/img/agent_qna_arch.png b/AgentQnA/assets/img/agent_qna_arch.png
new file mode 100644
index 0000000000..31a2039fdc
Binary files /dev/null and b/AgentQnA/assets/img/agent_qna_arch.png differ
diff --git a/AgentQnA/assets/img/agent_ui.png b/AgentQnA/assets/img/agent_ui.png
new file mode 100644
index 0000000000..154c85be83
Binary files /dev/null and b/AgentQnA/assets/img/agent_ui.png differ
diff --git a/AgentQnA/assets/img/agent_ui_result.png b/AgentQnA/assets/img/agent_ui_result.png
new file mode 100644
index 0000000000..813248d6a3
Binary files /dev/null and b/AgentQnA/assets/img/agent_ui_result.png differ
diff --git a/AgentQnA/docker_compose/intel/cpu/xeon/README.md b/AgentQnA/docker_compose/intel/cpu/xeon/README.md
index 1da7685349..dde535f2ae 100644
--- a/AgentQnA/docker_compose/intel/cpu/xeon/README.md
+++ b/AgentQnA/docker_compose/intel/cpu/xeon/README.md
@@ -41,21 +41,33 @@ This example showcases a hierarchical multi-agent system for question-answering
bash run_ingest_data.sh
```
-4. Launch Tool service
+4. Prepare SQL database
+ In this example, we will use the SQLite database provided in the [TAG-Bench](https://github.com/TAG-Research/TAG-Bench/tree/main). Run the commands below.
+
+ ```
+ # Download data
+ cd $WORKDIR
+ git clone https://github.com/TAG-Research/TAG-Bench.git
+ cd TAG-Bench/setup
+ chmod +x get_dbs.sh
+ ./get_dbs.sh
+ ```
+
+5. Launch Tool service
In this example, we will use some of the mock APIs provided in the Meta CRAG KDD Challenge to demonstrate the benefits of gaining additional context from mock knowledge graphs.
```
docker run -d -p=8080:8000 docker.io/aicrowd/kdd-cup-24-crag-mock-api:v0
```
-5. Launch `Agent` service
+6. Launch multi-agent system
- The configurations of the supervisor agent and the worker agent are defined in the docker-compose yaml file. We currently use openAI GPT-4o-mini as LLM, and llama3.1-70B-instruct (served by TGI-Gaudi) in Gaudi example. To use openai llm, run command below.
+ The configurations of the supervisor agent and the worker agents are defined in the docker-compose yaml file. We currently use openAI GPT-4o-mini as LLM.
```
cd $WORKDIR/GenAIExamples/AgentQnA/docker_compose/intel/cpu/xeon
bash launch_agent_service_openai.sh
```
-6. [Optional] Build `Agent` docker image if pulling images failed.
+7. [Optional] Build `Agent` docker image if pulling images failed.
```
git clone https://github.com/opea-project/GenAIComps.git
@@ -68,8 +80,11 @@ This example showcases a hierarchical multi-agent system for question-answering
First look at logs of the agent docker containers:
```
-# worker agent
+# worker RAG agent
docker logs rag-agent-endpoint
+
+# worker SQL agent
+docker logs sql-agent-endpoint
```
```
@@ -79,19 +94,27 @@ docker logs react-agent-endpoint
You should see something like "HTTP server setup successful" if the docker containers are started successfully.
-Second, validate worker agent:
+Second, validate worker RAG agent:
+
+```
+curl http://${host_ip}:9095/v1/chat/completions -X POST -H "Content-Type: application/json" -d '{
+ "messages": "Michael Jackson song Thriller"
+ }'
+```
+
+Third, validate worker SQL agent:
```
curl http://${host_ip}:9095/v1/chat/completions -X POST -H "Content-Type: application/json" -d '{
- "query": "Most recent album by Taylor Swift"
+ "messages": "How many employees are in the company?"
}'
```
-Third, validate supervisor agent:
+Finally, validate supervisor agent:
```
curl http://${host_ip}:9090/v1/chat/completions -X POST -H "Content-Type: application/json" -d '{
- "query": "Most recent album by Taylor Swift"
+ "messages": "How many albums does Iron Maiden have?"
}'
```
diff --git a/AgentQnA/docker_compose/intel/cpu/xeon/compose_openai.yaml b/AgentQnA/docker_compose/intel/cpu/xeon/compose_openai.yaml
index 3b78f97a1c..09bde26bde 100644
--- a/AgentQnA/docker_compose/intel/cpu/xeon/compose_openai.yaml
+++ b/AgentQnA/docker_compose/intel/cpu/xeon/compose_openai.yaml
@@ -31,6 +31,33 @@ services:
LANGCHAIN_PROJECT: "opea-worker-agent-service"
port: 9095
+ worker-sql-agent:
+ image: opea/agent:latest
+ container_name: sql-agent-endpoint
+ volumes:
+ - ${WORKDIR}/TAG-Bench/:/home/user/TAG-Bench # SQL database
+ ports:
+ - "9096:9096"
+ ipc: host
+ environment:
+ ip_address: ${ip_address}
+ strategy: sql_agent
+ db_name: ${db_name}
+ db_path: ${db_path}
+ use_hints: false
+ hints_file: /home/user/TAG-Bench/${db_name}_hints.csv
+ recursion_limit: ${recursion_limit_worker}
+ llm_engine: openai
+ OPENAI_API_KEY: ${OPENAI_API_KEY}
+ model: ${model}
+ temperature: 0
+ max_new_tokens: ${max_new_tokens}
+ stream: false
+ require_human_feedback: false
+ no_proxy: ${no_proxy}
+ http_proxy: ${http_proxy}
+ https_proxy: ${https_proxy}
+ port: 9096
supervisor-react-agent:
image: opea/agent:latest
diff --git a/AgentQnA/docker_compose/intel/cpu/xeon/launch_agent_service_openai.sh b/AgentQnA/docker_compose/intel/cpu/xeon/launch_agent_service_openai.sh
index de5c2e34c3..7b4e86a781 100644
--- a/AgentQnA/docker_compose/intel/cpu/xeon/launch_agent_service_openai.sh
+++ b/AgentQnA/docker_compose/intel/cpu/xeon/launch_agent_service_openai.sh
@@ -13,7 +13,10 @@ export temperature=0
export max_new_tokens=4096
export OPENAI_API_KEY=${OPENAI_API_KEY}
export WORKER_AGENT_URL="http://${ip_address}:9095/v1/chat/completions"
+export SQL_AGENT_URL="http://${ip_address}:9096/v1/chat/completions"
export RETRIEVAL_TOOL_URL="http://${ip_address}:8889/v1/retrievaltool"
export CRAG_SERVER=http://${ip_address}:8080
+export db_name=california_schools
+export db_path="sqlite:////home/user/TAG-Bench/dev_folder/dev_databases/${db_name}/${db_name}.sqlite"
docker compose -f compose_openai.yaml up -d
diff --git a/AgentQnA/docker_compose/intel/hpu/gaudi/README.md b/AgentQnA/docker_compose/intel/hpu/gaudi/README.md
index dcf8adfdc6..b920dff804 100644
--- a/AgentQnA/docker_compose/intel/hpu/gaudi/README.md
+++ b/AgentQnA/docker_compose/intel/hpu/gaudi/README.md
@@ -1,6 +1,6 @@
# Single node on-prem deployment AgentQnA on Gaudi
-This example showcases a hierarchical multi-agent system for question-answering applications. We deploy the example on Gaudi using open-source LLMs,
+This example showcases a hierarchical multi-agent system for question-answering applications. We deploy the example on Gaudi using open-source LLMs.
For more details, please refer to the deployment guide [here](../../../../README.md).
## Deployment with docker
@@ -45,22 +45,53 @@ For more details, please refer to the deployment guide [here](../../../../README
bash run_ingest_data.sh
```
-4. Launch Tool service
+4. Prepare SQL database
+ In this example, we will use the Chinook SQLite database. Run the commands below.
+
+ ```
+ # Download data
+ cd $WORKDIR
+ git clone https://github.com/lerocha/chinook-database.git
+ cp chinook-database/ChinookDatabase/DataSources/Chinook_Sqlite.sqlite $WORKDIR/GenAIExamples/AgentQnA/tests/
+ ```
+
+5. Launch Tool service
In this example, we will use some of the mock APIs provided in the Meta CRAG KDD Challenge to demonstrate the benefits of gaining additional context from mock knowledge graphs.
```
docker run -d -p=8080:8000 docker.io/aicrowd/kdd-cup-24-crag-mock-api:v0
```
-5. Launch `Agent` service
+6. Launch multi-agent system
+
+ On Gaudi2 we will serve `meta-llama/Meta-Llama-3.1-70B-Instruct` using vllm.
+
+ First build vllm-gaudi docker image.
+
+ ```bash
+ cd $WORKDIR
+ git clone https://github.com/vllm-project/vllm.git
+ cd ./vllm
+ git checkout v0.6.6
+ docker build --no-cache -f Dockerfile.hpu -t opea/vllm-gaudi:latest --shm-size=128g . --build-arg https_proxy=$https_proxy --build-arg http_proxy=$http_proxy
+ ```
- To use open-source LLMs on Gaudi2, run commands below.
+ Then launch vllm on Gaudi2 with the command below.
+ ```bash
+ vllm_port=8086
+ model="meta-llama/Meta-Llama-3.1-70B-Instruct"
+ docker run -d --runtime=habana --rm --name "vllm-gaudi-server" -e HABANA_VISIBLE_DEVICES=0,1,2,3 -p $vllm_port:8000 -v $vllm_volume:/data -e HF_TOKEN=$HF_TOKEN -e HUGGING_FACE_HUB_TOKEN=$HF_TOKEN -e HF_HOME=/data -e OMPI_MCA_btl_vader_single_copy_mechanism=none -e PT_HPU_ENABLE_LAZY_COLLECTIVES=true -e http_proxy=$http_proxy -e https_proxy=$https_proxy -e no_proxy=$no_proxy -e VLLM_SKIP_WARMUP=true --cap-add=sys_nice --ipc=host opea/vllm-gaudi:latest --model ${model} --max-seq-len-to-capture 16384 --tensor-parallel-size 4
```
- cd $WORKDIR/GenAIExamples/AgentQnA/docker_compose/intel/hpu/gaudi
- bash launch_tgi_gaudi.sh
- bash launch_agent_service_tgi_gaudi.sh
+
+ Then launch Agent microservices.
+
+ ```bash
+ cd $WORKDIR/GenAIExamples/AgentQnA/docker_compose/intel/hpu/gaudi/
+ bash launch_agent_service_gaudi.sh
```
-6. [Optional] Build `Agent` docker image if pulling images failed.
+7. [Optional] Build `Agent` docker image if pulling images failed.
+
+ If docker image pulling failed in Step 6 above, build the agent docker image with the commands below. After image build, try Step 6 again.
```
git clone https://github.com/opea-project/GenAIComps.git
@@ -73,8 +104,11 @@ For more details, please refer to the deployment guide [here](../../../../README
First look at logs of the agent docker containers:
```
-# worker agent
+# worker RAG agent
docker logs rag-agent-endpoint
+
+# worker SQL agent
+docker logs sql-agent-endpoint
```
```
@@ -84,19 +118,27 @@ docker logs react-agent-endpoint
You should see something like "HTTP server setup successful" if the docker containers are started successfully.
-Second, validate worker agent:
+Second, validate worker RAG agent:
+
+```
+curl http://${host_ip}:9095/v1/chat/completions -X POST -H "Content-Type: application/json" -d '{
+ "messages": "Michael Jackson song Thriller"
+ }'
+```
+
+Third, validate worker SQL agent:
```
curl http://${host_ip}:9095/v1/chat/completions -X POST -H "Content-Type: application/json" -d '{
- "query": "Most recent album by Taylor Swift"
+ "messages": "How many employees are in the company?"
}'
```
-Third, validate supervisor agent:
+Finally, validate supervisor agent:
```
curl http://${host_ip}:9090/v1/chat/completions -X POST -H "Content-Type: application/json" -d '{
- "query": "Most recent album by Taylor Swift"
+ "messages": "How many albums does Iron Maiden have?"
}'
```
diff --git a/AgentQnA/docker_compose/intel/hpu/gaudi/compose.yaml b/AgentQnA/docker_compose/intel/hpu/gaudi/compose.yaml
index a586ffd520..4895722c93 100644
--- a/AgentQnA/docker_compose/intel/hpu/gaudi/compose.yaml
+++ b/AgentQnA/docker_compose/intel/hpu/gaudi/compose.yaml
@@ -6,7 +6,6 @@ services:
image: opea/agent:latest
container_name: rag-agent-endpoint
volumes:
- # - ${WORKDIR}/GenAIExamples/AgentQnA/docker_image_build/GenAIComps/comps/agent/langchain/:/home/user/comps/agent/langchain/
- ${TOOLSET_PATH}:/home/user/tools/
ports:
- "9095:9095"
@@ -15,7 +14,7 @@ services:
ip_address: ${ip_address}
strategy: rag_agent_llama
recursion_limit: ${recursion_limit_worker}
- llm_engine: tgi
+ llm_engine: vllm
HUGGINGFACEHUB_API_TOKEN: ${HUGGINGFACEHUB_API_TOKEN}
llm_endpoint_url: ${LLM_ENDPOINT_URL}
model: ${LLM_MODEL_ID}
@@ -33,14 +32,41 @@ services:
LANGCHAIN_PROJECT: "opea-worker-agent-service"
port: 9095
+ worker-sql-agent:
+ image: opea/agent:latest
+ container_name: sql-agent-endpoint
+ volumes:
+ - ${WORKDIR}/GenAIExamples/AgentQnA/tests:/home/user/chinook-db # test db
+ ports:
+ - "9096:9096"
+ ipc: host
+ environment:
+ ip_address: ${ip_address}
+ strategy: sql_agent_llama
+ db_name: ${db_name}
+ db_path: ${db_path}
+ use_hints: false
+ recursion_limit: ${recursion_limit_worker}
+ llm_engine: vllm
+ HUGGINGFACEHUB_API_TOKEN: ${HUGGINGFACEHUB_API_TOKEN}
+ llm_endpoint_url: ${LLM_ENDPOINT_URL}
+ model: ${LLM_MODEL_ID}
+ temperature: ${temperature}
+ max_new_tokens: ${max_new_tokens}
+ stream: false
+ require_human_feedback: false
+ no_proxy: ${no_proxy}
+ http_proxy: ${http_proxy}
+ https_proxy: ${https_proxy}
+ port: 9096
supervisor-react-agent:
image: opea/agent:latest
container_name: react-agent-endpoint
depends_on:
- worker-rag-agent
+ - worker-sql-agent
volumes:
- # - ${WORKDIR}/GenAIExamples/AgentQnA/docker_image_build/GenAIComps/comps/agent/langchain/:/home/user/comps/agent/langchain/
- ${TOOLSET_PATH}:/home/user/tools/
ports:
- "9090:9090"
@@ -49,7 +75,7 @@ services:
ip_address: ${ip_address}
strategy: react_llama
recursion_limit: ${recursion_limit_supervisor}
- llm_engine: tgi
+ llm_engine: vllm
HUGGINGFACEHUB_API_TOKEN: ${HUGGINGFACEHUB_API_TOKEN}
llm_endpoint_url: ${LLM_ENDPOINT_URL}
model: ${LLM_MODEL_ID}
@@ -66,4 +92,5 @@ services:
LANGCHAIN_PROJECT: "opea-supervisor-agent-service"
CRAG_SERVER: $CRAG_SERVER
WORKER_AGENT_URL: $WORKER_AGENT_URL
+ SQL_AGENT_URL: $SQL_AGENT_URL
port: 9090
diff --git a/AgentQnA/docker_compose/intel/hpu/gaudi/launch_agent_service_tgi_gaudi.sh b/AgentQnA/docker_compose/intel/hpu/gaudi/launch_agent_service_gaudi.sh
similarity index 81%
rename from AgentQnA/docker_compose/intel/hpu/gaudi/launch_agent_service_tgi_gaudi.sh
rename to AgentQnA/docker_compose/intel/hpu/gaudi/launch_agent_service_gaudi.sh
index 38f7d592b5..fff5d53f8d 100644
--- a/AgentQnA/docker_compose/intel/hpu/gaudi/launch_agent_service_tgi_gaudi.sh
+++ b/AgentQnA/docker_compose/intel/hpu/gaudi/launch_agent_service_gaudi.sh
@@ -16,8 +16,8 @@ ls $HF_CACHE_DIR
export HUGGINGFACEHUB_API_TOKEN=${HUGGINGFACEHUB_API_TOKEN}
export LLM_MODEL_ID="meta-llama/Meta-Llama-3.1-70B-Instruct"
export NUM_SHARDS=4
-export LLM_ENDPOINT_URL="http://${ip_address}:8085"
-export temperature=0.01
+export LLM_ENDPOINT_URL="http://${ip_address}:8086"
+export temperature=0
export max_new_tokens=4096
# agent related environment variables
@@ -26,7 +26,11 @@ echo "TOOLSET_PATH=${TOOLSET_PATH}"
export recursion_limit_worker=12
export recursion_limit_supervisor=10
export WORKER_AGENT_URL="http://${ip_address}:9095/v1/chat/completions"
+export SQL_AGENT_URL="http://${ip_address}:9096/v1/chat/completions"
export RETRIEVAL_TOOL_URL="http://${ip_address}:8889/v1/retrievaltool"
export CRAG_SERVER=http://${ip_address}:8080
+export db_name=Chinook
+export db_path="sqlite:////home/user/chinook-db/Chinook_Sqlite.sqlite"
+
docker compose -f compose.yaml up -d
diff --git a/AgentQnA/docker_image_build/build.yaml b/AgentQnA/docker_image_build/build.yaml
index 61f2b0dda5..723a61c873 100644
--- a/AgentQnA/docker_image_build/build.yaml
+++ b/AgentQnA/docker_image_build/build.yaml
@@ -11,3 +11,9 @@ services:
https_proxy: ${https_proxy}
no_proxy: ${no_proxy}
image: ${REGISTRY:-opea}/agent:${TAG:-latest}
+ agent-ui:
+ build:
+ context: ../ui
+ dockerfile: ./docker/Dockerfile
+ extends: agent
+ image: ${REGISTRY:-opea}/agent-ui:${TAG:-latest}
diff --git a/AgentQnA/retrieval_tool/launch_retrieval_tool.sh b/AgentQnA/retrieval_tool/launch_retrieval_tool.sh
index 1a142abf8e..b0c22fea41 100644
--- a/AgentQnA/retrieval_tool/launch_retrieval_tool.sh
+++ b/AgentQnA/retrieval_tool/launch_retrieval_tool.sh
@@ -13,6 +13,7 @@ export TEI_EMBEDDING_ENDPOINT="http://${host_ip}:6006"
export TEI_RERANKING_ENDPOINT="http://${host_ip}:8808"
export REDIS_URL="redis://${host_ip}:6379"
export INDEX_NAME="rag-redis"
+export RERANK_TYPE="tei"
export MEGA_SERVICE_HOST_IP=${host_ip}
export EMBEDDING_SERVICE_HOST_IP=${host_ip}
export RETRIEVER_SERVICE_HOST_IP=${host_ip}
diff --git a/AgentQnA/tests/sql_agent_test/run_data_split.sh b/AgentQnA/tests/sql_agent_test/run_data_split.sh
new file mode 100644
index 0000000000..2fc2dfcb0e
--- /dev/null
+++ b/AgentQnA/tests/sql_agent_test/run_data_split.sh
@@ -0,0 +1,6 @@
+# Copyright (C) 2024 Intel Corporation
+# SPDX-License-Identifier: Apache-2.0
+
+DATAPATH=$WORKDIR/TAG-Bench/tag_queries.csv
+OUTFOLDER=$WORKDIR/TAG-Bench/query_by_db
+python3 split_data.py --path $DATAPATH --output $OUTFOLDER
diff --git a/AgentQnA/tests/sql_agent_test/split_data.py b/AgentQnA/tests/sql_agent_test/split_data.py
new file mode 100644
index 0000000000..1b3f5cfc79
--- /dev/null
+++ b/AgentQnA/tests/sql_agent_test/split_data.py
@@ -0,0 +1,27 @@
+# Copyright (C) 2024 Intel Corporation
+# SPDX-License-Identifier: Apache-2.0
+
+import argparse
+import os
+
+import pandas as pd
+
+if __name__ == "__main__":
+ parser = argparse.ArgumentParser()
+ parser.add_argument("--path", type=str, required=True)
+ parser.add_argument("--output", type=str, required=True)
+ args = parser.parse_args()
+
+ # if output folder does not exist, create it
+ if not os.path.exists(args.output):
+ os.makedirs(args.output)
+
+ # Load the data
+ data = pd.read_csv(args.path)
+
+ # Split the data by domain
+ domains = data["DB used"].unique()
+ for domain in domains:
+ domain_data = data[data["DB used"] == domain]
+ out = os.path.join(args.output, f"query_{domain}.csv")
+ domain_data.to_csv(out, index=False)
diff --git a/AgentQnA/tests/step1_build_images.sh b/AgentQnA/tests/step1_build_images.sh
index 43000f6630..4782da677a 100644
--- a/AgentQnA/tests/step1_build_images.sh
+++ b/AgentQnA/tests/step1_build_images.sh
@@ -21,7 +21,7 @@ function build_docker_images_for_retrieval_tool(){
# git clone https://github.com/opea-project/GenAIComps.git && cd GenAIComps && git checkout "${opea_branch:-"main"}" && cd ../
get_genai_comps
echo "Build all the images with --no-cache..."
- service_list="doc-index-retriever dataprep-redis embedding retriever-redis reranking"
+ service_list="doc-index-retriever dataprep-redis embedding retriever reranking"
docker compose -f build.yaml build ${service_list} --no-cache
docker pull ghcr.io/huggingface/text-embeddings-inference:cpu-1.5
@@ -35,6 +35,27 @@ function build_agent_docker_image() {
docker compose -f build.yaml build --no-cache
}
+function build_vllm_docker_image() {
+ echo "Building the vllm docker image"
+ cd $WORKPATH
+ echo $WORKPATH
+ if [ ! -d "./vllm" ]; then
+ echo "clone vllm repo...."
+ git clone https://github.com/vllm-project/vllm.git
+ fi
+ cd ./vllm
+ echo "Checking out latest stable release of vllm"
+ git checkout v0.6.6
+ docker build --no-cache -f Dockerfile.hpu -t opea/vllm-gaudi:comps --shm-size=128g . --build-arg https_proxy=$https_proxy --build-arg http_proxy=$http_proxy
+ if [ $? -ne 0 ]; then
+ echo "opea/vllm-gaudi:comps failed"
+ exit 1
+ else
+ echo "opea/vllm-gaudi:comps successful"
+ fi
+}
+
+
function main() {
echo "==================== Build docker images for retrieval tool ===================="
build_docker_images_for_retrieval_tool
@@ -43,6 +64,12 @@ function main() {
echo "==================== Build agent docker image ===================="
build_agent_docker_image
echo "==================== Build agent docker image completed ===================="
+
+ echo "==================== Build vllm docker image ===================="
+ build_vllm_docker_image
+ echo "==================== Build vllm docker image completed ===================="
+
+ docker image ls | grep vllm
}
main
diff --git a/AgentQnA/tests/step4_launch_and_validate_agent_tgi.sh b/AgentQnA/tests/step4_launch_and_validate_agent_tgi.sh
index fde46e0d5a..c99e212ff6 100644
--- a/AgentQnA/tests/step4_launch_and_validate_agent_tgi.sh
+++ b/AgentQnA/tests/step4_launch_and_validate_agent_tgi.sh
@@ -10,6 +10,8 @@ echo "WORKDIR=${WORKDIR}"
export ip_address=$(hostname -I | awk '{print $1}')
export TOOLSET_PATH=$WORKDIR/GenAIExamples/AgentQnA/tools/
export HUGGINGFACEHUB_API_TOKEN=${HUGGINGFACEHUB_API_TOKEN}
+HF_TOKEN=${HUGGINGFACEHUB_API_TOKEN}
+model="meta-llama/Meta-Llama-3.1-70B-Instruct"
export HF_CACHE_DIR=$WORKDIR/hf_cache
if [ ! -d "$HF_CACHE_DIR" ]; then
@@ -17,6 +19,9 @@ if [ ! -d "$HF_CACHE_DIR" ]; then
fi
ls $HF_CACHE_DIR
+vllm_port=8086
+vllm_volume=${HF_CACHE_DIR}
+
function start_tgi(){
echo "Starting tgi-gaudi server"
cd $WORKDIR/GenAIExamples/AgentQnA/docker_compose/intel/hpu/gaudi
@@ -24,14 +29,67 @@ function start_tgi(){
}
+function start_vllm_service_70B() {
+
+ echo "token is ${HF_TOKEN}"
+
+ echo "start vllm gaudi service"
+ echo "**************model is $model**************"
+ vllm_image=opea/vllm-gaudi:comps
+ docker run -d --runtime=habana --rm --name "vllm-gaudi-server" -e HABANA_VISIBLE_DEVICES=0,1,2,3 -p $vllm_port:8000 -v $vllm_volume:/data -e HF_TOKEN=$HF_TOKEN -e HUGGING_FACE_HUB_TOKEN=$HF_TOKEN -e HF_HOME=/data -e OMPI_MCA_btl_vader_single_copy_mechanism=none -e PT_HPU_ENABLE_LAZY_COLLECTIVES=true -e http_proxy=$http_proxy -e https_proxy=$https_proxy -e no_proxy=$no_proxy -e VLLM_SKIP_WARMUP=true --cap-add=sys_nice --ipc=host $vllm_image --model ${model} --max-seq-len-to-capture 16384 --tensor-parallel-size 4
+ sleep 5s
+ echo "Waiting vllm gaudi ready"
+ n=0
+ LOG_PATH=$PWD
+ until [[ "$n" -ge 100 ]] || [[ $ready == true ]]; do
+ docker logs vllm-gaudi-server
+ docker logs vllm-gaudi-server &> ${LOG_PATH}/vllm-gaudi-service.log
+ n=$((n+1))
+ if grep -q "Uvicorn running on" ${LOG_PATH}/vllm-gaudi-service.log; then
+ break
+ fi
+ if grep -q "No such container" ${LOG_PATH}/vllm-gaudi-service.log; then
+ echo "container vllm-gaudi-server not found"
+ exit 1
+ fi
+ sleep 5s
+ done
+ sleep 5s
+ echo "Service started successfully"
+}
+
+
+function prepare_data() {
+ cd $WORKDIR
+
+ echo "Downloading data..."
+ git clone https://github.com/TAG-Research/TAG-Bench.git
+ cd TAG-Bench/setup
+ chmod +x get_dbs.sh
+ ./get_dbs.sh
+
+ echo "Split data..."
+ cd $WORKPATH/tests/sql_agent_test
+ bash run_data_split.sh
+
+ echo "Data preparation done!"
+}
+
+function download_chinook_data(){
+ echo "Downloading chinook data..."
+ cd $WORKDIR
+ git clone https://github.com/lerocha/chinook-database.git
+ cp chinook-database/ChinookDatabase/DataSources/Chinook_Sqlite.sqlite $WORKDIR/GenAIExamples/AgentQnA/tests/
+}
+
function start_agent_and_api_server() {
echo "Starting CRAG server"
docker run -d --runtime=runc --name=kdd-cup-24-crag-service -p=8080:8000 docker.io/aicrowd/kdd-cup-24-crag-mock-api:v0
echo "Starting Agent services"
cd $WORKDIR/GenAIExamples/AgentQnA/docker_compose/intel/hpu/gaudi
- bash launch_agent_service_tgi_gaudi.sh
- sleep 10
+ bash launch_agent_service_gaudi.sh
+ sleep 2m
}
function validate() {
@@ -49,35 +107,76 @@ function validate() {
}
function validate_agent_service() {
- echo "----------------Test agent ----------------"
- # local CONTENT=$(http_proxy="" curl http://${ip_address}:9095/v1/chat/completions -X POST -H "Content-Type: application/json" -d '{
- # "query": "Tell me about Michael Jackson song thriller"
- # }')
+ # # test worker rag agent
+ echo "======================Testing worker rag agent======================"
export agent_port="9095"
- local CONTENT=$(python3 $WORKDIR/GenAIExamples/AgentQnA/tests/test.py)
+ prompt="Tell me about Michael Jackson song Thriller"
+ local CONTENT=$(python3 $WORKDIR/GenAIExamples/AgentQnA/tests/test.py --prompt "$prompt")
+ # echo $CONTENT
local EXIT_CODE=$(validate "$CONTENT" "Thriller" "rag-agent-endpoint")
- docker logs rag-agent-endpoint
+ echo $EXIT_CODE
+ local EXIT_CODE="${EXIT_CODE:0-1}"
if [ "$EXIT_CODE" == "1" ]; then
+ docker logs rag-agent-endpoint
exit 1
fi
- # local CONTENT=$(http_proxy="" curl http://${ip_address}:9090/v1/chat/completions -X POST -H "Content-Type: application/json" -d '{
- # "query": "Tell me about Michael Jackson song thriller"
- # }')
+ # # test worker sql agent
+ echo "======================Testing worker sql agent======================"
+ export agent_port="9096"
+ prompt="How many employees are there in the company?"
+ local CONTENT=$(python3 $WORKDIR/GenAIExamples/AgentQnA/tests/test.py --prompt "$prompt")
+ local EXIT_CODE=$(validate "$CONTENT" "8" "sql-agent-endpoint")
+ echo $CONTENT
+ # echo $EXIT_CODE
+ local EXIT_CODE="${EXIT_CODE:0-1}"
+ if [ "$EXIT_CODE" == "1" ]; then
+ docker logs sql-agent-endpoint
+ exit 1
+ fi
+
+ # test supervisor react agent
+ echo "======================Testing supervisor react agent======================"
export agent_port="9090"
- local CONTENT=$(python3 $WORKDIR/GenAIExamples/AgentQnA/tests/test.py)
- local EXIT_CODE=$(validate "$CONTENT" "Thriller" "react-agent-endpoint")
- docker logs react-agent-endpoint
+ prompt="How many albums does Iron Maiden have?"
+ local CONTENT=$(python3 $WORKDIR/GenAIExamples/AgentQnA/tests/test.py --prompt "$prompt")
+ local EXIT_CODE=$(validate "$CONTENT" "21" "react-agent-endpoint")
+ # echo $CONTENT
+ echo $EXIT_CODE
+ local EXIT_CODE="${EXIT_CODE:0-1}"
if [ "$EXIT_CODE" == "1" ]; then
+ docker logs react-agent-endpoint
exit 1
fi
}
+function remove_data() {
+ echo "Removing data..."
+ cd $WORKDIR
+ if [ -d "TAG-Bench" ]; then
+ rm -rf TAG-Bench
+ fi
+ echo "Data removed!"
+}
+
+function remove_chinook_data(){
+ echo "Removing chinook data..."
+ cd $WORKDIR
+ if [ -d "chinook-database" ]; then
+ rm -rf chinook-database
+ fi
+ echo "Chinook data removed!"
+}
+
function main() {
- echo "==================== Start TGI ===================="
- start_tgi
- echo "==================== TGI started ===================="
+ echo "==================== Prepare data ===================="
+ download_chinook_data
+ echo "==================== Data prepare done ===================="
+
+ echo "==================== Start VLLM service ===================="
+ start_vllm_service_70B
+ echo "==================== VLLM service started ===================="
echo "==================== Start agent ===================="
start_agent_and_api_server
@@ -88,4 +187,8 @@ function main() {
echo "==================== Agent service validated ===================="
}
+remove_data
+remove_chinook_data
main
+remove_data
+remove_chinook_data
diff --git a/AgentQnA/tests/test.py b/AgentQnA/tests/test.py
index f0ef934412..400684ffd6 100644
--- a/AgentQnA/tests/test.py
+++ b/AgentQnA/tests/test.py
@@ -1,6 +1,7 @@
# Copyright (C) 2024 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
+import argparse
import os
import requests
@@ -9,17 +10,47 @@
def generate_answer_agent_api(url, prompt):
proxies = {"http": ""}
payload = {
- "query": prompt,
+ "messages": prompt,
}
response = requests.post(url, json=payload, proxies=proxies)
answer = response.json()["text"]
return answer
+def process_request(url, query, is_stream=False):
+ proxies = {"http": ""}
+
+ payload = {
+ "messages": query,
+ }
+
+ try:
+ resp = requests.post(url=url, json=payload, proxies=proxies, stream=is_stream)
+ if not is_stream:
+ ret = resp.json()["text"]
+ print(ret)
+ else:
+ for line in resp.iter_lines(decode_unicode=True):
+ print(line)
+ ret = None
+
+ resp.raise_for_status() # Raise an exception for unsuccessful HTTP status codes
+ return ret
+ except requests.exceptions.RequestException as e:
+ ret = f"An error occurred:{e}"
+ print(ret)
+ return False
+
+
if __name__ == "__main__":
+ parser = argparse.ArgumentParser()
+ parser.add_argument("--prompt", type=str)
+ parser.add_argument("--stream", action="store_true")
+ args = parser.parse_args()
+
ip_address = os.getenv("ip_address", "localhost")
- agent_port = os.getenv("agent_port", "9095")
+ agent_port = os.getenv("agent_port", "9090")
url = f"http://{ip_address}:{agent_port}/v1/chat/completions"
- prompt = "Tell me about Michael Jackson song thriller"
- answer = generate_answer_agent_api(url, prompt)
- print(answer)
+ prompt = args.prompt
+
+ process_request(url, prompt, args.stream)
diff --git a/AgentQnA/tests/test_compose_on_gaudi.sh b/AgentQnA/tests/test_compose_on_gaudi.sh
index 0720a9b2b9..cf224b6aa1 100644
--- a/AgentQnA/tests/test_compose_on_gaudi.sh
+++ b/AgentQnA/tests/test_compose_on_gaudi.sh
@@ -4,6 +4,9 @@
set -xe
+echo "All running containers"
+docker ps
+
WORKPATH=$(dirname "$PWD")
export WORKDIR=$WORKPATH/../../
echo "WORKDIR=${WORKDIR}"
@@ -27,7 +30,7 @@ function stop_agent_docker() {
done
}
-function stop_tgi(){
+function stop_llm(){
cd $WORKPATH/docker_compose/intel/hpu/gaudi/
container_list=$(cat tgi_gaudi.yaml | grep container_name | cut -d':' -f2)
for container_name in $container_list; do
@@ -36,6 +39,14 @@ function stop_tgi(){
if [[ ! -z "$cid" ]]; then docker rm $cid -f && sleep 1s; fi
done
+ cid=$(docker ps -aq --filter "name=vllm-gaudi-server")
+ echo "Stopping container $cid"
+ if [[ ! -z "$cid" ]]; then docker rm $cid -f && sleep 1s; fi
+
+ cid=$(docker ps -aq --filter "name=test-comps-vllm-gaudi-service")
+ echo "Stopping container $cid"
+ if [[ ! -z "$cid" ]]; then docker rm $cid -f && sleep 1s; fi
+
}
function stop_retrieval_tool() {
@@ -52,7 +63,7 @@ function stop_retrieval_tool() {
echo "workpath: $WORKPATH"
echo "=================== Stop containers ===================="
stop_crag
-stop_tgi
+stop_llm
stop_agent_docker
stop_retrieval_tool
@@ -78,6 +89,7 @@ echo "=================== #5 Stop agent and API server===================="
stop_crag
stop_agent_docker
stop_retrieval_tool
+stop_llm
echo "=================== #5 Agent and API server stopped===================="
echo y | docker system prune
diff --git a/AgentQnA/tools/supervisor_agent_tools.yaml b/AgentQnA/tools/supervisor_agent_tools.yaml
index 4b53cc9f9f..bfe6f970d4 100644
--- a/AgentQnA/tools/supervisor_agent_tools.yaml
+++ b/AgentQnA/tools/supervisor_agent_tools.yaml
@@ -2,7 +2,7 @@
# SPDX-License-Identifier: Apache-2.0
search_knowledge_base:
- description: Search knowledge base for a given query. Returns text related to the query.
+ description: Search a knowledge base for a given query. Returns text related to the query.
callable_api: tools.py:search_knowledge_base
args_schema:
query:
@@ -10,6 +10,15 @@ search_knowledge_base:
description: query
return_output: retrieved_data
+search_artist_database:
+ description: Search a SQL database on artists and their music with a natural language query. Returns text related to the query.
+ callable_api: tools.py:search_sql_database
+ args_schema:
+ query:
+ type: str
+ description: natural language query
+ return_output: retrieved_data
+
get_artist_birth_place:
description: Get the birth place of an artist.
callable_api: tools.py:get_artist_birth_place
diff --git a/AgentQnA/tools/tools.py b/AgentQnA/tools/tools.py
index 94a44f6787..67137c3c18 100644
--- a/AgentQnA/tools/tools.py
+++ b/AgentQnA/tools/tools.py
@@ -8,13 +8,30 @@
def search_knowledge_base(query: str) -> str:
- """Search the knowledge base for a specific query."""
- # use worker agent (DocGrader) to search the knowledge base
+ """Search a knowledge base about music and singers for a given query.
+
+ Returns text related to the query.
+ """
url = os.environ.get("WORKER_AGENT_URL")
print(url)
proxies = {"http": ""}
payload = {
- "query": query,
+ "messages": query,
+ }
+ response = requests.post(url, json=payload, proxies=proxies)
+ return response.json()["text"]
+
+
+def search_sql_database(query: str) -> str:
+ """Search a SQL database on artists and their music with a natural language query.
+
+ Returns text related to the query.
+ """
+ url = os.environ.get("SQL_AGENT_URL")
+ print(url)
+ proxies = {"http": ""}
+ payload = {
+ "messages": query,
}
response = requests.post(url, json=payload, proxies=proxies)
return response.json()["text"]
diff --git a/AgentQnA/tools/worker_agent_tools.py b/AgentQnA/tools/worker_agent_tools.py
index fded38ec3a..9fe40f11f0 100644
--- a/AgentQnA/tools/worker_agent_tools.py
+++ b/AgentQnA/tools/worker_agent_tools.py
@@ -12,7 +12,7 @@ def search_knowledge_base(query: str) -> str:
print(url)
proxies = {"http": ""}
payload = {
- "messages": query,
+ "text": query,
}
response = requests.post(url, json=payload, proxies=proxies)
print(response)
diff --git a/AgentQnA/ui/docker/Dockerfile b/AgentQnA/ui/docker/Dockerfile
new file mode 100644
index 0000000000..1d5115f4b5
--- /dev/null
+++ b/AgentQnA/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"]
diff --git a/AgentQnA/ui/svelte/.editorconfig b/AgentQnA/ui/svelte/.editorconfig
new file mode 100644
index 0000000000..2b7a6637f7
--- /dev/null
+++ b/AgentQnA/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/AgentQnA/ui/svelte/.env b/AgentQnA/ui/svelte/.env
new file mode 100644
index 0000000000..260701a6d0
--- /dev/null
+++ b/AgentQnA/ui/svelte/.env
@@ -0,0 +1 @@
+AGENT_URL = '/v1/chat/completions'
diff --git a/AgentQnA/ui/svelte/.eslintignore b/AgentQnA/ui/svelte/.eslintignore
new file mode 100644
index 0000000000..38972655fa
--- /dev/null
+++ b/AgentQnA/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/AgentQnA/ui/svelte/.eslintrc.cjs b/AgentQnA/ui/svelte/.eslintrc.cjs
new file mode 100644
index 0000000000..cfe2be4d4d
--- /dev/null
+++ b/AgentQnA/ui/svelte/.eslintrc.cjs
@@ -0,0 +1,20 @@
+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/AgentQnA/ui/svelte/.prettierignore b/AgentQnA/ui/svelte/.prettierignore
new file mode 100644
index 0000000000..38972655fa
--- /dev/null
+++ b/AgentQnA/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/AgentQnA/ui/svelte/.prettierrc b/AgentQnA/ui/svelte/.prettierrc
new file mode 100644
index 0000000000..3b2006102e
--- /dev/null
+++ b/AgentQnA/ui/svelte/.prettierrc
@@ -0,0 +1,13 @@
+{
+ "pluginSearchDirs": [
+ "."
+ ],
+ "overrides": [
+ {
+ "files": "*.svelte",
+ "options": {
+ "parser": "svelte"
+ }
+ }
+ ]
+}
\ No newline at end of file
diff --git a/AgentQnA/ui/svelte/README.md b/AgentQnA/ui/svelte/README.md
new file mode 100644
index 0000000000..bd0ae2da10
--- /dev/null
+++ b/AgentQnA/ui/svelte/README.md
@@ -0,0 +1,60 @@
+# AgentQnA
+
+## 📸 Project Screenshots
+
+![project-screenshot](../../assets/img/agent_ui.png)
+![project-screenshot](../../assets/img/agent_ui_result.png)
+
+## 🧐 Features
+
+Here're some of the project's features:
+
+- Create Agent:Provide more precise answers based on user queries, showcase the high-quality output process of complex queries across different dimensions, and consolidate information to present comprehensive answers.
+
+## 🛠️ Get it Running
+
+1. Clone the repo.
+
+2. cd command to the current folder.
+
+ ```
+ cd AgentQnA/ui
+ ```
+
+3. Modify the required .env variables.
+
+ ```
+ AGENT_URL = ''
+ ```
+
+4. **For Local Development:**
+
+- Install the dependencies:
+
+ ```
+ npm install
+ ```
+
+- Start the development server:
+
+ ```
+ npm run dev
+ ```
+
+- The application will be available at `http://localhost:3000`.
+
+5. **For Docker Setup:**
+
+- Build the Docker image:
+
+ ```
+ docker build -t opea:agent-ui .
+ ```
+
+- Run the Docker container:
+
+ ```
+ docker run -d -p 3000:3000 --name agent-ui opea:agent-ui
+ ```
+
+- The application will be available at `http://localhost:3000`.
diff --git a/AgentQnA/ui/svelte/package.json b/AgentQnA/ui/svelte/package.json
new file mode 100644
index 0000000000..b778040bec
--- /dev/null
+++ b/AgentQnA/ui/svelte/package.json
@@ -0,0 +1,60 @@
+{
+ "name": "agent-example",
+ "version": "0.0.1",
+ "private": true,
+ "scripts": {
+ "dev": "vite dev --host 0.0.0.0",
+ "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",
+ "@sveltejs/adapter-auto": "1.0.0-next.75",
+ "@sveltejs/kit": "^1.20.1",
+ "@tailwindcss/typography": "0.5.7",
+ "@types/debug": "4.1.7",
+ "@typescript-eslint/eslint-plugin": "^5.27.0",
+ "@typescript-eslint/parser": "^5.27.0",
+ "autoprefixer": "^10.4.7",
+ "daisyui": "^2.52.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",
+ "neverthrow": "5.0.0",
+ "pocketbase": "0.7.0",
+ "postcss": "^8.4.23",
+ "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",
+ "ts-pattern": "4.0.5",
+ "tslib": "^2.3.1",
+ "typescript": "^4.7.4",
+ "vite": "^4.3.9"
+ },
+ "type": "module",
+ "dependencies": {
+ "@heroicons/vue": "^2.1.5",
+ "echarts": "^5.4.2",
+ "flowbite-svelte": "^0.38.5",
+ "flowbite-svelte-icons": "^0.3.6",
+ "fuse.js": "^6.6.2",
+ "marked": "^15.0.0",
+ "ramda": "^0.29.0",
+ "sjcl": "^1.0.8",
+ "sse.js": "^0.6.1",
+ "svelte-notifications": "^0.9.98"
+ }
+}
diff --git a/AgentQnA/ui/svelte/postcss.config.cjs b/AgentQnA/ui/svelte/postcss.config.cjs
new file mode 100644
index 0000000000..e68d4de268
--- /dev/null
+++ b/AgentQnA/ui/svelte/postcss.config.cjs
@@ -0,0 +1,13 @@
+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/AgentQnA/ui/svelte/src/app.d.ts b/AgentQnA/ui/svelte/src/app.d.ts
new file mode 100644
index 0000000000..76f5cae98c
--- /dev/null
+++ b/AgentQnA/ui/svelte/src/app.d.ts
@@ -0,0 +1,50 @@
+// Copyright (C) 2025 Intel Corporation
+// SPDX-License-Identifier: Apache-2.0
+
+// See: https://kit.svelte.dev/docs/types#app
+// import { Result} from "neverthrow";
+
+declare namespace App {
+ interface Locals {
+ user?: User;
+ }
+ // interface PageData { }
+ // interface PageError {}
+ // interface Platform {}
+}
+
+interface User {
+ id?: string;
+ email: string;
+ password?: string;
+ token?: string;
+ [key: string]: any;
+}
+
+type AuthResponse = Result;
+
+interface AuthAdapter {
+ login(props: { email: string; password: string }): Promise;
+ signup(props: { email: string; password: string; password_confirm: string }): Promise;
+ validate_session(props: { token: string }): Promise;
+ logout(props: { token: string; email: string }): Promise>;
+ forgotPassword(props: { email: string; password: string }): Promise>;
+}
+
+interface ChatAdapter {
+ modelList(props: {}): Promise>;
+ txt2img(props: {}): Promise>;
+}
+
+interface ChatMessage {
+ role: string;
+ content: string;
+}
+
+interface ChatMessageType {
+ model: string;
+ knowledge: string;
+ temperature: string;
+ max_new_tokens: string;
+ topk: string;
+}
diff --git a/AgentQnA/ui/svelte/src/app.html b/AgentQnA/ui/svelte/src/app.html
new file mode 100644
index 0000000000..5baaf1750e
--- /dev/null
+++ b/AgentQnA/ui/svelte/src/app.html
@@ -0,0 +1,17 @@
+
+
+
+
+
+
+
+
+ %sveltekit.head%
+
+
+ %sveltekit.body%
+
+
diff --git a/AgentQnA/ui/svelte/src/app.postcss b/AgentQnA/ui/svelte/src/app.postcss
new file mode 100644
index 0000000000..c3e0519c6a
--- /dev/null
+++ b/AgentQnA/ui/svelte/src/app.postcss
@@ -0,0 +1,82 @@
+/* Write your global styles here, in PostCSS syntax */
+@tailwind base;
+@tailwind components;
+@tailwind utilities;
+
+.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: #0071c5;
+}
+
+.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/AgentQnA/ui/svelte/src/lib/assets/Agent/createSub.svelte b/AgentQnA/ui/svelte/src/lib/assets/Agent/createSub.svelte
new file mode 100644
index 0000000000..b31044d0fc
--- /dev/null
+++ b/AgentQnA/ui/svelte/src/lib/assets/Agent/createSub.svelte
@@ -0,0 +1,25 @@
+
+
+
diff --git a/AgentQnA/ui/svelte/src/lib/assets/Agent/download.svelte b/AgentQnA/ui/svelte/src/lib/assets/Agent/download.svelte
new file mode 100644
index 0000000000..da8bcefb3d
--- /dev/null
+++ b/AgentQnA/ui/svelte/src/lib/assets/Agent/download.svelte
@@ -0,0 +1,9 @@
+
+
+
+
+
+
diff --git a/AgentQnA/ui/svelte/src/lib/assets/Agent/eye.svelte b/AgentQnA/ui/svelte/src/lib/assets/Agent/eye.svelte
new file mode 100644
index 0000000000..06f9a821e4
--- /dev/null
+++ b/AgentQnA/ui/svelte/src/lib/assets/Agent/eye.svelte
@@ -0,0 +1,16 @@
+
+
+
+
+
diff --git a/AgentQnA/ui/svelte/src/lib/assets/Agent/newAI.svelte b/AgentQnA/ui/svelte/src/lib/assets/Agent/newAI.svelte
new file mode 100644
index 0000000000..6fc1179daf
--- /dev/null
+++ b/AgentQnA/ui/svelte/src/lib/assets/Agent/newAI.svelte
@@ -0,0 +1,97 @@
+
+
+
+
+
diff --git a/AgentQnA/ui/svelte/src/lib/assets/Agent/resource.svelte b/AgentQnA/ui/svelte/src/lib/assets/Agent/resource.svelte
new file mode 100644
index 0000000000..6460bb34d2
--- /dev/null
+++ b/AgentQnA/ui/svelte/src/lib/assets/Agent/resource.svelte
@@ -0,0 +1,8 @@
+
+
+
+
+
diff --git a/AgentQnA/ui/svelte/src/lib/assets/Agent/search.svelte b/AgentQnA/ui/svelte/src/lib/assets/Agent/search.svelte
new file mode 100644
index 0000000000..79c22c7b2f
--- /dev/null
+++ b/AgentQnA/ui/svelte/src/lib/assets/Agent/search.svelte
@@ -0,0 +1,13 @@
+
+
+
diff --git a/AgentQnA/ui/svelte/src/lib/assets/Agent/searchDelete.svelte b/AgentQnA/ui/svelte/src/lib/assets/Agent/searchDelete.svelte
new file mode 100644
index 0000000000..e6907c21df
--- /dev/null
+++ b/AgentQnA/ui/svelte/src/lib/assets/Agent/searchDelete.svelte
@@ -0,0 +1,17 @@
+
+
+
diff --git a/AgentQnA/ui/svelte/src/lib/assets/Agent/searchResult.svelte b/AgentQnA/ui/svelte/src/lib/assets/Agent/searchResult.svelte
new file mode 100644
index 0000000000..378f3cdf50
--- /dev/null
+++ b/AgentQnA/ui/svelte/src/lib/assets/Agent/searchResult.svelte
@@ -0,0 +1,20 @@
+
+
+
diff --git a/AgentQnA/ui/svelte/src/lib/assets/Agent/star.svelte b/AgentQnA/ui/svelte/src/lib/assets/Agent/star.svelte
new file mode 100644
index 0000000000..1a0e4175cc
--- /dev/null
+++ b/AgentQnA/ui/svelte/src/lib/assets/Agent/star.svelte
@@ -0,0 +1,22 @@
+
+
+
diff --git a/AgentQnA/ui/svelte/src/lib/assets/Agent/summary.svelte b/AgentQnA/ui/svelte/src/lib/assets/Agent/summary.svelte
new file mode 100644
index 0000000000..952c986061
--- /dev/null
+++ b/AgentQnA/ui/svelte/src/lib/assets/Agent/summary.svelte
@@ -0,0 +1,44 @@
+
+
+
diff --git a/AgentQnA/ui/svelte/src/lib/assets/Agent/taskIcon.svelte b/AgentQnA/ui/svelte/src/lib/assets/Agent/taskIcon.svelte
new file mode 100644
index 0000000000..737b7a8cbc
--- /dev/null
+++ b/AgentQnA/ui/svelte/src/lib/assets/Agent/taskIcon.svelte
@@ -0,0 +1,24 @@
+
+
+
diff --git a/AgentQnA/ui/svelte/src/lib/assets/Agent/taskResult.svelte b/AgentQnA/ui/svelte/src/lib/assets/Agent/taskResult.svelte
new file mode 100644
index 0000000000..f4b3833002
--- /dev/null
+++ b/AgentQnA/ui/svelte/src/lib/assets/Agent/taskResult.svelte
@@ -0,0 +1,60 @@
+
+
+
diff --git a/AgentQnA/ui/svelte/src/lib/assets/Agent/time.svelte b/AgentQnA/ui/svelte/src/lib/assets/Agent/time.svelte
new file mode 100644
index 0000000000..140f544c82
--- /dev/null
+++ b/AgentQnA/ui/svelte/src/lib/assets/Agent/time.svelte
@@ -0,0 +1,8 @@
+
+
+
+
+
diff --git a/AgentQnA/ui/svelte/src/lib/assets/Agent/toolIcon.svelte b/AgentQnA/ui/svelte/src/lib/assets/Agent/toolIcon.svelte
new file mode 100644
index 0000000000..342f5df387
--- /dev/null
+++ b/AgentQnA/ui/svelte/src/lib/assets/Agent/toolIcon.svelte
@@ -0,0 +1,36 @@
+
+
+
diff --git a/AgentQnA/ui/svelte/src/lib/assets/icons/ActiveDislikeButtonIcon.svelte b/AgentQnA/ui/svelte/src/lib/assets/icons/ActiveDislikeButtonIcon.svelte
new file mode 100644
index 0000000000..b5c1ea06b0
--- /dev/null
+++ b/AgentQnA/ui/svelte/src/lib/assets/icons/ActiveDislikeButtonIcon.svelte
@@ -0,0 +1,28 @@
+
+
+
diff --git a/AgentQnA/ui/svelte/src/lib/assets/icons/ActiveLikeButtonIcon.svelte b/AgentQnA/ui/svelte/src/lib/assets/icons/ActiveLikeButtonIcon.svelte
new file mode 100644
index 0000000000..b410c73386
--- /dev/null
+++ b/AgentQnA/ui/svelte/src/lib/assets/icons/ActiveLikeButtonIcon.svelte
@@ -0,0 +1,24 @@
+
+
+
diff --git a/AgentQnA/ui/svelte/src/lib/assets/icons/Folder.svelte b/AgentQnA/ui/svelte/src/lib/assets/icons/Folder.svelte
new file mode 100644
index 0000000000..c338962899
--- /dev/null
+++ b/AgentQnA/ui/svelte/src/lib/assets/icons/Folder.svelte
@@ -0,0 +1,28 @@
+
+
+
diff --git a/AgentQnA/ui/svelte/src/lib/assets/icons/Knowledge.svelte b/AgentQnA/ui/svelte/src/lib/assets/icons/Knowledge.svelte
new file mode 100644
index 0000000000..7b1593d757
--- /dev/null
+++ b/AgentQnA/ui/svelte/src/lib/assets/icons/Knowledge.svelte
@@ -0,0 +1,38 @@
+
+
+
diff --git a/AgentQnA/ui/svelte/src/lib/assets/icons/NoTranslate.svelte b/AgentQnA/ui/svelte/src/lib/assets/icons/NoTranslate.svelte
new file mode 100644
index 0000000000..7f94dcef9c
--- /dev/null
+++ b/AgentQnA/ui/svelte/src/lib/assets/icons/NoTranslate.svelte
@@ -0,0 +1,32 @@
+
+
+
diff --git a/AgentQnA/ui/svelte/src/lib/assets/icons/OldHelp.svelte b/AgentQnA/ui/svelte/src/lib/assets/icons/OldHelp.svelte
new file mode 100644
index 0000000000..71c3cfb132
--- /dev/null
+++ b/AgentQnA/ui/svelte/src/lib/assets/icons/OldHelp.svelte
@@ -0,0 +1,41 @@
+
+
+
diff --git a/AgentQnA/ui/svelte/src/lib/assets/icons/Question.svelte b/AgentQnA/ui/svelte/src/lib/assets/icons/Question.svelte
new file mode 100644
index 0000000000..c4f296e2c2
--- /dev/null
+++ b/AgentQnA/ui/svelte/src/lib/assets/icons/Question.svelte
@@ -0,0 +1,6 @@
+
+
+
diff --git a/AgentQnA/ui/svelte/src/lib/assets/icons/addKnowledge.svelte b/AgentQnA/ui/svelte/src/lib/assets/icons/addKnowledge.svelte
new file mode 100644
index 0000000000..001de15b19
--- /dev/null
+++ b/AgentQnA/ui/svelte/src/lib/assets/icons/addKnowledge.svelte
@@ -0,0 +1,92 @@
+
+
+
diff --git a/AgentQnA/ui/svelte/src/lib/assets/icons/adminKnowledge.svelte b/AgentQnA/ui/svelte/src/lib/assets/icons/adminKnowledge.svelte
new file mode 100644
index 0000000000..2ec562e6ae
--- /dev/null
+++ b/AgentQnA/ui/svelte/src/lib/assets/icons/adminKnowledge.svelte
@@ -0,0 +1,229 @@
+
+
+
diff --git a/AgentQnA/ui/svelte/src/lib/assets/icons/arrow-path-icon.svelte b/AgentQnA/ui/svelte/src/lib/assets/icons/arrow-path-icon.svelte
new file mode 100644
index 0000000000..cecb4b1273
--- /dev/null
+++ b/AgentQnA/ui/svelte/src/lib/assets/icons/arrow-path-icon.svelte
@@ -0,0 +1,25 @@
+
+
+
+
+
+
+
diff --git a/AgentQnA/ui/svelte/src/lib/assets/icons/assistant.svelte b/AgentQnA/ui/svelte/src/lib/assets/icons/assistant.svelte
new file mode 100644
index 0000000000..73e947fa4b
--- /dev/null
+++ b/AgentQnA/ui/svelte/src/lib/assets/icons/assistant.svelte
@@ -0,0 +1,33 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/AgentQnA/ui/svelte/src/lib/assets/icons/chat-bubble-left-icon.svelte b/AgentQnA/ui/svelte/src/lib/assets/icons/chat-bubble-left-icon.svelte
new file mode 100644
index 0000000000..9ea21455b0
--- /dev/null
+++ b/AgentQnA/ui/svelte/src/lib/assets/icons/chat-bubble-left-icon.svelte
@@ -0,0 +1,25 @@
+
+
+
+
+
+
+
diff --git a/AgentQnA/ui/svelte/src/lib/assets/icons/chat.svelte b/AgentQnA/ui/svelte/src/lib/assets/icons/chat.svelte
new file mode 100644
index 0000000000..d62154acad
--- /dev/null
+++ b/AgentQnA/ui/svelte/src/lib/assets/icons/chat.svelte
@@ -0,0 +1,6 @@
+
+
+
diff --git a/AgentQnA/ui/svelte/src/lib/assets/icons/check-icon.svelte b/AgentQnA/ui/svelte/src/lib/assets/icons/check-icon.svelte
new file mode 100644
index 0000000000..5905fc0866
--- /dev/null
+++ b/AgentQnA/ui/svelte/src/lib/assets/icons/check-icon.svelte
@@ -0,0 +1,25 @@
+
+
+
+
+
+
+
diff --git a/AgentQnA/ui/svelte/src/lib/assets/icons/csv.svg b/AgentQnA/ui/svelte/src/lib/assets/icons/csv.svg
new file mode 100644
index 0000000000..1e808ba6cf
--- /dev/null
+++ b/AgentQnA/ui/svelte/src/lib/assets/icons/csv.svg
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/AgentQnA/ui/svelte/src/lib/assets/icons/dislikeButtonIcon.svelte b/AgentQnA/ui/svelte/src/lib/assets/icons/dislikeButtonIcon.svelte
new file mode 100644
index 0000000000..2ae9f8ed84
--- /dev/null
+++ b/AgentQnA/ui/svelte/src/lib/assets/icons/dislikeButtonIcon.svelte
@@ -0,0 +1,28 @@
+
+
+
diff --git a/AgentQnA/ui/svelte/src/lib/assets/icons/download-directory.svelte b/AgentQnA/ui/svelte/src/lib/assets/icons/download-directory.svelte
new file mode 100644
index 0000000000..d5ad5fb259
--- /dev/null
+++ b/AgentQnA/ui/svelte/src/lib/assets/icons/download-directory.svelte
@@ -0,0 +1,16 @@
+
+
+
diff --git a/AgentQnA/ui/svelte/src/lib/assets/icons/likeButtonIcon.svelte b/AgentQnA/ui/svelte/src/lib/assets/icons/likeButtonIcon.svelte
new file mode 100644
index 0000000000..aaabc6c072
--- /dev/null
+++ b/AgentQnA/ui/svelte/src/lib/assets/icons/likeButtonIcon.svelte
@@ -0,0 +1,24 @@
+
+
+
diff --git a/AgentQnA/ui/svelte/src/lib/assets/icons/loading-button-spinner-icon.svelte b/AgentQnA/ui/svelte/src/lib/assets/icons/loading-button-spinner-icon.svelte
new file mode 100644
index 0000000000..9be0ceb5b2
--- /dev/null
+++ b/AgentQnA/ui/svelte/src/lib/assets/icons/loading-button-spinner-icon.svelte
@@ -0,0 +1,25 @@
+
+
+
+
+
+
diff --git a/AgentQnA/ui/svelte/src/lib/assets/icons/message-avatar.svelte b/AgentQnA/ui/svelte/src/lib/assets/icons/message-avatar.svelte
new file mode 100644
index 0000000000..0cbe61c7ed
--- /dev/null
+++ b/AgentQnA/ui/svelte/src/lib/assets/icons/message-avatar.svelte
@@ -0,0 +1,17 @@
+
+
+
+
+{#if role === "Assistant"}
+
+{:else}
+
+{/if}
diff --git a/AgentQnA/ui/svelte/src/lib/assets/icons/no-file.svelte b/AgentQnA/ui/svelte/src/lib/assets/icons/no-file.svelte
new file mode 100644
index 0000000000..2e22f76cd0
--- /dev/null
+++ b/AgentQnA/ui/svelte/src/lib/assets/icons/no-file.svelte
@@ -0,0 +1,37 @@
+
+
+
diff --git a/AgentQnA/ui/svelte/src/lib/assets/icons/paper-airplane.svelte b/AgentQnA/ui/svelte/src/lib/assets/icons/paper-airplane.svelte
new file mode 100644
index 0000000000..6ee8c19f1c
--- /dev/null
+++ b/AgentQnA/ui/svelte/src/lib/assets/icons/paper-airplane.svelte
@@ -0,0 +1,27 @@
+
+
+
+
+
+
+
diff --git a/AgentQnA/ui/svelte/src/lib/assets/icons/paste-link.svelte b/AgentQnA/ui/svelte/src/lib/assets/icons/paste-link.svelte
new file mode 100644
index 0000000000..79f5b4d351
--- /dev/null
+++ b/AgentQnA/ui/svelte/src/lib/assets/icons/paste-link.svelte
@@ -0,0 +1,20 @@
+
+
+
diff --git a/AgentQnA/ui/svelte/src/lib/assets/icons/pencil-square-icon.svelte b/AgentQnA/ui/svelte/src/lib/assets/icons/pencil-square-icon.svelte
new file mode 100644
index 0000000000..3b55df66c1
--- /dev/null
+++ b/AgentQnA/ui/svelte/src/lib/assets/icons/pencil-square-icon.svelte
@@ -0,0 +1,25 @@
+
+
+
+
+
+
+
diff --git a/AgentQnA/ui/svelte/src/lib/assets/icons/plus-icon.svelte b/AgentQnA/ui/svelte/src/lib/assets/icons/plus-icon.svelte
new file mode 100644
index 0000000000..e97c9d6fbb
--- /dev/null
+++ b/AgentQnA/ui/svelte/src/lib/assets/icons/plus-icon.svelte
@@ -0,0 +1,27 @@
+
+
+
+
+
+
+
diff --git a/AgentQnA/ui/svelte/src/lib/assets/icons/portrait.svelte b/AgentQnA/ui/svelte/src/lib/assets/icons/portrait.svelte
new file mode 100644
index 0000000000..2f9828b88c
--- /dev/null
+++ b/AgentQnA/ui/svelte/src/lib/assets/icons/portrait.svelte
@@ -0,0 +1,20 @@
+
+
+
diff --git a/AgentQnA/ui/svelte/src/lib/assets/icons/translateIcon.svelte b/AgentQnA/ui/svelte/src/lib/assets/icons/translateIcon.svelte
new file mode 100644
index 0000000000..47a2f38ea1
--- /dev/null
+++ b/AgentQnA/ui/svelte/src/lib/assets/icons/translateIcon.svelte
@@ -0,0 +1,32 @@
+
+
+
diff --git a/AgentQnA/ui/svelte/src/lib/assets/icons/trash-icon.svelte b/AgentQnA/ui/svelte/src/lib/assets/icons/trash-icon.svelte
new file mode 100644
index 0000000000..363430c6d8
--- /dev/null
+++ b/AgentQnA/ui/svelte/src/lib/assets/icons/trash-icon.svelte
@@ -0,0 +1,25 @@
+
+
+
+
+
+
+
diff --git a/AgentQnA/ui/svelte/src/lib/assets/icons/upload-directory.svelte b/AgentQnA/ui/svelte/src/lib/assets/icons/upload-directory.svelte
new file mode 100644
index 0000000000..2020d107f3
--- /dev/null
+++ b/AgentQnA/ui/svelte/src/lib/assets/icons/upload-directory.svelte
@@ -0,0 +1,14 @@
+
+
+
diff --git a/AgentQnA/ui/svelte/src/lib/assets/icons/upload-files.svelte b/AgentQnA/ui/svelte/src/lib/assets/icons/upload-files.svelte
new file mode 100644
index 0000000000..59913cbedc
--- /dev/null
+++ b/AgentQnA/ui/svelte/src/lib/assets/icons/upload-files.svelte
@@ -0,0 +1,14 @@
+
+
+
diff --git a/AgentQnA/ui/svelte/src/lib/assets/icons/upoadKnowledge.svelte b/AgentQnA/ui/svelte/src/lib/assets/icons/upoadKnowledge.svelte
new file mode 100644
index 0000000000..a9f3f8f813
--- /dev/null
+++ b/AgentQnA/ui/svelte/src/lib/assets/icons/upoadKnowledge.svelte
@@ -0,0 +1,6 @@
+
+
+
diff --git a/AgentQnA/ui/svelte/src/lib/assets/icons/warning.svelte b/AgentQnA/ui/svelte/src/lib/assets/icons/warning.svelte
new file mode 100644
index 0000000000..ba821a9a48
--- /dev/null
+++ b/AgentQnA/ui/svelte/src/lib/assets/icons/warning.svelte
@@ -0,0 +1,22 @@
+
+
+
diff --git a/AgentQnA/ui/svelte/src/lib/assets/icons/x-mark-icon.svelte b/AgentQnA/ui/svelte/src/lib/assets/icons/x-mark-icon.svelte
new file mode 100644
index 0000000000..8df3b7a20d
--- /dev/null
+++ b/AgentQnA/ui/svelte/src/lib/assets/icons/x-mark-icon.svelte
@@ -0,0 +1,20 @@
+
+
+
diff --git a/AgentQnA/ui/svelte/src/lib/common/sse.d.ts b/AgentQnA/ui/svelte/src/lib/common/sse.d.ts
new file mode 100644
index 0000000000..c3f8ed69d6
--- /dev/null
+++ b/AgentQnA/ui/svelte/src/lib/common/sse.d.ts
@@ -0,0 +1,15 @@
+// Copyright (C) 2025 Intel Corporation
+// SPDX-License-Identifier: Apache-2.0
+
+declare module "sse.js" {
+ export type SSEOptions = EventSourceInit & {
+ headers?: Record;
+ payload?: string;
+ method?: string;
+ };
+
+ export class SSE extends EventSource {
+ constructor(url: string | URL, sseOptions?: SSEOptions);
+ stream(): void;
+ }
+}
diff --git a/AgentQnA/ui/svelte/src/lib/common/timediff.ts b/AgentQnA/ui/svelte/src/lib/common/timediff.ts
new file mode 100644
index 0000000000..09d191d8ae
--- /dev/null
+++ b/AgentQnA/ui/svelte/src/lib/common/timediff.ts
@@ -0,0 +1,26 @@
+// Copyright (C) 2025 Intel Corporation
+// SPDX-License-Identifier: Apache-2.0
+
+export default function timeDifference(current: number, previous: number) {
+ const msPerMinute = 60 * 1000;
+ const msPerHour = msPerMinute * 60;
+ const msPerDay = msPerHour * 24;
+ const msPerMonth = msPerDay * 30;
+ const msPerYear = msPerDay * 365;
+
+ const elapsed = current - previous;
+
+ if (elapsed < msPerMinute) {
+ return Math.round(elapsed / 1000) + " seconds ago";
+ } else if (elapsed < msPerHour) {
+ return Math.round(elapsed / msPerMinute) + " minutes ago";
+ } else if (elapsed < msPerDay) {
+ return Math.round(elapsed / msPerHour) + " hours ago";
+ } else if (elapsed < msPerMonth) {
+ return "approximately " + Math.round(elapsed / msPerDay) + " days ago";
+ } else if (elapsed < msPerYear) {
+ return "approximately " + Math.round(elapsed / msPerMonth) + " months ago";
+ } else {
+ return "approximately " + Math.round(elapsed / msPerYear) + " years ago";
+ }
+}
diff --git a/AgentQnA/ui/svelte/src/lib/components/agent/loadingStatic.svelte b/AgentQnA/ui/svelte/src/lib/components/agent/loadingStatic.svelte
new file mode 100644
index 0000000000..e100fce92a
--- /dev/null
+++ b/AgentQnA/ui/svelte/src/lib/components/agent/loadingStatic.svelte
@@ -0,0 +1,16 @@
+
+
+
diff --git a/AgentQnA/ui/svelte/src/lib/components/chat/chat.svelte b/AgentQnA/ui/svelte/src/lib/components/chat/chat.svelte
new file mode 100644
index 0000000000..b140e7d1b4
--- /dev/null
+++ b/AgentQnA/ui/svelte/src/lib/components/chat/chat.svelte
@@ -0,0 +1,239 @@
+
+
+
+
+
+ AI Agent
+
+
+
+
+
+ {#if chatMessages.length === 0 && query === ""}
+
+ {:else if showAgent || chatMessages.length > 0}
+
+
+
+
+
+
+ {agentName}
+
+
+
+ {agentDescripe}
+
+
+
+
+
+
+ {/if}
+
diff --git a/AgentQnA/ui/svelte/src/lib/components/chat/history.svelte b/AgentQnA/ui/svelte/src/lib/components/chat/history.svelte
new file mode 100644
index 0000000000..81d9c277f4
--- /dev/null
+++ b/AgentQnA/ui/svelte/src/lib/components/chat/history.svelte
@@ -0,0 +1,166 @@
+
+
+
+
+
+
+
+
+
+
+
+ Create Agent
+
+
+
+ {#if !chatList.length || chatList.length === 0}
+
+ {/if}
+
+
+ {#each chatList as { chatId: cId, title }}
+
+ {/each}
+
+
diff --git a/AgentQnA/ui/svelte/src/lib/components/chat/loadingAnimation.svelte b/AgentQnA/ui/svelte/src/lib/components/chat/loadingAnimation.svelte
new file mode 100644
index 0000000000..5adffb1d0a
--- /dev/null
+++ b/AgentQnA/ui/svelte/src/lib/components/chat/loadingAnimation.svelte
@@ -0,0 +1,37 @@
+
+
+
+
diff --git a/AgentQnA/ui/svelte/src/lib/components/content.svelte b/AgentQnA/ui/svelte/src/lib/components/content.svelte
new file mode 100644
index 0000000000..b09f31fadd
--- /dev/null
+++ b/AgentQnA/ui/svelte/src/lib/components/content.svelte
@@ -0,0 +1,33 @@
+
+
+
+
+
+
+
+
+ {#key currentChatID}
+
+ {/key}
+
+
diff --git a/AgentQnA/ui/svelte/src/lib/components/create.svelte b/AgentQnA/ui/svelte/src/lib/components/create.svelte
new file mode 100644
index 0000000000..4d7595b1e4
--- /dev/null
+++ b/AgentQnA/ui/svelte/src/lib/components/create.svelte
@@ -0,0 +1,238 @@
+
+
+
+
+
+
+
+ Create Agent
+
+
+
+
+
+
+
+ Enter up to 5 subtasks
+
+
+
+
+
+ {#if goals.length === 0}
+
+
+
+ Creating subtasks...
+
+
+ {:else}
+
+ {/if}
+
+
+
+
+ {
+ dispatch("returnToPrev");
+ }}>Cancel
+ save()}>Create
+
+
diff --git a/AgentQnA/ui/svelte/src/lib/components/generateGoal.svelte b/AgentQnA/ui/svelte/src/lib/components/generateGoal.svelte
new file mode 100644
index 0000000000..ac7156e757
--- /dev/null
+++ b/AgentQnA/ui/svelte/src/lib/components/generateGoal.svelte
@@ -0,0 +1,279 @@
+
+
+
+
+
+ {#each chatMessages as goal, index}
+
+
+
+
+
+ toggleOpenIndex(index)}
+ >
+
+ {goal.goal}
+ {openIndex === index ? "▲" : "▼"}
+
+
+
+ {#if goal.tool}
+
+
+
+ {goal.tool}
+
+ {/if}
+
+
+ {#if openIndex === index}
+ {#each goal.content.slice(0, -1) as msg}
+
+
+ Result
+
+
{@html renderMarkdown(msg)}
+
+ {/each}
+ {/if}
+
+
+
+
+
+ Current Result
+
+ {#if goal.content[goal.content.length - 1] && goal.content[goal.content.length - 1].startsWith("iVBORw0KGgoAAAANSUhEUgAA")}
+
+
+ {:else}
+
+ {@html renderMarkdown(goal.content[goal.content.length - 1])}
+ {/if}
+
+
+
+
+ {#if goal.source}
+
+ {#each goal.source as source, idx}
+
+ {/each}
+
+ {/if}
+
+ {/each}
+
+
+
+
+
+ {#if currentTool === "start" && currentSearch !== "start" && currentSearch !== "finish"}
+
+
+ Searching for the appropriate tool...
+
+ {/if}
+
+ {#if currentTool !== "" && currentTool !== "start" && currentSearch !== "start"}
+
+ {#if currentSearch !== "finish"}
+
+ {/if}
+ Currently using the tool
+ {currentTool}
+
+ {/if}
+
+ {#if currentSearch === "start"}
+ {#if (currentTool) === "Image Generation"}
+
+
+ Generating an image using the
+ {currentTool} tool...
+
+ {:else}
+
+
+ Searching using the
+ {currentTool} tool...
+
+ {/if}
+ {/if}
+
+
+{#if currentContent && currentContent !== ""}
+
+
-- Web Search Results --
+
{currentContent}
+
+{/if}
+
+ {#if currentSearch === "finish"}
+
+
+ Search completed, summarizing the current task content...
+
+ {/if}
+
+
+
diff --git a/AgentQnA/ui/svelte/src/lib/components/home.svelte b/AgentQnA/ui/svelte/src/lib/components/home.svelte
new file mode 100644
index 0000000000..f35ee44575
--- /dev/null
+++ b/AgentQnA/ui/svelte/src/lib/components/home.svelte
@@ -0,0 +1,154 @@
+
+
+
+
+
+
+
+ AI AGENT
+
+
+
+
+ {#each features as feature (feature.name)}
+
+ handleCreate(feature)}
+ >
+
+
+
+
+ {feature.name}
+
+
{feature.description}
+
+ {/each}
+
+
+
+
handleCreate(query)}
+ class="flex cursor-pointer items-center gap-3 whitespace-nowrap rounded-lg bg-blue-700 px-5 py-3 text-center text-sm font-medium text-white hover:bg-blue-800 focus:ring-4 focus:ring-blue-300 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800"
+ >
+
+ Start Creating
+
+
diff --git a/AgentQnA/ui/svelte/src/lib/components/layout.svelte b/AgentQnA/ui/svelte/src/lib/components/layout.svelte
new file mode 100644
index 0000000000..afbe4768bd
--- /dev/null
+++ b/AgentQnA/ui/svelte/src/lib/components/layout.svelte
@@ -0,0 +1,45 @@
+
+
+
+
+
+
+
+
+
diff --git a/AgentQnA/ui/svelte/src/lib/components/shared/click-outside.ts b/AgentQnA/ui/svelte/src/lib/components/shared/click-outside.ts
new file mode 100644
index 0000000000..3796181796
--- /dev/null
+++ b/AgentQnA/ui/svelte/src/lib/components/shared/click-outside.ts
@@ -0,0 +1,18 @@
+// Copyright (C) 2025 Intel Corporation
+// SPDX-License-Identifier: Apache-2.0
+
+export function clickOutside(node: HTMLElement): { destroy(): void } {
+ const handleClick = (event: MouseEvent) => {
+ if (node && !node.contains(event.target as Node) && !event.defaultPrevented) {
+ node.dispatchEvent(new CustomEvent("click_outside", { detail: node }));
+ }
+ };
+
+ document.addEventListener("click", handleClick, true);
+
+ return {
+ destroy() {
+ document.removeEventListener("click", handleClick, true);
+ },
+ };
+}
diff --git a/AgentQnA/ui/svelte/src/lib/components/shared/overlay.svelte b/AgentQnA/ui/svelte/src/lib/components/shared/overlay.svelte
new file mode 100644
index 0000000000..cfcb943507
--- /dev/null
+++ b/AgentQnA/ui/svelte/src/lib/components/shared/overlay.svelte
@@ -0,0 +1,15 @@
+
+
+
+
+
+
diff --git a/AgentQnA/ui/svelte/src/lib/components/shared/shared-utils.ts b/AgentQnA/ui/svelte/src/lib/components/shared/shared-utils.ts
new file mode 100644
index 0000000000..0a4b7443de
--- /dev/null
+++ b/AgentQnA/ui/svelte/src/lib/components/shared/shared-utils.ts
@@ -0,0 +1,167 @@
+// Copyright (C) 2025 Intel Corporation
+// SPDX-License-Identifier: Apache-2.0
+
+import { chatList$, chats$ } from "./shared.store";
+import { nanoid } from "nanoid";
+import {
+ LOCAL_STORAGE_KEY,
+ type Chat,
+ type ChatListItem,
+ type ModelOptionType,
+ type SelectedType,
+ type Message,
+} from "./shared.type";
+
+export function defineType(optionType: string, selected: SelectedType, MODEL_OPTION: ModelOptionType) {
+ let type: any = {};
+ let modeltype: any = {};
+
+ if (optionType == "Model") {
+ type = {
+ model: selected["Model"],
+ temperature: MODEL_OPTION.options.find((option) => option.label === "Temperature")?.value,
+ max_new_tokens: MODEL_OPTION.options.find((option) => option.label === "Max Tokens")?.value,
+ topk: MODEL_OPTION.options.find((option) => option.label === "Top K")?.value,
+ };
+ } else if (optionType == "knowledge base") {
+ const knowledge_map: { [key: string]: string } = {
+ Wikipedia: "WIKI",
+ "INC Document": "INC",
+ ASK_GM: "ASK_GM",
+ Young_Pat: "Young_Pat",
+ Customized: "Customized",
+ };
+ type = {
+ model: "knowledge",
+ knowledge: knowledge_map[selected["knowledge base"]],
+ };
+ if (selected["advance option"]) {
+ type.advanceOption = selected["advance option"];
+ }
+ }
+
+ return type;
+}
+
+let chat: Record;
+let chatlist: ChatListItem[];
+
+export const createNewChatListItem = (chatId: string, title: string): ChatListItem => {
+ return {
+ chatId,
+ title: title,
+ };
+};
+
+export const createNewChat = (chatId: string, messages: Message[], agentName: string, agentDescripe: string): Chat => {
+ return {
+ chatId,
+ messages,
+ agentName,
+ agentDescripe,
+ };
+};
+
+/**
+ * Insert new chat (For the root route)
+ */
+export const insertNewChat = (msgs: Message[], title: string, agentName: string, agentDescripe: string) => {
+ const newChatId = nanoid(8);
+
+ chatList$.update((chatList) => {
+ chatList.unshift(createNewChatListItem(newChatId, title));
+ return chatList;
+ });
+ chats$.update((chats) => {
+ chats[newChatId] = createNewChat(newChatId, msgs, agentName, agentDescripe);
+ return chats;
+ });
+
+ try {
+ const unsubscribe_chatlist = chatList$.subscribe((value: ChatListItem[]) => {
+ chatlist = value;
+ });
+ const unsubscribe_chats = chats$.subscribe((value: Record) => {
+ chat = value;
+ });
+ localStorage.setItem(LOCAL_STORAGE_KEY.CHAT_LIST, JSON.stringify(chatlist));
+ localStorage.setItem(newChatId, JSON.stringify(chat[newChatId]));
+
+ unsubscribe_chatlist();
+ unsubscribe_chats();
+ } catch (e: any) {}
+
+ return newChatId;
+};
+/**
+ * Update chat
+ */
+
+export const updateChat = (id: string, msgs: Message[], title: string, agentName: string, agentDescripe: string) => {
+ chats$.update((chats) => {
+ chats[id].messages = msgs;
+ chats[id].agentName = agentName;
+ chats[id].agentDescripe = agentDescripe;
+
+ return chats;
+ });
+
+ chatList$.update((chatList) => {
+ chatList = chatList.map((chat) => {
+ if (chat.chatId === id) {
+ chat.title = title;
+ }
+ return chat;
+ });
+ return chatList;
+ });
+ // Problem
+ try {
+ const unsubscribe_chatlist = chatList$.subscribe((value: ChatListItem[]) => {
+ chatlist = value;
+ });
+ const unsubscribe_chats = chats$.subscribe((value: Record) => {
+ chat = value;
+ });
+ localStorage.setItem(LOCAL_STORAGE_KEY.CHAT_LIST, JSON.stringify(chatlist));
+ localStorage.setItem(id, JSON.stringify(chat[id]));
+ unsubscribe_chatlist();
+ unsubscribe_chats();
+ } catch (e: any) {
+ console.log("update chat error", e);
+ }
+};
+
+export const upsertChat = (
+ chatId: string,
+ msgs: Message[],
+ title: string,
+ agentName: string,
+ agentDescripe: string,
+) => {
+ if (!chatId) {
+ chatId = insertNewChat(msgs, title, agentName, agentDescripe);
+ } else {
+ updateChat(chatId, msgs, title, agentName, agentDescripe);
+ }
+
+ return chatId;
+};
+
+export function scrollToBottom(scrollToDiv: HTMLElement) {
+ if (scrollToDiv) {
+ setTimeout(
+ () =>
+ scrollToDiv.scroll({
+ behavior: "auto",
+ top: scrollToDiv.scrollHeight,
+ }),
+ 100,
+ );
+ }
+}
+export const truncateString = (str = "", cutLength = 18) => {
+ const truncated = str?.substring?.(0, cutLength);
+
+ return truncated?.length < str?.length ? `${truncated}...` : truncated;
+};
diff --git a/AgentQnA/ui/svelte/src/lib/components/shared/shared.store.ts b/AgentQnA/ui/svelte/src/lib/components/shared/shared.store.ts
new file mode 100644
index 0000000000..a072fdec3a
--- /dev/null
+++ b/AgentQnA/ui/svelte/src/lib/components/shared/shared.store.ts
@@ -0,0 +1,34 @@
+// Copyright (C) 2025 Intel Corporation
+// SPDX-License-Identifier: Apache-2.0
+
+import { derived, writable } from "svelte/store";
+
+import type { Chat, ChatListItem } from "./shared.type";
+
+/**
+ * Banners
+ */
+export const banners$ = writable([] as any);
+
+export const hasBanners$ = derived(banners$, (banners) => {
+ return banners.length > 0;
+});
+
+/**
+ * localStorage
+ */
+export const chatList$ = writable([] as ChatListItem[]);
+export const chats$ = writable({} as Record);
+export const knowledge_base_id = writable("" as string);
+export const storageFiles = writable([]);
+export const admin$ = writable("" as string);
+
+export const parentPath = writable("" as string);
+export const parentIdx = writable(-1 as number);
+
+export const hintStart = writable(false as boolean);
+export const hintEnd = writable({ status: false, hintContent: "" });
+export const netError = writable(false as boolean);
+
+export const needRecreate = writable(false as boolean);
+export const displayHintRecreate = writable(false as boolean);
diff --git a/AgentQnA/ui/svelte/src/lib/components/shared/shared.type.ts b/AgentQnA/ui/svelte/src/lib/components/shared/shared.type.ts
new file mode 100644
index 0000000000..4b18abe014
--- /dev/null
+++ b/AgentQnA/ui/svelte/src/lib/components/shared/shared.type.ts
@@ -0,0 +1,83 @@
+// Copyright (C) 2025 Intel Corporation
+// SPDX-License-Identifier: Apache-2.0
+
+export interface ModelOptionType {
+ names: string[];
+ options: {
+ label: string;
+ value: number;
+ minRange: number;
+ maxRange: number;
+ step: number;
+ type: string;
+ }[];
+}
+
+export interface SelectedType {
+ [key: string]: string;
+ Model: string;
+ "knowledge base": string;
+ "advance option": string;
+}
+
+export enum LOCAL_STORAGE_KEY {
+ OPEN_AI_API_KEY = "openAiApiKey",
+ CHAT_LIST = "bChatList",
+ GPT_MODEL = "bGptModel",
+}
+
+export enum MESSAGE_ROLE {
+ SYSTEM = "system",
+ ASSISTANT = "assistant",
+ USER = "user",
+ HUMAN = "Human",
+}
+
+export enum BANNER_TYPE {
+ ERROR = "error",
+ INFO = "info",
+ WARNING = "warning",
+ SUCCESS = "success",
+}
+
+export enum ERROR {
+ LOCAL_STORAGE_SET_ITEM = "LOCAL_STORAGE_SET_ITEM",
+ OPENAI_CHAT_COMPLETION = "OPENAI_CHAT_COMPLETION",
+ REGISTRATION = "REGISTRATION",
+ LOGIN = "LOGIN",
+ PASSWORD_RESET = "PASSWORD_RESET",
+ USER_DATA_FETCH = "USER_DATA_FETCH",
+ PASSWORD_CHANGE = "PASSWORD_CHANGE",
+ CHECKOUT_SESSION_CREATE = "CHECKOUT_SESSION_CREATE",
+ DATA_SYNC_SAVE = "CHAT_SYNC_SAVE",
+ DATA_SYNC_SAVE_LIMIT = "CHAT_SYNC_SAVE_LIMIT",
+ DATA_SYNC_IMPORT = "CHAT_SYNC_IMPORT",
+ DATA_SYNC_DELETE_SAVED_CHAT = "CHAT_SYNC_DELETE_SAVED_CHAT",
+}
+
+export type Message = {
+ tool: string;
+ content: [];
+ goal: string;
+ source: [];
+};
+
+export type ChatListItem = {
+ chatId: string;
+ title: string;
+};
+
+export type Chat = {
+ chatId: string;
+ messages: Message[];
+ agentName: string;
+ agentDescripe: string;
+};
+
+// In-memory only
+export type Banner = {
+ bannerId: string;
+ bannerType: BANNER_TYPE;
+ title: string;
+ description: string;
+};
diff --git a/AgentQnA/ui/svelte/src/lib/components/shared/store.ts b/AgentQnA/ui/svelte/src/lib/components/shared/store.ts
new file mode 100644
index 0000000000..f496f131ba
--- /dev/null
+++ b/AgentQnA/ui/svelte/src/lib/components/shared/store.ts
@@ -0,0 +1,11 @@
+// Copyright (C) 2025 Intel Corporation
+// SPDX-License-Identifier: Apache-2.0
+
+import { writable } from "svelte/store";
+
+let open = writable(false);
+
+export { open };
+
+export const displayedGoals = writable([]);
+export const currentMsgs = writable<{ [key: string]: string[] }>({});
diff --git a/AgentQnA/ui/svelte/src/lib/components/timeline.svelte b/AgentQnA/ui/svelte/src/lib/components/timeline.svelte
new file mode 100644
index 0000000000..14baff43b0
--- /dev/null
+++ b/AgentQnA/ui/svelte/src/lib/components/timeline.svelte
@@ -0,0 +1,68 @@
+
+
+
+
+
+
+
diff --git a/AgentQnA/ui/svelte/src/lib/modules/chat/sidebar-chat-item.svelte b/AgentQnA/ui/svelte/src/lib/modules/chat/sidebar-chat-item.svelte
new file mode 100644
index 0000000000..5e6411082e
--- /dev/null
+++ b/AgentQnA/ui/svelte/src/lib/modules/chat/sidebar-chat-item.svelte
@@ -0,0 +1,169 @@
+
+
+
+
+
+
+
+
+ {#if isEditing}
+ e.stopPropagation()}
+ type="text"
+ name="title"
+ class="block bg-gray-100 text-black w-full h-5 ring mr-3 rounded-md py-1.5 shadow-sm outline-0 sm:text-sm sm:leading-6"
+ />
+ {:else}
+
+ {truncateString(title)}
+
+ {/if}
+
+
+
+ {#if isEditing}
+
+ handleSaveTitleEditClick()}>
+
+
+ handleCancelTitleEditClick()}>
+
+
+
+ {:else if isHovering}
+
+
handleTitleEditClick()}>
+
+
+
handleDeleteChat(chatId)}>
+
+
+
+ {/if}
+
diff --git a/AgentQnA/ui/svelte/src/lib/modules/chat/wait-for-knowledge.svelte b/AgentQnA/ui/svelte/src/lib/modules/chat/wait-for-knowledge.svelte
new file mode 100644
index 0000000000..bbe3e8becc
--- /dev/null
+++ b/AgentQnA/ui/svelte/src/lib/modules/chat/wait-for-knowledge.svelte
@@ -0,0 +1,33 @@
+
+
+
+
+{#if showSearch}
+
+
+
+
+
Searching for: {knowledge_question}
+
+{/if}
+
+{#if showGenerate}
+
+
+
+
+
Generating answers for you...
+
+{/if}
diff --git a/AgentQnA/ui/svelte/src/lib/modules/network.ts b/AgentQnA/ui/svelte/src/lib/modules/network.ts
new file mode 100644
index 0000000000..3443f673ef
--- /dev/null
+++ b/AgentQnA/ui/svelte/src/lib/modules/network.ts
@@ -0,0 +1,24 @@
+// Copyright (C) 2025 Intel Corporation
+// SPDX-License-Identifier: Apache-2.0
+
+import { env } from "$env/dynamic/public";
+import { SSE } from "sse.js";
+
+const AGENT_URL = env.AGENT_URL;
+
+export async function fetchAgentExecute(query: string) {
+ let payload = {};
+ let url = "";
+
+ payload = {
+ messages: query,
+ stream: true,
+ };
+
+ url = AGENT_URL;
+
+ return new SSE(url, {
+ headers: { "Content-Type": "application/json" },
+ payload: JSON.stringify(payload),
+ });
+}
diff --git a/AgentQnA/ui/svelte/src/routes/+layout.svelte b/AgentQnA/ui/svelte/src/routes/+layout.svelte
new file mode 100644
index 0000000000..b06bb1d3fe
--- /dev/null
+++ b/AgentQnA/ui/svelte/src/routes/+layout.svelte
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
diff --git a/AgentQnA/ui/svelte/src/routes/+page.svelte b/AgentQnA/ui/svelte/src/routes/+page.svelte
new file mode 100644
index 0000000000..f080b0e7f8
--- /dev/null
+++ b/AgentQnA/ui/svelte/src/routes/+page.svelte
@@ -0,0 +1,15 @@
+
+
+
+
+
+ AgentGPT
+
+
+
diff --git a/AgentQnA/ui/svelte/src/routes/+page.ts b/AgentQnA/ui/svelte/src/routes/+page.ts
new file mode 100644
index 0000000000..c0308971b6
--- /dev/null
+++ b/AgentQnA/ui/svelte/src/routes/+page.ts
@@ -0,0 +1,36 @@
+// Copyright (C) 2025 Intel Corporation
+// SPDX-License-Identifier: Apache-2.0
+
+import { browser } from "$app/environment";
+import { chats$, chatList$ } from "$lib/components/shared/shared.store";
+import { LOCAL_STORAGE_KEY } from "$lib/components/shared/shared.type";
+
+export const load = async () => {
+ if (browser) {
+ const chatList = localStorage.getItem(LOCAL_STORAGE_KEY.CHAT_LIST);
+
+ // Chat list
+ if (chatList) {
+ const parsedChatList = JSON.parse(chatList);
+ chatList$.set(parsedChatList);
+
+ // Chats
+ if (parsedChatList.length > 0) {
+ parsedChatList.forEach((listItem: any) => {
+ const chatId = listItem.chatId;
+ // chats$ messages should already be present in localStorage, else ¯\_(ツ)_/¯
+ const chat = localStorage.getItem(chatId);
+
+ if (chat) {
+ chats$.update((chats) => {
+ return {
+ ...chats,
+ [chatId]: JSON.parse(chat),
+ };
+ });
+ }
+ });
+ }
+ }
+ }
+};
diff --git a/AgentQnA/ui/svelte/static/favicon.png b/AgentQnA/ui/svelte/static/favicon.png
new file mode 100644
index 0000000000..75b997f815
Binary files /dev/null and b/AgentQnA/ui/svelte/static/favicon.png differ
diff --git a/AgentQnA/ui/svelte/svelte.config.js b/AgentQnA/ui/svelte/svelte.config.js
new file mode 100644
index 0000000000..1b125b500e
--- /dev/null
+++ b/AgentQnA/ui/svelte/svelte.config.js
@@ -0,0 +1,27 @@
+// Copyright (C) 2025 Intel Corporation
+// SPDX-License-Identifier: Apache-2.0
+
+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/AgentQnA/ui/svelte/tailwind.config.cjs b/AgentQnA/ui/svelte/tailwind.config.cjs
new file mode 100644
index 0000000000..43b1addf36
--- /dev/null
+++ b/AgentQnA/ui/svelte/tailwind.config.cjs
@@ -0,0 +1,11 @@
+const config = {
+ content: ["./src/**/*.{html,js,svelte,ts}", "./node_modules/flowbite-svelte/**/*.{html,js,svelte,ts}"],
+
+ theme: {
+ extend: {},
+ },
+
+ plugins: [require("daisyui"), require("@tailwindcss/typography"), require("flowbite/plugin")],
+};
+
+module.exports = config;
diff --git a/AgentQnA/ui/svelte/tsconfig.json b/AgentQnA/ui/svelte/tsconfig.json
new file mode 100644
index 0000000000..0f47472f79
--- /dev/null
+++ b/AgentQnA/ui/svelte/tsconfig.json
@@ -0,0 +1,13 @@
+{
+ "extends": "./.svelte-kit/tsconfig.json",
+ "compilerOptions": {
+ "allowJs": true,
+ "checkJs": true,
+ "esModuleInterop": true,
+ "forceConsistentCasingInFileNames": true,
+ "resolveJsonModule": true,
+ "skipLibCheck": true,
+ "sourceMap": true,
+ "strict": true
+ }
+}
diff --git a/AgentQnA/ui/svelte/vite.config.ts b/AgentQnA/ui/svelte/vite.config.ts
new file mode 100644
index 0000000000..9b19e8feca
--- /dev/null
+++ b/AgentQnA/ui/svelte/vite.config.ts
@@ -0,0 +1,21 @@
+// Copyright (C) 2025 Intel Corporation
+// SPDX-License-Identifier: Apache-2.0
+
+import { sveltekit } from "@sveltejs/kit/vite";
+import type { UserConfig } from "vite";
+
+const config: UserConfig = {
+ plugins: [sveltekit()],
+ server: {
+ proxy: {
+ "/api": {
+ target: "http://10.112.228.168:8000",
+ changeOrigin: true,
+ secure: true,
+ rewrite: (path) => path.replace(/^\/api/, ""),
+ },
+ },
+ },
+};
+
+export default config;
diff --git a/AudioQnA/Dockerfile b/AudioQnA/Dockerfile
index 5797aee9f4..07245de371 100644
--- a/AudioQnA/Dockerfile
+++ b/AudioQnA/Dockerfile
@@ -1,31 +1,49 @@
-
-
# Copyright (C) 2024 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
-FROM python:3.11-slim
+# Stage 1: base setup used by other stages
+FROM python:3.11-slim AS base
-RUN apt-get update -y && apt-get install -y --no-install-recommends --fix-missing \
- libgl1-mesa-glx \
- libjemalloc-dev \
- git
+# get security updates
+RUN apt-get update && apt-get upgrade -y && \
+ apt-get clean && rm -rf /var/lib/apt/lists/*
+
+ENV HOME=/home/user
RUN useradd -m -s /bin/bash user && \
- mkdir -p /home/user && \
- chown -R user /home/user/
+ mkdir -p $HOME && \
+ chown -R user $HOME
-WORKDIR /home/user/
-RUN git clone https://github.com/opea-project/GenAIComps.git
-WORKDIR /home/user/GenAIComps
-RUN pip install --no-cache-dir --upgrade pip setuptools && \
- pip install --no-cache-dir -r /home/user/GenAIComps/requirements.txt
+WORKDIR $HOME
+
+
+# Stage 2: latest GenAIComps sources
+FROM base AS git
+
+RUN apt-get update && apt-get install -y --no-install-recommends git
+RUN git clone --depth 1 https://github.com/opea-project/GenAIComps.git
-COPY ./audioqna.py /home/user/audioqna.py
-ENV PYTHONPATH=$PYTHONPATH:/home/user/GenAIComps
+# Stage 3: common layer shared by services using GenAIComps
+FROM base AS comps-base
+
+# copy just relevant parts
+COPY --from=git $HOME/GenAIComps/comps $HOME/GenAIComps/comps
+COPY --from=git $HOME/GenAIComps/*.* $HOME/GenAIComps/LICENSE $HOME/GenAIComps/
+
+WORKDIR $HOME/GenAIComps
+RUN pip install --no-cache-dir --upgrade pip setuptools && \
+ pip install --no-cache-dir -r $HOME/GenAIComps/requirements.txt
+WORKDIR $HOME
+
+ENV PYTHONPATH=$PYTHONPATH:$HOME/GenAIComps
USER user
-WORKDIR /home/user
+
+# Stage 4: unique part
+FROM comps-base
+
+COPY ./audioqna.py $HOME/audioqna.py
ENTRYPOINT ["python", "audioqna.py"]
diff --git a/AudioQnA/Dockerfile.multilang b/AudioQnA/Dockerfile.multilang
index ef7c926975..1d0573d217 100644
--- a/AudioQnA/Dockerfile.multilang
+++ b/AudioQnA/Dockerfile.multilang
@@ -1,32 +1,49 @@
-
-
# Copyright (C) 2024 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
-FROM python:3.11-slim
+# Stage 1: base setup used by other stages
+FROM python:3.11-slim AS base
+
+# get security updates
+RUN apt-get update && apt-get upgrade -y && \
+ apt-get clean && rm -rf /var/lib/apt/lists/*
-RUN apt-get update -y && apt-get install -y --no-install-recommends --fix-missing \
- libgl1-mesa-glx \
- libjemalloc-dev \
- git
+ENV HOME=/home/user
RUN useradd -m -s /bin/bash user && \
- mkdir -p /home/user && \
- chown -R user /home/user/
+ mkdir -p $HOME && \
+ chown -R user $HOME
-WORKDIR /home/user/
-RUN git clone https://github.com/opea-project/GenAIComps.git
+WORKDIR $HOME
-WORKDIR /home/user/GenAIComps
-RUN pip install --no-cache-dir --upgrade pip setuptools && \
- pip install --no-cache-dir -r /home/user/GenAIComps/requirements.txt
-COPY ./audioqna_multilang.py /home/user/audioqna_multilang.py
+# Stage 2: latest GenAIComps sources
+FROM base AS git
+
+RUN apt-get update && apt-get install -y --no-install-recommends git
+RUN git clone --depth 1 https://github.com/opea-project/GenAIComps.git
+
-ENV PYTHONPATH=$PYTHONPATH:/home/user/GenAIComps
+# Stage 3: common layer shared by services using GenAIComps
+FROM base AS comps-base
+
+# copy just relevant parts
+COPY --from=git $HOME/GenAIComps/comps $HOME/GenAIComps/comps
+COPY --from=git $HOME/GenAIComps/*.* $HOME/GenAIComps/LICENSE $HOME/GenAIComps/
+
+WORKDIR $HOME/GenAIComps
+RUN pip install --no-cache-dir --upgrade pip setuptools && \
+ pip install --no-cache-dir -r $HOME/GenAIComps/requirements.txt
+WORKDIR $HOME
+
+ENV PYTHONPATH=$PYTHONPATH:$HOME/GenAIComps
USER user
-WORKDIR /home/user
+
+# Stage 4: unique part
+FROM comps-base
+
+COPY ./audioqna_multilang.py $HOME/audioqna_multilang.py
ENTRYPOINT ["python", "audioqna_multilang.py"]
diff --git a/AvatarChatbot/Dockerfile b/AvatarChatbot/Dockerfile
index b845296f70..3266bc296a 100644
--- a/AvatarChatbot/Dockerfile
+++ b/AvatarChatbot/Dockerfile
@@ -1,33 +1,49 @@
-
-
# Copyright (C) 2024 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
-FROM python:3.11-slim
+# Stage 1: base setup used by other stages
+FROM python:3.11-slim AS base
+
+# get security updates
+RUN apt-get update && apt-get upgrade -y && \
+ apt-get clean && rm -rf /var/lib/apt/lists/*
-RUN apt-get update -y && apt-get install -y --no-install-recommends --fix-missing \
- libgl1-mesa-glx \
- libjemalloc-dev \
- vim \
- git
+ENV HOME=/home/user
RUN useradd -m -s /bin/bash user && \
- mkdir -p /home/user && \
- chown -R user /home/user/
+ mkdir -p $HOME && \
+ chown -R user $HOME
-WORKDIR /home/user/
-RUN git clone https://github.com/opea-project/GenAIComps.git
-WORKDIR /home/user/GenAIComps
+WORKDIR $HOME
-RUN pip install --no-cache-dir --upgrade pip && \
- pip install --no-cache-dir -r /home/user/GenAIComps/requirements.txt
-COPY ./avatarchatbot.py /home/user/avatarchatbot.py
+# Stage 2: latest GenAIComps sources
+FROM base AS git
+
+RUN apt-get update && apt-get install -y --no-install-recommends git
+RUN git clone --depth 1 https://github.com/opea-project/GenAIComps.git
+
-ENV PYTHONPATH=$PYTHONPATH:/home/user/GenAIComps
+# Stage 3: common layer shared by services using GenAIComps
+FROM base AS comps-base
+
+# copy just relevant parts
+COPY --from=git $HOME/GenAIComps/comps $HOME/GenAIComps/comps
+COPY --from=git $HOME/GenAIComps/*.* $HOME/GenAIComps/LICENSE $HOME/GenAIComps/
+
+WORKDIR $HOME/GenAIComps
+RUN pip install --no-cache-dir --upgrade pip && \
+ pip install --no-cache-dir -r $HOME/GenAIComps/requirements.txt
+WORKDIR $HOME
+
+ENV PYTHONPATH=$PYTHONPATH:$HOME/GenAIComps
USER user
-WORKDIR /home/user
+
+# Stage 4: unique part
+FROM comps-base
+
+COPY ./avatarchatbot.py $HOME/avatarchatbot.py
ENTRYPOINT ["python", "avatarchatbot.py"]
diff --git a/ChatQnA/Dockerfile b/ChatQnA/Dockerfile
index 4e431ac773..fb7f5e14ec 100644
--- a/ChatQnA/Dockerfile
+++ b/ChatQnA/Dockerfile
@@ -1,35 +1,49 @@
-
-
# Copyright (C) 2024 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
-FROM python:3.11-slim
+# Stage 1: base setup used by other stages
+FROM python:3.11-slim AS base
+
+# get security updates
+RUN apt-get update && apt-get upgrade -y && \
+ apt-get clean && rm -rf /var/lib/apt/lists/*
-RUN apt-get update -y && apt-get install -y --no-install-recommends --fix-missing \
- libgl1-mesa-glx \
- libjemalloc-dev \
- git
+ENV HOME=/home/user
RUN useradd -m -s /bin/bash user && \
- mkdir -p /home/user && \
- chown -R user /home/user/
+ mkdir -p $HOME && \
+ chown -R user $HOME
-WORKDIR /home/user/
-RUN git clone https://github.com/opea-project/GenAIComps.git
+WORKDIR $HOME
-WORKDIR /home/user/GenAIComps
-RUN pip install --no-cache-dir --upgrade pip setuptools && \
- pip install --no-cache-dir -r /home/user/GenAIComps/requirements.txt && \
- pip install --no-cache-dir langchain_core
-COPY ./chatqna.py /home/user/chatqna.py
+# Stage 2: latest GenAIComps sources
+FROM base AS git
+
+RUN apt-get update && apt-get install -y --no-install-recommends git
+RUN git clone --depth 1 https://github.com/opea-project/GenAIComps.git
+
-ENV PYTHONPATH=$PYTHONPATH:/home/user/GenAIComps
+# Stage 3: common layer shared by services using GenAIComps
+FROM base AS comps-base
+
+# copy just relevant parts
+COPY --from=git $HOME/GenAIComps/comps $HOME/GenAIComps/comps
+COPY --from=git $HOME/GenAIComps/*.* $HOME/GenAIComps/LICENSE $HOME/GenAIComps/
+
+WORKDIR $HOME/GenAIComps
+RUN pip install --no-cache-dir --upgrade pip setuptools && \
+ pip install --no-cache-dir -r $HOME/GenAIComps/requirements.txt
+WORKDIR $HOME
+
+ENV PYTHONPATH=$PYTHONPATH:$HOME/GenAIComps
USER user
-WORKDIR /home/user
-RUN echo 'ulimit -S -n 999999' >> ~/.bashrc
+# Stage 4: unique part
+FROM comps-base
+
+COPY ./chatqna.py $HOME/chatqna.py
ENTRYPOINT ["python", "chatqna.py"]
diff --git a/ChatQnA/Dockerfile.guardrails b/ChatQnA/Dockerfile.guardrails
index ed811148c0..4fe5fd2087 100644
--- a/ChatQnA/Dockerfile.guardrails
+++ b/ChatQnA/Dockerfile.guardrails
@@ -1,35 +1,49 @@
-
-
# Copyright (C) 2024 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
-FROM python:3.11-slim
+# Stage 1: base setup used by other stages
+FROM python:3.11-slim AS base
+
+# get security updates
+RUN apt-get update && apt-get upgrade -y && \
+ apt-get clean && rm -rf /var/lib/apt/lists/*
-RUN apt-get update -y && apt-get install -y --no-install-recommends --fix-missing \
- libgl1-mesa-glx \
- libjemalloc-dev \
- git
+ENV HOME=/home/user
RUN useradd -m -s /bin/bash user && \
- mkdir -p /home/user && \
- chown -R user /home/user/
+ mkdir -p $HOME && \
+ chown -R user $HOME
-WORKDIR /home/user/
-RUN git clone https://github.com/opea-project/GenAIComps.git
+WORKDIR $HOME
-WORKDIR /home/user/GenAIComps
-RUN pip install --no-cache-dir --upgrade pip setuptools && \
- pip install --no-cache-dir -r /home/user/GenAIComps/requirements.txt && \
- pip install --no-cache-dir langchain_core
-COPY ./chatqna.py /home/user/chatqna.py
+# Stage 2: latest GenAIComps sources
+FROM base AS git
+
+RUN apt-get update && apt-get install -y --no-install-recommends git
+RUN git clone --depth 1 https://github.com/opea-project/GenAIComps.git
+
-ENV PYTHONPATH=$PYTHONPATH:/home/user/GenAIComps
+# Stage 3: common layer shared by services using GenAIComps
+FROM base AS comps-base
+
+# copy just relevant parts
+COPY --from=git $HOME/GenAIComps/comps $HOME/GenAIComps/comps
+COPY --from=git $HOME/GenAIComps/*.* $HOME/GenAIComps/LICENSE $HOME/GenAIComps/
+
+WORKDIR $HOME/GenAIComps
+RUN pip install --no-cache-dir --upgrade pip setuptools && \
+ pip install --no-cache-dir -r $HOME/GenAIComps/requirements.txt
+WORKDIR $HOME
+
+ENV PYTHONPATH=$PYTHONPATH:$HOME/GenAIComps
USER user
-WORKDIR /home/user
-RUN echo 'ulimit -S -n 999999' >> ~/.bashrc
+# Stage 4: unique part
+FROM comps-base
+
+COPY ./chatqna.py $HOME/chatqna.py
ENTRYPOINT ["python", "chatqna.py", "--with-guardrails"]
diff --git a/ChatQnA/Dockerfile.without_rerank b/ChatQnA/Dockerfile.without_rerank
index 7d3a94c5de..9e6740e9b8 100644
--- a/ChatQnA/Dockerfile.without_rerank
+++ b/ChatQnA/Dockerfile.without_rerank
@@ -1,35 +1,49 @@
-
-
# Copyright (C) 2024 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
-FROM python:3.11-slim
+# Stage 1: base setup used by other stages
+FROM python:3.11-slim AS base
+
+# get security updates
+RUN apt-get update && apt-get upgrade -y && \
+ apt-get clean && rm -rf /var/lib/apt/lists/*
-RUN apt-get update -y && apt-get install -y --no-install-recommends --fix-missing \
- git \
- libgl1-mesa-glx \
- libjemalloc-dev
+ENV HOME=/home/user
RUN useradd -m -s /bin/bash user && \
- mkdir -p /home/user && \
- chown -R user /home/user/
+ mkdir -p $HOME && \
+ chown -R user $HOME
-WORKDIR /home/user/
-RUN git clone https://github.com/opea-project/GenAIComps.git
+WORKDIR $HOME
-WORKDIR /home/user/GenAIComps
-RUN pip install --no-cache-dir --upgrade pip setuptools && \
- pip install --no-cache-dir -r /home/user/GenAIComps/requirements.txt && \
- pip install --no-cache-dir langchain_core
-COPY ./chatqna.py /home/user/chatqna.py
+# Stage 2: latest GenAIComps sources
+FROM base AS git
+
+RUN apt-get update && apt-get install -y --no-install-recommends git
+RUN git clone --depth 1 https://github.com/opea-project/GenAIComps.git
+
-ENV PYTHONPATH=$PYTHONPATH:/home/user/GenAIComps
+# Stage 3: common layer shared by services using GenAIComps
+FROM base AS comps-base
+
+# copy just relevant parts
+COPY --from=git $HOME/GenAIComps/comps $HOME/GenAIComps/comps
+COPY --from=git $HOME/GenAIComps/*.* $HOME/GenAIComps/LICENSE $HOME/GenAIComps/
+
+WORKDIR $HOME/GenAIComps
+RUN pip install --no-cache-dir --upgrade pip setuptools && \
+ pip install --no-cache-dir -r $HOME/GenAIComps/requirements.txt
+WORKDIR $HOME
+
+ENV PYTHONPATH=$PYTHONPATH:$HOME/GenAIComps
USER user
-WORKDIR /home/user
-RUN echo 'ulimit -S -n 999999' >> ~/.bashrc
+# Stage 4: unique part
+FROM comps-base
+
+COPY ./chatqna.py $HOME/chatqna.py
ENTRYPOINT ["python", "chatqna.py", "--without-rerank"]
diff --git a/ChatQnA/Dockerfile.wrapper b/ChatQnA/Dockerfile.wrapper
index a9e4fb5444..40ac309246 100644
--- a/ChatQnA/Dockerfile.wrapper
+++ b/ChatQnA/Dockerfile.wrapper
@@ -1,32 +1,49 @@
# Copyright (C) 2024 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
-FROM python:3.11-slim
+# Stage 1: base setup used by other stages
+FROM python:3.11-slim AS base
-RUN apt-get update -y && apt-get install -y --no-install-recommends --fix-missing \
- libgl1-mesa-glx \
- libjemalloc-dev \
- git
+# get security updates
+RUN apt-get update && apt-get upgrade -y && \
+ apt-get clean && rm -rf /var/lib/apt/lists/*
+
+ENV HOME=/home/user
RUN useradd -m -s /bin/bash user && \
- mkdir -p /home/user && \
- chown -R user /home/user/
+ mkdir -p $HOME && \
+ chown -R user $HOME
+
+WORKDIR $HOME
+
+
+# Stage 2: latest GenAIComps sources
+FROM base AS git
-WORKDIR /home/user/
-RUN git clone https://github.com/opea-project/GenAIComps.git
+RUN apt-get update && apt-get install -y --no-install-recommends git
+RUN git clone --depth 1 https://github.com/opea-project/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
-COPY ./chatqna_wrapper.py /home/user/chatqna.py
+# Stage 3: common layer shared by services using GenAIComps
+FROM base AS comps-base
-ENV PYTHONPATH=$PYTHONPATH:/home/user/GenAIComps
+# copy just relevant parts
+COPY --from=git $HOME/GenAIComps/comps $HOME/GenAIComps/comps
+COPY --from=git $HOME/GenAIComps/*.* $HOME/GenAIComps/LICENSE $HOME/GenAIComps/
+
+WORKDIR $HOME/GenAIComps
+RUN pip install --no-cache-dir --upgrade pip setuptools && \
+ pip install --no-cache-dir -r $HOME/GenAIComps/requirements.txt
+WORKDIR $HOME
+
+ENV PYTHONPATH=$PYTHONPATH:$HOME/GenAIComps
USER user
-WORKDIR /home/user
-RUN echo 'ulimit -S -n 999999' >> ~/.bashrc
+# Stage 4: unique part
+FROM comps-base
+
+COPY ./chatqna_wrapper.py $HOME/chatqna.py
ENTRYPOINT ["python", "chatqna.py"]
diff --git a/ChatQnA/docker_compose/amd/gpu/rocm/README.md b/ChatQnA/docker_compose/amd/gpu/rocm/README.md
index 400cf325d3..b3a5069ab1 100644
--- a/ChatQnA/docker_compose/amd/gpu/rocm/README.md
+++ b/ChatQnA/docker_compose/amd/gpu/rocm/README.md
@@ -94,7 +94,7 @@ cd GenAIComps
### 2. Build Retriever Image
```bash
-docker build --no-cache -t opea/retriever-redis:latest --build-arg https_proxy=$https_proxy --build-arg http_proxy=$http_proxy -f comps/retrievers/redis/langchain/Dockerfile .
+docker build --no-cache -t opea/retriever:latest --build-arg https_proxy=$https_proxy --build-arg http_proxy=$http_proxy -f comps/retrievers/src/Dockerfile .
```
### 3. Build Dataprep Image
@@ -143,7 +143,7 @@ docker build -t opea/nginx:latest --build-arg https_proxy=$https_proxy --build-a
Then run the command `docker images`, you will have the following 5 Docker Images:
-1. `opea/retriever-redis:latest`
+1. `opea/retriever:latest`
2. `opea/dataprep-redis:latest`
3. `opea/chatqna:latest`
4. `opea/chatqna-ui:latest` or `opea/chatqna-react-ui:latest`
diff --git a/ChatQnA/docker_compose/amd/gpu/rocm/compose.yaml b/ChatQnA/docker_compose/amd/gpu/rocm/compose.yaml
index dd0c4ddc7e..1a7b9ad9b4 100644
--- a/ChatQnA/docker_compose/amd/gpu/rocm/compose.yaml
+++ b/ChatQnA/docker_compose/amd/gpu/rocm/compose.yaml
@@ -49,7 +49,7 @@ services:
security_opt:
- seccomp:unconfined
chatqna-retriever:
- image: ${REGISTRY:-opea}/retriever-redis:${TAG:-latest}
+ image: ${REGISTRY:-opea}/retriever:${TAG:-latest}
container_name: chatqna-retriever-redis-server
depends_on:
- chatqna-redis-vector-db
@@ -63,6 +63,8 @@ services:
REDIS_URL: ${CHATQNA_REDIS_URL}
INDEX_NAME: ${CHATQNA_INDEX_NAME}
TEI_EMBEDDING_ENDPOINT: ${CHATQNA_TEI_EMBEDDING_ENDPOINT}
+ LOGFLAG: ${LOGFLAG}
+ RETRIEVER_COMPONENT_NAME: "OPEA_RETRIEVER_REDIS"
restart: unless-stopped
chatqna-tei-reranking-service:
image: ghcr.io/huggingface/text-embeddings-inference:cpu-1.5
diff --git a/ChatQnA/docker_compose/intel/cpu/aipc/README.md b/ChatQnA/docker_compose/intel/cpu/aipc/README.md
index 860629fa46..9297cff2e5 100644
--- a/ChatQnA/docker_compose/intel/cpu/aipc/README.md
+++ b/ChatQnA/docker_compose/intel/cpu/aipc/README.md
@@ -21,7 +21,7 @@ export https_proxy="Your_HTTPs_Proxy"
### 1. Build Retriever Image
```bash
-docker build --no-cache -t opea/retriever-redis:latest --build-arg https_proxy=$https_proxy --build-arg http_proxy=$http_proxy -f comps/retrievers/redis/langchain/Dockerfile .
+docker build --no-cache -t opea/retriever:latest --build-arg https_proxy=$https_proxy --build-arg http_proxy=$http_proxy -f comps/retrievers/src/Dockerfile .
```
### 2. Build Dataprep Image
@@ -58,10 +58,10 @@ cd GenAIComps
docker build -t opea/nginx:latest --build-arg https_proxy=$https_proxy --build-arg http_proxy=$http_proxy -f comps/third_parties/nginx/src/Dockerfile .
```
-Then run the command `docker images`, you will have the following 6 Docker Images:
+Then run the command `docker images`, you will have the following Docker Images:
1. `opea/dataprep-redis:latest`
-2. `opea/retriever-redis:latest`
+2. `opea/retriever:latest`
3. `opea/chatqna:latest`
4. `opea/chatqna-ui:latest`
5. `opea/nginx:latest`
diff --git a/ChatQnA/docker_compose/intel/cpu/aipc/compose.yaml b/ChatQnA/docker_compose/intel/cpu/aipc/compose.yaml
index f2fe08c833..7cc74b0f37 100644
--- a/ChatQnA/docker_compose/intel/cpu/aipc/compose.yaml
+++ b/ChatQnA/docker_compose/intel/cpu/aipc/compose.yaml
@@ -39,7 +39,7 @@ services:
https_proxy: ${https_proxy}
command: --model-id ${EMBEDDING_MODEL_ID} --auto-truncate
retriever:
- image: ${REGISTRY:-opea}/retriever-redis:${TAG:-latest}
+ image: ${REGISTRY:-opea}/retriever:${TAG:-latest}
container_name: retriever-redis-server
depends_on:
- redis-vector-db
@@ -55,6 +55,8 @@ services:
INDEX_NAME: ${INDEX_NAME}
TEI_EMBEDDING_ENDPOINT: http://tei-embedding-service:80
HUGGINGFACEHUB_API_TOKEN: ${HUGGINGFACEHUB_API_TOKEN}
+ LOGFLAG: ${LOGFLAG}
+ RETRIEVER_COMPONENT_NAME: "OPEA_RETRIEVER_REDIS"
restart: unless-stopped
tei-reranking-service:
image: ghcr.io/huggingface/text-embeddings-inference:cpu-1.5
diff --git a/ChatQnA/docker_compose/intel/cpu/xeon/README.md b/ChatQnA/docker_compose/intel/cpu/xeon/README.md
index 91aa867897..f908470d71 100644
--- a/ChatQnA/docker_compose/intel/cpu/xeon/README.md
+++ b/ChatQnA/docker_compose/intel/cpu/xeon/README.md
@@ -105,7 +105,7 @@ cd GenAIComps
### 1. Build Retriever Image
```bash
-docker build --no-cache -t opea/retriever-redis:latest --build-arg https_proxy=$https_proxy --build-arg http_proxy=$http_proxy -f comps/retrievers/redis/langchain/Dockerfile .
+docker build --no-cache -t opea/retriever:latest --build-arg https_proxy=$https_proxy --build-arg http_proxy=$http_proxy -f comps/retrievers/src/Dockerfile .
```
### 2. Build Dataprep Image
@@ -167,7 +167,7 @@ docker build -t opea/nginx:latest --build-arg https_proxy=$https_proxy --build-a
Then run the command `docker images`, you will have the following 5 Docker Images:
1. `opea/dataprep-redis:latest`
-2. `opea/retriever-redis:latest`
+2. `opea/retriever:latest`
3. `opea/chatqna:latest` or `opea/chatqna-without-rerank:latest`
4. `opea/chatqna-ui:latest`
5. `opea/nginx:latest`
diff --git a/ChatQnA/docker_compose/intel/cpu/xeon/README_pinecone.md b/ChatQnA/docker_compose/intel/cpu/xeon/README_pinecone.md
index cd1737d420..dce5b0a540 100644
--- a/ChatQnA/docker_compose/intel/cpu/xeon/README_pinecone.md
+++ b/ChatQnA/docker_compose/intel/cpu/xeon/README_pinecone.md
@@ -108,7 +108,7 @@ cd GenAIComps
### 1. Build Retriever Image
```bash
-docker build --no-cache -t opea/retriever-pinecone:latest --build-arg https_proxy=$https_proxy --build-arg http_proxy=$http_proxy -f comps/retrievers/pinecone/langchain/Dockerfile .
+docker build --no-cache -t opea/retriever:latest --build-arg https_proxy=$https_proxy --build-arg http_proxy=$http_proxy -f comps/retrievers/src/Dockerfile .
```
### 2. Build Dataprep Image
@@ -170,7 +170,7 @@ docker build -t opea/nginx:latest --build-arg https_proxy=$https_proxy --build-a
Then run the command `docker images`, you will have the following 5 Docker Images:
1. `opea/dataprep-pinecone:latest`
-2. `opea/retriever-pinecone:latest`
+2. `opea/retriever:latest`
3. `opea/chatqna:latest` or `opea/chatqna-without-rerank:latest`
4. `opea/chatqna-ui:latest`
5. `opea/nginx:latest`
@@ -352,7 +352,7 @@ click [here](https://raw.githubusercontent.com/opea-project/GenAIComps/v1.1/comp
Or run this command to get the file on a terminal.
```bash
-wget https://raw.githubusercontent.com/opea-project/GenAIComps/main/comps/retrievers/redis/data/nke-10k-2023.pdf
+wget https://raw.githubusercontent.com/opea-project/GenAIComps/v1.1/comps/retrievers/redis/data/nke-10k-2023.pdf
```
diff --git a/ChatQnA/docker_compose/intel/cpu/xeon/README_qdrant.md b/ChatQnA/docker_compose/intel/cpu/xeon/README_qdrant.md
index 7cb4241ee3..6688f25370 100644
--- a/ChatQnA/docker_compose/intel/cpu/xeon/README_qdrant.md
+++ b/ChatQnA/docker_compose/intel/cpu/xeon/README_qdrant.md
@@ -73,7 +73,7 @@ cd GenAIComps
### 1. Build Retriever Image
```bash
-docker build --no-cache -t opea/retriever-qdrant:latest --build-arg https_proxy=$https_proxy --build-arg http_proxy=$http_proxy -f comps/retrievers/qdrant/haystack/Dockerfile .
+docker build --no-cache -t opea/retriever:latest --build-arg https_proxy=$https_proxy --build-arg http_proxy=$http_proxy -f comps/retrievers/src/Dockerfile .
```
### 2. Build Dataprep Image
@@ -128,7 +128,7 @@ docker build -t opea/nginx:latest --build-arg https_proxy=$https_proxy --build-a
Then run the command `docker images`, you will have the following 5 Docker Images:
1. `opea/dataprep-qdrant:latest`
-2. `opea/retriever-qdrant:latest`
+2. `opea/retriever:latest`
3. `opea/chatqna:latest`
4. `opea/chatqna-ui:latest`
5. `opea/nginx:latest`
diff --git a/ChatQnA/docker_compose/intel/cpu/xeon/compose.yaml b/ChatQnA/docker_compose/intel/cpu/xeon/compose.yaml
index 0c290b8683..6e94a9f998 100644
--- a/ChatQnA/docker_compose/intel/cpu/xeon/compose.yaml
+++ b/ChatQnA/docker_compose/intel/cpu/xeon/compose.yaml
@@ -39,7 +39,7 @@ services:
https_proxy: ${https_proxy}
command: --model-id ${EMBEDDING_MODEL_ID} --auto-truncate
retriever:
- image: ${REGISTRY:-opea}/retriever-redis:${TAG:-latest}
+ image: ${REGISTRY:-opea}/retriever:${TAG:-latest}
container_name: retriever-redis-server
depends_on:
- redis-vector-db
@@ -55,6 +55,8 @@ services:
INDEX_NAME: ${INDEX_NAME}
TEI_EMBEDDING_ENDPOINT: http://tei-embedding-service:80
HUGGINGFACEHUB_API_TOKEN: ${HUGGINGFACEHUB_API_TOKEN}
+ LOGFLAG: ${LOGFLAG}
+ RETRIEVER_COMPONENT_NAME: "OPEA_RETRIEVER_REDIS"
restart: unless-stopped
tei-reranking-service:
image: ghcr.io/huggingface/text-embeddings-inference:cpu-1.5
diff --git a/ChatQnA/docker_compose/intel/cpu/xeon/compose_pinecone.yaml b/ChatQnA/docker_compose/intel/cpu/xeon/compose_pinecone.yaml
index f42fd6fd2d..022fe3b612 100644
--- a/ChatQnA/docker_compose/intel/cpu/xeon/compose_pinecone.yaml
+++ b/ChatQnA/docker_compose/intel/cpu/xeon/compose_pinecone.yaml
@@ -12,8 +12,6 @@ services:
- tei-embedding-service
ports:
- "6007:6007"
- - "6008:6008"
- - "6009:6009"
environment:
no_proxy: ${no_proxy}
http_proxy: ${http_proxy}
@@ -37,7 +35,7 @@ services:
https_proxy: ${https_proxy}
command: --model-id ${EMBEDDING_MODEL_ID} --auto-truncate
retriever:
- image: ${REGISTRY:-opea}/retriever-pinecone:${TAG:-latest}
+ image: ${REGISTRY:-opea}/retriever:${TAG:-latest}
container_name: retriever-pinecone-server
ports:
- "7000:7000"
@@ -51,6 +49,8 @@ services:
LANGCHAIN_API_KEY: ${LANGCHAIN_API_KEY}
TEI_EMBEDDING_ENDPOINT: http://tei-embedding-service:80
HUGGINGFACEHUB_API_TOKEN: ${HUGGINGFACEHUB_API_TOKEN}
+ LOGFLAG: ${LOGFLAG}
+ RETRIEVER_COMPONENT_NAME: "OPEA_RETRIEVER_PINECONE"
restart: unless-stopped
tei-reranking-service:
image: ghcr.io/huggingface/text-embeddings-inference:cpu-1.5
diff --git a/ChatQnA/docker_compose/intel/cpu/xeon/compose_qdrant.yaml b/ChatQnA/docker_compose/intel/cpu/xeon/compose_qdrant.yaml
index ad7df8fa79..af69531c21 100644
--- a/ChatQnA/docker_compose/intel/cpu/xeon/compose_qdrant.yaml
+++ b/ChatQnA/docker_compose/intel/cpu/xeon/compose_qdrant.yaml
@@ -22,8 +22,8 @@ services:
https_proxy: ${https_proxy}
QDRANT_HOST: qdrant-vector-db
QDRANT_PORT: 6333
- COLLECTION_NAME: ${INDEX_NAME}
- TEI_ENDPOINT: http://tei-embedding-service:80
+ QDRANT_INDEX_NAME: ${INDEX_NAME}
+ TEI_EMBEDDING_ENDPOINT: http://tei-embedding-service:80
HUGGINGFACEHUB_API_TOKEN: ${HUGGINGFACEHUB_API_TOKEN}
tei-embedding-service:
image: ghcr.io/huggingface/text-embeddings-inference:cpu-1.5
@@ -39,7 +39,7 @@ services:
https_proxy: ${https_proxy}
command: --model-id ${EMBEDDING_MODEL_ID} --auto-truncate
retriever:
- image: ${REGISTRY:-opea}/retriever-qdrant:${TAG:-latest}
+ image: ${REGISTRY:-opea}/retriever:${TAG:-latest}
container_name: retriever-qdrant-server
depends_on:
- qdrant-vector-db
@@ -54,6 +54,8 @@ services:
QDRANT_PORT: 6333
INDEX_NAME: ${INDEX_NAME}
TEI_EMBEDDING_ENDPOINT: ${TEI_EMBEDDING_ENDPOINT}
+ LOGFLAG: ${LOGFLAG}
+ RETRIEVER_COMPONENT_NAME: "OPEA_RETRIEVER_QDRANT"
restart: unless-stopped
tei-reranking-service:
image: ghcr.io/huggingface/text-embeddings-inference:cpu-1.5
diff --git a/ChatQnA/docker_compose/intel/cpu/xeon/compose_vllm.yaml b/ChatQnA/docker_compose/intel/cpu/xeon/compose_vllm.yaml
index 33725f47ec..f34868b6de 100644
--- a/ChatQnA/docker_compose/intel/cpu/xeon/compose_vllm.yaml
+++ b/ChatQnA/docker_compose/intel/cpu/xeon/compose_vllm.yaml
@@ -39,7 +39,7 @@ services:
https_proxy: ${https_proxy}
command: --model-id ${EMBEDDING_MODEL_ID} --auto-truncate
retriever:
- image: ${REGISTRY:-opea}/retriever-redis:${TAG:-latest}
+ image: ${REGISTRY:-opea}/retriever:${TAG:-latest}
container_name: retriever-redis-server
depends_on:
- redis-vector-db
@@ -55,6 +55,8 @@ services:
INDEX_NAME: ${INDEX_NAME}
TEI_EMBEDDING_ENDPOINT: http://tei-embedding-service:80
HUGGINGFACEHUB_API_TOKEN: ${HUGGINGFACEHUB_API_TOKEN}
+ LOGFLAG: ${LOGFLAG}
+ RETRIEVER_COMPONENT_NAME: "OPEA_RETRIEVER_REDIS"
restart: unless-stopped
tei-reranking-service:
image: ghcr.io/huggingface/text-embeddings-inference:cpu-1.5
diff --git a/ChatQnA/docker_compose/intel/cpu/xeon/compose_without_rerank.yaml b/ChatQnA/docker_compose/intel/cpu/xeon/compose_without_rerank.yaml
index 938a6690d3..92d7fcf7bc 100644
--- a/ChatQnA/docker_compose/intel/cpu/xeon/compose_without_rerank.yaml
+++ b/ChatQnA/docker_compose/intel/cpu/xeon/compose_without_rerank.yaml
@@ -39,7 +39,7 @@ services:
https_proxy: ${https_proxy}
command: --model-id ${EMBEDDING_MODEL_ID} --auto-truncate
retriever:
- image: ${REGISTRY:-opea}/retriever-redis:${TAG:-latest}
+ image: ${REGISTRY:-opea}/retriever:${TAG:-latest}
container_name: retriever-redis-server
depends_on:
- redis-vector-db
@@ -55,6 +55,8 @@ services:
INDEX_NAME: ${INDEX_NAME}
TEI_EMBEDDING_ENDPOINT: http://tei-embedding-service:80
HUGGINGFACEHUB_API_TOKEN: ${HUGGINGFACEHUB_API_TOKEN}
+ LOGFLAG: ${LOGFLAG}
+ RETRIEVER_COMPONENT_NAME: "OPEA_RETRIEVER_REDIS"
restart: unless-stopped
tgi-service:
image: ghcr.io/huggingface/text-generation-inference:2.4.0-intel-cpu
diff --git a/ChatQnA/docker_compose/intel/hpu/gaudi/README.md b/ChatQnA/docker_compose/intel/hpu/gaudi/README.md
index 5276321e6f..85b0338549 100644
--- a/ChatQnA/docker_compose/intel/hpu/gaudi/README.md
+++ b/ChatQnA/docker_compose/intel/hpu/gaudi/README.md
@@ -78,7 +78,7 @@ cd GenAIComps
### 1. Build Retriever Image
```bash
-docker build --no-cache -t opea/retriever-redis:latest --build-arg https_proxy=$https_proxy --build-arg http_proxy=$http_proxy -f comps/retrievers/redis/langchain/Dockerfile .
+docker build --no-cache -t opea/retriever:latest --build-arg https_proxy=$https_proxy --build-arg http_proxy=$http_proxy -f comps/retrievers/src/Dockerfile .
```
### 2. Build Dataprep Image
@@ -156,7 +156,7 @@ docker build -t opea/nginx:latest --build-arg https_proxy=$https_proxy --build-a
Then run the command `docker images`, you will have the following 5 Docker Images:
-- `opea/retriever-redis:latest`
+- `opea/retriever:latest`
- `opea/dataprep-redis:latest`
- `opea/chatqna:latest`
- `opea/chatqna-ui:latest`
diff --git a/ChatQnA/docker_compose/intel/hpu/gaudi/compose.yaml b/ChatQnA/docker_compose/intel/hpu/gaudi/compose.yaml
index 8748a31b44..cc75704aef 100644
--- a/ChatQnA/docker_compose/intel/hpu/gaudi/compose.yaml
+++ b/ChatQnA/docker_compose/intel/hpu/gaudi/compose.yaml
@@ -40,7 +40,7 @@ services:
https_proxy: ${https_proxy}
command: --model-id ${EMBEDDING_MODEL_ID} --auto-truncate --otlp-endpoint $OTEL_EXPORTER_OTLP_TRACES_ENDPOINT
retriever:
- image: ${REGISTRY:-opea}/retriever-redis:${TAG:-latest}
+ image: ${REGISTRY:-opea}/retriever:${TAG:-latest}
container_name: retriever-redis-server
depends_on:
- redis-vector-db
@@ -57,6 +57,8 @@ services:
TEI_EMBEDDING_ENDPOINT: http://tei-embedding-service:80
HUGGINGFACEHUB_API_TOKEN: ${HUGGINGFACEHUB_API_TOKEN}
TELEMETRY_ENDPOINT: ${TELEMETRY_ENDPOINT}
+ LOGFLAG: ${LOGFLAG}
+ RETRIEVER_COMPONENT_NAME: "OPEA_RETRIEVER_REDIS"
restart: unless-stopped
tei-reranking-service:
image: ghcr.io/huggingface/tei-gaudi:1.5.0
diff --git a/ChatQnA/docker_compose/intel/hpu/gaudi/compose_guardrails.yaml b/ChatQnA/docker_compose/intel/hpu/gaudi/compose_guardrails.yaml
index 55230d5829..4f062dce3f 100644
--- a/ChatQnA/docker_compose/intel/hpu/gaudi/compose_guardrails.yaml
+++ b/ChatQnA/docker_compose/intel/hpu/gaudi/compose_guardrails.yaml
@@ -78,7 +78,7 @@ services:
https_proxy: ${https_proxy}
command: --model-id ${EMBEDDING_MODEL_ID} --auto-truncate
retriever:
- image: ${REGISTRY:-opea}/retriever-redis:${TAG:-latest}
+ image: ${REGISTRY:-opea}/retriever:${TAG:-latest}
container_name: retriever-redis-server
depends_on:
- redis-vector-db
@@ -94,6 +94,8 @@ services:
INDEX_NAME: ${INDEX_NAME}
TEI_EMBEDDING_ENDPOINT: http://tei-embedding-service:80
HUGGINGFACEHUB_API_TOKEN: ${HUGGINGFACEHUB_API_TOKEN}
+ LOGFLAG: ${LOGFLAG}
+ RETRIEVER_COMPONENT_NAME: "OPEA_RETRIEVER_REDIS"
restart: unless-stopped
tei-reranking-service:
image: ghcr.io/huggingface/tei-gaudi:1.5.0
diff --git a/ChatQnA/docker_compose/intel/hpu/gaudi/compose_vllm.yaml b/ChatQnA/docker_compose/intel/hpu/gaudi/compose_vllm.yaml
index 50e2f00591..5c7bd8e0d2 100644
--- a/ChatQnA/docker_compose/intel/hpu/gaudi/compose_vllm.yaml
+++ b/ChatQnA/docker_compose/intel/hpu/gaudi/compose_vllm.yaml
@@ -39,7 +39,7 @@ services:
https_proxy: ${https_proxy}
command: --model-id ${EMBEDDING_MODEL_ID} --auto-truncate
retriever:
- image: ${REGISTRY:-opea}/retriever-redis:${TAG:-latest}
+ image: ${REGISTRY:-opea}/retriever:${TAG:-latest}
container_name: retriever-redis-server
depends_on:
- redis-vector-db
@@ -55,6 +55,8 @@ services:
INDEX_NAME: ${INDEX_NAME}
TEI_EMBEDDING_ENDPOINT: http://tei-embedding-service:80
HUGGINGFACEHUB_API_TOKEN: ${HUGGINGFACEHUB_API_TOKEN}
+ LOGFLAG: ${LOGFLAG}
+ RETRIEVER_COMPONENT_NAME: "OPEA_RETRIEVER_REDIS"
restart: unless-stopped
tei-reranking-service:
image: ghcr.io/huggingface/tei-gaudi:1.5.0
diff --git a/ChatQnA/docker_compose/intel/hpu/gaudi/compose_without_rerank.yaml b/ChatQnA/docker_compose/intel/hpu/gaudi/compose_without_rerank.yaml
index 524b44c1a0..8da9ecc0e4 100644
--- a/ChatQnA/docker_compose/intel/hpu/gaudi/compose_without_rerank.yaml
+++ b/ChatQnA/docker_compose/intel/hpu/gaudi/compose_without_rerank.yaml
@@ -39,7 +39,7 @@ services:
https_proxy: ${https_proxy}
command: --model-id ${EMBEDDING_MODEL_ID} --auto-truncate
retriever:
- image: ${REGISTRY:-opea}/retriever-redis:${TAG:-latest}
+ image: ${REGISTRY:-opea}/retriever:${TAG:-latest}
container_name: retriever-redis-server
depends_on:
- redis-vector-db
@@ -55,6 +55,8 @@ services:
INDEX_NAME: ${INDEX_NAME}
TEI_EMBEDDING_ENDPOINT: http://tei-embedding-service:80
HUGGINGFACEHUB_API_TOKEN: ${HUGGINGFACEHUB_API_TOKEN}
+ LOGFLAG: ${LOGFLAG}
+ RETRIEVER_COMPONENT_NAME: "OPEA_RETRIEVER_REDIS"
restart: unless-stopped
tgi-service:
image: ghcr.io/huggingface/tgi-gaudi:2.0.6
diff --git a/ChatQnA/docker_compose/intel/hpu/gaudi/how_to_validate_service.md b/ChatQnA/docker_compose/intel/hpu/gaudi/how_to_validate_service.md
index ca778e7e91..3834d5b8cc 100644
--- a/ChatQnA/docker_compose/intel/hpu/gaudi/how_to_validate_service.md
+++ b/ChatQnA/docker_compose/intel/hpu/gaudi/how_to_validate_service.md
@@ -46,7 +46,7 @@ bee1132464cd opea/chatqna:latest "python c
f810f3b4d329 opea/embedding:latest "python embedding_te…" 2 minutes ago Up 2 minutes 0.0.0.0:6000->6000/tcp, :::6000->6000/tcp embedding-server
325236a01f9b opea/llm-textgen:latest "python llm.py" 2 minutes ago Up 2 minutes 0.0.0.0:9000->9000/tcp, :::9000->9000/tcp llm-textgen-gaudi-server
2fa17d84605f opea/dataprep-redis:latest "python prepare_doc_…" 2 minutes ago Up 2 minutes 0.0.0.0:6007->6007/tcp, :::6007->6007/tcp dataprep-redis-server
-69e1fb59e92c opea/retriever-redis:latest "/home/user/comps/re…" 2 minutes ago Up 2 minutes 0.0.0.0:7000->7000/tcp, :::7000->7000/tcp retriever-redis-server
+69e1fb59e92c opea/retriever:latest "/home/user/comps/re…" 2 minutes ago Up 2 minutes 0.0.0.0:7000->7000/tcp, :::7000->7000/tcp retriever-redis-server
313b9d14928a opea/reranking-tei:latest "python reranking_te…" 2 minutes ago Up 2 minutes 0.0.0.0:8000->8000/tcp, :::8000->8000/tcp reranking-tei-gaudi-server
174bd43fa6b5 ghcr.io/huggingface/tei-gaudi:1.5.0 "text-embeddings-rou…" 2 minutes ago Up 2 minutes 0.0.0.0:8090->80/tcp, :::8090->80/tcp tei-embedding-gaudi-server
05c40b636239 ghcr.io/huggingface/tgi-gaudi:2.0.6 "text-generation-lau…" 2 minutes ago Exited (1) About a minute ago tgi-gaudi-server
diff --git a/ChatQnA/docker_compose/nvidia/gpu/README.md b/ChatQnA/docker_compose/nvidia/gpu/README.md
index 4b21130f17..edf9dc12f4 100644
--- a/ChatQnA/docker_compose/nvidia/gpu/README.md
+++ b/ChatQnA/docker_compose/nvidia/gpu/README.md
@@ -104,7 +104,7 @@ cd GenAIComps
### 2. Build Retriever Image
```bash
-docker build --no-cache -t opea/retriever-redis:latest --build-arg https_proxy=$https_proxy --build-arg http_proxy=$http_proxy -f comps/retrievers/redis/langchain/Dockerfile .
+docker build --no-cache -t opea/retriever:latest --build-arg https_proxy=$https_proxy --build-arg http_proxy=$http_proxy -f comps/retrievers/src/Dockerfile .
```
### 3. Build Dataprep Image
@@ -153,7 +153,7 @@ docker build -t opea/nginx:latest --build-arg https_proxy=$https_proxy --build-a
Then run the command `docker images`, you will have the following 5 Docker Images:
-1. `opea/retriever-redis:latest`
+1. `opea/retriever:latest`
2. `opea/dataprep-redis:latest`
3. `opea/chatqna:latest`
4. `opea/chatqna-ui:latest` or `opea/chatqna-react-ui:latest`
diff --git a/ChatQnA/docker_compose/nvidia/gpu/compose.yaml b/ChatQnA/docker_compose/nvidia/gpu/compose.yaml
index ba504c2eb3..40f45491c8 100644
--- a/ChatQnA/docker_compose/nvidia/gpu/compose.yaml
+++ b/ChatQnA/docker_compose/nvidia/gpu/compose.yaml
@@ -40,7 +40,7 @@ services:
https_proxy: ${https_proxy}
command: --model-id ${EMBEDDING_MODEL_ID} --auto-truncate
retriever:
- image: ${REGISTRY:-opea}/retriever-redis:${TAG:-latest}
+ image: ${REGISTRY:-opea}/retriever:${TAG:-latest}
container_name: retriever-redis-server
depends_on:
- redis-vector-db
@@ -55,6 +55,8 @@ services:
REDIS_HOST: redis-vector-db
INDEX_NAME: ${INDEX_NAME}
TEI_EMBEDDING_ENDPOINT: ${TEI_EMBEDDING_ENDPOINT}
+ LOGFLAG: ${LOGFLAG}
+ RETRIEVER_COMPONENT_NAME: "OPEA_RETRIEVER_REDIS"
restart: unless-stopped
tei-reranking-service:
image: ghcr.io/huggingface/text-embeddings-inference:1.5
diff --git a/ChatQnA/docker_image_build/build.yaml b/ChatQnA/docker_image_build/build.yaml
index ac85d0ab07..7ae42b6029 100644
--- a/ChatQnA/docker_image_build/build.yaml
+++ b/ChatQnA/docker_image_build/build.yaml
@@ -47,24 +47,12 @@ services:
dockerfile: comps/embeddings/src/Dockerfile
extends: chatqna
image: ${REGISTRY:-opea}/embedding:${TAG:-latest}
- retriever-redis:
+ retriever:
build:
context: GenAIComps
- dockerfile: comps/retrievers/redis/langchain/Dockerfile
+ dockerfile: comps/retrievers/src/Dockerfile
extends: chatqna
- image: ${REGISTRY:-opea}/retriever-redis:${TAG:-latest}
- retriever-qdrant:
- build:
- context: GenAIComps
- dockerfile: comps/retrievers/qdrant/haystack/Dockerfile
- extends: chatqna
- image: ${REGISTRY:-opea}/retriever-qdrant:${TAG:-latest}
- retriever-pinecone:
- build:
- context: GenAIComps
- dockerfile: comps/retrievers/pinecone/langchain/Dockerfile
- extends: chatqna
- image: ${REGISTRY:-opea}/retriever-pinecone:${TAG:-latest}
+ image: ${REGISTRY:-opea}/retriever:${TAG:-latest}
reranking:
build:
context: GenAIComps
diff --git a/ChatQnA/kubernetes/gmc/README.md b/ChatQnA/kubernetes/gmc/README.md
index 2c849c5079..db8b3466f1 100644
--- a/ChatQnA/kubernetes/gmc/README.md
+++ b/ChatQnA/kubernetes/gmc/README.md
@@ -16,7 +16,7 @@ The ChatQnA uses the below prebuilt images if you choose a Xeon deployment
- redis-vector-db: redis/redis-stack:7.2.0-v9
- tei_embedding_service: ghcr.io/huggingface/text-embeddings-inference:cpu-1.5
-- retriever: opea/retriever-redis:latest
+- retriever: opea/retriever:latest
- tei_xeon_service: ghcr.io/huggingface/text-embeddings-inference:cpu-1.5
- tgi-service: ghcr.io/huggingface/text-generation-inference:2.4.0-intel-cpu
- chaqna-xeon-backend-server: opea/chatqna:latest
diff --git a/ChatQnA/tests/test_compose_guardrails_on_gaudi.sh b/ChatQnA/tests/test_compose_guardrails_on_gaudi.sh
index b0376affb5..8fe8dc733f 100644
--- a/ChatQnA/tests/test_compose_guardrails_on_gaudi.sh
+++ b/ChatQnA/tests/test_compose_guardrails_on_gaudi.sh
@@ -19,7 +19,7 @@ function build_docker_images() {
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="chatqna-guardrails chatqna-ui dataprep-redis retriever-redis guardrails nginx"
+ service_list="chatqna-guardrails chatqna-ui dataprep-redis retriever guardrails nginx"
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.6
diff --git a/ChatQnA/tests/test_compose_on_gaudi.sh b/ChatQnA/tests/test_compose_on_gaudi.sh
index 9cfe519b87..22eccb2d5d 100644
--- a/ChatQnA/tests/test_compose_on_gaudi.sh
+++ b/ChatQnA/tests/test_compose_on_gaudi.sh
@@ -19,7 +19,7 @@ function build_docker_images() {
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="chatqna chatqna-ui dataprep-redis retriever-redis nginx"
+ service_list="chatqna chatqna-ui dataprep-redis retriever nginx"
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.6
diff --git a/ChatQnA/tests/test_compose_on_rocm.sh b/ChatQnA/tests/test_compose_on_rocm.sh
index 09a79e9d81..e1cd6adb67 100644
--- a/ChatQnA/tests/test_compose_on_rocm.sh
+++ b/ChatQnA/tests/test_compose_on_rocm.sh
@@ -52,7 +52,7 @@ function build_docker_images() {
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="chatqna chatqna-ui dataprep-redis retriever-redis nginx"
+ service_list="chatqna chatqna-ui dataprep-redis retriever nginx"
docker compose -f build.yaml build ${service_list} --no-cache > "${LOG_PATH}"/docker_image_build.log
docker pull ghcr.io/huggingface/text-generation-inference:2.3.1-rocm
diff --git a/ChatQnA/tests/test_compose_on_xeon.sh b/ChatQnA/tests/test_compose_on_xeon.sh
index 25ca70bc77..babca0cd43 100644
--- a/ChatQnA/tests/test_compose_on_xeon.sh
+++ b/ChatQnA/tests/test_compose_on_xeon.sh
@@ -19,7 +19,7 @@ function build_docker_images() {
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="chatqna chatqna-ui dataprep-redis retriever-redis nginx"
+ service_list="chatqna chatqna-ui dataprep-redis retriever nginx"
docker compose -f build.yaml build ${service_list} --no-cache > ${LOG_PATH}/docker_image_build.log
docker pull ghcr.io/huggingface/text-generation-inference:2.4.0-intel-cpu
diff --git a/ChatQnA/tests/test_compose_pinecone_on_xeon.sh b/ChatQnA/tests/test_compose_pinecone_on_xeon.sh
index 63147e4eb7..35c58f6754 100755
--- a/ChatQnA/tests/test_compose_pinecone_on_xeon.sh
+++ b/ChatQnA/tests/test_compose_pinecone_on_xeon.sh
@@ -19,7 +19,7 @@ function build_docker_images() {
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="chatqna chatqna-ui dataprep-pinecone retriever-pinecone nginx"
+ service_list="chatqna chatqna-ui dataprep-pinecone retriever nginx"
docker compose -f build.yaml build ${service_list} --no-cache > ${LOG_PATH}/docker_image_build.log
docker pull ghcr.io/huggingface/text-generation-inference:2.4.0-intel-cpu
@@ -38,6 +38,7 @@ function start_services() {
export PINECONE_INDEX_NAME="langchain-test"
export INDEX_NAME="langchain-test"
export HUGGINGFACEHUB_API_TOKEN=${HUGGINGFACEHUB_API_TOKEN}
+ export LOGFLAG=true
# Start Docker Containers
docker compose -f compose_pinecone.yaml up -d > ${LOG_PATH}/start_services_with_compose.log
@@ -111,7 +112,7 @@ function validate_microservices() {
# test /v1/dataprep/delete_file
validate_service \
- "http://${ip_address}:6009/v1/dataprep/delete_file" \
+ "http://${ip_address}:6007/v1/dataprep/delete_file" \
'{"status":true}' \
"dataprep_del" \
"dataprep-pinecone-server"
diff --git a/ChatQnA/tests/test_compose_qdrant_on_xeon.sh b/ChatQnA/tests/test_compose_qdrant_on_xeon.sh
index 79108ddd47..ee4b4efb0a 100644
--- a/ChatQnA/tests/test_compose_qdrant_on_xeon.sh
+++ b/ChatQnA/tests/test_compose_qdrant_on_xeon.sh
@@ -19,7 +19,7 @@ function build_docker_images() {
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="chatqna chatqna-ui dataprep-qdrant retriever-qdrant nginx"
+ service_list="chatqna chatqna-ui dataprep-qdrant retriever nginx"
docker compose -f build.yaml build ${service_list} --no-cache > ${LOG_PATH}/docker_image_build.log
docker images && sleep 1s
diff --git a/ChatQnA/tests/test_compose_vllm_on_gaudi.sh b/ChatQnA/tests/test_compose_vllm_on_gaudi.sh
index f68d246a0b..75af30e149 100644
--- a/ChatQnA/tests/test_compose_vllm_on_gaudi.sh
+++ b/ChatQnA/tests/test_compose_vllm_on_gaudi.sh
@@ -17,10 +17,10 @@ ip_address=$(hostname -I | awk '{print $1}')
function build_docker_images() {
cd $WORKPATH/docker_image_build
git clone https://github.com/opea-project/GenAIComps.git && cd GenAIComps && git checkout "${opea_branch:-"main"}" && cd ../
- git clone https://github.com/HabanaAI/vllm-fork.git
+ git clone https://github.com/HabanaAI/vllm-fork.git && cd vllm-fork && git checkout v0.6.4.post2+Gaudi-1.19.0 && cd ../
echo "Build all the images with --no-cache, check docker_image_build.log for details..."
- service_list="chatqna chatqna-ui dataprep-redis retriever-redis vllm-gaudi nginx"
+ service_list="chatqna chatqna-ui dataprep-redis retriever vllm-gaudi nginx"
docker compose -f build.yaml build ${service_list} --no-cache > ${LOG_PATH}/docker_image_build.log
docker pull ghcr.io/huggingface/text-embeddings-inference:cpu-1.5
diff --git a/ChatQnA/tests/test_compose_vllm_on_xeon.sh b/ChatQnA/tests/test_compose_vllm_on_xeon.sh
index 72f0dd465a..6d95c68a91 100644
--- a/ChatQnA/tests/test_compose_vllm_on_xeon.sh
+++ b/ChatQnA/tests/test_compose_vllm_on_xeon.sh
@@ -20,7 +20,7 @@ function build_docker_images() {
git clone https://github.com/vllm-project/vllm.git
echo "Build all the images with --no-cache, check docker_image_build.log for details..."
- service_list="chatqna chatqna-ui dataprep-redis retriever-redis vllm nginx"
+ service_list="chatqna chatqna-ui dataprep-redis retriever vllm nginx"
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.6
diff --git a/ChatQnA/tests/test_compose_without_rerank_on_gaudi.sh b/ChatQnA/tests/test_compose_without_rerank_on_gaudi.sh
index 1f2f94eba0..e1187bfcf9 100644
--- a/ChatQnA/tests/test_compose_without_rerank_on_gaudi.sh
+++ b/ChatQnA/tests/test_compose_without_rerank_on_gaudi.sh
@@ -19,7 +19,7 @@ function build_docker_images() {
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="chatqna-without-rerank chatqna-ui dataprep-redis retriever-redis nginx"
+ service_list="chatqna-without-rerank chatqna-ui dataprep-redis retriever nginx"
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.6
diff --git a/ChatQnA/tests/test_compose_without_rerank_on_xeon.sh b/ChatQnA/tests/test_compose_without_rerank_on_xeon.sh
index e530cdf1b0..230b8a5d60 100644
--- a/ChatQnA/tests/test_compose_without_rerank_on_xeon.sh
+++ b/ChatQnA/tests/test_compose_without_rerank_on_xeon.sh
@@ -19,7 +19,7 @@ function build_docker_images() {
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="chatqna-without-rerank chatqna-ui dataprep-redis retriever-redis nginx"
+ service_list="chatqna-without-rerank chatqna-ui dataprep-redis retriever nginx"
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.6
diff --git a/CodeGen/Dockerfile b/CodeGen/Dockerfile
index e0aa7d13f0..ab059bbe49 100644
--- a/CodeGen/Dockerfile
+++ b/CodeGen/Dockerfile
@@ -1,34 +1,51 @@
-
-
# Copyright (C) 2024 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
-FROM python:3.11-slim
+# Stage 1: base setup used by other stages
+FROM python:3.11-slim AS base
-ENV LANG=C.UTF-8
+# get security updates
+RUN apt-get update && apt-get upgrade -y && \
+ apt-get clean && rm -rf /var/lib/apt/lists/*
-RUN apt-get update -y && apt-get install -y --no-install-recommends --fix-missing \
- libgl1-mesa-glx \
- libjemalloc-dev \
- git
+ENV HOME=/home/user
RUN useradd -m -s /bin/bash user && \
- mkdir -p /home/user && \
- chown -R user /home/user/
+ mkdir -p $HOME && \
+ chown -R user $HOME
-WORKDIR /home/user/
-RUN git clone https://github.com/opea-project/GenAIComps.git
+WORKDIR $HOME
+
+
+# Stage 2: latest GenAIComps sources
+FROM base AS git
+
+RUN apt-get update && apt-get install -y --no-install-recommends git
+RUN git clone --depth 1 https://github.com/opea-project/GenAIComps.git
-WORKDIR /home/user/GenAIComps
-RUN pip install --no-cache-dir --upgrade pip setuptools && \
- pip install --no-cache-dir -r /home/user/GenAIComps/requirements.txt
-COPY ./codegen.py /home/user/codegen.py
+# Stage 3: common layer shared by services using GenAIComps
+FROM base AS comps-base
-ENV PYTHONPATH=$PYTHONPATH:/home/user/GenAIComps
+# copy just relevant parts
+COPY --from=git $HOME/GenAIComps/comps $HOME/GenAIComps/comps
+COPY --from=git $HOME/GenAIComps/*.* $HOME/GenAIComps/LICENSE $HOME/GenAIComps/
+
+WORKDIR $HOME/GenAIComps
+RUN pip install --no-cache-dir --upgrade pip setuptools && \
+ pip install --no-cache-dir -r $HOME/GenAIComps/requirements.txt
+WORKDIR $HOME
+
+ENV PYTHONPATH=$PYTHONPATH:$HOME/GenAIComps
USER user
-WORKDIR /home/user
+
+# Stage 4: unique part
+FROM comps-base
+
+ENV LANG=C.UTF-8
+
+COPY ./codegen.py $HOME/codegen.py
ENTRYPOINT ["python", "codegen.py"]
diff --git a/CodeGen/docker_compose/intel/cpu/xeon/README.md b/CodeGen/docker_compose/intel/cpu/xeon/README.md
index 8db3c15c85..01ee5d1fa4 100644
--- a/CodeGen/docker_compose/intel/cpu/xeon/README.md
+++ b/CodeGen/docker_compose/intel/cpu/xeon/README.md
@@ -41,12 +41,6 @@ cd GenAIExamples/CodeGen/ui
docker build -t opea/codegen-ui:latest --build-arg https_proxy=$https_proxy --build-arg http_proxy=$http_proxy -f ./docker/Dockerfile .
```
-Then run the command `docker images`, you will have the following 3 Docker Images:
-
-- `opea/llm-textgen:latest`
-- `opea/codegen:latest`
-- `opea/codegen-ui:latest`
-
### 4. Build CodeGen React UI Docker Image (Optional)
Build react frontend Docker image via below command:
@@ -58,7 +52,7 @@ cd GenAIExamples/CodeGen/ui
docker build --no-cache -t opea/codegen-react-ui:latest --build-arg https_proxy=$https_proxy --build-arg http_proxy=$http_proxy -f ./docker/Dockerfile.react .
```
-Then run the command `docker images`, you will have the following 3 Docker Images:
+Then run the command `docker images`, you will have the following Docker Images:
- `opea/llm-textgen:latest`
- `opea/codegen:latest`
diff --git a/CodeGen/docker_compose/intel/hpu/gaudi/README.md b/CodeGen/docker_compose/intel/hpu/gaudi/README.md
index 0006f019e4..106f7d1ffc 100644
--- a/CodeGen/docker_compose/intel/hpu/gaudi/README.md
+++ b/CodeGen/docker_compose/intel/hpu/gaudi/README.md
@@ -44,7 +44,7 @@ cd GenAIExamples/CodeGen/ui
docker build --no-cache -t opea/codegen-react-ui:latest --build-arg https_proxy=$https_proxy --build-arg http_proxy=$http_proxy -f ./docker/Dockerfile.react .
```
-Then run the command `docker images`, you will have the following 3 Docker images:
+Then run the command `docker images`, you will have the following Docker images:
- `opea/llm-textgen:latest`
- `opea/codegen:latest`
diff --git a/CodeTrans/Dockerfile b/CodeTrans/Dockerfile
index 918d936c96..55014a5825 100644
--- a/CodeTrans/Dockerfile
+++ b/CodeTrans/Dockerfile
@@ -1,32 +1,49 @@
-
-
# Copyright (C) 2024 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
-FROM python:3.11-slim
+# Stage 1: base setup used by other stages
+FROM python:3.11-slim AS base
+
+# get security updates
+RUN apt-get update && apt-get upgrade -y && \
+ apt-get clean && rm -rf /var/lib/apt/lists/*
-RUN apt-get update -y && apt-get install -y --no-install-recommends --fix-missing \
- libgl1-mesa-glx \
- libjemalloc-dev \
- git
+ENV HOME=/home/user
RUN useradd -m -s /bin/bash user && \
- mkdir -p /home/user && \
- chown -R user /home/user/
+ mkdir -p $HOME && \
+ chown -R user $HOME
-WORKDIR /home/user/
-RUN git clone https://github.com/opea-project/GenAIComps.git
+WORKDIR $HOME
-WORKDIR /home/user/GenAIComps
-RUN pip install --no-cache-dir --upgrade pip setuptools && \
- pip install --no-cache-dir -r /home/user/GenAIComps/requirements.txt
-COPY ./code_translation.py /home/user/code_translation.py
+# Stage 2: latest GenAIComps sources
+FROM base AS git
+
+RUN apt-get update && apt-get install -y --no-install-recommends git
+RUN git clone --depth 1 https://github.com/opea-project/GenAIComps.git
+
-ENV PYTHONPATH=$PYTHONPATH:/home/user/GenAIComps
+# Stage 3: common layer shared by services using GenAIComps
+FROM base AS comps-base
+
+# copy just relevant parts
+COPY --from=git $HOME/GenAIComps/comps $HOME/GenAIComps/comps
+COPY --from=git $HOME/GenAIComps/*.* $HOME/GenAIComps/LICENSE $HOME/GenAIComps/
+
+WORKDIR $HOME/GenAIComps
+RUN pip install --no-cache-dir --upgrade pip setuptools && \
+ pip install --no-cache-dir -r $HOME/GenAIComps/requirements.txt
+WORKDIR $HOME
+
+ENV PYTHONPATH=$PYTHONPATH:$HOME/GenAIComps
USER user
-WORKDIR /home/user
+
+# Stage 4: unique part
+FROM comps-base
+
+COPY ./code_translation.py $HOME/code_translation.py
ENTRYPOINT ["python", "code_translation.py"]
diff --git a/DocIndexRetriever/Dockerfile b/DocIndexRetriever/Dockerfile
index c8794f3efc..dcfd665f74 100644
--- a/DocIndexRetriever/Dockerfile
+++ b/DocIndexRetriever/Dockerfile
@@ -1,30 +1,49 @@
# Copyright (C) 2024 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
-FROM python:3.11-slim
+# Stage 1: base setup used by other stages
+FROM python:3.11-slim AS base
-RUN apt-get update -y && apt-get install -y --no-install-recommends --fix-missing \
- libgl1-mesa-glx \
- libjemalloc-dev \
- git
+# get security updates
+RUN apt-get update && apt-get upgrade -y && \
+ apt-get clean && rm -rf /var/lib/apt/lists/*
+
+ENV HOME=/home/user
RUN useradd -m -s /bin/bash user && \
- mkdir -p /home/user && \
- chown -R user /home/user/
+ mkdir -p $HOME && \
+ chown -R user $HOME
-WORKDIR /home/user/
-RUN git clone https://github.com/opea-project/GenAIComps.git
+WORKDIR $HOME
+
+
+# Stage 2: latest GenAIComps sources
+FROM base AS git
+
+RUN apt-get update && apt-get install -y --no-install-recommends git
+RUN git clone --depth 1 https://github.com/opea-project/GenAIComps.git
-WORKDIR /home/user/GenAIComps
-RUN pip install --no-cache-dir --upgrade pip setuptools && \
- pip install --no-cache-dir -r /home/user/GenAIComps/requirements.txt
-COPY ./retrieval_tool.py /home/user/retrieval_tool.py
+# Stage 3: common layer shared by services using GenAIComps
+FROM base AS comps-base
-ENV PYTHONPATH=$PYTHONPATH:/home/user/GenAIComps
+# copy just relevant parts
+COPY --from=git $HOME/GenAIComps/comps $HOME/GenAIComps/comps
+COPY --from=git $HOME/GenAIComps/*.* $HOME/GenAIComps/LICENSE $HOME/GenAIComps/
+
+WORKDIR $HOME/GenAIComps
+RUN pip install --no-cache-dir --upgrade pip setuptools && \
+ pip install --no-cache-dir -r $HOME/GenAIComps/requirements.txt
+WORKDIR $HOME
+
+ENV PYTHONPATH=$PYTHONPATH:$HOME/GenAIComps
USER user
-WORKDIR /home/user
+
+# Stage 4: unique part
+FROM comps-base
+
+COPY ./retrieval_tool.py $HOME/retrieval_tool.py
ENTRYPOINT ["python", "retrieval_tool.py"]
diff --git a/DocIndexRetriever/docker_compose/intel/cpu/xeon/README.md b/DocIndexRetriever/docker_compose/intel/cpu/xeon/README.md
index a4f085e8b0..5699ece356 100644
--- a/DocIndexRetriever/docker_compose/intel/cpu/xeon/README.md
+++ b/DocIndexRetriever/docker_compose/intel/cpu/xeon/README.md
@@ -15,7 +15,7 @@ DocRetriever are the most widely adopted use case for leveraging the different m
- Retriever Vector store Image
```bash
- docker build -t opea/retriever-redis:latest --build-arg https_proxy=$https_proxy --build-arg http_proxy=$http_proxy -f comps/retrievers/redis/langchain/Dockerfile .
+ docker build -t opea/retriever:latest --build-arg https_proxy=$https_proxy --build-arg http_proxy=$http_proxy -f comps/retrievers/src/Dockerfile .
```
- Rerank TEI Image
diff --git a/DocIndexRetriever/docker_compose/intel/cpu/xeon/compose.yaml b/DocIndexRetriever/docker_compose/intel/cpu/xeon/compose.yaml
index 206bdfb11b..6384312e9b 100644
--- a/DocIndexRetriever/docker_compose/intel/cpu/xeon/compose.yaml
+++ b/DocIndexRetriever/docker_compose/intel/cpu/xeon/compose.yaml
@@ -67,7 +67,7 @@ services:
LOGFLAG: ${LOGFLAG}
restart: unless-stopped
retriever:
- image: ${REGISTRY:-opea}/retriever-redis:${TAG:-latest}
+ image: ${REGISTRY:-opea}/retriever:${TAG:-latest}
container_name: retriever-redis-server
depends_on:
- redis-vector-db
@@ -83,6 +83,7 @@ services:
HUGGINGFACEHUB_API_TOKEN: ${HUGGINGFACEHUB_API_TOKEN}
TEI_EMBEDDING_ENDPOINT: ${TEI_EMBEDDING_ENDPOINT}
LOGFLAG: ${LOGFLAG}
+ RETRIEVER_COMPONENT_NAME: "OPEA_RETRIEVER_REDIS"
restart: unless-stopped
tei-reranking-service:
image: ghcr.io/huggingface/text-embeddings-inference:cpu-1.5
diff --git a/DocIndexRetriever/docker_compose/intel/cpu/xeon/compose_without_rerank.yaml b/DocIndexRetriever/docker_compose/intel/cpu/xeon/compose_without_rerank.yaml
index a0a3e7d726..81baf2da3a 100644
--- a/DocIndexRetriever/docker_compose/intel/cpu/xeon/compose_without_rerank.yaml
+++ b/DocIndexRetriever/docker_compose/intel/cpu/xeon/compose_without_rerank.yaml
@@ -67,7 +67,7 @@ services:
LOGFLAG: ${LOGFLAG}
restart: unless-stopped
retriever:
- image: ${REGISTRY:-opea}/retriever-redis:${TAG:-latest}
+ image: ${REGISTRY:-opea}/retriever:${TAG:-latest}
container_name: retriever-redis-server
depends_on:
- redis-vector-db
@@ -83,6 +83,7 @@ services:
HUGGINGFACEHUB_API_TOKEN: ${HUGGINGFACEHUB_API_TOKEN}
TEI_EMBEDDING_ENDPOINT: http://tei-embedding-service:80
LOGFLAG: ${LOGFLAG}
+ RETRIEVER_COMPONENT_NAME: "OPEA_RETRIEVER_REDIS"
restart: unless-stopped
doc-index-retriever-server:
image: ${REGISTRY:-opea}/doc-index-retriever:${TAG:-latest}
diff --git a/DocIndexRetriever/docker_compose/intel/hpu/gaudi/README.md b/DocIndexRetriever/docker_compose/intel/hpu/gaudi/README.md
index f30d017e8e..f2de0048a8 100644
--- a/DocIndexRetriever/docker_compose/intel/hpu/gaudi/README.md
+++ b/DocIndexRetriever/docker_compose/intel/hpu/gaudi/README.md
@@ -15,7 +15,7 @@ DocRetriever are the most widely adopted use case for leveraging the different m
- Retriever Vector store Image
```bash
- docker build -t opea/retriever-redis:latest --build-arg https_proxy=$https_proxy --build-arg http_proxy=$http_proxy -f comps/retrievers/redis/langchain/Dockerfile .
+ docker build -t opea/retriever:latest --build-arg https_proxy=$https_proxy --build-arg http_proxy=$http_proxy -f comps/retrievers/src/Dockerfile .
```
- Rerank TEI Image
diff --git a/DocIndexRetriever/docker_compose/intel/hpu/gaudi/compose.yaml b/DocIndexRetriever/docker_compose/intel/hpu/gaudi/compose.yaml
index 903bb8d635..a73970f36c 100644
--- a/DocIndexRetriever/docker_compose/intel/hpu/gaudi/compose.yaml
+++ b/DocIndexRetriever/docker_compose/intel/hpu/gaudi/compose.yaml
@@ -72,7 +72,7 @@ services:
LOGFLAG: ${LOGFLAG}
restart: unless-stopped
retriever:
- image: ${REGISTRY:-opea}/retriever-redis:${TAG:-latest}
+ image: ${REGISTRY:-opea}/retriever:${TAG:-latest}
container_name: retriever-redis-server
depends_on:
- redis-vector-db
@@ -86,6 +86,7 @@ services:
REDIS_URL: ${REDIS_URL}
INDEX_NAME: ${INDEX_NAME}
LOGFLAG: ${LOGFLAG}
+ RETRIEVER_COMPONENT_NAME: "OPEA_RETRIEVER_REDIS"
restart: unless-stopped
tei-reranking-service:
image: ghcr.io/huggingface/text-embeddings-inference:cpu-1.5
diff --git a/DocIndexRetriever/docker_image_build/build.yaml b/DocIndexRetriever/docker_image_build/build.yaml
index 956c46fe48..4619a9962d 100644
--- a/DocIndexRetriever/docker_image_build/build.yaml
+++ b/DocIndexRetriever/docker_image_build/build.yaml
@@ -17,12 +17,12 @@ services:
dockerfile: comps/embeddings/src/Dockerfile
extends: doc-index-retriever
image: ${REGISTRY:-opea}/embedding:${TAG:-latest}
- retriever-redis:
+ retriever:
build:
context: GenAIComps
- dockerfile: comps/retrievers/redis/langchain/Dockerfile
+ dockerfile: comps/retrievers/src/Dockerfile
extends: doc-index-retriever
- image: ${REGISTRY:-opea}/retriever-redis:${TAG:-latest}
+ image: ${REGISTRY:-opea}/retriever:${TAG:-latest}
reranking:
build:
context: GenAIComps
diff --git a/DocIndexRetriever/tests/test_compose_on_xeon.sh b/DocIndexRetriever/tests/test_compose_on_xeon.sh
index 8c52a32228..43e39da5a5 100644
--- a/DocIndexRetriever/tests/test_compose_on_xeon.sh
+++ b/DocIndexRetriever/tests/test_compose_on_xeon.sh
@@ -21,7 +21,7 @@ function build_docker_images() {
echo "Cloning GenAIComps repository"
git clone https://github.com/opea-project/GenAIComps.git && cd GenAIComps && git checkout "${opea_branch:-"main"}" && cd ../
fi
- service_list="dataprep-redis embedding retriever-redis reranking doc-index-retriever"
+ service_list="dataprep-redis embedding retriever reranking doc-index-retriever"
docker compose -f build.yaml build ${service_list} --no-cache > ${LOG_PATH}/docker_image_build.log
docker pull ghcr.io/huggingface/text-embeddings-inference:cpu-1.5
diff --git a/DocIndexRetriever/tests/test_compose_without_rerank_on_xeon.sh b/DocIndexRetriever/tests/test_compose_without_rerank_on_xeon.sh
index fb499fb657..a65dbac6a7 100644
--- a/DocIndexRetriever/tests/test_compose_without_rerank_on_xeon.sh
+++ b/DocIndexRetriever/tests/test_compose_without_rerank_on_xeon.sh
@@ -21,7 +21,7 @@ function build_docker_images() {
echo "Cloning GenAIComps repository"
git clone https://github.com/opea-project/GenAIComps.git && cd GenAIComps && git checkout "${opea_branch:-"main"}" && cd ../
fi
- service_list="dataprep-redis embedding retriever-redis doc-index-retriever"
+ service_list="dataprep-redis embedding retriever doc-index-retriever"
docker compose -f build.yaml build ${service_list} --no-cache > ${LOG_PATH}/docker_image_build.log
docker pull ghcr.io/huggingface/text-embeddings-inference:cpu-1.5
diff --git a/DocSum/Dockerfile b/DocSum/Dockerfile
index 27e08ee7a3..fd01f3bca0 100644
--- a/DocSum/Dockerfile
+++ b/DocSum/Dockerfile
@@ -1,32 +1,56 @@
# Copyright (C) 2024 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
-FROM python:3.11-slim
+# Stage 1: base setup used by other stages
+FROM python:3.11-slim AS base
-RUN apt-get update -y && apt-get install -y --no-install-recommends --fix-missing \
- libgl1-mesa-glx \
- libjemalloc-dev \
- git \
- ffmpeg
+# get security updates
+RUN apt-get update && apt-get upgrade -y && \
+ apt-get clean && rm -rf /var/lib/apt/lists/*
+
+ENV HOME=/home/user
RUN useradd -m -s /bin/bash user && \
- mkdir -p /home/user && \
- chown -R user /home/user/
+ mkdir -p $HOME && \
+ chown -R user $HOME
+
+WORKDIR $HOME
+
+
+# Stage 2: latest GenAIComps sources
+FROM base AS git
+
+RUN apt-get update && apt-get install -y --no-install-recommends git
+RUN git clone --depth 1 https://github.com/opea-project/GenAIComps.git
+
-WORKDIR /home/user
-RUN git clone https://github.com/opea-project/GenAIComps.git
+# Stage 3: common layer shared by services using GenAIComps
+FROM base AS comps-base
-WORKDIR /home/user/GenAIComps
+# copy just relevant parts
+COPY --from=git $HOME/GenAIComps/comps $HOME/GenAIComps/comps
+COPY --from=git $HOME/GenAIComps/*.* $HOME/GenAIComps/LICENSE $HOME/GenAIComps/
+
+WORKDIR $HOME/GenAIComps
RUN pip install --no-cache-dir --upgrade pip setuptools && \
- pip install --no-cache-dir -r /home/user/GenAIComps/requirements.txt
+ pip install --no-cache-dir -r $HOME/GenAIComps/requirements.txt
+WORKDIR $HOME
+
+ENV PYTHONPATH=$PYTHONPATH:$HOME/GenAIComps
-COPY ./docsum.py /home/user/docsum.py
+USER user
-ENV PYTHONPATH=$PYTHONPATH:/home/user/GenAIComps
+# Stage 4: unique part
+FROM comps-base
+
+USER root
+# FFmpeg needed for media processing
+RUN apt-get update && \
+ apt-get install -y --no-install-recommends ffmpeg && \
+ apt-get clean && rm -rf /var/lib/apt/lists/*
USER user
-WORKDIR /home/user
+COPY ./docsum.py $HOME/docsum.py
ENTRYPOINT ["python", "docsum.py"]
-
diff --git a/DocSum/docker_compose/amd/gpu/rocm/README.md b/DocSum/docker_compose/amd/gpu/rocm/README.md
index b45a496755..4d41a5cd31 100644
--- a/DocSum/docker_compose/amd/gpu/rocm/README.md
+++ b/DocSum/docker_compose/amd/gpu/rocm/README.md
@@ -81,7 +81,7 @@ export DOCSUM_HUGGINGFACEHUB_API_TOKEN=${your_hf_api_token}
export DOCSUM_LLM_SERVER_PORT="8008"
export DOCSUM_BACKEND_SERVER_PORT="8888"
export DOCSUM_FRONTEND_PORT="5173"
-export DocSum_COMPONENT_NAME="OPEADocSum_TGI"
+export DocSum_COMPONENT_NAME="OpeaDocSumTgi"
```
Note: Please replace with `host_ip` with your external IP address, do not use localhost.
diff --git a/DocSum/docker_compose/set_env.sh b/DocSum/docker_compose/set_env.sh
index 3307955cc8..f116a99c3a 100644
--- a/DocSum/docker_compose/set_env.sh
+++ b/DocSum/docker_compose/set_env.sh
@@ -20,4 +20,4 @@ export BACKEND_SERVICE_ENDPOINT="http://${host_ip}:8888/v1/docsum"
export LLM_ENDPOINT_PORT=8008
export DOCSUM_PORT=9000
export LLM_ENDPOINT="http://${host_ip}:${LLM_ENDPOINT_PORT}"
-export DocSum_COMPONENT_NAME="OPEADocSum_TGI"
+export DocSum_COMPONENT_NAME="OpeaDocSumTgi"
diff --git a/DocSum/tests/test_compose_on_gaudi.sh b/DocSum/tests/test_compose_on_gaudi.sh
index 10e4d0c9fa..db0977b040 100644
--- a/DocSum/tests/test_compose_on_gaudi.sh
+++ b/DocSum/tests/test_compose_on_gaudi.sh
@@ -26,7 +26,7 @@ export no_proxy="${no_proxy},${host_ip}"
export LLM_ENDPOINT_PORT=8008
export DOCSUM_PORT=9000
export LLM_ENDPOINT="http://${host_ip}:${LLM_ENDPOINT_PORT}"
-export DocSum_COMPONENT_NAME="OPEADocSum_TGI"
+export DocSum_COMPONENT_NAME="OpeaDocSumTgi"
export LOGFLAG=True
WORKPATH=$(dirname "$PWD")
diff --git a/DocSum/tests/test_compose_on_rocm.sh b/DocSum/tests/test_compose_on_rocm.sh
index dc0baa26cb..54935f2b78 100644
--- a/DocSum/tests/test_compose_on_rocm.sh
+++ b/DocSum/tests/test_compose_on_rocm.sh
@@ -32,7 +32,7 @@ export ASR_SERVICE_HOST_IP=${host_ip}
export BACKEND_SERVICE_ENDPOINT="http://${ip_address}:8888/v1/docsum"
export DOCSUM_CARD_ID="card1"
export DOCSUM_RENDER_ID="renderD136"
-export DocSum_COMPONENT_NAME="OPEADocSum_TGI"
+export DocSum_COMPONENT_NAME="OpeaDocSumTgi"
export LOGFLAG=True
function build_docker_images() {
diff --git a/DocSum/tests/test_compose_on_xeon.sh b/DocSum/tests/test_compose_on_xeon.sh
index d353fcefdb..13036fc0db 100644
--- a/DocSum/tests/test_compose_on_xeon.sh
+++ b/DocSum/tests/test_compose_on_xeon.sh
@@ -26,7 +26,7 @@ export no_proxy="${no_proxy},${host_ip}"
export LLM_ENDPOINT_PORT=8008
export DOCSUM_PORT=9000
export LLM_ENDPOINT="http://${host_ip}:${LLM_ENDPOINT_PORT}"
-export DocSum_COMPONENT_NAME="OPEADocSum_TGI"
+export DocSum_COMPONENT_NAME="OpeaDocSumTgi"
export LOGFLAG=True
WORKPATH=$(dirname "$PWD")
diff --git a/EdgeCraftRAG/Dockerfile b/EdgeCraftRAG/Dockerfile
index b2a9984a8e..fb7f5e14ec 100644
--- a/EdgeCraftRAG/Dockerfile
+++ b/EdgeCraftRAG/Dockerfile
@@ -1,34 +1,49 @@
# Copyright (C) 2024 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
-FROM python:3.11-slim
+# Stage 1: base setup used by other stages
+FROM python:3.11-slim AS base
-SHELL ["/bin/bash", "-o", "pipefail", "-c"]
+# get security updates
+RUN apt-get update && apt-get upgrade -y && \
+ apt-get clean && rm -rf /var/lib/apt/lists/*
-RUN apt-get update -y && apt-get install -y --no-install-recommends --fix-missing \
- libgl1-mesa-glx \
- libjemalloc-dev \
- git
+ENV HOME=/home/user
RUN useradd -m -s /bin/bash user && \
- mkdir -p /home/user && \
- chown -R user /home/user/
+ mkdir -p $HOME && \
+ chown -R user $HOME
-COPY ./chatqna.py /home/user/chatqna.py
+WORKDIR $HOME
-WORKDIR /home/user
-RUN git clone https://github.com/opea-project/GenAIComps.git
-WORKDIR /home/user/GenAIComps
+# Stage 2: latest GenAIComps sources
+FROM base AS git
+
+RUN apt-get update && apt-get install -y --no-install-recommends git
+RUN git clone --depth 1 https://github.com/opea-project/GenAIComps.git
+
+
+# Stage 3: common layer shared by services using GenAIComps
+FROM base AS comps-base
+
+# copy just relevant parts
+COPY --from=git $HOME/GenAIComps/comps $HOME/GenAIComps/comps
+COPY --from=git $HOME/GenAIComps/*.* $HOME/GenAIComps/LICENSE $HOME/GenAIComps/
+
+WORKDIR $HOME/GenAIComps
RUN pip install --no-cache-dir --upgrade pip setuptools && \
- pip install --no-cache-dir -r /home/user/GenAIComps/requirements.txt
+ pip install --no-cache-dir -r $HOME/GenAIComps/requirements.txt
+WORKDIR $HOME
-ENV PYTHONPATH=$PYTHONPATH:/home/user/GenAIComps
+ENV PYTHONPATH=$PYTHONPATH:$HOME/GenAIComps
USER user
-WORKDIR /home/user
-RUN echo 'ulimit -S -n 999999' >> ~/.bashrc
+# Stage 4: unique part
+FROM comps-base
+
+COPY ./chatqna.py $HOME/chatqna.py
ENTRYPOINT ["python", "chatqna.py"]
diff --git a/EdgeCraftRAG/Dockerfile.server b/EdgeCraftRAG/Dockerfile.server
index 363807777d..3bb572f116 100644
--- a/EdgeCraftRAG/Dockerfile.server
+++ b/EdgeCraftRAG/Dockerfile.server
@@ -15,8 +15,7 @@ RUN wget -qO - https://repositories.intel.com/gpu/intel-graphics.key | \
gpg --yes --dearmor --output /usr/share/keyrings/intel-graphics.gpg
RUN echo "deb [arch=amd64,i386 signed-by=/usr/share/keyrings/intel-graphics.gpg] https://repositories.intel.com/gpu/ubuntu jammy client" | \
tee /etc/apt/sources.list.d/intel-gpu-jammy.list
-RUN apt-get update
-RUN apt-get install -y \
+RUN apt-get update && apt-get install -y \
intel-opencl-icd intel-level-zero-gpu level-zero intel-level-zero-gpu-raytracing \
intel-media-va-driver-non-free libmfx1 libmfxgen1 libvpl2 \
libegl-mesa0 libegl1-mesa libegl1-mesa-dev libgbm1 libgl1-mesa-dev libgl1-mesa-dri \
diff --git a/EdgeCraftRAG/tests/test_compose_vllm_on_arc.sh b/EdgeCraftRAG/tests/test_compose_vllm_on_arc.sh
index 3d9c2dd4f6..4ff56fafde 100755
--- a/EdgeCraftRAG/tests/test_compose_vllm_on_arc.sh
+++ b/EdgeCraftRAG/tests/test_compose_vllm_on_arc.sh
@@ -39,7 +39,7 @@ function build_docker_images() {
echo "Build vllm_openvino image from GenAIComps..."
cd $WORKPATH && git clone https://github.com/opea-project/GenAIComps.git && cd GenAIComps && git checkout "${opea_branch:-"main"}"
- cd comps/llms/text-generation/vllm/langchain/dependency
+ cd comps/third_parties/vllm/src/
bash ./build_docker_vllm_openvino.sh gpu
docker images && sleep 1s
diff --git a/FaqGen/Dockerfile b/FaqGen/Dockerfile
index 4018b44d1f..2d1afd002a 100644
--- a/FaqGen/Dockerfile
+++ b/FaqGen/Dockerfile
@@ -1,33 +1,49 @@
-
-
# Copyright (C) 2024 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
-FROM python:3.11-slim
+# Stage 1: base setup used by other stages
+FROM python:3.11-slim AS base
+# get security updates
+RUN apt-get update && apt-get upgrade -y && \
+ apt-get clean && rm -rf /var/lib/apt/lists/*
-RUN apt-get update -y && apt-get install -y --no-install-recommends --fix-missing \
- libgl1-mesa-glx \
- libjemalloc-dev \
- git
+ENV HOME=/home/user
RUN useradd -m -s /bin/bash user && \
- mkdir -p /home/user && \
- chown -R user /home/user/
+ mkdir -p $HOME && \
+ chown -R user $HOME
-WORKDIR /home/user/
-RUN git clone https://github.com/opea-project/GenAIComps.git
+WORKDIR $HOME
+
+
+# Stage 2: latest GenAIComps sources
+FROM base AS git
+
+RUN apt-get update && apt-get install -y --no-install-recommends git
+RUN git clone --depth 1 https://github.com/opea-project/GenAIComps.git
-WORKDIR /home/user/GenAIComps
-RUN pip install --no-cache-dir --upgrade pip setuptools && \
- pip install --no-cache-dir -r /home/user/GenAIComps/requirements.txt
-COPY ./faqgen.py /home/user/faqgen.py
+# Stage 3: common layer shared by services using GenAIComps
+FROM base AS comps-base
-ENV PYTHONPATH=$PYTHONPATH:/home/user/GenAIComps
+# copy just relevant parts
+COPY --from=git $HOME/GenAIComps/comps $HOME/GenAIComps/comps
+COPY --from=git $HOME/GenAIComps/*.* $HOME/GenAIComps/LICENSE $HOME/GenAIComps/
+
+WORKDIR $HOME/GenAIComps
+RUN pip install --no-cache-dir --upgrade pip setuptools && \
+ pip install --no-cache-dir -r $HOME/GenAIComps/requirements.txt
+WORKDIR $HOME
+
+ENV PYTHONPATH=$PYTHONPATH:$HOME/GenAIComps
USER user
-WORKDIR /home/user
+
+# Stage 4: unique part
+FROM comps-base
+
+COPY ./faqgen.py $HOME/faqgen.py
ENTRYPOINT ["python", "faqgen.py"]
diff --git a/FaqGen/docker_compose/amd/gpu/rocm/README.md b/FaqGen/docker_compose/amd/gpu/rocm/README.md
index b677d78354..68d8e2212f 100644
--- a/FaqGen/docker_compose/amd/gpu/rocm/README.md
+++ b/FaqGen/docker_compose/amd/gpu/rocm/README.md
@@ -34,7 +34,7 @@ export FAQGEN_HUGGINGFACEHUB_API_TOKEN=${your_hf_api_token}
export FAQGEN_BACKEND_SERVER_PORT=8888
export FAGGEN_UI_PORT=5173
export LLM_ENDPOINT="http://${HOST_IP}:${FAQGEN_TGI_SERVICE_PORT}"
-export FAQGen_COMPONENT_NAME="OPEAFAQGen_TGI"
+export FAQGen_COMPONENT_NAME="OpeaFaqGenTgi"
```
Note: Please replace with `host_ip` with your external IP address, do not use localhost.
diff --git a/FaqGen/docker_compose/intel/cpu/xeon/README.md b/FaqGen/docker_compose/intel/cpu/xeon/README.md
index db1d8db5a1..a961a6aa98 100644
--- a/FaqGen/docker_compose/intel/cpu/xeon/README.md
+++ b/FaqGen/docker_compose/intel/cpu/xeon/README.md
@@ -77,7 +77,7 @@ export https_proxy=${your_http_proxy}
export host_ip=${your_host_ip}
export LLM_ENDPOINT_PORT=8008
export LLM_SERVICE_PORT=9000
-export FAQGen_COMPONENT_NAME="OPEAFAQGen_TGI"
+export FAQGen_COMPONENT_NAME="OpeaFaqGenTgi"
export LLM_MODEL_ID="meta-llama/Meta-Llama-3-8B-Instruct"
export HUGGINGFACEHUB_API_TOKEN=${your_hf_api_token}
export MEGA_SERVICE_HOST_IP=${host_ip}
diff --git a/FaqGen/docker_compose/intel/hpu/gaudi/README.md b/FaqGen/docker_compose/intel/hpu/gaudi/README.md
index 69a2f2bd01..7364e92387 100644
--- a/FaqGen/docker_compose/intel/hpu/gaudi/README.md
+++ b/FaqGen/docker_compose/intel/hpu/gaudi/README.md
@@ -157,7 +157,7 @@ export https_proxy=${your_http_proxy}
export host_ip=${your_host_ip}
export LLM_ENDPOINT_PORT=8008
export LLM_SERVICE_PORT=9000
-export FAQGen_COMPONENT_NAME="OPEAFAQGen_TGI"
+export FAQGen_COMPONENT_NAME="OpeaFaqGenTgi"
export LLM_MODEL_ID="meta-llama/Meta-Llama-3-8B-Instruct"
export HUGGINGFACEHUB_API_TOKEN=${your_hf_api_token}
export MEGA_SERVICE_HOST_IP=${host_ip}
diff --git a/FaqGen/tests/test_compose_on_gaudi.sh b/FaqGen/tests/test_compose_on_gaudi.sh
index ba3a4a1605..95ed2950a0 100644
--- a/FaqGen/tests/test_compose_on_gaudi.sh
+++ b/FaqGen/tests/test_compose_on_gaudi.sh
@@ -31,7 +31,7 @@ function start_services() {
export host_ip=${ip_address}
export LLM_ENDPOINT_PORT=8008
- export FAQGen_COMPONENT_NAME="OPEAFAQGen_TGI"
+ export FAQGen_COMPONENT_NAME="OpeaFaqGenTgi"
export LLM_MODEL_ID="Intel/neural-chat-7b-v3-3"
export LLM_ENDPOINT="http://${host_ip}:${LLM_ENDPOINT_PORT}"
export HUGGINGFACEHUB_API_TOKEN=${HUGGINGFACEHUB_API_TOKEN}
diff --git a/FaqGen/tests/test_compose_on_rocm.sh b/FaqGen/tests/test_compose_on_rocm.sh
index 4b9d940ae7..726c83461b 100644
--- a/FaqGen/tests/test_compose_on_rocm.sh
+++ b/FaqGen/tests/test_compose_on_rocm.sh
@@ -28,7 +28,7 @@ export MEGA_SERVICE_HOST_IP=${ip_address}
export LLM_SERVICE_HOST_IP=${ip_address}
export BACKEND_SERVICE_ENDPOINT="http://${ip_address}:8888/v1/faqgen"
export PATH="~/miniconda3/bin:$PATH"
-export FAQGen_COMPONENT_NAME="OPEAFAQGen_TGI"
+export FAQGen_COMPONENT_NAME="OpeaFaqGenTgi"
export LOGFLAG=True
function build_docker_images() {
diff --git a/FaqGen/tests/test_compose_on_xeon.sh b/FaqGen/tests/test_compose_on_xeon.sh
index f2ed53480e..e4409358d2 100755
--- a/FaqGen/tests/test_compose_on_xeon.sh
+++ b/FaqGen/tests/test_compose_on_xeon.sh
@@ -31,7 +31,7 @@ function start_services() {
export host_ip=${ip_address}
export LLM_ENDPOINT_PORT=8008
- export FAQGen_COMPONENT_NAME="OPEAFAQGen_TGI"
+ export FAQGen_COMPONENT_NAME="OpeaFaqGenTgi"
export LLM_MODEL_ID="Intel/neural-chat-7b-v3-3"
export LLM_ENDPOINT="http://${host_ip}:${LLM_ENDPOINT_PORT}"
export HUGGINGFACEHUB_API_TOKEN=${HUGGINGFACEHUB_API_TOKEN}
diff --git a/GraphRAG/Dockerfile b/GraphRAG/Dockerfile
index bf01c01b2e..1e50649dd5 100644
--- a/GraphRAG/Dockerfile
+++ b/GraphRAG/Dockerfile
@@ -1,33 +1,49 @@
# Copyright (C) 2024 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
-FROM python:3.11-slim
+# Stage 1: base setup used by other stages
+FROM python:3.11-slim AS base
-RUN apt-get update -y && apt-get install -y --no-install-recommends --fix-missing \
- git \
- libgl1-mesa-glx \
- libjemalloc-dev
+# get security updates
+RUN apt-get update && apt-get upgrade -y && \
+ apt-get clean && rm -rf /var/lib/apt/lists/*
+
+ENV HOME=/home/user
RUN useradd -m -s /bin/bash user && \
- mkdir -p /home/user && \
- chown -R user /home/user/
+ mkdir -p $HOME && \
+ chown -R user $HOME
+
+WORKDIR $HOME
+
+
+# Stage 2: latest GenAIComps sources
+FROM base AS git
-WORKDIR /home/user/
-RUN git clone https://github.com/opea-project/GenAIComps.git
+RUN apt-get update && apt-get install -y --no-install-recommends git
+RUN git clone --depth 1 https://github.com/opea-project/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
+# Stage 3: common layer shared by services using GenAIComps
+FROM base AS comps-base
-ENV PYTHONPATH=$PYTHONPATH:/home/user/GenAIComps
+# copy just relevant parts
+COPY --from=git $HOME/GenAIComps/comps $HOME/GenAIComps/comps
+COPY --from=git $HOME/GenAIComps/*.* $HOME/GenAIComps/LICENSE $HOME/GenAIComps/
+
+WORKDIR $HOME/GenAIComps
+RUN pip install --no-cache-dir --upgrade pip setuptools && \
+ pip install --no-cache-dir -r $HOME/GenAIComps/requirements.txt
+WORKDIR $HOME
+
+ENV PYTHONPATH=$PYTHONPATH:$HOME/GenAIComps
USER user
-WORKDIR /home/user
-RUN echo 'ulimit -S -n 999999' >> ~/.bashrc
+# Stage 4: unique part
+FROM comps-base
+
+COPY ./graphrag.py $HOME/graphrag.py
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 4b5817a190..baf7b95a9d 100644
--- a/GraphRAG/docker_compose/intel/hpu/gaudi/compose.yaml
+++ b/GraphRAG/docker_compose/intel/hpu/gaudi/compose.yaml
@@ -95,14 +95,14 @@ services:
LOGFLAG: ${LOGFLAG}
restart: unless-stopped
retriever-neo4j-llamaindex:
- image: ${REGISTRY:-opea}/retriever-neo4j-llamaindex:${TAG:-latest}
+ image: ${REGISTRY:-opea}/retriever:${TAG:-latest}
container_name: retriever-neo4j-server
depends_on:
- neo4j-apoc
- tgi-gaudi-service
- tei-embedding-service
ports:
- - "6009:6009"
+ - "7000:7000"
ipc: host
environment:
no_proxy: ${no_proxy}
@@ -111,7 +111,7 @@ services:
host_ip: ${host_ip}
HUGGING_FACE_HUB_TOKEN: ${HUGGINGFACEHUB_API_TOKEN}
HF_TOKEN: ${HF_TOKEN}
- NEO4J_URL: ${NEO4J_URL}
+ NEO4J_URI: ${NEO4J_URL}
NEO4J_USERNAME: ${NEO4J_USERNAME}
NEO4J_PASSWORD: ${NEO4J_PASSWORD}
TGI_LLM_ENDPOINT: ${TGI_LLM_ENDPOINT}
@@ -122,6 +122,7 @@ services:
EMBEDDING_MODEL_ID: ${EMBEDDING_MODEL_ID}
LLM_MODEL_ID: ${LLM_MODEL_ID}
LOGFLAG: ${LOGFLAG}
+ RETRIEVER_COMPONENT_NAME: "OPEA_RETRIEVER_NEO4J"
restart: unless-stopped
graphrag-gaudi-backend-server:
image: ${REGISTRY:-opea}/graphrag:${TAG:-latest}
@@ -139,7 +140,7 @@ services:
- http_proxy=${http_proxy}
- MEGA_SERVICE_HOST_IP=graphrag-gaudi-backend-server
- RETRIEVER_SERVICE_HOST_IP=retriever-neo4j-llamaindex
- - RETRIEVER_SERVICE_PORT=6009
+ - RETRIEVER_SERVICE_PORT=7000
- LLM_SERVER_HOST_IP=tgi-gaudi-service
- LLM_SERVER_PORT=${LLM_SERVER_PORT:-80}
- LOGFLAG=${LOGFLAG}
diff --git a/GraphRAG/docker_image_build/build.yaml b/GraphRAG/docker_image_build/build.yaml
index 0be2bcb523..870b15a674 100644
--- a/GraphRAG/docker_image_build/build.yaml
+++ b/GraphRAG/docker_image_build/build.yaml
@@ -11,15 +11,15 @@ services:
context: ../
dockerfile: ./Dockerfile
image: ${REGISTRY:-opea}/graphrag:${TAG:-latest}
- retriever-neo4j-llamaindex:
+ retriever:
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-llamaindex:${TAG:-latest}
+ dockerfile: comps/retrievers/src/Dockerfile
+ image: ${REGISTRY:-opea}/retriever:${TAG:-latest}
dataprep-neo4j-llamaindex:
build:
args:
diff --git a/GraphRAG/tests/test_compose_on_gaudi.sh b/GraphRAG/tests/test_compose_on_gaudi.sh
index 3525936ae9..96e671b3f6 100755
--- a/GraphRAG/tests/test_compose_on_gaudi.sh
+++ b/GraphRAG/tests/test_compose_on_gaudi.sh
@@ -38,6 +38,7 @@ function start_services() {
export TEI_EMBEDDING_ENDPOINT="http://${ip_address}:6006"
export TGI_LLM_ENDPOINT="http://${ip_address}:6005"
export host_ip=${ip_address}
+ export LOGFLAG=true
# Start Docker Containers
sed -i "s|container_name: graphrag-gaudi-backend-server|container_name: graphrag-gaudi-backend-server\n volumes:\n - \"${WORKPATH}\/docker_image_build\/GenAIComps:\/home\/user\/GenAIComps\"|g" compose.yaml
@@ -125,10 +126,12 @@ function validate_microservices() {
"extract_graph_neo4j" \
"dataprep-neo4j-server"
+ sleep 2m
+
# retrieval microservice
validate_service \
- "${ip_address}:6009/v1/retrieval" \
- "Retrieval of answers from community summaries successful" \
+ "${ip_address}:7000/v1/retrieval" \
+ "retrieved_docs" \
"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?\"}]}"
diff --git a/MultimodalQnA/Dockerfile b/MultimodalQnA/Dockerfile
index 1baca70dfa..ca73e5486a 100644
--- a/MultimodalQnA/Dockerfile
+++ b/MultimodalQnA/Dockerfile
@@ -1,32 +1,49 @@
# Copyright (C) 2024 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
-FROM python:3.11-slim
+# Stage 1: base setup used by other stages
+FROM python:3.11-slim AS base
-RUN apt-get update -y && apt-get install -y --no-install-recommends --fix-missing \
- libgl1-mesa-glx \
- libjemalloc-dev \
- git
+# get security updates
+RUN apt-get update && apt-get upgrade -y && \
+ apt-get clean && rm -rf /var/lib/apt/lists/*
+
+ENV HOME=/home/user
RUN useradd -m -s /bin/bash user && \
- mkdir -p /home/user && \
- chown -R user /home/user/
+ mkdir -p $HOME && \
+ chown -R user $HOME
-WORKDIR /home/user/
-#RUN git clone https://github.com/opea-project/GenAIComps.git
-RUN git clone https://github.com/mhbuehler/GenAIComps.git --single-branch --branch mmqna-image-query
+WORKDIR $HOME
-WORKDIR /home/user/GenAIComps
-RUN pip install --no-cache-dir --upgrade pip setuptools && \
- pip install --no-cache-dir -r /home/user/GenAIComps/requirements.txt
+# Stage 2: latest GenAIComps sources
+FROM base AS git
+
+RUN apt-get update && apt-get install -y --no-install-recommends git
+#RUN git clone --depth 1 https://github.com/opea-project/GenAIComps.git
+RUN git clone --depth 1 https://github.com/mhbuehler/GenAIComps.git --single-branch --branch mmqna-image-query
+
+# Stage 3: common layer shared by services using GenAIComps
+FROM base AS comps-base
-COPY ./multimodalqna.py /home/user/multimodalqna.py
+# copy just relevant parts
+COPY --from=git $HOME/GenAIComps/comps $HOME/GenAIComps/comps
+COPY --from=git $HOME/GenAIComps/*.* $HOME/GenAIComps/LICENSE $HOME/GenAIComps/
-ENV PYTHONPATH=$PYTHONPATH:/home/user/GenAIComps
+WORKDIR $HOME/GenAIComps
+RUN pip install --no-cache-dir --upgrade pip setuptools && \
+ pip install --no-cache-dir -r $HOME/GenAIComps/requirements.txt
+WORKDIR $HOME
+
+ENV PYTHONPATH=$PYTHONPATH:$HOME/GenAIComps
USER user
-WORKDIR /home/user
+
+# Stage 4: unique part
+FROM comps-base
+
+COPY ./multimodalqna.py $HOME/multimodalqna.py
ENTRYPOINT ["python", "multimodalqna.py"]
# ENTRYPOINT ["/usr/bin/sleep", "infinity"]
diff --git a/MultimodalQnA/docker_compose/amd/gpu/rocm/README.md b/MultimodalQnA/docker_compose/amd/gpu/rocm/README.md
index 2e16848a72..af0812d84d 100644
--- a/MultimodalQnA/docker_compose/amd/gpu/rocm/README.md
+++ b/MultimodalQnA/docker_compose/amd/gpu/rocm/README.md
@@ -45,7 +45,7 @@ docker build --no-cache -t opea/lvm-llava:latest --build-arg https_proxy=$https_
### 3. Build retriever-multimodal-redis Image
```bash
-docker build --no-cache -t opea/retriever-redis:latest --build-arg https_proxy=$https_proxy --build-arg http_proxy=$http_proxy -f comps/retrievers/redis/langchain/Dockerfile .
+docker build --no-cache -t opea/retriever:latest --build-arg https_proxy=$https_proxy --build-arg http_proxy=$http_proxy -f comps/retrievers/src/Dockerfile .
```
### 4. Build dataprep-multimodal-redis Image
@@ -86,7 +86,7 @@ Then run the command `docker images`, you will have the following 8 Docker Image
1. `opea/dataprep-multimodal-redis:latest`
2. `ghcr.io/huggingface/text-generation-inference:2.4.1-rocm`
3. `opea/lvm:latest`
-4. `opea/retriever-multimodal-redis:latest`
+4. `opea/retriever:latest`
5. `opea/embedding:latest`
6. `opea/embedding-multimodal-bridgetower:latest`
7. `opea/multimodalqna:latest`
diff --git a/MultimodalQnA/docker_compose/amd/gpu/rocm/compose.yaml b/MultimodalQnA/docker_compose/amd/gpu/rocm/compose.yaml
index bea1632c63..e38f175f94 100644
--- a/MultimodalQnA/docker_compose/amd/gpu/rocm/compose.yaml
+++ b/MultimodalQnA/docker_compose/amd/gpu/rocm/compose.yaml
@@ -73,7 +73,7 @@ services:
MULTIMODAL_EMBEDDING: true
restart: unless-stopped
retriever-redis:
- image: ${REGISTRY:-opea}/retriever-redis:${TAG:-latest}
+ image: ${REGISTRY:-opea}/retriever:${TAG:-latest}
container_name: retriever-redis
depends_on:
- redis-vector-db
@@ -87,7 +87,8 @@ services:
REDIS_URL: ${REDIS_URL}
INDEX_NAME: ${INDEX_NAME}
BRIDGE_TOWER_EMBEDDING: ${BRIDGE_TOWER_EMBEDDING}
- RETRIEVER_TYPE: "redis"
+ LOGFLAG: ${LOGFLAG}
+ RETRIEVER_COMPONENT_NAME: "OPEA_RETRIEVER_REDIS"
restart: unless-stopped
tgi-rocm:
image: ghcr.io/huggingface/text-generation-inference:3.0.1-rocm
diff --git a/MultimodalQnA/docker_compose/intel/cpu/xeon/README.md b/MultimodalQnA/docker_compose/intel/cpu/xeon/README.md
index 247a07b1f5..29afb29d41 100644
--- a/MultimodalQnA/docker_compose/intel/cpu/xeon/README.md
+++ b/MultimodalQnA/docker_compose/intel/cpu/xeon/README.md
@@ -141,7 +141,7 @@ docker build --no-cache -t opea/embedding:latest --build-arg https_proxy=$https_
### 2. Build retriever-multimodal-redis Image
```bash
-docker build --no-cache -t opea/retriever-redis:latest --build-arg https_proxy=$https_proxy --build-arg http_proxy=$http_proxy -f comps/retrievers/redis/langchain/Dockerfile .
+docker build --no-cache -t opea/retriever:latest --build-arg https_proxy=$https_proxy --build-arg http_proxy=$http_proxy -f comps/retrievers/src/Dockerfile .
```
### 3. Build LVM Images
@@ -198,7 +198,7 @@ Then run the command `docker images`, you will have the following 11 Docker Imag
1. `opea/dataprep-multimodal-redis:latest`
2. `opea/lvm:latest`
3. `opea/lvm-llava:latest`
-4. `opea/retriever-multimodal-redis:latest`
+4. `opea/retriever:latest`
5. `opea/whisper:latest`
6. `opea/redis-vector-db`
7. `opea/embedding:latest`
diff --git a/MultimodalQnA/docker_compose/intel/cpu/xeon/compose.yaml b/MultimodalQnA/docker_compose/intel/cpu/xeon/compose.yaml
index 6123798617..d8fba95810 100644
--- a/MultimodalQnA/docker_compose/intel/cpu/xeon/compose.yaml
+++ b/MultimodalQnA/docker_compose/intel/cpu/xeon/compose.yaml
@@ -89,7 +89,7 @@ services:
MULTIMODAL_EMBEDDING: true
restart: unless-stopped
retriever-redis:
- image: ${REGISTRY:-opea}/retriever-redis:${TAG:-latest}
+ image: ${REGISTRY:-opea}/retriever:${TAG:-latest}
container_name: retriever-redis
depends_on:
- redis-vector-db
@@ -106,7 +106,8 @@ services:
REDIS_RETRIEVER_PORT: ${REDIS_RETRIEVER_PORT}
INDEX_NAME: ${INDEX_NAME}
BRIDGE_TOWER_EMBEDDING: ${BRIDGE_TOWER_EMBEDDING}
- RETRIEVER_TYPE: "redis"
+ LOGFLAG: ${LOGFLAG}
+ RETRIEVER_COMPONENT_NAME: "OPEA_RETRIEVER_REDIS"
restart: unless-stopped
lvm-llava:
image: ${REGISTRY:-opea}/lvm-llava:${TAG:-latest}
diff --git a/MultimodalQnA/docker_compose/intel/hpu/gaudi/README.md b/MultimodalQnA/docker_compose/intel/hpu/gaudi/README.md
index 1e4bbff4dd..6acf980652 100644
--- a/MultimodalQnA/docker_compose/intel/hpu/gaudi/README.md
+++ b/MultimodalQnA/docker_compose/intel/hpu/gaudi/README.md
@@ -93,7 +93,7 @@ docker build --no-cache -t opea/embedding:latest --build-arg https_proxy=$https_
### 2. Build retriever-multimodal-redis Image
```bash
-docker build --no-cache -t opea/retriever-redis:latest --build-arg https_proxy=$https_proxy --build-arg http_proxy=$http_proxy -f comps/retrievers/redis/langchain/Dockerfile .
+docker build --no-cache -t opea/retriever:latest --build-arg https_proxy=$https_proxy --build-arg http_proxy=$http_proxy -f comps/retrievers/src/Dockerfile .
```
### 3. Build LVM Images
@@ -148,7 +148,7 @@ Then run the command `docker images`, you will have the following 11 Docker Imag
1. `opea/dataprep-multimodal-redis:latest`
2. `opea/lvm:latest`
3. `ghcr.io/huggingface/tgi-gaudi:2.0.6`
-4. `opea/retriever-multimodal-redis:latest`
+4. `opea/retriever:latest`
5. `opea/whisper:latest`
6. `opea/redis-vector-db`
7. `opea/embedding:latest`
diff --git a/MultimodalQnA/docker_compose/intel/hpu/gaudi/compose.yaml b/MultimodalQnA/docker_compose/intel/hpu/gaudi/compose.yaml
index aecc3b6e84..6bc8cb3ec9 100644
--- a/MultimodalQnA/docker_compose/intel/hpu/gaudi/compose.yaml
+++ b/MultimodalQnA/docker_compose/intel/hpu/gaudi/compose.yaml
@@ -90,7 +90,7 @@ services:
MULTIMODAL_EMBEDDING: true
restart: unless-stopped
retriever-redis:
- image: ${REGISTRY:-opea}/retriever-redis:${TAG:-latest}
+ image: ${REGISTRY:-opea}/retriever:${TAG:-latest}
container_name: retriever-redis
depends_on:
- redis-vector-db
@@ -107,7 +107,8 @@ services:
REDIS_RETRIEVER_PORT: ${REDIS_RETRIEVER_PORT}
INDEX_NAME: ${INDEX_NAME}
BRIDGE_TOWER_EMBEDDING: ${BRIDGE_TOWER_EMBEDDING}
- RETRIEVER_TYPE: "redis"
+ LOGFLAG: ${LOGFLAG}
+ RETRIEVER_COMPONENT_NAME: "OPEA_RETRIEVER_REDIS"
restart: unless-stopped
tgi-gaudi:
image: ghcr.io/huggingface/tgi-gaudi:2.0.6
diff --git a/MultimodalQnA/docker_image_build/build.yaml b/MultimodalQnA/docker_image_build/build.yaml
index a3159bac29..9c26d99d8e 100644
--- a/MultimodalQnA/docker_image_build/build.yaml
+++ b/MultimodalQnA/docker_image_build/build.yaml
@@ -29,12 +29,12 @@ services:
dockerfile: comps/embeddings/src/Dockerfile
extends: multimodalqna
image: ${REGISTRY:-opea}/embedding:${TAG:-latest}
- retriever-redis:
+ retriever:
build:
context: GenAIComps
- dockerfile: comps/retrievers/redis/langchain/Dockerfile
+ dockerfile: comps/retrievers/src/Dockerfile
extends: multimodalqna
- image: ${REGISTRY:-opea}/retriever-redis:${TAG:-latest}
+ image: ${REGISTRY:-opea}/retriever:${TAG:-latest}
lvm-llava:
build:
context: GenAIComps
diff --git a/MultimodalQnA/tests/test_compose_on_gaudi.sh b/MultimodalQnA/tests/test_compose_on_gaudi.sh
index 1b3053eb51..162f625543 100644
--- a/MultimodalQnA/tests/test_compose_on_gaudi.sh
+++ b/MultimodalQnA/tests/test_compose_on_gaudi.sh
@@ -47,7 +47,7 @@ function build_docker_images() {
#git clone https://github.com/opea-project/GenAIComps.git && cd GenAIComps && git checkout "${opea_branch:-"main"}" && cd ../
git clone https://github.com/mhbuehler/GenAIComps.git && cd GenAIComps && git checkout "${opea_branch:-"mmqna-image-query"}" && cd ../
echo "Build all the images with --no-cache, check docker_image_build.log for details..."
- service_list="multimodalqna multimodalqna-ui embedding-multimodal-bridgetower embedding retriever-redis lvm dataprep-multimodal-redis asr whisper"
+ service_list="multimodalqna multimodalqna-ui embedding-multimodal-bridgetower embedding retriever lvm dataprep-multimodal-redis whisper"
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.6
diff --git a/MultimodalQnA/tests/test_compose_on_rocm.sh b/MultimodalQnA/tests/test_compose_on_rocm.sh
index 62f27481ae..65fe94390d 100644
--- a/MultimodalQnA/tests/test_compose_on_rocm.sh
+++ b/MultimodalQnA/tests/test_compose_on_rocm.sh
@@ -23,7 +23,7 @@ function build_docker_images() {
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="multimodalqna multimodalqna-ui embedding-multimodal-bridgetower embedding retriever-redis lvm dataprep-multimodal-redis asr whisper"
+ service_list="multimodalqna multimodalqna-ui embedding-multimodal-bridgetower embedding retriever lvm dataprep-multimodal-redis whisper"
docker compose -f build.yaml build ${service_list} --no-cache > ${LOG_PATH}/docker_image_build.log
docker images && sleep 1m
@@ -196,7 +196,7 @@ function validate_microservices() {
"dataprep_get" \
"dataprep-multimodal-redis"
- sleep 1m
+ sleep 2m
# multimodal retrieval microservice
echo "Validating retriever-redis"
@@ -208,7 +208,7 @@ function validate_microservices() {
"retriever-redis" \
"{\"text\":\"test\",\"embedding\":${your_embedding}}"
- sleep 3m
+ sleep 5m
# llava server
echo "Evaluating lvm-llava"
diff --git a/MultimodalQnA/tests/test_compose_on_xeon.sh b/MultimodalQnA/tests/test_compose_on_xeon.sh
index 3d5ad4bbfb..b0515b5d1d 100644
--- a/MultimodalQnA/tests/test_compose_on_xeon.sh
+++ b/MultimodalQnA/tests/test_compose_on_xeon.sh
@@ -47,7 +47,7 @@ function build_docker_images() {
#git clone https://github.com/opea-project/GenAIComps.git && cd GenAIComps && git checkout "${opea_branch:-"main"}" && cd ../
git clone https://github.com/mhbuehler/GenAIComps.git && cd GenAIComps && git checkout "${opea_branch:-"mmqna-image-query"}" && cd ../
echo "Build all the images with --no-cache, check docker_image_build.log for details..."
- service_list="multimodalqna multimodalqna-ui embedding-multimodal-bridgetower embedding retriever-redis lvm-llava lvm dataprep-multimodal-redis asr whisper"
+ service_list="multimodalqna multimodalqna-ui embedding-multimodal-bridgetower embedding retriever lvm-llava lvm dataprep-multimodal-redis whisper"
docker compose -f build.yaml build ${service_list} --no-cache > ${LOG_PATH}/docker_image_build.log
docker images && sleep 1m
diff --git a/ProductivitySuite/docker_compose/intel/cpu/xeon/README.md b/ProductivitySuite/docker_compose/intel/cpu/xeon/README.md
index 8faa43e3c2..75ffa4483e 100644
--- a/ProductivitySuite/docker_compose/intel/cpu/xeon/README.md
+++ b/ProductivitySuite/docker_compose/intel/cpu/xeon/README.md
@@ -19,7 +19,7 @@ docker build --no-cache -t opea/embedding:latest --build-arg https_proxy=$https_
### 2. Build Retriever Image
```bash
-docker build --no-cache -t opea/retriever-redis:latest --build-arg https_proxy=$https_proxy --build-arg http_proxy=$http_proxy -f comps/retrievers/redis/langchain/Dockerfile .
+docker build --no-cache -t opea/retriever:latest --build-arg https_proxy=$https_proxy --build-arg http_proxy=$http_proxy -f comps/retrievers/src/Dockerfile .
```
### 3. Build Rerank Image
@@ -51,7 +51,7 @@ docker build -t opea/promptregistry-mongo-server:latest --build-arg https_proxy=
### 7. Build Chat History Image
```bash
-docker build -t opea/chathistory-mongo-server:latest --build-arg https_proxy=$https_proxy --build-arg http_proxy=$http_proxy -f comps/chathistory/mongo/Dockerfile .
+docker build -t opea/chathistory-mongo-server:latest --build-arg https_proxy=$https_proxy --build-arg http_proxy=$http_proxy -f comps/chathistory/src/Dockerfile .
cd ..
```
diff --git a/ProductivitySuite/docker_compose/intel/cpu/xeon/compose.yaml b/ProductivitySuite/docker_compose/intel/cpu/xeon/compose.yaml
index 67921ec35b..1872f12923 100644
--- a/ProductivitySuite/docker_compose/intel/cpu/xeon/compose.yaml
+++ b/ProductivitySuite/docker_compose/intel/cpu/xeon/compose.yaml
@@ -69,7 +69,7 @@ services:
LOGFLAG: ${LOGFLAG}
restart: unless-stopped
retriever:
- image: ${REGISTRY:-opea}/retriever-redis:${TAG:-latest}
+ image: ${REGISTRY:-opea}/retriever:${TAG:-latest}
container_name: retriever-redis-server
depends_on:
- redis-vector-db
@@ -85,8 +85,8 @@ services:
INDEX_NAME: ${INDEX_NAME}
TEI_EMBEDDING_ENDPOINT: ${TEI_EMBEDDING_ENDPOINT}
HUGGINGFACEHUB_API_TOKEN: ${HUGGINGFACEHUB_API_TOKEN}
- RETRIEVER_TYPE: ${RETRIEVER_TYPE}
LOGFLAG: ${LOGFLAG}
+ RETRIEVER_COMPONENT_NAME: "OPEA_RETRIEVER_REDIS"
restart: unless-stopped
tei-reranking-service:
image: ghcr.io/huggingface/text-embeddings-inference:cpu-1.5
diff --git a/ProductivitySuite/docker_image_build/build.yaml b/ProductivitySuite/docker_image_build/build.yaml
index 7090e7ac0d..dd8da57399 100644
--- a/ProductivitySuite/docker_image_build/build.yaml
+++ b/ProductivitySuite/docker_image_build/build.yaml
@@ -17,12 +17,12 @@ services:
dockerfile: comps/embeddings/src/Dockerfile
extends: chatqna
image: ${REGISTRY:-opea}/embedding:${TAG:-latest}
- retriever-redis:
+ retriever:
build:
context: GenAIComps
- dockerfile: comps/retrievers/redis/langchain/Dockerfile
+ dockerfile: comps/retrievers/src/Dockerfile
extends: chatqna
- image: ${REGISTRY:-opea}/retriever-redis:${TAG:-latest}
+ image: ${REGISTRY:-opea}/retriever:${TAG:-latest}
reranking:
build:
context: GenAIComps
@@ -50,7 +50,7 @@ services:
chathistory-mongo-server:
build:
context: GenAIComps
- dockerfile: comps/chathistory/mongo/Dockerfile
+ dockerfile: comps/chathistory/src/Dockerfile
extends: chatqna
image: ${REGISTRY:-opea}/chathistory-mongo-server:${TAG:-latest}
productivity-suite-react-ui-server:
diff --git a/ProductivitySuite/kubernetes/intel/cpu/xeon/manifest/chatqna.yaml b/ProductivitySuite/kubernetes/intel/cpu/xeon/manifest/chatqna.yaml
index 624c0b0081..c921efea55 100644
--- a/ProductivitySuite/kubernetes/intel/cpu/xeon/manifest/chatqna.yaml
+++ b/ProductivitySuite/kubernetes/intel/cpu/xeon/manifest/chatqna.yaml
@@ -811,7 +811,7 @@ spec:
runAsUser: 1000
seccompProfile:
type: RuntimeDefault
- image: "opea/retriever-redis:latest"
+ image: "opea/retriever:latest"
imagePullPolicy: IfNotPresent
ports:
- name: retriever-usvc
diff --git a/ProductivitySuite/tests/test_compose_on_xeon.sh b/ProductivitySuite/tests/test_compose_on_xeon.sh
index f415923905..fa0b6e2a4a 100755
--- a/ProductivitySuite/tests/test_compose_on_xeon.sh
+++ b/ProductivitySuite/tests/test_compose_on_xeon.sh
@@ -80,7 +80,7 @@ function start_services() {
export LLM_SERVER_PORT=9009
export PROMPT_COLLECTION_NAME="prompt"
export host_ip=${ip_address}
- export FAQGen_COMPONENT_NAME="OPEAFAQGen_TGI"
+ export FAQGen_COMPONENT_NAME="OpeaFaqGenTgi"
export LOGFLAG=True
# Start Docker Containers
diff --git a/SearchQnA/Dockerfile b/SearchQnA/Dockerfile
index 2d8e59f6b5..df8d536b08 100644
--- a/SearchQnA/Dockerfile
+++ b/SearchQnA/Dockerfile
@@ -1,32 +1,49 @@
-
-
# Copyright (C) 2024 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
-FROM python:3.11-slim
+# Stage 1: base setup used by other stages
+FROM python:3.11-slim AS base
+
+# get security updates
+RUN apt-get update && apt-get upgrade -y && \
+ apt-get clean && rm -rf /var/lib/apt/lists/*
-RUN apt-get update -y && apt-get install -y --no-install-recommends --fix-missing \
- libgl1-mesa-glx \
- libjemalloc-dev \
- git
+ENV HOME=/home/user
RUN useradd -m -s /bin/bash user && \
- mkdir -p /home/user && \
- chown -R user /home/user/
+ mkdir -p $HOME && \
+ chown -R user $HOME
-WORKDIR /home/user/
-RUN git clone https://github.com/opea-project/GenAIComps.git
+WORKDIR $HOME
-WORKDIR /home/user/GenAIComps
-RUN pip install --no-cache-dir --upgrade pip setuptools && \
- pip install --no-cache-dir -r /home/user/GenAIComps/requirements.txt
-COPY ./searchqna.py /home/user/searchqna.py
+# Stage 2: latest GenAIComps sources
+FROM base AS git
+
+RUN apt-get update && apt-get install -y --no-install-recommends git
+RUN git clone --depth 1 https://github.com/opea-project/GenAIComps.git
+
-ENV PYTHONPATH=$PYTHONPATH:/home/user/GenAIComps
+# Stage 3: common layer shared by services using GenAIComps
+FROM base AS comps-base
+
+# copy just relevant parts
+COPY --from=git $HOME/GenAIComps/comps $HOME/GenAIComps/comps
+COPY --from=git $HOME/GenAIComps/*.* $HOME/GenAIComps/LICENSE $HOME/GenAIComps/
+
+WORKDIR $HOME/GenAIComps
+RUN pip install --no-cache-dir --upgrade pip setuptools && \
+ pip install --no-cache-dir -r $HOME/GenAIComps/requirements.txt
+WORKDIR $HOME
+
+ENV PYTHONPATH=$PYTHONPATH:$HOME/GenAIComps
USER user
-WORKDIR /home/user
+
+# Stage 4: unique part
+FROM comps-base
+
+COPY ./searchqna.py $HOME/searchqna.py
ENTRYPOINT ["python", "searchqna.py"]
diff --git a/Translation/Dockerfile b/Translation/Dockerfile
index 33931689c1..70266c9b87 100644
--- a/Translation/Dockerfile
+++ b/Translation/Dockerfile
@@ -1,42 +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.
-
-
-FROM python:3.11-slim
-
-RUN apt-get update -y && apt-get install -y --no-install-recommends --fix-missing \
- libgl1-mesa-glx \
- libjemalloc-dev \
- git
+# Copyright (C) 2024 Intel Corporation
+# SPDX-License-Identifier: Apache-2.0
+
+# Stage 1: base setup used by other stages
+FROM python:3.11-slim AS base
+
+# get security updates
+RUN apt-get update && apt-get upgrade -y && \
+ apt-get clean && rm -rf /var/lib/apt/lists/*
+
+ENV HOME=/home/user
RUN useradd -m -s /bin/bash user && \
- mkdir -p /home/user && \
- chown -R user /home/user/
+ mkdir -p $HOME && \
+ chown -R user $HOME
-WORKDIR /home/user/
-RUN git clone https://github.com/opea-project/GenAIComps.git
+WORKDIR $HOME
-WORKDIR /home/user/GenAIComps
-RUN pip install --no-cache-dir --upgrade pip setuptools && \
- pip install --no-cache-dir -r /home/user/GenAIComps/requirements.txt
-COPY ./translation.py /home/user/translation.py
+# Stage 2: latest GenAIComps sources
+FROM base AS git
+
+RUN apt-get update && apt-get install -y --no-install-recommends git
+RUN git clone --depth 1 https://github.com/opea-project/GenAIComps.git
+
-ENV PYTHONPATH=$PYTHONPATH:/home/user/GenAIComps
+# Stage 3: common layer shared by services using GenAIComps
+FROM base AS comps-base
+
+# copy just relevant parts
+COPY --from=git $HOME/GenAIComps/comps $HOME/GenAIComps/comps
+COPY --from=git $HOME/GenAIComps/*.* $HOME/GenAIComps/LICENSE $HOME/GenAIComps/
+
+WORKDIR $HOME/GenAIComps
+RUN pip install --no-cache-dir --upgrade pip setuptools && \
+ pip install --no-cache-dir -r $HOME/GenAIComps/requirements.txt
+WORKDIR $HOME
+
+ENV PYTHONPATH=$PYTHONPATH:$HOME/GenAIComps
USER user
-WORKDIR /home/user
+
+# Stage 4: unique part
+FROM comps-base
+
+COPY ./translation.py $HOME/translation.py
ENTRYPOINT ["python", "translation.py"]
diff --git a/VideoQnA/Dockerfile b/VideoQnA/Dockerfile
index bd1ff121f5..0504a71881 100644
--- a/VideoQnA/Dockerfile
+++ b/VideoQnA/Dockerfile
@@ -1,33 +1,49 @@
-
-
# Copyright (C) 2024 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
-FROM python:3.11-slim
+# Stage 1: base setup used by other stages
+FROM python:3.11-slim AS base
+
+# get security updates
+RUN apt-get update && apt-get upgrade -y && \
+ apt-get clean && rm -rf /var/lib/apt/lists/*
-RUN apt-get update -y && apt-get install -y --no-install-recommends --fix-missing \
- libgl1-mesa-glx \
- libjemalloc-dev \
- git
+ENV HOME=/home/user
RUN useradd -m -s /bin/bash user && \
- mkdir -p /home/user && \
- chown -R user /home/user/
+ mkdir -p $HOME && \
+ chown -R user $HOME
-WORKDIR /home/user/
+WORKDIR $HOME
-RUN git clone https://github.com/opea-project/GenAIComps.git
-WORKDIR /home/user/GenAIComps
-RUN pip install --no-cache-dir --upgrade pip setuptools && \
- pip install --no-cache-dir -r /home/user/GenAIComps/requirements.txt
+# Stage 2: latest GenAIComps sources
+FROM base AS git
+
+RUN apt-get update && apt-get install -y --no-install-recommends git
+RUN git clone --depth 1 https://github.com/opea-project/GenAIComps.git
+
-COPY ./videoqna.py /home/user/videoqna.py
+# Stage 3: common layer shared by services using GenAIComps
+FROM base AS comps-base
-ENV PYTHONPATH=$PYTHONPATH:/home/user/GenAIComps
+# copy just relevant parts
+COPY --from=git $HOME/GenAIComps/comps $HOME/GenAIComps/comps
+COPY --from=git $HOME/GenAIComps/*.* $HOME/GenAIComps/LICENSE $HOME/GenAIComps/
+
+WORKDIR $HOME/GenAIComps
+RUN pip install --no-cache-dir --upgrade pip setuptools && \
+ pip install --no-cache-dir -r $HOME/GenAIComps/requirements.txt
+WORKDIR $HOME
+
+ENV PYTHONPATH=$PYTHONPATH:$HOME/GenAIComps
USER user
-WORKDIR /home/user
+
+# Stage 4: unique part
+FROM comps-base
+
+COPY ./videoqna.py $HOME/videoqna.py
ENTRYPOINT ["python", "videoqna.py"]
diff --git a/VideoQnA/docker_compose/intel/cpu/xeon/README.md b/VideoQnA/docker_compose/intel/cpu/xeon/README.md
index 921f1175db..6c5af3d84f 100644
--- a/VideoQnA/docker_compose/intel/cpu/xeon/README.md
+++ b/VideoQnA/docker_compose/intel/cpu/xeon/README.md
@@ -59,7 +59,7 @@ docker build -t opea/embedding-multimodal-clip:latest --build-arg https_proxy=$h
### 2. Build Retriever Image
```bash
-docker build -t opea/retriever-vdms:latest --build-arg https_proxy=$https_proxy --build-arg http_proxy=$http_proxy -f comps/retrievers/vdms/langchain/Dockerfile .
+docker build -t opea/retriever:latest --build-arg https_proxy=$https_proxy --build-arg http_proxy=$http_proxy -f comps/retrievers/src/Dockerfile .
```
### 3. Build Reranking Image
@@ -108,15 +108,13 @@ Then run the command `docker images`, you will have the following 8 Docker Image
1. `opea/dataprep-multimodal-vdms:latest`
2. `opea/embedding-multimodal-clip:latest`
-3. `opea/retriever-vdms:latest`
- <<<<<<< HEAD
+3. `opea/retriever:latest`
4. `opea/reranking:latest`
5. `opea/video-llama-lvm-server:latest`
6. # `opea/lvm-video-llama:latest`
7. `opea/reranking-tei:latest`
8. `opea/lvm-video-llama:latest`
9. `opea/lvm:latest`
- > > > > > > > d93597cbfd9da92b956adb3673c9e5d743c181af
10. `opea/videoqna:latest`
11. `opea/videoqna-ui:latest`
diff --git a/VideoQnA/docker_compose/intel/cpu/xeon/compose.yaml b/VideoQnA/docker_compose/intel/cpu/xeon/compose.yaml
index 8610b90aed..f52ceef414 100644
--- a/VideoQnA/docker_compose/intel/cpu/xeon/compose.yaml
+++ b/VideoQnA/docker_compose/intel/cpu/xeon/compose.yaml
@@ -41,7 +41,7 @@ services:
- /home/$USER/.cache/huggingface/hub:/home/user/.cache/huggingface/hub
restart: unless-stopped
retriever:
- image: ${REGISTRY:-opea}/retriever-vdms:${TAG:-latest}
+ image: ${REGISTRY:-opea}/retriever:${TAG:-latest}
container_name: retriever-vdms-server
depends_on:
- vdms-vector-db
@@ -52,10 +52,12 @@ services:
no_proxy: ${no_proxy}
http_proxy: ${http_proxy}
https_proxy: ${https_proxy}
- INDEX_NAME: ${INDEX_NAME}
+ VDMS_INDEX_NAME: ${INDEX_NAME}
VDMS_HOST: ${VDMS_HOST}
VDMS_PORT: ${VDMS_PORT}
- USECLIP: ${USECLIP}
+ VDMS_USE_CLIP: ${USECLIP}
+ LOGFLAG: ${LOGFLAG}
+ RETRIEVER_COMPONENT_NAME: "OPEA_RETRIEVER_VDMS"
entrypoint: sh -c 'sleep 30 && python retriever_vdms.py'
restart: unless-stopped
volumes:
diff --git a/VideoQnA/docker_image_build/build.yaml b/VideoQnA/docker_image_build/build.yaml
index 9fb5a752d4..8f000f7295 100644
--- a/VideoQnA/docker_image_build/build.yaml
+++ b/VideoQnA/docker_image_build/build.yaml
@@ -29,12 +29,12 @@ services:
dockerfile: comps/third_parties/clip/src/Dockerfile
extends: videoqna
image: ${REGISTRY:-opea}/embedding-multimodal-clip:${TAG:-latest}
- retriever-vdms:
+ retriever:
build:
context: GenAIComps
- dockerfile: comps/retrievers/vdms/langchain/Dockerfile
+ dockerfile: comps/retrievers/src/Dockerfile
extends: videoqna
- image: ${REGISTRY:-opea}/retriever-vdms:${TAG:-latest}
+ image: ${REGISTRY:-opea}/retriever:${TAG:-latest}
reranking:
build:
context: GenAIComps
diff --git a/VisualQnA/Dockerfile b/VisualQnA/Dockerfile
index ef6a2e2536..257b39df89 100644
--- a/VisualQnA/Dockerfile
+++ b/VisualQnA/Dockerfile
@@ -1,32 +1,49 @@
-
-
# Copyright (C) 2024 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
-FROM python:3.11-slim
+# Stage 1: base setup used by other stages
+FROM python:3.11-slim AS base
+
+# get security updates
+RUN apt-get update && apt-get upgrade -y && \
+ apt-get clean && rm -rf /var/lib/apt/lists/*
-RUN apt-get update -y && apt-get install -y --no-install-recommends --fix-missing \
- libgl1-mesa-glx \
- libjemalloc-dev \
- git
+ENV HOME=/home/user
RUN useradd -m -s /bin/bash user && \
- mkdir -p /home/user && \
- chown -R user /home/user/
+ mkdir -p $HOME && \
+ chown -R user $HOME
-WORKDIR /home/user/
-RUN git clone https://github.com/opea-project/GenAIComps.git
+WORKDIR $HOME
-WORKDIR /home/user/GenAIComps
-RUN pip install --no-cache-dir --upgrade pip setuptools && \
- pip install --no-cache-dir -r /home/user/GenAIComps/requirements.txt
-COPY ./visualqna.py /home/user/visualqna.py
+# Stage 2: latest GenAIComps sources
+FROM base AS git
+
+RUN apt-get update && apt-get install -y --no-install-recommends git
+RUN git clone --depth 1 https://github.com/opea-project/GenAIComps.git
+
-ENV PYTHONPATH=/home/user/GenAIComps
+# Stage 3: common layer shared by services using GenAIComps
+FROM base AS comps-base
+
+# copy just relevant parts
+COPY --from=git $HOME/GenAIComps/comps $HOME/GenAIComps/comps
+COPY --from=git $HOME/GenAIComps/*.* $HOME/GenAIComps/LICENSE $HOME/GenAIComps/
+
+WORKDIR $HOME/GenAIComps
+RUN pip install --no-cache-dir --upgrade pip setuptools && \
+ pip install --no-cache-dir -r $HOME/GenAIComps/requirements.txt
+WORKDIR $HOME
+
+ENV PYTHONPATH=$PYTHONPATH:$HOME/GenAIComps
USER user
-WORKDIR /home/user
+
+# Stage 4: unique part
+FROM comps-base
+
+COPY ./visualqna.py $HOME/visualqna.py
ENTRYPOINT ["python", "visualqna.py"]
diff --git a/docker_images_list.md b/docker_images_list.md
index dd934ae827..e487fef948 100644
--- a/docker_images_list.md
+++ b/docker_images_list.md
@@ -2,7 +2,7 @@
A list of released OPEA docker images in https://hub.docker.com/, contains all relevant images from the GenAIExamples, GenAIComps and GenAIInfra projects. Please expect more public available images in the future release.
-Take ChatQnA for example. ChatQnA is a chatbot application service based on the Retrieval Augmented Generation (RAG) architecture. It consists of [opea/embedding](https://hub.docker.com/r/opea/embedding), [opea/retriever-redis](https://hub.docker.com/r/opea/retriever-redis), [opea/reranking-tei](https://hub.docker.com/r/opea/reranking-tei), [opea/llm-textgen](https://hub.docker.com/r/opea/llm-textgen), [opea/dataprep-redis](https://hub.docker.com/r/opea/dataprep-redis), [opea/chatqna](https://hub.docker.com/r/opea/chatqna), [opea/chatqna-ui](https://hub.docker.com/r/opea/chatqna-ui) and [opea/chatqna-conversation-ui](https://hub.docker.com/r/opea/chatqna-conversation-ui) (Optional) multiple microservices. Other services are similar, see the corresponding README for details.
+Take ChatQnA for example. ChatQnA is a chatbot application service based on the Retrieval Augmented Generation (RAG) architecture. It consists of [opea/embedding](https://hub.docker.com/r/opea/embedding), [opea/retriever](https://hub.docker.com/r/opea/retriever-redis), [opea/reranking-tei](https://hub.docker.com/r/opea/reranking-tei), [opea/llm-textgen](https://hub.docker.com/r/opea/llm-textgen), [opea/dataprep-redis](https://hub.docker.com/r/opea/dataprep-redis), [opea/chatqna](https://hub.docker.com/r/opea/chatqna), [opea/chatqna-ui](https://hub.docker.com/r/opea/chatqna-ui) and [opea/chatqna-conversation-ui](https://hub.docker.com/r/opea/chatqna-conversation-ui) (Optional) multiple microservices. Other services are similar, see the corresponding README for details.
## Example images
@@ -44,7 +44,7 @@ Take ChatQnA for example. ChatQnA is a chatbot application service based on the
| ------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [opea/agent]() | [Link](https://github.com/opea-project/GenAIComps/blob/main/comps/agent/src/Dockerfile) | The docker image exposed the OPEA agent microservice for GenAI application use |
| [opea/asr](https://hub.docker.com/r/opea/asr) | [Link](https://github.com/opea-project/GenAIComps/blob/main/comps/asr/src/Dockerfile) | The docker image exposed the OPEA Audio-Speech-Recognition microservice for GenAI application use |
-| [opea/chathistory-mongo-server](https://hub.docker.com/r/opea/chathistory-mongo-server) | [Link](https://github.com/opea-project/GenAIComps/blob/main/comps/chathistory/mongo/Dockerfile) | The docker image exposes OPEA Chat History microservice which based on MongoDB database, designed to allow user to store, retrieve and manage chat conversations |
+| [opea/chathistory-mongo-server](https://hub.docker.com/r/opea/chathistory-mongo-server) | [Link](https://github.com/opea-project/GenAIComps/blob/main/comps/chathistory/src/Dockerfile) | The docker image exposes OPEA Chat History microservice which based on MongoDB database, designed to allow user to store, retrieve and manage chat conversations |
| [opea/dataprep-milvus](https://hub.docker.com/r/opea/dataprep-milvus) | [Link](https://github.com/opea-project/GenAIComps/blob/main/comps/dataprep/milvus/langchain/Dockerfile) | The docker image exposed the OPEA dataprep microservice based on milvus vectordb for GenAI application use |
| [opea/dataprep-multimodal-vdms](https://hub.docker.com/r/opea/dataprep-multimodal-vdms) | [Link](https://github.com/opea-project/GenAIComps/blob/main/comps/dataprep/vdms/multimodal_langchain/Dockerfile) | This docker image exposes an OPEA dataprep microservice based on a multi-modal VDMS for use by GenAI applications. |
| [opea/dataprep-multimodal-redis](https://hub.docker.com/r/opea/dataprep-multimodal-redis) | [Link](https://github.com/opea-project/GenAIComps/blob/main/comps/dataprep/redis/langchain/Dockerfile) | This docker image exposes an OPEA dataprep microservice based on a multi-modal redis for use by GenAI applications. |
@@ -78,20 +78,13 @@ Take ChatQnA for example. ChatQnA is a chatbot application service based on the
| [opea/lvm-llama-vision]() | [Link](https://github.com/opea-project/GenAIComps/blob/main/comps/lvms/src/integrations/dependency/llama-vision/Dockerfile) | The docker image exposed the OPEA microservice running LLaMA Vision as a large visual model (LVM) server for GenAI application use |
| [opea/lvm-predictionguard](https://hub.docker.com/r/opea/lvm-predictionguard) | [Link](https://github.com/opea-project/GenAIComps/blob/main/comps/lvms/src/integrations/dependency/predictionguard/Dockerfile) | The docker image exposed the OPEA microservice running PredictionGuard as a large visual model (LVM) server for GenAI application use |
| [opea/nginx](https://hub.docker.com/r/opea/nginx) | [Link](https://github.com/opea-project/GenAIComps/blob/main/comps/third_parties/nginx/src/Dockerfile) | The docker image exposed the OPEA nginx microservice for GenAI application use |
+| [opea/pathway](https://hub.docker.com/r/opea/vectorstore-pathway) | [Link](https://github.com/opea-project/GenAIComps/blob/main/comps/third_parties/pathway/src/Dockerfile) | The docker image exposed the OPEA Vectorstores microservice with Pathway for GenAI application use |
| [opea/promptregistry-mongo-server](https://hub.docker.com/r/opea/promptregistry-mongo-server) | [Link](https://github.com/opea-project/GenAIComps/blob/main/comps/prompt_registry/src/Dockerfile) | The docker image exposes the OPEA Prompt Registry microservices which based on MongoDB database, designed to store and retrieve user's preferred prompts |
| [opea/reranking]() | [Link](https://github.com/opea-project/GenAIComps/blob/main/comps/rerankings/src/Dockerfile) | The docker image exposed the OPEA reranking microservice based on tei docker image for GenAI application use |
-| [opea/retriever-milvus](https://hub.docker.com/r/opea/retriever-milvus) | [Link](https://github.com/opea-project/GenAIComps/blob/main/comps/retrievers/milvus/langchain/Dockerfile) | The docker image exposed the OPEA retrieval microservice based on milvus vectordb for GenAI application use |
-| [opea/retriever-pathway](https://hub.docker.com/r/opea/retriever-pathway) | [Link](https://github.com/opea-project/GenAIComps/blob/main/comps/retrievers/pathway/langchain/Dockerfile) | The docker image exposed the OPEA retrieval microservice with pathway for GenAI application use |
-| [opea/retriever-pgvector](https://hub.docker.com/r/opea/retriever-pgvector) | [Link](https://github.com/opea-project/GenAIComps/blob/main/comps/retrievers/pgvector/langchain/Dockerfile) | The docker image exposed the OPEA retrieval microservice based on pgvector vectordb for GenAI application use |
-| [opea/retriever-pinecone](https://hub.docker.com/r/opea/retriever-pinecone) | [Link](https://github.com/opea-project/GenAIComps/blob/main/comps/retrievers/pinecone/langchain/Dockerfile) | The docker image exposed the OPEA retrieval microservice based on pinecone vectordb for GenAI application use |
-| [opea/retriever-qdrant](https://hub.docker.com/r/opea/retriever-qdrant) | [Link](https://github.com/opea-project/GenAIComps/blob/main/comps/retrievers/qdrant/haystack/Dockerfile) | The docker image exposed the OPEA retrieval microservice based on qdrant vectordb for GenAI application use |
-| [opea/retriever-redis](https://hub.docker.com/r/opea/retriever-redis) | [Link](https://github.com/opea-project/GenAIComps/blob/main/comps/retrievers/redis/langchain/Dockerfile) | The docker image exposed the OPEA retrieval microservice based on redis vectordb for GenAI application use |
-| [opea/retriever-redis-llamaindex](https://hub.docker.com/r/opea/retriever-redis-llamaindex) | [Link](https://github.com/opea-project/GenAIComps/blob/main/comps/retrievers/redis/llama_index/Dockerfile) | The docker image exposed the OPEA retriever service based on LlamaIndex for GenAI application use |
-| [opea/retriever-vdms](https://hub.docker.com/r/opea/retriever-vdms) | [Link](https://github.com/opea-project/GenAIComps/blob/main/comps/retrievers/vdms/langchain/Dockerfile) | The docker image exposed the OPEA retriever service based on Visual Data Management System for GenAI application use |
+| [opea/retriever]() | [Link](https://github.com/opea-project/GenAIComps/blob/main/comps/retrievers/src/Dockerfile) | The docker image exposed the OPEA retrieval microservice based on milvus vectordb for GenAI application use |
| [opea/speecht5](https://hub.docker.com/r/opea/speecht5) | [Link](https://github.com/opea-project/GenAIComps/blob/main/comps/tts/src/integrations/dependency/speecht5/Dockerfile) | The docker image exposed the OPEA SpeechT5 service for GenAI application use |
| [opea/speecht5-gaudi](https://hub.docker.com/r/opea/speecht5-gaudi) | [Link](https://github.com/opea-project/GenAIComps/blob/main/comps/tts/src/integrations/dependency/speecht5/Dockerfile.intel_hpu) | The docker image exposed the OPEA SpeechT5 service on Gaudi2 for GenAI application use |
| [opea/tei-gaudi](https://hub.docker.com/r/opea/tei-gaudi/tags) | [Link](https://github.com/huggingface/tei-gaudi/blob/habana-main/Dockerfile-hpu) | The docker image powered by HuggingFace Text Embedding Inference (TEI) on Gaudi2 for deploying and serving Embedding Models |
-| [opea/vectorstore-pathway](https://hub.docker.com/r/opea/vectorstore-pathway) | [Link](https://github.com/opea-project/GenAIComps/blob/main/comps/vectorstores/pathway/Dockerfile) | The docker image exposed the OPEA Vectorstores microservice with Pathway for GenAI application use |
| [opea/lvm-video-llama](https://hub.docker.com/r/opea/lvm-video-llama) | [Link](https://github.com/opea-project/GenAIComps/blob/main/comps/lvms/src/integrations/dependency/video-llama/Dockerfile) | The docker image exposed the OPEA microservice running Video-Llama as a large visual model (LVM) server for GenAI application use |
| [opea/tts](https://hub.docker.com/r/opea/tts) | [Link](https://github.com/opea-project/GenAIComps/blob/main/comps/tts/src/Dockerfile) | The docker image exposed the OPEA Text-To-Speech microservice for GenAI application use |
| [opea/vllm](https://hub.docker.com/r/opea/vllm) | [Link](https://github.com/vllm-project/vllm/blob/main/Dockerfile.cpu) | The docker image powered by vllm-project for deploying and serving vllm Models |