Delegate RAG and query enrichment to vtk-mcp#33
Draft
vicentebolea wants to merge 11 commits intomasterfrom
Draft
Delegate RAG and query enrichment to vtk-mcp#33vicentebolea wants to merge 11 commits intomasterfrom
vicentebolea wants to merge 11 commits intomasterfrom
Conversation
Replace local ChromaDB-based RAG with vtk-mcp HTTP client that provides richer context via hybrid vector search, VTK class API documentation lookup, and post-generation import validation. - Add vtk_mcp_client.py: HTTP JSON-RPC client for vtk-mcp server - vector_search: hybrid search over VTK code examples - search_classes + get_class_info: query enrichment with VTK API docs - fix_imports: validate and auto-correct VTK import statements - client.py: replace ChromaDB paths with vtk-mcp; single VTKMCPClient instance per query reused for both context enrichment and import fixing - cli.py: replace --collection/--database with --mcp-url - state/initializer.py: pass mcp_url state to VTKPromptClient - pyproject.toml: drop heavy RAG deps from core; add requests; keep old deps in optional [rag] extra for legacy rag-chat/build-rag-db tools
- Fix client.py query(): remove duplicate content re-assignment after tool loop, guard regex extraction with empty-match handling, use getattr for optional usage attribute - generation.py: execute_with_renderer now returns (success, error); on execution failure retry once via prompt_client.query(execution_error=) when vtk-mcp is configured so the LLM can use tools to fix the code
- Wrap long return tuple onto multiple lines (E501) - Add type: ignore[call-overload] on create() with unpacked tools dict
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
vtk_mcp_client.pyHTTP client--ragnow requires--mcp-urlpointing to a running vtk-mcp server--mcp-urlis set)How it works
When
--mcp-urlis set, a singleVTKMCPClientinstance is created per query and used for:--rag): hybrid vector search over VTK examples + Python API docs for relevant VTK classesChanges
vtk_mcp_client.py: new HTTP JSON-RPC client wrapping vtk-mcp toolsclient.py: removed ChromaDB code paths; addedmcp_urlfieldcli.py: replaced--collection/--databasewith--mcp-urlpyproject.toml: removed all RAG deps; addedrequests; removedrag-chat,vtk-build-rag,vtk-test-ragentry pointsrag_chat_wrapper.py,build_rag_db.py,test_rag.py,rag-components/submodule,data/,db/Usage
Test plan
45 passed, 14 skipped)--mcp-urlstill works