Repository navigation
feat(rag): recurring ingest, community-distribution docs, and latest-query retrieval #290
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
e94ff66
f28bb94
cb7a1c7
56e498c
ad1eae8
e138761
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,10 @@ | ||
| # Pre-merge eval, part 1: deploys a pull request labelled `eval` (added by /eval, see | ||
| # .github/workflows/pr-eval.yaml) into the shared preview namespace. One PR at a time: | ||
| # the /eval workflow refuses while another PR holds the label. Removing the label | ||
| # deletes the Application and everything it deployed. | ||
| # deletes the Application but keeps what it deployed: every preview uses the same | ||
| # names in the same namespace, and the next PR's Application takes those objects over. | ||
| # Deleting them instead races with that takeover and can leave the Agents stuck | ||
| # terminating while kagent recreates their Deployments. | ||
| # | ||
| # The commit deployed is the one the maintainer reviewed, pinned by the workflow in a | ||
| # second label `eval-sha:<sha>`, not the PR's head: commits pushed after /eval are not | ||
|
|
@@ -14,6 +17,8 @@ metadata: | |
| spec: | ||
| goTemplate: true | ||
| goTemplateOptions: ["missingkey=error"] | ||
| syncPolicy: | ||
| preserveResourcesOnDeletion: true | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove the explicit deletion finalizer. The Application template still sets When the
|
||
| generators: | ||
| - pullRequest: | ||
| github: | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| # Cross-encoder reranker (TEI on CPU) used by the MCP server after retrieval. | ||
| apiVersion: argoproj.io/v1alpha1 | ||
| kind: Application | ||
| metadata: | ||
| name: reranker | ||
| namespace: argocd | ||
| spec: | ||
| project: default | ||
| source: | ||
| repoURL: https://github.com/kubeflow/docs-agent | ||
| targetRevision: main | ||
| path: deploy/platform/reranker | ||
| destination: | ||
| server: https://kubernetes.default.svc | ||
| namespace: ml-infra | ||
| syncPolicy: | ||
| automated: | ||
| prune: true | ||
| selfHeal: true |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| # Cross-encoder reranker for the MCP server (RERANKER_URL in the docs-agent chart): | ||
| # Hugging Face Text Embeddings Inference on CPU, same shape as embeddings-service. | ||
| # Without it the MCP server skips reranking and returns hits in retrieval order. | ||
| apiVersion: serving.kserve.io/v1beta1 | ||
| kind: InferenceService | ||
| metadata: | ||
| name: reranker-service | ||
| namespace: ml-infra | ||
| annotations: | ||
| serving.kserve.io/deploymentMode: RawDeployment | ||
| spec: | ||
| predictor: | ||
| minReplicas: 1 | ||
| maxReplicas: 1 | ||
| containers: | ||
| - name: kserve-container | ||
| image: ghcr.io/huggingface/text-embeddings-inference:cpu-1.7 | ||
| args: | ||
| - --model-id | ||
| - BAAI/bge-reranker-base | ||
| - --port | ||
| - "8080" | ||
| - --auto-truncate | ||
| - --max-client-batch-size | ||
| - "32" | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Allow the candidate counts that retrieval sends. For a release-date query without a version, retrieval can send all 50 candidates to the reranker. (raw.githubusercontent.com) TEI v1.7 rejects requests with more than this configured limit of 32 texts. The client then returns the original hits without reranking. (raw.githubusercontent.com) Raise the limit to cover the configured retrieval depths, or batch client requests without dropping candidates.
|
||
| - --max-batch-tokens | ||
| - "16384" | ||
| ports: | ||
| - containerPort: 8080 | ||
| protocol: TCP | ||
| resources: | ||
| requests: | ||
| cpu: 500m | ||
| memory: 1Gi | ||
| limits: | ||
| cpu: "4" | ||
| memory: 4Gi | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,68 @@ | ||
| {{- if .Values.ingest.enabled }} | ||
| {{- $tag := .Values.ingest.image.tag | default .Values.mcp.image.tag }} | ||
| {{- $image := printf "%s:%s" .Values.ingest.image.repository $tag }} | ||
| # Recurring ingest. After every Argo CD sync this Job compiles the pipelines shipped in the | ||
| # ingest image, uploads them to Kubeflow Pipelines and replaces the recurring runs with the | ||
| # ones listed in .Values.ingest.schedules (docs-agent-mcp/pipelines/ingest_schedule.py). | ||
| # The pipelines run in the Kubeflow Pipelines namespace and write to Milvus; this Job only | ||
| # talks to the Pipelines API. | ||
| apiVersion: v1 | ||
| kind: ConfigMap | ||
| metadata: | ||
| name: {{ .Release.Name }}-ingest-schedules | ||
| labels: | ||
| {{- include "docs-agent.labels" . | nindent 4 }} | ||
| data: | ||
| schedules.json: | | ||
| {{- dict "experiment" .Values.ingest.experiment "schedules" .Values.ingest.schedules | toPrettyJson | nindent 4 }} | ||
| --- | ||
| apiVersion: batch/v1 | ||
| kind: Job | ||
| metadata: | ||
| name: {{ .Release.Name }}-ingest-schedule | ||
| labels: | ||
| {{- include "docs-agent.labels" . | nindent 4 }} | ||
| annotations: | ||
| argocd.argoproj.io/hook: PostSync | ||
| argocd.argoproj.io/hook-delete-policy: BeforeHookCreation | ||
| spec: | ||
| backoffLimit: 2 | ||
| activeDeadlineSeconds: 600 | ||
| template: | ||
| metadata: | ||
| labels: | ||
| app: {{ .Release.Name }}-ingest-schedule | ||
| spec: | ||
| restartPolicy: Never | ||
| containers: | ||
| - name: register | ||
| image: {{ $image }} | ||
| command: ["python", "/app/pipelines/ingest_schedule.py", "register", "--config", "/config/schedules.json"] | ||
| env: | ||
| - name: KFP_HOST | ||
| value: {{ .Values.ingest.kfpHost | quote }} | ||
| # The docs pipeline's chunk and store steps run in this same image. | ||
| - name: DOCS_INGEST_IMAGE | ||
| value: {{ $image }} | ||
| - name: INGEST_VERSION | ||
| value: {{ $tag | quote }} | ||
| - name: HOME | ||
| value: /tmp | ||
| volumeMounts: | ||
| - name: config | ||
| mountPath: /config | ||
| readOnly: true | ||
| resources: | ||
| requests: {cpu: 50m, memory: 192Mi} | ||
| limits: {memory: 512Mi} | ||
| securityContext: | ||
| allowPrivilegeEscalation: false | ||
| runAsNonRoot: true | ||
| runAsUser: 1000 | ||
| capabilities: | ||
| drop: ["ALL"] | ||
| volumes: | ||
| - name: config | ||
| configMap: | ||
| name: {{ .Release.Name }}-ingest-schedules | ||
| {{- end }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Publish the ingest image under the release tag, or set
ingest.image.tagfor release deployments.The chart uses
ingest.image.tagas a fallback tomcp.image.tag, and its comment states that CI builds both images from the same commit. Whenrelease_versionis set, the MCP image gets the release tag but the ingest image gets only the short SHA. If an environment setsmcp.image.tagto a release version and enables ingest without settingingest.image.tag, the ingest registration Job can fail to pull its image.Publish the ingest image under the release tag too, so the fallback resolves. Keep the existing SHA tag. Alternatively, require release deployments to set
ingest.image.tagexplicitly.zizmor (1.32.0)
[warning] 8-195: overly broad permissions (excessive-permissions): default permissions used due to no permissions: block
(excessive-permissions)