Skip to content

Commit

Permalink
Documentation README update for ProductivitySuite example (opea-proje…
Browse files Browse the repository at this point in the history
…ct#863)

Signed-off-by: Yeoh, Hoong Tee <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
hteeyeoh and pre-commit-ci[bot] authored Sep 23, 2024
1 parent 3fb6060 commit 6f4b00f
Show file tree
Hide file tree
Showing 5 changed files with 103 additions and 65 deletions.
40 changes: 28 additions & 12 deletions ProductivitySuite/README.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,39 @@
# OPEA Productivity Suite Application
# Productivity Suite Application

OPEA Productivity Suite streamlines your workflow to boost productivity. It leverages the OPEA microservices to provide a comprehensive suite of features to cater to the diverse needs of modern enterprises.
Productivity Suite, a tool designed to streamline your workflow and boost productivity! Our application leverages the power of OPEA microservices to deliver a comprehensive suite of features tailored to meet the diverse needs of modern enterprises.

## Key Features
---

- Chat with Documents: Engage in intelligent conversations with your documents using our advanced RAG Capabilities. Our Retrieval-Augmented Generation (RAG) model allows you to ask questions, receive relevant information, and gain insights from your documents in real-time.
## 🛠️ Key Features

- Content Summarization: Save time and effort by automatically summarizing lengthy documents or articles, enabling you to quickly grasp the key takeaways.
### 💬 Chat with Documents

- FAQ Generation: Effortlessly create comprehensive FAQs based on your documents, ensuring that your users have access to the information they need.
Engage in intelligent conversations with your documents using our advanced **Retrieval-Augmented Generation (RAG)** capabilities. Ask questions, receive relevant information, and gain insights from your documents in real-time!

- Code Generation: Boost your coding productivity with our code generation feature. Simply provide a description of the functionality you require, and the application will generate the corresponding code snippets, saving you valuable time and effort.
### 📄 Content Summarization

- User Context Management: Maintain a seamless workflow by managing your user's context within the application. Our context management system keeps track of your documents and chat history, allowing for personalized experiences.
Summarize lengthy documents or articles, enabling you to grasp key takeaways quickly. Save time and effort with our intelligent summarization feature!

- Identity and access management: uses the open source platform Keycloak for single sign-on identity and access management.
### ❓ FAQ Generation

Refer to the [Keycloak Configuration Guide](./docker_compose/intel/cpu/xeon/keycloak_setup_guide.md) for instructions to setup Keycloak.
Effortlessly create comprehensive FAQs based on your documents. Ensure your users have access to the information they need with minimal effort!

Refer to the [Xeon Guide](./docker_compose/intel/cpu/xeon/README.md) for instructions to build docker images from source and running the application via docker compose.
### 💻 Code Generation

Refer to the [Xeon Kubernetes Guide](./kubernetes/intel/README.md) for instructions to deploy the application via kubernetes.
Boost your coding productivity by providing a description of the functionality you require. Our application generates corresponding code snippets, saving you valuable time and effort!

### 🎛️ User Context Management

Maintain a seamless workflow by managing your user's context within the application. Our context management system keeps track of documents and chat history for a personalized experience.

### 🔐 Identity and Access Management

Utilizes the open-source platform **Keycloak** for single sign-on identity and access management. This ensures secure and convenient access to your productivity tools.

---

## 📚 Setup Guide

- **[Keycloak Configuration Guide](./docker_compose/intel/cpu/xeon/keycloak_setup_guide.md)**: Instructions to set up Keycloak for identity and access management.
- **[Xeon Guide](./docker_compose/intel/cpu/xeon/README.md)**: Instructions to build Docker images from source and run the application via Docker Compose.
- **[Xeon Kubernetes Guide](./kubernetes/intel/README.md)**: Instructions to deploy the application via Kubernetes.
76 changes: 42 additions & 34 deletions ProductivitySuite/docker_compose/intel/cpu/xeon/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

This document outlines the deployment process for OPEA Productivity Suite utilizing the [GenAIComps](https://github.com/opea-project/GenAIComps.git) microservice pipeline on Intel Xeon server and [GenAIExamples](https://github.com/opea-project/GenAIExamples.git) solutions. The steps include Docker image creation, container deployment via Docker Compose, and service execution to integrate microservices such as `embedding`, `retriever`, `rerank`, and `llm`. We will publish the Docker images to Docker Hub soon, it will simplify the deployment process for this service.

## 🚀 Build Docker Images
---

## 🐳 Build Docker Images

First of all, you need to build Docker Images locally and install the python package of it.

Expand Down Expand Up @@ -38,15 +40,12 @@ docker build --no-cache -t opea/llm-tgi:latest --build-arg https_proxy=$https_pr

```bash
docker build --no-cache -t opea/dataprep-redis:latest --build-arg https_proxy=$https_proxy --build-arg http_proxy=$http_proxy -f comps/dataprep/redis/langchain/Dockerfile .

```

### 6. Build Prompt Registry Image

```bash
docker build -t opea/promptregistry-mongo-server:latest --build-arg https_proxy=$https_proxy --build-arg http_proxy=$http_proxy -f comps/prompt_registry/mongo/Dockerfile .


```

### 7. Build Chat History Image
Expand Down Expand Up @@ -100,6 +99,8 @@ cd GenAIExamples/ProductivitySuite/ui
docker build --no-cache -t ProductivitySuite/docker_compose/intel/cpu/xeon/compose.yaml docker/Dockerfile.react .
```

---

## 🚀 Start Microservices

### Setup Environment Variables
Expand Down Expand Up @@ -184,17 +185,19 @@ Note: Please replace with `host_ip` with you external IP address, do not use loc
```bash
cd GenAIExamples/ProductivitySuite/docker_compose/intel/cpu/xeon
```

```bash
docker compose -f compose.yaml up -d
```

### Setup Keycloak
---

### 🔐 Setup Keycloak

Please refer to **[keycloak_setup_guide](keycloak_setup_guide.md)** for more detail related to Keycloak configuration setup.

Please refer to [keycloak_setup_guide](keycloak_setup_guide.md) for more detail related to Keycloak configuration setup.
---

### Validate Microservices
### Validate Microservices

1. TEI Embedding Service

Expand Down Expand Up @@ -474,6 +477,8 @@ Please refer to [keycloak_setup_guide](keycloak_setup_guide.md) for more detail
"user": "test", "id":"{Conversation id to Delete}"}'
```

---

## 🚀 Launch the UI

To access the frontend, open the following URL in your browser: http://{host_ip}:5174. By default, the UI runs on port 80 internally. If you prefer to use a different host port to access the frontend, you can modify the port mapping in the `compose.yaml` file as shown below:
Expand All @@ -490,57 +495,60 @@ Here is an example of running Productivity Suite
![project-screenshot](../../../../assets/img/chat_qna_init.png)
![project-screenshot](../../../../assets/img/Login_page.png)

## 🧐 Features
---

## 🛠️ Key Features

Here're some of the project's features:

### CHAT QNA
### 💬ChatQnA

- Start a Text Chat:Initiate a text chat with the ability to input written conversations, where the dialogue content can also be customized based on uploaded files.
- Context Awareness: The AI assistant maintains the context of the conversation, understanding references to previous statements or questions. This allows for more natural and coherent exchanges.
- **Start a Text Chat**:Initiate a text chat with the ability to input written conversations, where the dialogue content can also be customized based on uploaded files.
- **Context Awareness**: The AI assistant maintains the context of the conversation, understanding references to previous statements or questions. This allows for more natural and coherent exchanges.

### DATA SOURCE
### 🎛️ Data Source

- The choice between uploading locally or copying a remote link. Chat according to uploaded knowledge base.
- Uploaded File would get listed and user would be able add or remove file/links
- **File Upload or Remote Link**: The choice between uploading locally or copying a remote link. Chat according to uploaded knowledge base.
- **File Management**:Uploaded File would get listed and user would be able add or remove file/links

#### Screen Shot
#### Screenshots

![project-screenshot](../../../../assets/img/data_source.png)

- Clear: Clear the record of the current dialog box without retaining the contents of the dialog box.
- Chat history: Historical chat records can still be retained after refreshing, making it easier for users to view the context.
- Conversational Chat : The application maintains a history of the conversation, allowing users to review previous messages and the AI to refer back to earlier points in the dialogue when necessary.
- **Clear Chat**: Clear the record of the current dialog box without retaining the contents of the dialog box.
- **Chat history**: Historical chat records can still be retained after refreshing, making it easier for users to view the context.
- **Conversational Chat**: The application maintains a history of the conversation, allowing users to review previous messages and the AI to refer back to earlier points in the dialogue when necessary.

#### Screen Shots
#### Screenshots

![project-screenshot](../../../../assets/img/chat_qna_init.png)
![project-screenshot](../../../../assets/img/chatqna_with_conversation.png)

### CODEGEN
### 💻 Codegen

- **Generate code**: generate the corresponding code based on the current user's input.
- Generate code: generate the corresponding code based on the current user's input.
#### Screenshots
Screen Shot
![project-screenshot](../../../../assets/img/codegen.png)
![project-screenshot](../../../../assets/img/codegen.png)
### DOC SUMMARY
### 📚 Document Summarization
- Summarizing Uploaded Files: Upload files from their local device, then click 'Generate Summary' to summarize the content of the uploaded file. The summary will be displayed on the 'Summary' box.
- Summarizing Text via Pasting: Paste the text to be summarized into the text box, then click 'Generate Summary' to produce a condensed summary of the content, which will be displayed in the 'Summary' box on the right.
- Scroll to Bottom: The summarized content will automatically scroll to the bottom.
- **Summarizing Uploaded Files**: Upload files from their local device, then click 'Generate Summary' to summarize the content of the uploaded file. The summary will be displayed on the 'Summary' box.
- **Summarizing Text via Pasting**: Paste the text to be summarized into the text box, then click 'Generate Summary' to produce a condensed summary of the content, which will be displayed in the 'Summary' box on the right.
- **Scroll to Bottom**: The summarized content will automatically scroll to the bottom.
#### Screen Shot
#### Screenshots
![project-screenshot](../../../../assets/img/doc_summary_paste.png)
![project-screenshot](../../../../assets/img/doc_summary_file.png)
### FAQ Generator
### FAQ Generator
- Generate FAQs from Text via Pasting: Paste the text to into the text box, then click 'Generate FAQ' to produce a condensed FAQ of the content, which will be displayed in the 'FAQ' box below.
- **Generate FAQs from Text via Pasting**: Paste the text to into the text box, then click 'Generate FAQ' to produce a condensed FAQ of the content, which will be displayed in the 'FAQ' box below.
- Generate FAQs from Text via txt file Upload: Upload the file in the Upload bar, then click 'Generate FAQ' to produce a condensed FAQ of the content, which will be displayed in the 'FAQ' box below.
- **Generate FAQs from Text via txt file Upload**: Upload the file in the Upload bar, then click 'Generate FAQ' to produce a condensed FAQ of the content, which will be displayed in the 'FAQ' box below.
#### Screen Shot
#### Screenshots
![project-screenshot](../../../../assets/img/faq_generator.png)
Original file line number Diff line number Diff line change
@@ -1,21 +1,27 @@
# Keycloak Configuration Setup
# 🔐 Keycloak Configuration Setup

This document show you step-by-step how to configure Keycloak settings.
This README document provides a comprehensive, step-by-step guide on how to configure **Keycloak** settings. The user management is facilitated via Keycloak, and the configuration is outlined below:

The user management is done via Keycloak and the configuration steps look like this:

1. Access the Keycloak admin console via url http:${host_ip}:8080 or endpoint that exposed from your kubernetes cluster to configure user. Use default username(admin) and password(admin) to login.
1. Access the Keycloak admin console via url http:${host_ip}:8080 or endpoint that is exposed from your Kubernetes cluster to configure users. Use the default username(**admin**) and password(**admin**) to login.
![project-screenshot](../../../../assets/img/keycloak_login.png)

2. Create a new realm named **productivitysuite** within Keycloak.
![project-screenshot](../../../../assets/img/create_realm.png)

![project-screenshot](../../../../assets/img/create_productivitysuite_realm.png)

3. Create a new client called **productivitysuite** with default configurations.
![project-screenshot](../../../../assets/img/create_client.png)
4. Select the **productivitysuite** client that created just now. Insert your ProductivitySuite UI url endpoint into "Valid redirect URIs" and "Web origins" field. Example as screenshot below:

4. Select the **productivitysuite** client that you just created. Insert your ProductivitySuite UI url endpoint into **"Valid redirect URIs"** and **"Web origins"** field. Refer to screenshot below as an example:
![project-screenshot](../../../../assets/img/productivitysuite_client_settings.png)
5. From the left pane select the Realm roles and create a new role name as user and another new role as viewer.

5. From the left pane, select the Realm roles and create a new role named **user** and another new role as **viewer**.
![project-screenshot](../../../../assets/img/create_roles.png)
6. Create a new user name as for example mary and another user as bob. Set passwords for both users (set 'Temporary' to 'Off'). Select Role mapping on the top, assign the user role to mary and assign the viewer role to bob.

6. Create a new user named, for example, **mary** and another user as **bob**. Set passwords for both users (set **'Temporary'** to **'Off'**).Select **Role mapping** on the top, assign the user role to mary and assign the viewer role to bob.
![project-screenshot](../../../../assets/img/create_users.png)

![project-screenshot](../../../../assets/img/set_user_password.png)

![project-screenshot](../../../../assets/img/user_role_mapping.png)
28 changes: 18 additions & 10 deletions ProductivitySuite/kubernetes/intel/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Deploy ProductivitySuite with ReactUI
# 🚀 Deploy ProductivitySuite with ReactUI

The document outlines the deployment steps for ProductivitySuite via Kubernetes cluster while utilizing the [GenAIComps](https://github.com/opea-project/GenAIComps.git) microservice pipeline components and ReactUI, a popular React-based user interface library.

Expand All @@ -16,12 +16,14 @@ In ProductivitySuite, it consists of following pipelines/examples and components
- keycloak
```

## Prerequisites for Deploying ProductivitySuite with ReactUI
---

## ⚠️ Prerequisites for Deploying ProductivitySuite with ReactUI
To begin with, ensure that you have following prerequisites in place:

1. Kubernetes installation: Make sure that you have Kubernetes installed.
2. Images: Make sure you have all the images ready for the examples and components stated above. You may refer to [README](../../docker_compose/intel/cpu/xeon/README.md) for steps to build the images.
3. Configuration Values: Set the following values in all the yaml files before proceeding with the deployment:
1. Kubernetes installation: Make sure that you have Kubernetes installed.
2. 🐳 Images: Make sure you have all the images ready for the examples and components stated above. You may refer to [README](../../docker_compose/intel/cpu/xeon/README.md) for steps to build the images.
3. 🔧 Configuration Values: Set the following values in all the yaml files before proceeding with the deployment:

a. HUGGINGFACEHUB_API_TOKEN (Your HuggingFace token to download your desired model from HuggingFace):
```
Expand All @@ -42,20 +44,26 @@ To begin with, ensure that you have following prerequisites in place:
# Look for ENDPOINT in the yaml and insert all the url endpoint for all the required backend service.
```
4. MODEL_ID and model-volume (OPTIONAL): You may as well customize the "MODEL_ID" to use different model and model-volume for the volume to be mounted.
4. MODEL_ID and model-volume **(OPTIONAL)**: You may as well customize the "MODEL_ID" to use different model and model-volume for the volume to be mounted.
5. After finish with steps above, you can proceed with the deployment of the yaml file.
## Deploying ProductivitySuite
---
## 🌐 Deploying ProductivitySuite
You can use yaml files in xeon folder to deploy ProductivitySuite with reactUI.
```
cd GenAIExamples/ProductivitySuite/kubernetes/intel/cpu/xeon/manifests/
kubectl apply -f *.yaml
```
## User Management via Keycloak Configuration
Please refer to [keycloak_setup_guide](../../docker_compose/intel/cpu/xeon/keycloak_setup_guide.md) for more detail related to Keycloak configuration setup.
---
## 🔐 User Management via Keycloak Configuration
Please refer to **[keycloak_setup_guide](../../docker_compose/intel/cpu/xeon/keycloak_setup_guide.md)** for more detail related to Keycloak configuration setup.
---
## Verify Services
## Verify Services
To verify the installation, run command 'kubectl get pod' to make sure all pods are running.
To view all the available services, run command 'kubectl get svc' to obtain ports that need to used as backend service endpoint in productivity_suite_reactui.yaml.
Expand Down
2 changes: 1 addition & 1 deletion supported_examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -190,4 +190,4 @@ FAQ Generation Application leverages the power of large language models (LLMs) t

### ProductivitySuite

[Productivity Suite](./ProductivitySuite/README.md) streamlines your workflow to boost productivity. It leverages the OPEA microservices to provide a comprehensive suite of features to cater to the diverse needs of modern enterprises.
[Productivity Suite](./ProductivitySuite/README.md) streamlines your workflow to boost productivity. It leverages the power of OPEA microservices to deliver a comprehensive suite of features tailored to meet the diverse needs of modern enterprises.

0 comments on commit 6f4b00f

Please sign in to comment.