Skip to content

Commit a732b90

Browse files
committed
Merge branch 'deps-main' into fix/stackit-embedder
2 parents 5bd7277 + e77c29b commit a732b90

32 files changed

Lines changed: 606 additions & 397 deletions

File tree

.devcontainer/Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ ARG DEBIAN_FRONTEND=noninteractive
44
ARG USER=vscode
55

66
RUN DEBIAN_FRONTEND=noninteractive \
7-
&& apt-get update \
7+
&& apt-get update \
88
&& apt-get install -y build-essential --no-install-recommends make \
99
ca-certificates \
1010
git \
@@ -27,7 +27,7 @@ RUN DEBIAN_FRONTEND=noninteractive \
2727
# Python and poetry installation
2828
USER $USER
2929
ARG HOME="/home/$USER"
30-
ARG PYTHON_VERSION=3.11
30+
ARG PYTHON_VERSION=3.13
3131

3232
ENV PYENV_ROOT="${HOME}/.pyenv"
3333
ENV PATH="${PYENV_ROOT}/shims:${PYENV_ROOT}/bin:${HOME}/.local/bin:$PATH"
@@ -40,4 +40,4 @@ RUN echo "done 0" \
4040
&& pyenv global ${PYTHON_VERSION} \
4141
&& echo "done 3" \
4242
&& curl -sSL https://install.python-poetry.org | python3 - \
43-
&& poetry config virtualenvs.in-project true
43+
&& poetry config virtualenvs.in-project true

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ The template supports multiple LLM (Large Language Model) providers, such as STA
3838

3939

