Skip to content

Commit a5f41ea

Browse files
authored
Merge pull request #145 from AET-DevOps25/docs/finalize-arhictectures
Finalize architectures and readme
2 parents 9181255 + 681402b commit a5f41ea

File tree

8 files changed

+69
-8
lines changed

8 files changed

+69
-8
lines changed

README.md

Lines changed: 69 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,15 @@ The application is designed for home cooks, culinary enthusiasts, individuals wi
2424

2525
### Integration of Generative AI
2626

27-
Generative AI is integrated meaningfully through a dedicated LLM microservice developed in Python. This service processes user inputs in natural language, generates recipes based on the provided ingredients, modifies existing recipes according to user needs, and provides meal suggestions. The use of GenAI enhances the user experience by offering creative, context-aware, and highly adaptable culinary solutions.
27+
Generative AI is integrated meaningfully through a dedicated LLM microservice developed in Python. This service processes user inputs in natural language, generates recipes based on the provided ingredients, modifies existing recipes according to user needs, and provides meal suggestions based on the user dietary preferences. The use of GenAI enhances the user experience by offering a personalized RAG system that emphasizes user-specific recipe collections. Through the use of a conversational AI system, we provide to the users with a multi-turn chat with context preservation.
2828

2929
### Functional Scenarios
3030

3131
1. **Ingredient-Based Recipe Generation**: A user inputs, "Suggest a quick dinner recipe with chicken and broccoli." The system uses the LLM to generate a relevant recipe, which is presented to the user through the user interface.
3232

3333
2. **Recipe Modification**: A user submits a traditional recipe and requests, "Make this vegan." The LLM identifies non-vegan ingredients and substitutes them with plant-based alternatives, returning a modified version of the recipe.
3434

35-
3. **Meal Planning**: A user asks for a weekly meal plan. The LLM generates a diverse and nutritionally balanced plan, optionally based on dietary restrictions or cuisine preferences.
35+
3. **Meal Planning with User Preferences**: A user defines his/her dietary preferences in the web application and asks for a weekly meal plan in the chat. The LLM generates a diverse and nutritionally balanced plan, based on dietary restrictions or cuisine preferences.
3636

3737
4. **Ingredient-Limited Cooking**: A user specifies available ingredients, such as "eggs, spinach, and cheese," and the system suggests recipes that can be prepared using those ingredients, optimizing for simplicity and flavor.
3838

@@ -57,6 +57,7 @@ Generative AI is integrated meaningfully through a dedicated LLM microservice de
5757
- Login with GitLab LRZ SSO
5858
- Chat interface (user prompt + LLM response)
5959
- Preference settings (gluten-free, diabetic, vegan, etc.)
60+
- Recipe document upload
6061
- Recipe history viewer
6162

6263
### 2. Backend (Spring Boot REST API)
@@ -82,9 +83,9 @@ Generative AI is integrated meaningfully through a dedicated LLM microservice de
8283
**Responsibilities:**
8384

8485
- Process incoming prompts and preferences.
85-
- Use LLM (e.g., GPT via LangChain) to generate, modify, and plan recipes.
86+
- Use LLM (e.g., GPT via LangChain or Llama3) to generate, modify, and plan recipes.
87+
- Fetch additional data from a well known recipe source stored in the vector database Qdrant to enable document retrieval for answering recipe document based questions.
8688
- Structure outputs into JSON responses and provide endpoints via FastAPI for server module.
87-
- Fetch additional data from a well known recipe source stored in the vector database Qdrant.
8889

8990
**Design:**
9091

@@ -107,7 +108,7 @@ Generative AI is integrated meaningfully through a dedicated LLM microservice de
107108

108109
**Collections:**
109110

110-
- `recipes` – Stores embedded recipe documents which are uploaded by the user
111+
- `recipes` – Stores user specific embedded recipe documents which are uploaded by the user
111112

112113
### 6. DevOps
113114

@@ -135,7 +136,8 @@ Generative AI is integrated meaningfully through a dedicated LLM microservice de
135136
### Communication Flow Example
136137

