You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Discussion - GSoC ] Design for agentic RAG on Kubeflow #59
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.
changed the title [-][Discussion] Agentic RAG on Kubeflow (Expansion of kubeflow/docs-agent)[/-][+][Discussion - GSoC ] Design for agentic RAG on Kubeflow[/+]on Feb 23, 2026
I've been exploring the Scale-to-Zero autoscaling for the KServe InferenceService (Issue #47).
Over the past two days I've had discussions with @chasecadet and @SanthoshToorpu on the right scaling metric. We explored:
Offset lag → needs Kafka/message queue, not applicable
HTTP add-on → DDoS risk of unnecessary scaling
Prometheus/vLLM metrics → not yet implemented
Current thinking is to wait for @chasecadet and @jaiakash input on the metric before finalizing the manifest changes. Happy to proceed once the OCI gsoc26 cluster is ready for testing.
I've been exploring the Scale-to-Zero autoscaling for the KServe InferenceService (Issue #47).
Over the past two days I've had discussions with @chasecadet and @SanthoshToorpu on the right scaling metric. We explored:
Offset lag → needs Kafka/message queue, not applicable
HTTP add-on → DDoS risk of unnecessary scaling
Prometheus/vLLM metrics → not yet implemented
Current thinking is to wait for @chasecadet and @jaiakash input on the metric before finalizing the manifest changes. Happy to proceed once the OCI gsoc26 cluster is ready for testing.
Open to feedback on the approach!
Hi @KUNDAN1334 for auto scaling I think you can start with minikube or kind on local. As @jaiakash is configuring the cluster this might take a while
Thanks @SanthoshToorpu! That makes sense — I'll set up minikube locally and test the autoscaling behavior there while the OCI cluster is being configured.
Hey @SanthoshToorpu — tried setting up KServe locally with Kind on Mac M4. Got KServe + Knative + Kourier all running, but InferenceService isn't getting a URL assigned — seems like a Kind networking limitation with Knative ingress.
Will wait for the OCI gsoc26 cluster for proper end-to-end testing. But confirmed the Scale-to-Zero manifest config (minReplicas: 0, Knative annotations) is valid and gets accepted by KServe without errors.
Hi Everyone,
I’ve been following the Slack discussion and the current state that @SanthoshToorpu shared.
My proposal is to evolve this into a proper multi-agent system. Instead of having a single RAG pipeline hitting one index, we could introduce a router that decides whether to query:
the documentation
GitHub issues
platform/reference architecture docs
based on what the user is actually asking.
The reason I think this matters: right now if someone asks "why is my pipeline failing" vs "how do I configure KServe" vs "what does the reference architecture recommend" they all hit the same index and get blended results.
Also, is there a preferred agent framework @SanthoshToorpu you'd like to see this built with? I’ve worked with LangGraph, but I’m open to Kagent if that aligns better with the Kubeflow ecosystem.
And scale-to-zero makes sense for the cost problem, but shouldn't auth come before scaling? Right now the WebSocket is completely open, so even with scale-to-zero in place you still can't safely expose this publicly.
Hey everyone — been reading through the thread and the issues. Want to drop some architectural thoughts that might help structure the design conversation, especially following @sakshisemalti's point on auth.
On auth coming before scaling — fully agree. The WebSocket server is currently wide open. scaleToZero helps with cost, but a public-facing agent endpoint without even a bearer token check is a security gap we'd have to document as a known limitation. My thinking: a lightweight token middleware on the WebSocket handshake path (process_request handler) should be a gating requirement before we expose this. Happy to prototype that if it's useful.
On the bigger architectural question — I think the agentic layer has some unresolved prerequisites worth mapping out first:
Right now, if we add an intent router on top of the existing milvus_search(), it'll be routing across a single monolithic collection that gets dropped and rebuilt on every pipeline run (the issue @haroon0x flagged in #10). Multi-source retrieval doesn't work if running the issues pipeline nukes the docs. That has to be fixed first — Milvus partitions are the clean path there.
Second: the current connect-per-request pattern in milvus_search() in both server/app.py and server-https/app.py opens and closes a TCP/gRPC connection on every call. In an agentic loop where a single user turn triggers 4-6 tool calls, this adds seconds of accumulated latency. Connection pooling (#28) is a hard prerequisite before the agentic routing layer is usable in practice.
Third: the rag_core logic — get_embedding(), milvus_search(), execute_tool() — is currently duplicated verbatim between both server files (tracked in #60, filed today). Adding the agentic router in both places separately is the exact kind of 2x divergence that makes the codebase painful to maintain. A single shared rag_core.py with zero framework imports is the right extraction boundary.
So my proposed dependency order before we even reach the router:
I'd lean LangGraph for now. Kagent is an interesting direction for Kubeflow's k8s-native story, but it's still early and the RAG tooling integration is thin compared to LangGraph's ToolNode + StateGraph pattern. The cyclic graph @saurabhhhcodes sketched in #42 — query → retrieve → evaluate context → optionally re-query — maps naturally to a LangGraph StateGraph with a conditional edge. We could structure it as a rag_agent.py module that the shared rag_core.py feeds into, keeping the server code minimal.
What I'm working on:
I'm planning to contribute the three prerequisite fixes above (#28, #9 — issue comments ingestion for the knowledge base, #60) as stepping-stone PRs ahead of the application period. The goal is to have the infrastructure solid so the agentic layer has a clean surface to build on.
Happy to sync in #kubeflow-doc-agent on Slack if it's useful — or to draft an architectural diagram here before raising any PRs.
Scale-to-Zero pod termination needs full Knative autoscaler — has limitations in Kind/RawDeployment mode. Will validate complete scale-down behavior on OCI gsoc26 cluster once ready.
Hi everyone! I've been following the discussions here and on the slack, and wanted to share what I've been building locally so I can align with the project's direction before opening any PRs.
What I've built so far (local, ready to push):
Complete local environment scripts (Kind cluster, KFP v2.5.0, KServe v0.13.1 with Knative+Kourier, Milvus via Helm)
4 standalone KFP v2 components (crawler, document-chunker, embedding-generator, milvus-indexer) with Dockerfiles, component.yaml specs, and unit tests
KFP v2 ingestion pipeline: crawl → chunk → embed → validate → index_to_milvus (5-step pipeline that stores embeddings into Milvus with idempotent upsert)
Vector store SDK (MilvusVectorStore) with retry logic, batch operations, async support, and tests
Standardized on all-mpnet-base-v2 (768d) across all components, matching @SanthoshToorpu's kagent POC
I have a few questions to make sure my work aligns with where the project is headed before I submit anything:
Collection schema convergence
I noticed the kagent POC uses the original pipeline schema (file_unique_id, content_text, citation_url, vector), while my components use a more generic schema (chunk_id, text, metadata as a JSON blob, embedding). The POC approach is more explicit with dedicated fields per attribute; mine is more flexible and would support arbitrary metadata keys — which could help if we eventually index multiple sources (docs, issues, platform pages). Is there a preferred schema, or would it be useful if I wrote up a short comparison of the trade-offs for the team to decide on?
Agentic layer direction — kagent vs. LangGraph
I see @SanthoshToorpu merged the kagent + Feast + Milvus POC. I had originally been exploring LangGraph for the retrieve → evaluate → re-retrieve cyclic pattern. Before I go deeper on either path, I wanted to understand:
Has kagent been decided as the orchestration layer, or is this still open for discussion? I'd love to understand if kagent supports conditional re-execution loops natively, or if that's something that would need to be layered on top.
I also noticed the POC uses Feast as an intermediary between Milvus and the agent, but the MCP server seems to query Milvus directly. I'd appreciate any pointers on what Feast adds in this architecture — is it for caching, feature versioning, or something else?
Are there any design docs or references beyond kagent-feast-mcp/README.md that I should study to get up to speed?
PR sequencing @GunaPalanivel proposed an ordering in [Discussion - GSoC ] Design for agentic RAG on Kubeflow #59: partition isolation → connection pooling → shared rag_core → agentic router. My ingestion pipeline and vector store SDK sit at the earlier end of that chain and are self-contained — they don't touch the agentic layer. Would it be helpful if I opened a PR now so the team has something concrete to review and build on, or should I hold off until the schema question above is settled?
Defining retrieval quality
Chase mentioned earlier — "what does good look like?" My pipeline's validate step currently checks structural integrity (embedding counts, dimensions, file existence), but I know the harder question is retrieval quality. I'd be glad to help build out a golden-dataset evaluation step (e.g., a small set of test queries with known-good source docs, measuring recall@k). Would that be a useful next contribution?
Happy to join the next sync call to demo what I have and get direct feedback.
Expanding on my earlier update with a proper design discussion, since this thread is the right place for it.
@SanthoshToorpu — good catch on the Mermaid rendering! GitHub Issues don't render Mermaid natively. Replaced all diagrams with rendered images below.
Architecture Overview
Here's how the work I've submitted maps to the four GSoC deliverables:
Agentic Router Graph Topology
Dependency Chain and PR Strategy
All 7 PRs are stacked on a single base (#49) to keep each reviewable in isolation while maintaining a coherent dependency order:
The ordering follows the prerequisite chain: shared extraction → connection pooling → auth → agentic layer. The router is useless if every tool call opens a new TCP connection, and exposing it without auth is a non-starter. That's why pooling (#66) and auth (#67) landed before the router (#68).
Technical Decisions
LangGraph over Kagent
I chose LangGraph for the agentic layer for a few reasons:
Cyclic graph support — the retrieve → evaluate → re_retrieve → evaluate loop is the core of the architecture. LangGraph's StateGraph with conditional edges maps to this directly. The evaluate node checks context relevance and routes back to re_retrieve (up to MAX_RETRIEVAL_ATTEMPTS) or forward to synthesize.
Testability — each node is a pure function (AgentState) -> dict that returns only the keys it modifies. This makes unit testing trivial without mocking graph internals.
Maturity — Kagent is interesting for k8s-native orchestration, but for RAG-specific patterns (conditional re-retrieval, relevance thresholds, intent-based routing), LangGraph has more battle-tested primitives today.
That said, Kagent could be the right choice for the deployment orchestration layer (managing the agent as a k8s workload). These aren't mutually exclusive.
Partition Strategy (not drop+recreate)
The existing kubeflow-pipeline.py drops and recreates the entire Milvus collection on every pipeline run. This is destructive — running the platform docs pipeline would nuke the Kubeflow docs index.
PR #70 uses Milvus partitions with an upsert-like pattern: delete stale records by file_unique_id, then insert fresh ones. This means:
Multiple pipelines can write to the same collection without interfering
Incremental updates are safe (no downtime, no data loss)
Connection Pooling
PR #66 adds MilvusConnectionManager — a thread-safe singleton that maintains a persistent connection with health checks via utility.list_collections(). The existing per-request connect/disconnect pattern added ~200ms per search call. In an agentic loop with 3-4 retrieval steps, that's nearly a second of pure connection overhead eliminated.
Auth
PR #67 adds opt-in API key auth to both servers. Key design choices:
secrets.compare_digest() for timing-safe comparison (prevents timing side-channel attacks)
.strip() on the env var to handle whitespace edge cases
urllib.parse.parse_qs() for proper URL-encoded query parameter parsing in the WebSocket server
Auth is disabled when API_KEY is unset (backwards-compatible)
35 curated golden queries across 3 intent categories with expected source URL patterns. Metrics: Recall@k, Precision@k, MRR. CLI with --dry-run for CI validation.
This directly addresses the "what does good look like?" question. The golden dataset defines it concretely — designed to run against a live Milvus instance or be extended with mock backends for CI.
docs-agent module: Both WS and HTTPS deployments with readiness probes
Includes a terraform.tfvars.example with annotated placeholders and a README documenting the data ingestion requirement (Milvus deploys empty — you need to run the pipeline to populate it).
What's Left for the GSoC Period
The pre-GSoC work above covers the infrastructure bedrock. The GSoC period would focus on:
Fine-tuning the router — Replace keyword-based intent classification with a lightweight fine-tuned classifier. This is the "Router model" mentioned in the GSoC description's future vision.
KServe integration — Serve Llama 3 via KServe with Scale-to-Zero, wire the synthesize node to hit the KServe endpoint instead of a hardcoded URL.
End-to-end deployment validation — Deploy the full stack on OCI using the Terraform modules, run the eval framework against it, iterate on retrieval quality using the golden dataset.
MCP exploration — The GSoC description mentions MCP for agent-to-tool security. This could layer on top of the existing auth middleware.
I kept the existing schema (file_unique_id, content_text, citation_url, vector) to avoid breaking the current pipeline and server contracts. Schema evolution is a good GSoC-period discussion once the multi-source ingestion pipelines are in place.
Happy to discuss any of this further here or in #kubeflow-doc-agent on Slack. Would love feedback on the architecture and proposed timeline.
Hi @jaiakash and @chasecadet, I've been following the discussions here and on Slack regarding the high volume of incoming PRs and the potential security gaps (auth/secrets).
To help reduce the manual review burden, I'd like to contribute a standardized Makefile (#14) and Pre-commit hooks (#15).
Why this is necessary now:
Security Guardrails: With the rush of new RAG features, the risk of leaked API keys is high. Pre-commit hooks (like detect-private-key) catch these on the developer's machine before they hit the repo.
Review Efficiency: It shifts linting and YAML validation to the 'Left.' Mentors won't have to waste time commenting on formatting or broken syntax because the code won't even commit locally unless it passes these checks.
Contributor Uniformity: A Makefile provides a 'single source of truth' for commands. Instead of different contributors using different test runners, everyone aligns on a simple make test.
I've already prototyped a 'safe' version in my fork that covers the core Python/YAML checks—would you like me to open a PR for this to help streamline the workflow?
@SanthoshToorpu Thanks for pointing that out! GitHub Issues don't render Mermaid natively (unlike PR descriptions). I've updated the comment above — all 5 diagrams are now rendered as images via mermaid.ink. Should be fully visible now.
One thing worth flagging: PR #58 (merged by @SanthoshToorpu)establishes Kagent as the orchestration layer. The LangGraph router in #68 is technically strong but may diverge from the official Kagent direction.
@SanthoshToorpu@chasecadet — would it be useful to clarify whether LangGraph and Kagent are meant to coexist, or if one is the preferred path?
Happy to focus my contribution on extending the Kagent POC with multi-source retrieval if that's more aligned.
Hey, i spent some time going through the entire codebase before jumping into any feature work and honestly there are a few things that need fixing first otherwise whatever we build on top is going to inherit these problems
here is what i found after reading every file
the main ones:
both servers (server/ and server-https/) still use the old pymilvus connections.connect() api which is global state and not thread safe. under any real traffic this will race
the SentenceTransformer model gets created inside milvus_search() on every single request. thats a 420mb model loading from disk every time someone asks a question
httpx client also gets created per request instead of being reused, so no connection pooling at all
the mcp server has a _init() function with a classic check-then-act race condition, two requests hit it at the same time and you get double initialization
CORS is set to allow_origins=["*"] with credentials=true which is basically wide open
the kagent pipeline has a double @dsl.component decorator on chunk_and_embed so it will crash at runtime with a missing module error
the main pipeline drops the entire milvus collection before reinserting, so if it fails halfway through you get zero results
milvus credentials are hardcoded as root/Milvus right in the source
there are placeholder values like YOUR_NAMESPACE and YOUR_DOCKERHUB_USERNAME in the manifests that will silently fail on deploy
system prompt is copy pasted across 3 files, same with the tools definition
tried running the poc locally on wsl2 with kind and the milvus helm chart immediately crashed wsl because of memory pressure, no mention of this anywhere in the readme
none of these are feature requests, these are things that are already broken or will break the moment you put real traffic on it. i tracked all of this in issue #72 with the dependency order of what needs to get fixed first
Read through the full spec that got merged (gsoc2026_agentic_rag.md) and went back through every file in the repo again with fresh eyes. also tried running the kagent poc locally on wsl2 with kind which surfaced some stuff you wont find from just reading code.
what changed since my last comment
the spec formalized three architectural blueprints. architecture B (kagent) is the primary live target. architecture A (kserve custom) and C (langgraph/adk) are documented scaffolds. this clears up the langgraph vs kagent question i raised earlier. they coexist at different layers, kagent handles k8s lifecycle, langgraph/adk handles the reasoning loop if the project goes that direction.
the spec also added two scope items i didnt have before: code ingestion (ast parsing of kubeflow/manifests) and developer ide mode (mcp endpoint for cursor/claude/copilot). both are phase 1 deliverables.
pre-work: what i found (updated)
went deeper this time. the original comment had 5 structural issues. after reading every line again i found more. here is the full list, grouped by what actually breaks vs what is just messy:
things that will crash or corrupt data under real traffic:
both servers create a new SentenceTransformer (420mb model) inside milvus_search() on every request. 5 concurrent users = 2.1gb of duplicate models in memory. this isnt in issue #72 yet, needs its own issue
the kagent pipeline at kagent-feast-mcp/pipelines/kubeflow-pipeline.py has a double @dsl.component decorator on chunk_and_embed. the outer one wins, so it gets packages_to_install=["requests"] instead of ["sentence-transformers"]. will crash with ModuleNotFoundError at runtime
the main pipeline drops the entire milvus collection before reinserting (pipelines/kubeflow-pipeline.py:338). if the github api rate limits you halfway, the collection is empty and agents return nothing
milvus credentials hardcoded as root/Milvus in mcp-server/server.py:6-7. not from env, not from secrets
things that block deployment:
server-https/Dockerfile is missing the HF cache env vars that server/Dockerfile has. runs as appuser but model download tries to write to /root/.cache. will get PermissionError
4 different python versions across dockerfiles and kfp components (3.9, 3.10, 3.11, 3.13). the 3.13 one is risky since some libs dont support it yet
no version pinning in any requirements.txt. torch and sentence-transformers break between versions regularly
tried deploying milvus via helm on wsl2+kind and it immediately crashed the wsl vm. etcd + minio + milvus together exceed the default wsl memory limit. zero mention of this in the readme, zero error logs because it kills at the os level not the k8s level
same 5-layer structure as before but updated for the spec:
layer 0 (pre-work, week 1-2): everything in #72 plus the new findings above. no features until the substrate is solid.
layer 1 (foundation, week 3-4): scale-to-zero on InferenceService, dedicated embedding service on KServe, kustomize overlays done and tested.
layer 2 (data architecture, week 5-6): 3 milvus collections (docs, issues, code). the code collection is new from the spec, ast parsing of kubeflow/manifests. refactored ingestion pipelines that upsert instead of drop-and-recreate. embedding calls go to the KServe service not local model loading.
layer 3 (agent core, week 7-9): this is where the blueprint choice matters. if `kagent` is primary, we build the intent router as an MCP tool and let `kagent` manage the agent lifecycle via CRDs. if we go `langgraph/adk`, we build a `StateGraph` with `classify → retrieve → evaluate → retry` nodes served via `KServe`. i'd lean toward starting with `kagent` since thats what the spec says is primary and pivot if we hit a wall. the thin-context MCP response design from the spec (return a golden snippet + validation link, not a massive payload) shapes how the tools return data.
layer 4 (hardening, week 10-12): auth, rate limiting, feedback loop for golden dataset, ci/cd with `trivy` scanning, `ragas` eval with concrete thresholds.
honestly some of these timelines are estimates. once we actually start building, especially layers 2 and 3, we are going to find things we didnt anticipate. thats normal. the important part is the dependency order is right, the pre-work clears the path, and we iterate from there. the goal isnt to predict everything perfectly upfront, its to have the right foundation so we can move fast when things change.
on langgraph vs kagent vs adk
the spec answers this more clearly than before. kagent is the primary live target. langgraph and adk are architecture C, documented scaffold. my take is we build on kagent for the core deployment and if the reasoning loop needs something kagent CRDs cant express (like cyclic retry with state), we evaluate langgraph or adk at that point. not worth locking in a framework decision until we hit the actual constraint.
if you approve #72 i'll update there with the individual issues and PR flow. your guidance will make this even better.
updated my plan to align with the merged spec and the latest codebase audit. details are in my comment above. Let me know if anything needs adjusting.
Following up on my earlier points, good to see the auth-before-scaling concern resonated with others.
One gap I haven't seen discussed yet: once the pre-work is done and the ingestion pipelines are running, how do we know what's in Milvus is actually returning good results? The spec explicitly calls for a feedback loop and golden dataset, but there's no component for this yet in the codebase.
I'd like to take ownership of this piece, building the evaluation layer that measures retrieval quality after every ingestion run, and the feedback loop that continuously improves it over time. @chasecadet@SanthoshToorpu happy to share more details on my approach if useful.
Hi everyone! I'm Rohit (@kmr-rohit), I've been working on this repo (CI workflows, MCP server env config, API server image builds) and would like to contribute further for GSoC 2026.
After going through the KEP, the merged spec, and this discussion thread, I'd like to focus on these areas:
1. GitHub Issues Ingestion Pipeline + MCP Tool
The download_github_issues component already exists at pipelines/kubeflow-pipeline.py:67-213 but isn't wired into any pipeline. I'd like to:
Create a new KFP pipeline (pipelines/issues-pipeline.py) that wires it: download_github_issues → chunk_and_embed_issues → store_milvus
Create a separate issues_rag Milvus collection with issue-specific metadata (issue_number, state, labels)
Use an issues-aware chunking strategy: title+body as primary chunk, comment threads split at comment boundaries
Add a search_github_issues tool to the MCP server
Update the Agent CRD with routing guidance (docs tool for how-to/concepts, issues tool for bugs/workarounds)
Question for mentors: Should this be a separate issues_rag collection or partition isolation within docs_rag (relates to Issue #10)?
2. Test Infrastructure
The repo currently has zero tests. I'd like to add:
Unit tests for the MCP server (search_kubeflow_docs tool) with mocked Milvus
Unit tests for pipeline component logic (cleaning, chunking, rate limiting handling)
A CI workflow (.github/workflows/tests.yml) to run pytest on every PR
Extract the content cleaning logic into a testable utility function
3. Code Ingestion Pipeline (YAML/AST-aware)
KEP Phase 1 calls for code ingestion of kubeflow/manifests. This doesn't exist yet. I'd like to build:
A YAML-aware chunker that splits at --- resource boundaries and extracts K8s metadata (kind, name, namespace)
A Python AST chunker for extracting function/class definitions with docstrings
Kustomize-aware parsing that preserves overlay structure
New code_rag Milvus collection with resource_kind, resource_name, file_type fields
search_kubeflow_code MCP tool
Question for mentors: For kubeflow/manifests, should I scope to just Kustomize/YAML resources initially, or also include Python/Go source via AST from the start?
4. OCI Deployment Experience
I've also been working with @jaiakash on deploying the full Kubeflow platform and docs-agent stack on OCI using Terraform (jaiakash/deploy-kubeflow). The setup covers OKE cluster provisioning, Kubeflow installation, and the docs-agent components. Happy to contribute deployment documentation or Terraform modules upstream if that's useful.
I'll open separate tracking issues for each area and start with PR 1 (tests) since it's purely additive and conflicts with nobody.
Thanks for opening this design discussion. I’ve been reading through the thread, the merged spec, and the repo to understand the direction of the project. From what I understand, the goal is to evolve the current Kubeflow docs assistant from a single RAG pipeline into a more agentic system that can route queries across multiple sources (docs, issues, platform architecture, etc.), while running on a Kubernetes-native stack with Kagent handling orchestration.
Building on the discussion around retrieval quality and evaluation raised by @sakshisemalti, @asfandyar-prog, and @KUNDAN1334, I had a question about how the evaluation layer is expected to interact with the agent at runtime. It seems like the current idea focuses on offline benchmarking with a golden dataset and metrics such as Recall@k or MRR. Would there also be value in lightweight runtime signals from the retrieval layer (for example, similarity thresholds, reranking, or confidence flags) that the agent could use to decide whether to retry retrieval or return a fallback response?
I’m also curious whether defining a small shared schema or “contract” for retrieval responses early on might help keep things consistent across tools and pipelines. For example, each tool returning structured fields such as source_url, chunk_text, and similarity_score could make it easier to plug evaluation, logging, and retry logic into the agent layer regardless of whether orchestration is handled by Kagent or another framework.
I’m currently going through the docs-agent codebase and the Kagent POC to understand the architecture more deeply, and I’d love to contribute where it would be most useful. Areas like retrieval evaluation, ingestion pipelines, or improving the routing logic seem especially interesting to me. If there are specific areas where contributors should focus at this stage, I’d be happy to dig into those.
For Scale-to-Zero (Issue #47) — I've already tested minReplicas: 0 with scaleToZeroGracePeriod: 120s on Kind/Mac M4. The manifest is ready. Main blocker is validating actual pod scale-down which needs the OCI cluster. Happy to take this end-to-end once cluster access is available.
For the namespace fix (Issue #91) — I have the server.py + manifests fix ready. Waiting on @SanthoshToorpu for namespace approach confirmation before opening PR.
One area nobody has claimed yet: WebSocket / SSE support for long-lived agent connections (mentioned in the spec under "Hardened System Considerations"). Happy to scope this out as a separate issue if useful.
Contributor: Sameer | CS student, Hyderabad, India
After reading through the existing codebase, I want to share my initial design thinking for the agentic upgrade. Happy to be corrected on anything — this is my first time working with this stack.
What the current system does well
The 2025 implementation already has a solid foundation:
KFP pipeline for automated ingestion (fetch → chunk → embed → store in Milvus)
KServe serving Llama 3.1-8B with --enable-auto-tool-choice already enabled in the vLLM config
FastAPI server with both streaming (SSE) and non-streaming responses
Tool calling is technically wired up via search_kubeflow_docs
The core gap: one tool, no routing
The current system has a single tool (search_kubeflow_docs) and every query takes the same path regardless of what's being asked. A question like "What changed in KFP v2?" should fetch from the live GitHub repo. A question like "What is a pipeline?" might not need retrieval at all. Right now, both go through the same Milvus lookup.
Proposed agentic upgrades
1. Query router / classifier
Add a lightweight classifier at the start of the pipeline to bucket incoming queries:
Simple/definitional → answer directly from LLM knowledge (no retrieval)
Documentation questions → existing Milvus search
Code/config/recent changes questions → live GitHub repo tool
Complex multi-part questions → break into sub-queries, run multiple tools
This avoids unnecessary Milvus calls and improves latency for simple queries.
2. Expand the tool registry
Beyond search_kubeflow_docs, add:
search_github_repo(repo, query) — fetches live from the Kubeflow GitHub repos for code examples and recent changes
get_file_content(repo, path) — retrieves a specific manifest or config file when the user asks about a specific component
3. Multi-step reasoning loop
For complex questions, allow the agent to chain tool calls — e.g., first search the docs, then look up the specific manifest referenced in the docs, then synthesize a cited answer from both sources.
4. Chat history summarization
The README mentions chat history is currently in localStorage with a known token overflow risk. A simple summarization step after N turns would prevent context window issues during longer sessions.
For the query router — would a small fine-tuned classifier model be preferred here, or is a prompt-based routing approach (asking the LLM itself to classify the query type) more aligned with the project's direction? I want to make sure my proposal matches the architecture vision before going deeper.
Looking forward to feedback, and happy to adjust any of this based on the mentors' direction!
Reading through the full thread — one gap I don't see addressed yet is the portability separation @tarekabouzeid emphasized: Core Kubeflow Services vs OCI-specific adapters. The current Terraform scaffolding (PR #71) bundles both. I'm planning to propose a clean module boundary in my GSoC proposal so the reference architecture is genuinely redeployable on any cluster, not just OCI. Happy to discuss the right abstraction layer for this.
@chasecadet After reading server-https/app.py in depth, I noticed the handle_tool_follow_up() function sends results back as a single formatted string. For multi-source routing, this response format will need to be structured (source type + content + citation) so the agent can reason about which index answered the query. Planning to address this in my proposal.
I also noted Chase's recent comment that local dev "isnt worth it", which drops the priority of local WSL2/memory fixes to shift focus toward OCI deployments.
Proposed next step for #72: add the open bug tickets (#128, #91, #148, #163, #152, #154, #160, #171, #175) to the checklist and close the duplicates. Let's fix these foundational issues before layering more features.
A few things from running this stack in production:
On content truncation: The main servers truncate content_text to 400 chars before the LLM sees it, but the pipeline stores 2000 chars and the MCP server doesn't truncate at all. Same index, different answer quality depending on the code path. Makes evaluation inconsistent. Filed as [#181].
On scale-to-zero: Cold start with vLLM + Llama 3.1-8B is 30-60s for GPU model load. What worked for us: KEDA ScaledObject keeping minReplicas: 1 during traffic hours, scale to 0 off-hours only. Cut costs ~60%, kept p99 under 3s.
On Feast: The kagent-feast-mcp pipeline monkey-patches Feast's VARCHAR limit at runtime. The main servers already use pymilvus directly without this problem. Worth deciding early whether Feast stays in the production path.
Hi @chasecadet@SanthoshToorpu — I've just submitted my GSoC 2026 proposal for the Agentic RAG project to help Kubeflow users find documentation more intelligently.
A bit about me:
2nd-year B.Tech AI/ML student at SRMIST, India
Built a local Edge AI server using Ollama + Qwen on Android (offline LLM inference)
Integrated OpenAI APIs in production React.js + Spring Boot applications
Experience with RAG systems and local LLM deployment
I'm excited about the possibility of contributing to Kubeflow's documentation infrastructure! Happy to iterate on scope or answer any questions about my technical approach.
Closing this GSoC 2026 pre-application design discussion thread now that the GSoC 2026 Agentic RAG architecture (#207, #210, #240, #249, #261, #262) has shipped on main. Thank you to everyone who participated!
Activity
google-oss-prow commentedon Feb 23, 2026
@jaiakash: The label(s)
area/gsoccannot be applied, because the repository doesn't have them.Details
In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.
[-][Discussion] Agentic RAG on Kubeflow (Expansion of kubeflow/docs-agent)[/-][+][Discussion - GSoC ] Design for agentic RAG on Kubeflow[/+]KUNDAN1334 commentedon Feb 23, 2026
Hi everyone! I'm Kundan, a GSoC 2026 aspirant.
I've been exploring the Scale-to-Zero autoscaling for the KServe InferenceService (Issue #47).
Over the past two days I've had discussions with @chasecadet and @SanthoshToorpu on the right scaling metric. We explored:
Current thinking is to wait for @chasecadet and @jaiakash input on the metric before finalizing the manifest changes. Happy to proceed once the OCI gsoc26 cluster is ready for testing.
Open to feedback on the approach!
SanthoshToorpu commentedon Feb 23, 2026
Hi @KUNDAN1334 for auto scaling I think you can start with minikube or kind on local. As @jaiakash is configuring the cluster this might take a while
KUNDAN1334 commentedon Feb 23, 2026
Thanks @SanthoshToorpu! That makes sense — I'll set up minikube locally and test the autoscaling behavior there while the OCI cluster is being configured.
Will share results here once done.
KUNDAN1334 commentedon Feb 23, 2026
Hey @SanthoshToorpu — tried setting up KServe locally with Kind on Mac M4. Got KServe + Knative + Kourier all running, but InferenceService isn't getting a URL assigned — seems like a Kind networking limitation with Knative ingress.
Will wait for the OCI gsoc26 cluster for proper end-to-end testing. But confirmed the Scale-to-Zero manifest config (minReplicas: 0, Knative annotations) is valid and gets accepted by KServe without errors.
sakshisemalti commentedon Feb 23, 2026
Hi Everyone,
I’ve been following the Slack discussion and the current state that @SanthoshToorpu shared.
My proposal is to evolve this into a proper multi-agent system. Instead of having a single RAG pipeline hitting one index, we could introduce a router that decides whether to query:
based on what the user is actually asking.
The reason I think this matters: right now if someone asks "why is my pipeline failing" vs "how do I configure KServe" vs "what does the reference architecture recommend" they all hit the same index and get blended results.
Also, is there a preferred agent framework @SanthoshToorpu you'd like to see this built with? I’ve worked with LangGraph, but I’m open to Kagent if that aligns better with the Kubeflow ecosystem.
And scale-to-zero makes sense for the cost problem, but shouldn't auth come before scaling? Right now the WebSocket is completely open, so even with scale-to-zero in place you still can't safely expose this publicly.
GunaPalanivel commentedon Feb 24, 2026
Hey everyone — been reading through the thread and the issues. Want to drop some architectural thoughts that might help structure the design conversation, especially following @sakshisemalti's point on auth.
On auth coming before scaling — fully agree. The WebSocket server is currently wide open.
scaleToZerohelps with cost, but a public-facing agent endpoint without even a bearer token check is a security gap we'd have to document as a known limitation. My thinking: a lightweight token middleware on the WebSocket handshake path (process_requesthandler) should be a gating requirement before we expose this. Happy to prototype that if it's useful.On the bigger architectural question — I think the agentic layer has some unresolved prerequisites worth mapping out first:
Right now, if we add an intent router on top of the existing
milvus_search(), it'll be routing across a single monolithic collection that gets dropped and rebuilt on every pipeline run (the issue @haroon0x flagged in #10). Multi-source retrieval doesn't work if running the issues pipeline nukes the docs. That has to be fixed first — Milvus partitions are the clean path there.Second: the current
connect-per-requestpattern inmilvus_search()in bothserver/app.pyandserver-https/app.pyopens and closes a TCP/gRPC connection on every call. In an agentic loop where a single user turn triggers 4-6 tool calls, this adds seconds of accumulated latency. Connection pooling (#28) is a hard prerequisite before the agentic routing layer is usable in practice.Third: the
rag_corelogic —get_embedding(),milvus_search(),execute_tool()— is currently duplicated verbatim between both server files (tracked in #60, filed today). Adding the agentic router in both places separately is the exact kind of 2x divergence that makes the codebase painful to maintain. A single sharedrag_core.pywith zero framework imports is the right extraction boundary.So my proposed dependency order before we even reach the router:
On the framework question (LangGraph vs Kagent):
I'd lean LangGraph for now. Kagent is an interesting direction for Kubeflow's k8s-native story, but it's still early and the RAG tooling integration is thin compared to LangGraph's
ToolNode+StateGraphpattern. The cyclic graph @saurabhhhcodes sketched in #42 — query → retrieve → evaluate context → optionally re-query — maps naturally to a LangGraphStateGraphwith a conditional edge. We could structure it as arag_agent.pymodule that the sharedrag_core.pyfeeds into, keeping the server code minimal.What I'm working on:
I'm planning to contribute the three prerequisite fixes above (#28, #9 — issue comments ingestion for the knowledge base, #60) as stepping-stone PRs ahead of the application period. The goal is to have the infrastructure solid so the agentic layer has a clean surface to build on.
Happy to sync in
#kubeflow-doc-agenton Slack if it's useful — or to draft an architectural diagram here before raising any PRs.cc @chasecadet @tarekabouzeid @SanthoshToorpu
KUNDAN1334 commentedon Feb 24, 2026
@SanthoshToorpu — local testing update as suggested!
Tested on Mac M4 with Kind cluster:
Scale-to-Zero pod termination needs full Knative autoscaler — has limitations in Kind/RawDeployment mode. Will validate complete scale-down behavior on OCI gsoc26 cluster once ready.
Manifest is ready for review.
gupta-tilak commentedon Feb 25, 2026
Hi everyone! I've been following the discussions here and on the slack, and wanted to share what I've been building locally so I can align with the project's direction before opening any PRs.
What I've built so far (local, ready to push):
I have a few questions to make sure my work aligns with where the project is headed before I submit anything:
Collection schema convergence
I noticed the kagent POC uses the original pipeline schema (file_unique_id, content_text, citation_url, vector), while my components use a more generic schema (chunk_id, text, metadata as a JSON blob, embedding). The POC approach is more explicit with dedicated fields per attribute; mine is more flexible and would support arbitrary metadata keys — which could help if we eventually index multiple sources (docs, issues, platform pages). Is there a preferred schema, or would it be useful if I wrote up a short comparison of the trade-offs for the team to decide on?
Agentic layer direction — kagent vs. LangGraph
I see @SanthoshToorpu merged the kagent + Feast + Milvus POC. I had originally been exploring LangGraph for the retrieve → evaluate → re-retrieve cyclic pattern. Before I go deeper on either path, I wanted to understand:
PR sequencing
@GunaPalanivel proposed an ordering in [Discussion - GSoC ] Design for agentic RAG on Kubeflow #59: partition isolation → connection pooling → shared rag_core → agentic router. My ingestion pipeline and vector store SDK sit at the earlier end of that chain and are self-contained — they don't touch the agentic layer. Would it be helpful if I opened a PR now so the team has something concrete to review and build on, or should I hold off until the schema question above is settled?
Defining retrieval quality
Chase mentioned earlier — "what does good look like?" My pipeline's validate step currently checks structural integrity (embedding counts, dimensions, file existence), but I know the harder question is retrieval quality. I'd be glad to help build out a golden-dataset evaluation step (e.g., a small set of test queries with known-good source docs, measuring recall@k). Would that be a useful next contribution?
Happy to join the next sync call to demo what I have and get direct feedback.
cc @chasecadet @SanthoshToorpu @tarekabouzeid
himanshu748 commentedon Feb 27, 2026
Expanding on my earlier update with a proper design discussion, since this thread is the right place for it.
Architecture Overview
Here's how the work I've submitted maps to the four GSoC deliverables:
Agentic Router Graph Topology
Dependency Chain and PR Strategy
All 7 PRs are stacked on a single base (#49) to keep each reviewable in isolation while maintaining a coherent dependency order:
The ordering follows the prerequisite chain: shared extraction → connection pooling → auth → agentic layer. The router is useless if every tool call opens a new TCP connection, and exposing it without auth is a non-starter. That's why pooling (#66) and auth (#67) landed before the router (#68).
Technical Decisions
LangGraph over Kagent
I chose LangGraph for the agentic layer for a few reasons:
Cyclic graph support — the retrieve → evaluate → re_retrieve → evaluate loop is the core of the architecture. LangGraph's
StateGraphwith conditional edges maps to this directly. Theevaluatenode checks context relevance and routes back tore_retrieve(up toMAX_RETRIEVAL_ATTEMPTS) or forward tosynthesize.Testability — each node is a pure function
(AgentState) -> dictthat returns only the keys it modifies. This makes unit testing trivial without mocking graph internals.Maturity — Kagent is interesting for k8s-native orchestration, but for RAG-specific patterns (conditional re-retrieval, relevance thresholds, intent-based routing), LangGraph has more battle-tested primitives today.
That said, Kagent could be the right choice for the deployment orchestration layer (managing the agent as a k8s workload). These aren't mutually exclusive.
Partition Strategy (not drop+recreate)
The existing
kubeflow-pipeline.pydrops and recreates the entire Milvus collection on every pipeline run. This is destructive — running the platform docs pipeline would nuke the Kubeflow docs index.PR #70 uses Milvus partitions with an upsert-like pattern: delete stale records by
file_unique_id, then insert fresh ones. This means:PARTITION_MAPinagent/config.pyConnection Pooling
PR #66 adds
MilvusConnectionManager— a thread-safe singleton that maintains a persistent connection with health checks viautility.list_collections(). The existing per-request connect/disconnect pattern added ~200ms per search call. In an agentic loop with 3-4 retrieval steps, that's nearly a second of pure connection overhead eliminated.Auth
PR #67 adds opt-in API key auth to both servers. Key design choices:
secrets.compare_digest()for timing-safe comparison (prevents timing side-channel attacks).strip()on the env var to handle whitespace edge casesurllib.parse.parse_qs()for proper URL-encoded query parameter parsing in the WebSocket serverAPI_KEYis unset (backwards-compatible)Evaluation Framework (#69)
35 curated golden queries across 3 intent categories with expected source URL patterns. Metrics: Recall@k, Precision@k, MRR. CLI with
--dry-runfor CI validation.This directly addresses the "what does good look like?" question. The golden dataset defines it concretely — designed to run against a live Milvus instance or be extended with mock backends for CI.
Terraform / OCI Deployment (#71)
The Terraform scaffolding covers:
Includes a
terraform.tfvars.examplewith annotated placeholders and a README documenting the data ingestion requirement (Milvus deploys empty — you need to run the pipeline to populate it).What's Left for the GSoC Period
The pre-GSoC work above covers the infrastructure bedrock. The GSoC period would focus on:
synthesizenode to hit the KServe endpoint instead of a hardcoded URL.I kept the existing schema (
file_unique_id,content_text,citation_url,vector) to avoid breaking the current pipeline and server contracts. Schema evolution is a good GSoC-period discussion once the multi-source ingestion pipelines are in place.Happy to discuss any of this further here or in
#kubeflow-doc-agenton Slack. Would love feedback on the architecture and proposed timeline.cc @chasecadet @tarekabouzeid @SanthoshToorpu
Champbreed commentedon Feb 27, 2026
Hi @jaiakash and @chasecadet, I've been following the discussions here and on Slack regarding the high volume of incoming PRs and the potential security gaps (auth/secrets).
To help reduce the manual review burden, I'd like to contribute a standardized Makefile (#14) and Pre-commit hooks (#15).
Why this is necessary now:
I've already prototyped a 'safe' version in my fork that covers the core Python/YAML checks—would you like me to open a PR for this to help streamline the workflow?
SanthoshToorpu commentedon Feb 27, 2026
@himanshu748 I'm probably not a pro but can you paste images in a mermaid format 😅
Hard to visualise 🙂
himanshu748 commentedon Feb 27, 2026
@SanthoshToorpu Thanks for pointing that out! GitHub Issues don't render Mermaid natively (unlike PR descriptions). I've updated the comment above — all 5 diagrams are now rendered as images via mermaid.ink. Should be fully visible now.
KUNDAN1334 commentedon Feb 27, 2026
Great work @himanshu748 — very comprehensive.
One thing worth flagging: PR #58 (merged by @SanthoshToorpu)establishes Kagent as the orchestration layer. The LangGraph router in #68 is technically strong but may diverge from the official Kagent direction.
@SanthoshToorpu @chasecadet — would it be useful to clarify whether LangGraph and Kagent are meant to coexist, or if one is the preferred path?
Happy to focus my contribution on extending the Kagent POC with multi-source retrieval if that's more aligned.
14 remaining items
GunaPalanivel commentedon Mar 7, 2026
Hey, i spent some time going through the entire codebase before jumping into any feature work and honestly there are a few things that need fixing first otherwise whatever we build on top is going to inherit these problems
here is what i found after reading every file
the main ones:
both servers (
server/andserver-https/) still use the oldpymilvus connections.connect()api which is global state and not thread safe. under any real traffic this will racethe
SentenceTransformermodel gets created insidemilvus_search()on every single request. thats a 420mb model loading from disk every time someone asks a questionhttpxclient also gets created per request instead of being reused, so no connection pooling at allthe mcp server has a
_init()function with a classic check-then-act race condition, two requests hit it at the same time and you get double initializationCORS is set to
allow_origins=["*"]withcredentials=truewhich is basically wide openthe kagent pipeline has a double
@dsl.componentdecorator onchunk_and_embedso it will crash at runtime with a missing module errorthe main pipeline drops the entire milvus collection before reinserting, so if it fails halfway through you get zero results
milvus credentials are hardcoded as
root/Milvusright in the sourcethere are placeholder values like
YOUR_NAMESPACEandYOUR_DOCKERHUB_USERNAMEin the manifests that will silently fail on deploysystem prompt is copy pasted across 3 files, same with the tools definition
tried running the poc locally on wsl2 with
kindand the milvus helm chart immediately crashed wsl because of memory pressure, no mention of this anywhere in the readmenone of these are feature requests, these are things that are already broken or will break the moment you put real traffic on it. i tracked all of this in issue
#72with the dependency order of what needs to get fixed firsti'll update there with the individual issues and pr flow, your guidance will make this even better
cc: @SanthoshToorpu
GunaPalanivel commentedon Mar 7, 2026
updated my plan to align with the merged spec and the latest codebase audit. details are in my comment above. Let me know if anything needs adjusting.
cc: @chasecadet @tarekabouzeid @SanthoshToorpu
sakshisemalti commentedon Mar 8, 2026
Following up on my earlier points, good to see the auth-before-scaling concern resonated with others.
One gap I haven't seen discussed yet: once the pre-work is done and the ingestion pipelines are running, how do we know what's in Milvus is actually returning good results? The spec explicitly calls for a feedback loop and golden dataset, but there's no component for this yet in the codebase.
I'd like to take ownership of this piece, building the evaluation layer that measures retrieval quality after every ingestion run, and the feedback loop that continuously improves it over time.
@chasecadet @SanthoshToorpu happy to share more details on my approach if useful.
kmr-rohit commentedon Mar 12, 2026
Hi everyone! I'm Rohit (@kmr-rohit), I've been working on this repo (CI workflows, MCP server env config, API server image builds) and would like to contribute further for GSoC 2026.
After going through the KEP, the merged spec, and this discussion thread, I'd like to focus on these areas:
1. GitHub Issues Ingestion Pipeline + MCP Tool
The
download_github_issuescomponent already exists atpipelines/kubeflow-pipeline.py:67-213but isn't wired into any pipeline. I'd like to:pipelines/issues-pipeline.py) that wires it:download_github_issues → chunk_and_embed_issues → store_milvusissues_ragMilvus collection with issue-specific metadata (issue_number, state, labels)search_github_issuestool to the MCP serverkubeflow/kubeflow,kubeflow/pipelines,kubeflow/manifestsQuestion for mentors: Should this be a separate
issues_ragcollection or partition isolation withindocs_rag(relates to Issue #10)?2. Test Infrastructure
The repo currently has zero tests. I'd like to add:
search_kubeflow_docstool) with mocked Milvus.github/workflows/tests.yml) to run pytest on every PR3. Code Ingestion Pipeline (YAML/AST-aware)
KEP Phase 1 calls for code ingestion of
kubeflow/manifests. This doesn't exist yet. I'd like to build:---resource boundaries and extracts K8s metadata (kind,name,namespace)code_ragMilvus collection withresource_kind,resource_name,file_typefieldssearch_kubeflow_codeMCP toolQuestion for mentors: For
kubeflow/manifests, should I scope to just Kustomize/YAML resources initially, or also include Python/Go source via AST from the start?4. OCI Deployment Experience
I've also been working with @jaiakash on deploying the full Kubeflow platform and docs-agent stack on OCI using Terraform (jaiakash/deploy-kubeflow). The setup covers OKE cluster provisioning, Kubeflow installation, and the docs-agent components. Happy to contribute deployment documentation or Terraform modules upstream if that's useful.
I'll open separate tracking issues for each area and start with PR 1 (tests) since it's purely additive and conflicts with nobody.
Happy to discuss or adjust scope based on mentor feedback. cc @SanthoshToorpu @chasecadet @tarekabouzeid
Prathyusha-hub-M commentedon Mar 14, 2026
Thanks for opening this design discussion. I’ve been reading through the thread, the merged spec, and the repo to understand the direction of the project. From what I understand, the goal is to evolve the current Kubeflow docs assistant from a single RAG pipeline into a more agentic system that can route queries across multiple sources (docs, issues, platform architecture, etc.), while running on a Kubernetes-native stack with Kagent handling orchestration.
Building on the discussion around retrieval quality and evaluation raised by @sakshisemalti, @asfandyar-prog, and @KUNDAN1334, I had a question about how the evaluation layer is expected to interact with the agent at runtime. It seems like the current idea focuses on offline benchmarking with a golden dataset and metrics such as Recall@k or MRR. Would there also be value in lightweight runtime signals from the retrieval layer (for example, similarity thresholds, reranking, or confidence flags) that the agent could use to decide whether to retry retrieval or return a fallback response?
I’m also curious whether defining a small shared schema or “contract” for retrieval responses early on might help keep things consistent across tools and pipelines. For example, each tool returning structured fields such as source_url, chunk_text, and similarity_score could make it easier to plug evaluation, logging, and retry logic into the agent layer regardless of whether orchestration is handled by Kagent or another framework.
I’m currently going through the docs-agent codebase and the Kagent POC to understand the architecture more deeply, and I’d love to contribute where it would be most useful. Areas like retrieval evaluation, ingestion pipelines, or improving the routing logic seem especially interesting to me. If there are specific areas where contributors should focus at this stage, I’d be happy to dig into those.
KUNDAN1334 commentedon Mar 14, 2026
Thanks for the detailed spec @chasecadet @tarekabouzeid — this really clarifies the scope.
A few areas I'm particularly interested in contributing to:
Code Ingestion Pipeline — AST parsing of kubeflow/manifests for developer-focused queries. This complements the docs pipeline I already have scoped.
Scale-to-Zero (Issue feat: Add Scale-to-Zero configuration to KServe InferenceService #47) — already validated locally on Kind, ready to test on OCI cluster once access is available.
Katib integration for RAG hyperparameter tuning — chunk size, top-k, temperature optimization via the feedback loop.
Happy to pick up issues as they get chunked out. Looking forward to the community call!
KUNDAN1334 commentedon Mar 14, 2026
Adding more specifics to my earlier comment:
For Scale-to-Zero (Issue #47) — I've already tested minReplicas: 0 with scaleToZeroGracePeriod: 120s on Kind/Mac M4. The manifest is ready. Main blocker is validating actual pod scale-down which needs the OCI cluster. Happy to take this end-to-end once cluster access is available.
For the namespace fix (Issue #91) — I have the server.py + manifests fix ready. Waiting on @SanthoshToorpu for namespace approach confirmation before opening PR.
One area nobody has claimed yet: WebSocket / SSE support for long-lived agent connections (mentioned in the spec under "Hardened System Considerations"). Happy to scope this out as a separate issue if useful.
SameerAliKhan-git commentedon Mar 16, 2026
Design Proposal — Agentic RAG on Kubeflow
Contributor: Sameer | CS student, Hyderabad, India
After reading through the existing codebase, I want to share my initial design thinking for the agentic upgrade. Happy to be corrected on anything — this is my first time working with this stack.
What the current system does well
The 2025 implementation already has a solid foundation:
--enable-auto-tool-choicealready enabled in the vLLM configsearch_kubeflow_docsThe core gap: one tool, no routing
The current system has a single tool (
search_kubeflow_docs) and every query takes the same path regardless of what's being asked. A question like "What changed in KFP v2?" should fetch from the live GitHub repo. A question like "What is a pipeline?" might not need retrieval at all. Right now, both go through the same Milvus lookup.Proposed agentic upgrades
1. Query router / classifier
Add a lightweight classifier at the start of the pipeline to bucket incoming queries:
This avoids unnecessary Milvus calls and improves latency for simple queries.
2. Expand the tool registry
Beyond
search_kubeflow_docs, add:search_github_repo(repo, query)— fetches live from the Kubeflow GitHub repos for code examples and recent changesget_file_content(repo, path)— retrieves a specific manifest or config file when the user asks about a specific component3. Multi-step reasoning loop
For complex questions, allow the agent to chain tool calls — e.g., first search the docs, then look up the specific manifest referenced in the docs, then synthesize a cited answer from both sources.
4. Chat history summarization
The README mentions chat history is currently in
localStoragewith a known token overflow risk. A simple summarization step after N turns would prevent context window issues during longer sessions.Current architecture (2025 baseline)
flowchart TD User(["User query"]) --> API["FastAPI server"] API --> LLM["Llama 3.1-8B via KServe"] LLM -->|"decides to call"| Tool["search_kubeflow_docs (only tool)"] Tool --> Milvus[("Milvus vector DB")] Milvus -->|"top-k chunks"| Tool Tool -->|"context"| LLM LLM -->|"cited answer"| User subgraph ETL ["KFP ingestion pipeline"] GH["GitHub repos"] -->|"fetch docs"| Chunk["chunk + embed"] Chunk -->|"store vectors"| Milvus endProposed agentic architecture (2026)
flowchart TD User(["User query"]) --> API["FastAPI server"] API --> Router{"Query router (classifier)"} Router -->|"simple query"| LLM Router -->|"docs question"| LLM Router -->|"code / config"| LLM Router -->|"complex multi-step"| LLM LLM["Llama 3.1-8B via KServe"] -->|"selects tool(s)"| Registry["Tool registry"] Registry --> T1["search_kubeflow_docs — Milvus"] Registry --> T2["search_github_repo — Live GitHub API"] Registry --> T3["get_file_content — Specific manifests"] T1 -->|"chunks + URLs"| LLM T2 -->|"live code / issues"| LLM T3 -->|"YAML / config"| LLM LLM -->|"cited answer"| User subgraph ETL ["KFP ingestion pipeline"] GH["GitHub repos"] --> Chunk["chunk + embed"] --> Milvus[("Milvus")] end T1 -.- MilvusOpen question for mentors
For the query router — would a small fine-tuned classifier model be preferred here, or is a prompt-based routing approach (asking the LLM itself to classify the query type) more aligned with the project's direction? I want to make sure my proposal matches the architecture vision before going deeper.
Looking forward to feedback, and happy to adjust any of this based on the mentors' direction!
Anurag-M1 commentedon Mar 19, 2026
Reading through the full thread — one gap I don't see addressed yet is the portability separation @tarekabouzeid emphasized: Core Kubeflow Services vs OCI-specific adapters. The current Terraform scaffolding (PR #71) bundles both. I'm planning to propose a clean module boundary in my GSoC proposal so the reference architecture is genuinely redeployable on any cluster, not just OCI. Happy to discuss the right abstraction layer for this.
Anurag-M1 commentedon Mar 19, 2026
@chasecadet After reading server-https/app.py in depth, I noticed the handle_tool_follow_up() function sends results back as a single formatted string. For multi-source routing, this response format will need to be structured (source type + content + citation) so the agent can reason about which index answered the query. Planning to address this in my proposal.
GunaPalanivel commentedon Mar 26, 2026
I ran an audit of upstream/main (db8fda6) against #72 and recent bug reports. No bug fix PRs have been merged to date. 18 bugs are still live.
Key findings:
connections.connect()(not thread-safe).mcp-server/_init()has a TOCTOU race condition (bug: Race condition in mcp-server/server.py _init() under concurrent requests #74, bug(mcp-server): race condition in _init() allows multiple threads to initialize model and client simultaneously #169).SentenceTransformerloads from disk on every request (Performance Bug: SentenceTransformer is re-initialized on every Milvus search request #128, bug(server-https): SentenceTransformer model reloaded on every query causing severe latency #157).httpx.AsyncClientis created per request (bug: httpx.AsyncClient created per-request in server-https/app.py #75).server-https/app.pysetsallow_origins=["*"]with credentials (security: Replace CORS allow_origins=["*"] with env-var allowlist #76).chatbot.jsis vulnerable to XSS viainnerHTMLinjections (bug(frontend): XSS vulnerability in chatbot.js — inline code and bold text not HTML-escaped before innerHTML #175). Milvus credentials are hardcoded (bug(mcp-server): Placeholder <YOUR_NAMESPACE> in Milvus connection URI #91).milvus_searchswallows all exceptions (bug(server, server-https): milvus_search silently swallows all exceptions, preventing retry and transparent degradation #160). Mutual recursion betweenstream_llm_responseandhandle_tool_follow_upresults in unbounded stack growth (bug(server-https): mutual recursion between stream_llm_response and handle_tool_follow_up causes unbounded stack growth #152). Pipeline chunking throwsZeroDivisionErroron empty docs (bug(pipelines): ZeroDivisionError crash in chunk_and_embed when text splitter returns empty chunks #148, bug(pipelines): ZeroDivisionError in chunk_and_embed_incremental when text splitter returns empty chunks #163). Citations are dropped in follow-up calls (bug(server-https): citations from follow-up tool calls are silently discarded #154).milvus-deployment.yamlis a raw pod dump rather than a manifest (bug(manifests): milvus-deployment.yaml is a live Pod state dump, not an applicable Deployment manifest #171). Found 14 unhandled placeholders (<YOUR_NAMESPACE>) across the manifests.I also noted Chase's recent comment that local dev "isnt worth it", which drops the priority of local WSL2/memory fixes to shift focus toward OCI deployments.
Proposed next step for #72: add the open bug tickets (#128, #91, #148, #163, #152, #154, #160, #171, #175) to the checklist and close the duplicates. Let's fix these foundational issues before layering more features.
cc: @SanthoshToorpu @jaiakash
JayDS22 commentedon Mar 27, 2026
A few things from running this stack in production:
On content truncation: The main servers truncate
content_textto 400 chars before the LLM sees it, but the pipeline stores 2000 chars and the MCP server doesn't truncate at all. Same index, different answer quality depending on the code path. Makes evaluation inconsistent. Filed as [#181].On scale-to-zero: Cold start with vLLM + Llama 3.1-8B is 30-60s for GPU model load. What worked for us: KEDA ScaledObject keeping
minReplicas: 1during traffic hours, scale to 0 off-hours only. Cut costs ~60%, kept p99 under 3s.On Feast: The
kagent-feast-mcppipeline monkey-patches Feast's VARCHAR limit at runtime. The main servers already use pymilvus directly without this problem. Worth deciding early whether Feast stays in the production path.Ritvikesh253 commentedon Mar 29, 2026
Hi @chasecadet @SanthoshToorpu — I've just submitted my GSoC 2026 proposal for the Agentic RAG project to help Kubeflow users find documentation more intelligently.
A bit about me:
I'm excited about the possibility of contributing to Kubeflow's documentation infrastructure! Happy to iterate on scope or answer any questions about my technical approach.
GitHub: github.com/Ritvikesh253
Linkdin : www.linkedin.com/in/ritvikesh-reddy-38ab37317
Proposal submitted via GSoC portal on March 29, 2026.
Looking forward to your feedback!
chasecadet commentedon Nov 20, 2026
Closing this GSoC 2026 pre-application design discussion thread now that the GSoC 2026 Agentic RAG architecture (#207, #210, #240, #249, #261, #262) has shipped on
main. Thank you to everyone who participated!