4040
## 1. Getting Started
41-
A [`Tiltfile`](./Tiltfile) is provided to get you started :rocket:. If Tilt is new for you, and you want to learn more about it, please take a look at the [Tilt guides](https://docs.tilt.dev/tiltfile_authoring).
41+
A [`Tiltfile`](./Tiltfile) is provided to get you started :rocket:. If Tilt is new for you, and you want to learn more about it, please take a look at the [Tilt guides](https://docs.tilt.dev/tiltfile_authoring.html).
4242

4343
### 1.1 Components
4444

infrastructure/rag/Chart.lock

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
dependencies:
22
- name: langfuse
33
repository: https://langfuse.github.io/langfuse-k8s
4-
version: 0.13.1
4+
version: 1.3.4
55
- name: qdrant
66
repository: https://qdrant.github.io/qdrant-helm
77
version: 1.15.0
@@ -14,5 +14,5 @@ dependencies:
1414
- name: ollama
1515
repository: https://otwld.github.io/ollama-helm/
1616
version: 1.24.0
17-
digest: sha256:5d274ff927bf767fd41057275293a1751fd0f7834d7499d2b3345eb0f433335b
18-
generated: "2025-07-31T08:32:30.614652929Z"
17+
digest: sha256:30cc964388864bd738eb0668367576dbad45eb9d6a885cdc48ef7c07c9692aa0
18+
generated: "2025-08-04T09:23:39.885193+02:00"

infrastructure/rag/Chart.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ appVersion: "1.0.0"
1010
dependencies:
1111
- name: langfuse
1212
repository: https://langfuse.github.io/langfuse-k8s
13-
version: "0.13.1"
13+
version: "1.3.4"
1414
condition: features.langfuse.enabled
1515
- name: qdrant
1616
version: 1.15.0
@@ -21,6 +21,7 @@ dependencies:
2121
version: "15.0.7"
2222
condition: features.minio.enabled
2323
- name: keydb
24+
alias: keydb
2425
repository: https://enapter.github.io/charts/
2526
version: "0.48.0"
2627
condition: features.keydb.enabled

infrastructure/rag/values.yaml

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -477,6 +477,7 @@ langfuse:
477477
repository: langfuse/langfuse-worker
478478
tag: "3.88.1"
479479
pullPolicy: Always
480+
port: 3030
480481

481482
# NextAuth configuration
482483
nextauth:
@@ -548,6 +549,22 @@ langfuse:
548549
url: "clickhouse://rag-clickhouse:9000"
549550
ssl: false
550551
autoMigrate: true
552+
resources:
553+
limits:
554+
cpu: "2"
555+
memory: "8Gi"
556+
requests:
557+
cpu: "2"
558+
memory: "4Gi"
559+
560+
zookeeper:
561+
resources:
562+
limits:
563+
cpu: "2"
564+
memory: "2Gi"
565+
requests:
566+
cpu: "1"
567+
memory: "1Gi"
551568

552569
# S3/MinIO Configuration (external MinIO)
553570
s3:
@@ -588,10 +605,6 @@ minio:
588605
enabled: false
589606
mode: standalone
590607

591-
592-
593-
594-
595608
ollama:
596609
image:
597610
tag: 0.5.1
@@ -607,3 +620,8 @@ ollama:
607620
qdrant:
608621
image:
609622
tag: v1.14.1
623+
624+
keydb:
625+
multiMaster: "no"
626+
activeReplicas: "no"
627+
nodes: 1

libs/README.md

Lines changed: 19 additions & 15 deletions
Large diffs are not rendered by default.

libs/admin-api-lib/src/admin_api_lib/dependency_container.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
from rag_core_lib.impl.settings.ollama_llm_settings import OllamaSettings
6666
from rag_core_lib.impl.settings.rag_class_types_settings import RAGClassTypeSettings
6767
from rag_core_lib.impl.settings.stackit_vllm_settings import StackitVllmSettings
68-
from rag_core_lib.impl.tracers.langfuse_traced_chain import LangfuseTracedGraph
68+
from rag_core_lib.impl.tracers.langfuse_traced_runnable import LangfuseTracedRunnable
6969
from rag_core_lib.impl.utils.async_threadsafe_semaphore import AsyncThreadsafeSemaphore
7070

7171

@@ -138,19 +138,19 @@ class DependencyContainer(DeclarativeContainer):
138138
chunker=summary_text_splitter,
139139
semaphore=Singleton(AsyncThreadsafeSemaphore, summarizer_settings.maximum_concurrreny),
140140
)
141+
traced_summarizer = Singleton(
142+
LangfuseTracedRunnable,
143+
inner_chain=summarizer,
144+
settings=langfuse_settings,
145+
)
141146

142147
summary_enhancer = List(
143-
Singleton(PageSummaryEnhancer, summarizer, chunker_settings),
148+
Singleton(PageSummaryEnhancer, traced_summarizer, chunker_settings),
144149
)
145-
untraced_information_enhancer = Singleton(
150+
information_enhancer = Singleton(
146151
GeneralEnhancer,
147152
summary_enhancer,
148153
)
149-
information_enhancer = Singleton(
150-
LangfuseTracedGraph,
151-
inner_chain=untraced_information_enhancer,
152-
settings=langfuse_settings,
153-
)
154154

155155
document_deleter = Singleton(
156156
DefaultDocumentDeleter, rag_api=rag_api, file_service=file_service, key_value_store=key_value_store

libs/admin-api-lib/src/admin_api_lib/impl/summarizer/langchain_summarizer.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
"""Module for the LangchainSummarizer class."""
22

3+
import asyncio
34
import logging
45
import traceback
56
from typing import Optional
@@ -27,6 +28,8 @@ class LangchainSummarizer(Summarizer):
2728
document and retries the summarization process if an error occurs.
2829
"""
2930

31+
RETRY_WAIT_TIME = 10
32+
3033
def __init__(
3134
self,
3235
langfuse_manager: LangfuseManager,
@@ -84,7 +87,12 @@ async def ainvoke(self, query: SummarizerInput, config: Optional[RunnableConfig]
8487
except Exception as e:
8588
logger.error("Error in summarizing langchain doc: %s %s", e, traceback.format_exc())
8689
config["tries_remaining"] = tries_remaining - 1
87-
result = await self._create_chain().ainvoke({"text": langchain_document.page_content}, config)
90+
if "rate limit" in str(e).lower() or "ratelimit" in str(e).lower():
91+
logger.warning(
92+
"Rate limit encountered, waiting %d seconds before retry...", self.RETRY_WAIT_TIME
93+
)
94+
await asyncio.sleep(self.RETRY_WAIT_TIME)
95+
result = await self.ainvoke(query, config)
8896
# Extract content from AIMessage if it's not already a string
8997
content = result.content if hasattr(result, "content") else str(result)
9098
outputs.append(content)

libs/admin-api-lib/src/admin_api_lib/information_enhancer/information_enhancer.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@
66
from langchain_core.documents import Document
77
from langchain_core.runnables import RunnableConfig
88

9-
from rag_core_lib.chains.async_chain import AsyncChain
9+
from rag_core_lib.runnables.async_runnable import AsyncRunnable
1010

1111
RetrieverInput = list[Document]
1212
RetrieverOutput = list[Document]
1313

1414

15-
class InformationEnhancer(AsyncChain[RetrieverInput, RetrieverOutput], ABC):
15+
class InformationEnhancer(AsyncRunnable[RetrieverInput, RetrieverOutput], ABC):
1616
"""The base class for an information enhancer."""
1717

1818
@abstractmethod

libs/admin-api-lib/src/admin_api_lib/summarizer/summarizer.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@
55

66
from langchain_core.runnables import RunnableConfig
77

8-
from rag_core_lib.chains.async_chain import AsyncChain
8+
from rag_core_lib.runnables.async_runnable import AsyncRunnable
99

1010
SummarizerInput = str
1111
SummarizerOutput = str
1212

1313

14-
class Summarizer(AsyncChain[SummarizerInput, SummarizerOutput], ABC):
14+
class Summarizer(AsyncRunnable[SummarizerInput, SummarizerOutput], ABC):
1515
"""Baseclass for summarizers."""
1616

1717
@abstractmethod

0 commit comments

Comments
 (0)