137138
1. User logs in via GitLab LRZ → token returned.
138-
2. User types: _"Suggest a vegan dinner with lentils."_
139+
2. User select his/her didtary preferences.
140+
2. User types: _"Suggest a dinner with lentils."_
139141
3. React sends prompt + preferences to Spring Boot API.
140142
4. API calls GenAI microservice with combined data.
141143
5. GenAI returns structured recipe.
@@ -185,6 +187,48 @@ cd team-continuous-disappointment
185187

186188
### Server Setup
187189

190+
**Note**: Please be aware that you need to manually add the GITLAB_CLIENT_SECRET from the `.env` file (see [.env.template](.env.template)) to the [application.yaml](server/api-gw/src/main/resources/application.yaml) file for the field `client-secret` for local development.
191+
```bash
192+
spring:
193+
profiles:
194+
active: dev
195+
application:
196+
name: api-gw
197+
cloud:
198+
gateway:
199+
mvc:
200+
routes:
201+
- id: user
202+
uri: http://user-service:8081
203+
predicates:
204+
- Path=/user/**
205+
- id: chat
206+
uri: http://chat-service:8082
207+
predicates:
208+
- Path=/chat/**
209+
security:
210+
oauth2:
211+
resourceserver:
212+
opaquetoken:
213+
client-id: ${GITLAB_CLIENT_ID:60a9e442420a386f2ddff0f60ed0801dd7e826f0710507e982d5afe6aa054334}
214+
client-secret: -> PUT HERE <-
215+
introspection-uri: https://gitlab.lrz.de/oauth/introspect
216+
217+
218+
server:
219+
port: 8080
220+
221+
management:
222+
endpoints:
223+
web:
224+
exposure:
225+
include:
226+
- health
227+
- info
228+
- metrics
229+
- prometheus
230+
```
231+
188232
1. Navigate to the `server` directory:
189233
```bash
190234
cd server
@@ -286,7 +330,7 @@ The LLM service will be available at [http://localhost:8000](http://localhost:80
286330

287331
- Built with FastAPI for AI-powered recipe recommendations.
288332
- Integrates with local and cloud LLMs for generating suggestions based on the given ingredients.
289-
- Stores embedded documents in a vector database to be able to make similarity search.
333+
- Stores embedded documents in a vector database to be able to make similarity search and document retrieval.
290334
- Source code is in the `genai` directory.
291335
- Tests are in the `genai/tests` directory.
292336

@@ -510,7 +554,24 @@ API documentation is available in the [`genai/openapi.yaml`](genai/openapi.yaml)
510554
- Usability: The chat interface must be responsive and intuitive.
511555
- Observability & Monitoring: The system must expose Prometheus metrics for all critical services. Dashboards must be created in Grafana to visualize response latency, error rates, and user request volume. Besides that, at least one alert must be defined.
512556

513-
## Architecture Overview - TODO
557+
## Architecture Overview
558+
559+
### UML Component Diagram
560+
561+
The following UML component diagram shows the details of the RecipAI application architecture and provides a comprehensive overview of the interfaces offered by the genai, chat, user, and API gateway services.
562+
![Component Diagram](docs/architecture_diagrams/component_diagram.png)
563+
564+
### UML Class Diagram - Server
565+
The following UML class diagram shows the details of the RecipAI application server’s repository layer, service layer, and controller layer.
566+
![Server Class Diagram](docs/architecture_diagrams/server_class_diagram.png)
567+
568+
### UML Class Diagram - GenAI
569+
The following UML class diagram shows the details of the RecipAI GenAI module's repository layer, service layer, and controller layer.
570+
![GenAI Class Diagram](docs/architecture_diagrams/genai_class_diagram.png)
571+
572+
### UML Use Case Diagram
573+
The following UML use case diagram shows the use cases and the participating actors of the RecipAI web application.
574+
![Use Case Diagram](docs/architecture_diagrams/use_case_diagram.png)
514575
515576
## Monitoring and Observability
516577
-30 KB
Binary file not shown.
620 KB
Loading
-13.6 KB
Binary file not shown.
523 KB
Loading
790 KB
Loading
228 KB
Loading
-12.8 KB
Binary file not shown.

0 commit comments

Comments
 (0)