|
7 | 7 |
|
8 | 8 | Introduction for the architecture of this solution pattern. |
9 | 9 |
|
| 10 | +[#challenges] |
10 | 11 | == Common Challenges |
11 | 12 |
|
| 13 | +This solution pattern address the following challenges: |
| 14 | + |
| 15 | +- Integrating private knowledge into a generative AI workflow. |
| 16 | + |
| 17 | +- Capturing and syncronizing near real-time stock exchange data makes periodic fine tuning |
| 18 | +of LLMs prohibitive. |
| 19 | + |
| 20 | +- Exposing private data sources via externally hosted API services Hosting AI services raises security |
| 21 | +and privacy concerns for most enterprises. |
| 22 | + |
12 | 23 | [#tech_stack] |
13 | 24 | == Technology Stack |
14 | 25 |
|
15 | 26 | // Change links and text here as you see fit. |
16 | | -* Red Hat supported products |
| 27 | +* Red Hat supported products: |
17 | 28 | ** https://www.redhat.com/en/technologies/cloud-computing/openshift[Red Hat OpenShift] |
18 | | -** Red Hat Application Foundation |
19 | | -*** https://access.redhat.com/products/quarkus[Quarkus] |
20 | | -*** https://www.redhat.com/en/technologies/cloud-computing/openshift/openshift-streams-for-apache-kafka[Kafka Streams] |
| 29 | +*** https://https://developers.redhat.com/products/openshift-dev-spaces/overview[Red Hat Openshift Dev Spaces] |
| 30 | +** https://access.redhat.com/products/red-hat-application-foundations[Red Hat Application Foundation] |
| 31 | +*** https://docs.redhat.com/en/documentation/red_hat_build_of_apache_camel/4.0[Red Hat build of Apache Camel] (included |
| 32 | +with Red Hat Application Foundation) |
21 | 33 | * Other open source products: |
22 | | -** https://www.postgresql.org/[PostgreSQL database] |
23 | | -** https://helm.sh/[Helm] |
| 34 | +** https://weaviate.io/[Weaviate vector database] |
| 35 | +** https://ollama.com/[Ollama Model Server and model files] |
| 36 | +** https://https://huggingface.co/gradio[Gradio] |
24 | 37 |
|
25 | 38 |
|
26 | 39 | [#in_depth] |
27 | 40 | == An in-depth look at the solution's architecture |
28 | 41 |
|
29 | | -Technical description including all or some of the following: architecture ir ed diagrams. In-depth details of the decisions made and solutions used. Description of each service and what it is used for. Description of any integration. |
30 | | - |
31 | | -=== Using images |
32 | | - |
33 | | -image::red_hat_open-hybrid-cloud.png[width=30%] |
| 42 | +A closer look at the services and components that make up this solution pattern. |
34 | 43 |
|
35 | | -{empty} |
36 | | - |
37 | | -=== Embedding HTML |
38 | | - |
39 | | -++++ |
40 | | - <br> |
41 | | - <h3> Embed HTML by surrounding it with with four +s before and after. </h3> |
42 | | - <span>View the ascii doc to learn more</span> |
43 | | - <br> |
44 | | -++++ |
| 44 | +=== Data Flow |
45 | 45 |
|
| 46 | +image::dataflow.jpg[width=100%] |
46 | 47 |
|
47 | | -=== Different decorators |
| 48 | +==== Ingest Engine |
| 49 | +Data flow begins at the source with stock information made available |
| 50 | +via a RESTful API service hosted by Alpha Vantage. The ingest engine consisting |
| 51 | +of two Camel services takes care of keeping data fresh in the Weaviate |
| 52 | +vector database. The ingest processes are highly configurable and perform |
| 53 | +filtering and discarding of invalid or null data. As stock symbol information is |
| 54 | +read in, vector embeddings are generated and stored in the Weaviate vector database along |
| 55 | +with the financial entities for each stock symbol. An example json record is available |
| 56 | +in the https://www.alphavantage.co/query?function=OVERVIEW&symbol=IBM&apikey=demo[AlphaVantage API documentation]. |
48 | 57 |
|
49 | | -[TIP] |
50 | | -==== |
51 | | -This is a Tip |
52 | | -==== |
| 58 | +==== Vector Database |
| 59 | +The vector database used is Weaviate. Weaviate is a highly performant and scalable open-source vector database |
| 60 | +that simplifies the development of AI applications. Built-in vector and hybrid search, easy-to-connect machine |
| 61 | +learning models, and a focus on data privacy enable developers of all levels to build, iterate, and scale AI |
| 62 | +capabilities faster. |
53 | 63 |
|
54 | | -[NOTE] |
55 | | -==== |
56 | | -This is a NOTE |
57 | | -==== |
| 64 | +==== Machine Learning (ML) models |
| 65 | +This solution pattern makes use of two ML models, an enbeddings model (`all-minilm`) and an LLM (`granite3-dense:8b`) |
| 66 | +which is configurable at run time. The enbeddings model is used to generate vector embeddings for each stock symbol and |
| 67 | +the LLM summarizes the stock information. Granite a series of LLMs developed by IBM, specifically designed |
| 68 | +for enterprise applications, focusing on business use cases like code generation, summarization, and classification, |
| 69 | +with a strong emphasis on security and data privacy, all while being open-source under the Apache 2.0 license. |
58 | 70 |
|
59 | | -[WARNING] |
60 | | -==== |
61 | | -This is a WARNING |
62 | | -==== |
63 | 71 |
|
64 | | -[IMPORTANT] |
65 | | -==== |
66 | | -This is IMPORTANT |
67 | | -==== |
| 72 | +image::rag-architecture.jpg[width=100%] |
68 | 73 |
|
| 74 | +{empty} |
69 | 75 |
|
70 | | -=== Creating tables |
71 | | - |
72 | | -[cols="1a,1a,1a"] |
73 | | -|=== |
74 | | -| *Column A* | Column *A* | _Column C_ |
75 | | -| |
76 | | -* Lorem Ipsum |
77 | | -* Lorem Ipsum |
78 | | - |
79 | | -| |
80 | | -* Lorem Ipsum |
81 | | -* Lorem Ipsum |
82 | | - |
83 | | -| |
84 | | -* Lorem Ipsum |
85 | | -* Lorem Ipsum |
86 | | -|=== |
| 76 | +=== Architecture |
87 | 77 |
|
| 78 | +=== Ingest Engine |
88 | 79 |
|
| 80 | +==== Weaviate vector database |
| 81 | +The Weaviate vector database is installed using the helm installer which allows for enterprise features to be enabled including |
| 82 | +API key token authentication and data sharding. Weaviate's cloud-native design supports horizontal scaling and efficient resource consumption, |
| 83 | +allowing it to handle large volumes of data and user requests easily. Interested readers are encouraged to find out more |
| 84 | +about https://www.redhat.com/en/blog/building-powerful-applications-weaviate-and-red-hat-openshift-retrieval-augmented-generation-workflow[the benefits of hosting Weaviate on Openshift]. |
89 | 85 |
|
90 | | -=== Content that can be copied |
| 86 | +==== Ollama Model Server |
| 87 | +https://github.com/ollama/ollama[Ollama] is a popular and easy to use platform to host and serve LLMs. It supports a number of |
| 88 | +operating systems and provides good integration and compatibility with the open source ecosystem including Weaviate. Ollama |
| 89 | +is deployed on Openshift using a https://github.com/openshift/source-to-image[standard source-to-image workflow]. Details |
| 90 | +can be found in this repository. |
91 | 91 |
|
92 | | -Click below to copy the content |
93 | | -[.console-input] |
94 | | -[source,shell script] |
95 | | ----- |
96 | | -oc version #openshift cli client |
97 | | -oc login --token=<token> --server=<server> |
98 | | ----- |
| 92 | +==== User Interface |
| 93 | +The UI is written in Python using the Gradio framework and is deployed using Openshift source-to-image workflow. |
| 94 | +Example queries are presented to the user as pushbuttons to perform semantic |
| 95 | +and generative queries. Users may also enter custom queries and prompts. |
99 | 96 |
|
| 97 | +==== Developer IDE |
| 98 | +Provided by Red Hat Openshift DevSpaces, this IDE allows developers to work with the codebase and test their changes |
| 99 | +in a live environment. |
100 | 100 |
|
101 | 101 | [#more_tech] |
102 | 102 | == About the Technology Stack |
103 | 103 |
|
104 | | -If you want to include more details about the tech stack you used, this is the place. |
| 104 | +https://weaviate.io/[Weaviate] is an open-source vector database that makes it easy to build AI applications. |
| 105 | +https://ollama.com/[Ollama] is a popular and easy to use platform to host and serve LLMs. |
0 commit comments