Mumbai Swapnil Patil — RAG-to-MCP Submission - #33
Open
swap002 wants to merge 3 commits into
Open
Conversation
…an injury/child/school/hazard complaint fall through as Standard priority → added an explicit severity-keyword scan that forces Urgent independent of and prior to taxonomy classification, plus Other+NEEDS_REVIEW fallback for descriptions matching no taxonomy keyword
….2's two approvers (Department Head, HR Director) across separate chunks → switched to sentence-accumulating chunking capped at 400 tokens; verified clause 5.2 stays intact in one chunk against the real policy documents Also fixes, per the same enforcement pass: - Wrong retrieval: collection built with cosine space + 0.6 similarity filter, retrieved chunks grouped by source document so cross-document evidence is never merged into one claim. - Context breach: retrieve_and_answer prompts the LLM with only post-threshold retrieved chunks; when nothing clears the threshold it returns the refusal template verbatim without calling the LLM at all.
… call query_policy_documents for any question, wasting calls and inviting hallucinated refusals → tool description now explicitly names the three covered documents and states refusal behavior for out-of-scope questions Implemented do_POST to dispatch tools/list and tools/call over JSON-RPC 2.0 (HTTP 200 always, -32700/-32601/-32602 for parse/unknown-method/ unknown-tool errors), and query_policy_documents to map RAG refusals and exceptions to isError: true with a non-empty content message. Verified with test_client.py --run-all: tools/list correctly reports scope, the budget-forecast question correctly returns isError: true, and the unknown-method call correctly returns -32601. The two in-scope answer tests currently fail because chromadb is not installed in this environment (no packages were installed per instructions) — the server surfaces that as isError: true with the underlying ModuleNotFoundError rather than crashing or fabricating an answer.
|
Hi there, participant! Thanks for joining our RAG-to-MCP Workshop! We're reviewing your PR for the 3 Use Cases (UC-0A, UC-RAG, UC-MCP). Once your submission is validated and merged, you'll be awarded your completion badge! Next Steps:
|
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.
RAG-to-MCP — Submission PR
Name: Swapnil Patil
City / Group: Mumbai
Date: 2026-07-16
AI tool(s) used: Claude Code (Sonnet 5)
Submission Checklist
uc-0a/agents.md— present and updateduc-0a/skills.md— present and updateduc-0a/classifier.py— runs without crashuc-0a/results_pune.csv— output present (notest_mumbai.csvexists indata/city-test-files/, so Pune was used — see note below)uc-rag/agents.md— present and updateduc-rag/skills.md— present and updateduc-rag/rag_server.py— not the stub, own implementationuc-mcp/agents.md— present and updateduc-mcp/skills.md— present and updateduc-mcp/mcp_server.py— passes 3 of 5test_client.pychecks (see UC-MCP section — the 2 failures are an environment limitation, not a server bug)Note on city: the branch/participant name uses Mumbai, but
data/city-test-files/only shipstest_pune.csv,test_hyderabad.csv,test_kolkata.csv,test_ahmedabad.csv(no Mumbai file). Usedtest_pune.csvfor UC-0A.Note on environment: per instructions for this exercise, no new packages were installed.
sentence-transformerswas already present;chromadbandgoogle-generativeaiwere not, and were not installed. This means UC-RAG'sbuild_index/retrieve_and_answerand UC-MCP's in-scope answer path could not be run end-to-end in this environment. Everything that doesn't require those two packages was verified directly (see below) — installchromadb+google-generativeaiand setGEMINI_API_KEYto run the full pipeline.UC-0A — Complaint Classifier
Which failure mode did you encounter first?
Which enforcement rule fixed it? Quote from your agents.md:
Your commit message for UC-0A:
Verification checkpoints:
results_pune.csv: rows PM-202402 (child/school), PM-202411 (hazard), PM-202420 (injury), PM-202446 (fell) are all Urgent.categoryis one of the 10 allowed values.UC-RAG — RAG Server
Which failure mode did you encounter? (chunk boundary / wrong retrieval / answer outside context)
What chunking strategy did you use and why?
Did your system correctly refuse "What is the flexible working culture?"? (Should return refusal template — not in any document)
Did your system retrieve the correct document for "Can I use my personal phone for work files?"? (Should retrieve IT policy, not HR leave policy)
Which enforcement rule in agents.md prevented answers outside retrieved context?
Your commit message for UC-RAG:
Verification checkpoints:
UC-MCP — MCP Server
Paste your tool description from mcp_server.py TOOL_DEFINITION:
Does it state the document scope explicitly?
Run result:
python3 test_client.py --run-all(Paste the summary output)Did the budget forecast question return isError: true?
In one sentence — why is the tool description the enforcement?
Your commit message for UC-MCP:
Verification checkpoints:
python3 test_client.py --run-allexecutes without connection error.isError: true.CRAFT Reflection
Which step of the CRAFT loop was hardest across all three UCs?
What did you add to agents.md manually that the AI did not generate?
One specific task in your real work where you will use R.I.C.E in the next 7 days: