Skip to content

Commit 2042ef2

Browse files
committed
Update project metadata in pyproject.toml: rename to "rag-backend" and bump version to "2.2.0"
1 parent 57377e5 commit 2042ef2

19 files changed

Lines changed: 463 additions & 13930 deletions

File tree

README.md

Lines changed: 28 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,6 @@ The MCP server supports customizable documentation for its tools through environ
9898
- `MCP_CHAT_WITH_HISTORY_NOTES`: Additional notes about the tool
9999
- `MCP_CHAT_WITH_HISTORY_EXAMPLES`: Usage examples
100100

101-
102101
For further information on configuration and usage, please consult the [MCP Server README](./services/mcp-server/README.md).
103102

104103
#### 1.1.5 Frontend
@@ -124,28 +123,40 @@ For further information, please consult the [Libs README](./libs/README.md).
124123

125124
### 1.2 Requirements
126125

127-
> 📝 *Windows users*: make sure you use wsl for infrastructure setup & orchestration.
126+
> 📝 Windows users: make sure you use WSL for infrastructure setup & orchestration.
128127
129-
Every package contains a `pyproject.toml` with the required Python packages.
130-
[Poetry](https://python-poetry.org/) is used for requirement management.
131-
To ensure the requirements are consistent, you have to update the `poetry.lock` in addition to the `pyproject.toml` when updating/changing requirements. Additional requirements like *black* and *flake8* are provided for development. You can install them with `poetry install --with dev` inside the package-directory.
128+
Every package contains a `pyproject.toml` with the required Python packages. [Poetry](https://python-poetry.org/) is used for requirement management. To ensure the requirements are consistent, you have to update the `poetry.lock` in addition to the `pyproject.toml` when updating/changing requirements. Additional requirements like *black* and *flake8* are provided for development. You can install them with `poetry install --with dev` inside the package-directory.
132129

133130
> 📝 Do not update the requirements in the `pyproject.toml` manually. Doing so will invalidate the `poetry.lock`. Use the *poetry* application for this.
134131
132+
#### Directory-based local libraries (no local packages)
133+
134+
- Services do not install local libs as packages. Instead, containers set `PYTHONPATH` to include the service `src` and the needed `libs/*/src` folders.
135+
- During image builds, libs' third-party dependencies are installed with `poetry install --no-root` in each lib directory. The service is also installed with `--no-root`.
136+
- If you run services locally outside Docker, export `PYTHONPATH` accordingly, e.g. for rag-backend:
137+
138+
```bash
139+
export PYTHONPATH="services/rag-backend/src:libs/rag-core-api/src:libs/rag-core-lib/src:$PYTHONPATH"
140+
```
141+
142+
135143
#### Adding new requirements
136-
Run
144+
145+
Run:
146+
137147
```bash
138148
poetry add --lock <package>
139149
```
140-
insisde of the package directory in order to add new packages. This will automatically update the `pyproject.toml` and the `poetry.lock`.
150+
151+
inside of the package directory in order to add new packages. This will automatically update the `pyproject.toml` and the `poetry.lock`.
141152

142153
System requirements have to manually be added to the `Dockerfile`.
143154

144155
### 1.3 Usage
156+
145157
This example of the rag-template includes a WebUI for document-management, as well as for the chat.
146158

147-
After following the setup instruction for either the [local installation](#-local-setup-instructions) or the [installation on a server](#-Deployment-to-server) the WebUI is accessible via the configured ingress.
148-
After uploading a file in the document-management WebUI you can start asking question about your document in the chat WebUI.
159+
After following the setup instruction for either the [local installation](#14-local-setup-instructions) or the [installation on a server](#2-deployment-to-server) the WebUI is accessible via the configured ingress. After uploading a file in the document-management WebUI you can start asking question about your document in the chat WebUI.
149160

150161
For a complete documentation of the available REST-APIs, please consult [the libs README](./libs/README.md).
151162

@@ -182,17 +193,14 @@ STACKIT_EMBEDDER_API_KEY=...
182193
# or be created via the langfuse UI.
183194
LANGFUSE_PUBLIC_KEY=pk-lf-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
184195
LANGFUSE_SECRET_KEY=sk-lf-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
185-
186196
```
187197

188198
This results in a basic auth with username=`foo` and password=`bar`.
189199

190-
> 📝 NOTE: All values containing `...` are placeholders and have to be replaced with real values.
191-
> This deployment comes with multiple options. You change the `global.config.envs.rag_class_types.RAG_CLASS_TYPE_LLM_TYPE` in the helm-deployment to on of the following values:
200+
> 📝 NOTE: All values containing `...` are placeholders and have to be replaced with real values. This deployment comes with multiple options. You change the `global.config.envs.rag_class_types.RAG_CLASS_TYPE_LLM_TYPE` in the helm-deployment to one of the following values:
192201
>
193202
> - `stackit`: Uses an OpenAI compatible LLM, like the STACKIT model serving service.
194203
> - `ollama`: Uses ollama as an LLM provider.
195-
>
196204
197205
#### 1.4.1 Environment Variables Setup
198206

@@ -351,17 +359,15 @@ To connect the debugger, you can use the following `launch.json`:
351359
}
352360
```
353361

354-
The following will delete everything deployed with `tilt up` command
362+
The following will delete everything deployed with `tilt up` command:
355363

356364
```shell
357365
tilt down
358366
```
359367

360368
#### 1.4.4 Access via ingress
361369

362-
A detailed explanation of, how to access a service via ingress, can be found in the [infrastructure README](./infrastructure/README.md).
363-
364-
370+
A detailed explanation of how to access a service via ingress can be found in the [infrastructure README](./infrastructure/README.md).
365371

366372
## 2. Deployment to server
367373

@@ -371,7 +377,8 @@ The RAG template requires *at least*:
371377
- A Kubernetes Cluster
372378
- S3 ObjectStorage
373379

374-
Provided is an example Terraform script, using the [STACKIT Terrraform Provider](https://registry.terraform.io/providers/stackitcloud/stackit/latest/docs):
380+
Provided is an example Terraform script, using the [STACKIT Terraform Provider](https://registry.terraform.io/providers/stackitcloud/stackit/latest/docs):
381+
375382
```terraform
376383
resource "stackit_ske_project" "rag-ske" {
377384
project_id = var.stackit_project_id
@@ -421,18 +428,17 @@ resource "stackit_objectstorage_bucket" "docs" {
421428
}
422429
```
423430

424-
For further information please consult the [STACKIT Terrraform Provider documentation](https://registry.terraform.io/providers/stackitcloud/stackit/latest/docs).
431+
For further information please consult the [STACKIT Terraform Provider documentation](https://registry.terraform.io/providers/stackitcloud/stackit/latest/docs).
425432

426433
Further requirements for the server can be found in the [infrastructure README](./infrastructure/README.md).
427434

428435
### 2.2 Langfuse
429436

430437
A detailed description regarding the configuration of Langfuse can be found in the [infrastructure README](./infrastructure/README.md).
431438

432-
433439
## 3. Build and Test
434-
The example `Tiltfile` provides a triggered linting and testing.
435-
The linting-settings can be changed in the `services/rag-backend/pyproject.toml` file under section `tool.flake8`.
440+
441+
The example `Tiltfile` provides a triggered linting and testing. The linting-settings can be changed in the `services/rag-backend/pyproject.toml` file under section `tool.flake8`.
436442

437443
## 4. Contribution Guidelines
438444

Tiltfile

Lines changed: 53 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,15 @@ docker_build(
163163
sync(core_library_context+"/rag-core-lib", "/app/libs/rag-core-lib"),
164164
],
165165
dockerfile=backend_context + "/Dockerfile",
166-
ignore=["infrastructure/"],
166+
ignore=[
167+
"infrastructure/",
168+
"libs/admin-api-lib/",
169+
"libs/extractor-api-lib/",
170+
"services/admin-backend/",
171+
"services/document-extractor/",
172+
"services/mcp-server/",
173+
"services/frontend/",
174+
],
167175
)
168176

169177
# Add linter trigger
@@ -189,7 +197,7 @@ local_resource(
189197
################################## build mcp image and do live update ##################################################
190198
# NOTE: full image names should match the one in the helm chart values.yaml!
191199
registry = "ghcr.io/stackitcloud/rag-template"
192-
mcp_image_name = "rag-mcp"
200+
mcp_image_name = "mcp-server"
193201

194202
mcp_context = "./services/mcp-server"
195203
mcp_full_image_name = "%s/%s" % (registry, mcp_image_name)
@@ -203,7 +211,14 @@ docker_build(
203211
sync(mcp_context, "/app/services/mcp-server"),
204212
],
205213
dockerfile=mcp_context + "/Dockerfile",
206-
ignore=["infrastructure/"],
214+
ignore=[
215+
"infrastructure/",
216+
"libs/",
217+
"services/admin-backend/",
218+
"services/document-extractor/",
219+
"services/rag-backend/",
220+
"services/frontend/",
221+
],
207222
)
208223

209224
# Add linter trigger
@@ -238,7 +253,15 @@ docker_build(
238253
sync(core_library_context + "/admin-api-lib", "/app/libs/admin-api-lib"),
239254
],
240255
dockerfile=admin_backend_context + "/Dockerfile",
241-
ignore=["infrastructure/"],
256+
ignore=[
257+
"infrastructure/",
258+
"libs/rag-core-api/",
259+
"libs/extractor-api-lib/",
260+
"services/rag-backend/",
261+
"services/document-extractor/",
262+
"services/mcp-server/",
263+
"services/frontend/",
264+
],
242265
)
243266

244267
# Add linter trigger
@@ -282,7 +305,16 @@ docker_build(
282305
sync(core_library_context +"/extractor-api-lib", "/app/libs/extractor-api-lib"),
283306
],
284307
dockerfile=extractor_context + "/Dockerfile",
285-
ignore=["infrastructure/"],
308+
ignore=[
309+
"infrastructure/",
310+
"libs/rag-core-api/",
311+
"libs/rag-core-lib/",
312+
"libs/admin-api-lib/",
313+
"services/rag-backend/",
314+
"services/admin-backend/",
315+
"services/mcp-server/",
316+
"services/frontend/",
317+
],
286318
)
287319

288320
# Add linter trigger
@@ -318,7 +350,14 @@ docker_build(
318350
".",
319351
dockerfile="./services/frontend/apps/chat-app/Dockerfile",
320352
live_update=[sync("./services/frontend", "/usr/src/app")],
321-
ignore=["infrastructure/"],
353+
ignore=[
354+
"infrastructure/",
355+
"libs/",
356+
"services/admin-backend/",
357+
"services/document-extractor/",
358+
"services/mcp-server/",
359+
"services/rag-backend/",
360+
],
322361
)
323362

324363
########################################################################################################################
@@ -332,7 +371,14 @@ docker_build(
332371
".",
333372
dockerfile="services/frontend/apps/admin-app/Dockerfile",
334373
live_update=[sync("./services/frontend", "/usr/src/app")],
335-
ignore=["infrastructure/"],
374+
ignore=[
375+
"infrastructure/",
376+
"libs/",
377+
"services/admin-backend/",
378+
"services/document-extractor/",
379+
"services/mcp-server/",
380+
"services/rag-backend/",
381+
],
336382
)
337383

338384

infrastructure/rag/values.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ backend:
128128
port: 8080
129129

130130
pythonPathEnv:
131-
PYTHONPATH: src
131+
PYTHONPATH: "/app/services/rag-backend/src:/app/libs/rag-core-api/src:/app/libs/rag-core-lib/src"
132132

133133
ingress:
134134
enabled: true
@@ -297,7 +297,7 @@ adminBackend:
297297
port: 8080
298298

299299
pythonPathEnv:
300-
PYTHONPATH: src
300+
PYTHONPATH: "/app/services/admin-backend/src:/app/libs/admin-api-lib/src:/app/libs/rag-core-lib/src"
301301

302302
ingress:
303303
enabled: true
@@ -371,7 +371,7 @@ extractor:
371371
port: 8080
372372

373373
pythonPathEnv:
374-
PYTHONPATH: src
374+
PYTHONPATH: "/app/services/document-extractor/src:/app/libs/extractor-api-lib/src"
375375

376376
adminFrontend:
377377
name: admin-frontend

0 commit comments

Comments
 (0)