Skip to content

[Bengaluru] Sivasubramanian — RAG to MCP Submission - #49

Open
sivasubramanian86 wants to merge 3 commits into
nasscomAI:masterfrom
sivasubramanian86:participant/sivasubramanian-bengaluru
Open

[Bengaluru] Sivasubramanian — RAG to MCP Submission#49
sivasubramanian86 wants to merge 3 commits into
nasscomAI:masterfrom
sivasubramanian86:participant/sivasubramanian-bengaluru

Conversation

@sivasubramanian86

Copy link
Copy Markdown

RAG-to-MCP — Submission PR

Name: Sivasubramanian
City / Group: Bengaluru
Date: 24-08-2026
AI tool(s) used: Google Antigravity / Gemini


Submission Checklist

  • uc-0a/agents.md — present and updated
  • uc-0a/skills.md — present and updated
  • uc-0a/classifier.py — runs without crash
  • uc-0a/results_pune.csv — output present
  • uc-rag/agents.md — present and updated
  • uc-rag/skills.md — present and updated
  • uc-rag/rag_server.py — not the stub, your implementation
  • uc-mcp/agents.md — present and updated
  • uc-mcp/skills.md — present and updated
  • uc-mcp/mcp_server.py — passes at least one test_client.py test
  • 3+ commits with meaningful messages, one per UC
  • All sections below filled

UC-0A — Complaint Classifier

Which failure mode did you encounter first?

Severity blindness and taxonomy drift. Naive LLM prompts misclassified high-severity hazards (children near deep potholes, fallen seniors, fire/electrical hazards) as Standard priority.

Which enforcement rule fixed it? Quote from your agents.md:

"Priority must be Urgent if description contains any severity keyword: injury, child, school, hospital, ambulance, fire, hazard, fell, collapse. Otherwise, classify as Standard or Low based on impact."
"Category must be exactly one of: Pothole, Flooding, Streetlight, Waste, Noise, Road Damage, Heritage Damage, Heat Hazard, Drain Blockage, Other. No variations, abbreviations, or plurals."

Your commit message for UC-0A:

d76428c UC-0A Generated agents.md and skills.md, implemented complaint classifier

Verification checkpoints:

  • All severity-signal rows (injury/child/school/hospital keywords) classified as Urgent
  • No invented categories outside the defined taxonomy
  • Justification column present and non-empty for every row

UC-RAG — RAG Server

Which failure mode did you encounter?
(chunk boundary / wrong retrieval / answer outside context)

Chunk boundary cutting multi-condition approval rules (splitting Clause 5.2 across chunks) and cross-document blending on personal device questions.

What chunking strategy did you use and why?

Sentence-aware chunking (_chunk_text) accumulating whole sentences up to 400 tokens without splitting mid-sentence. This prevents cutting binding clauses and preserves complete obligations within single chunks.

Did your system correctly refuse "What is the flexible working culture?"?
(Should return refusal template — not in any document)

Yes — Returns: This question is not covered in the retrieved policy documents. Retrieved chunks: none (out of policy scope). Please contact the relevant department for guidance.

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)

Yes — Correctly retrieves policy_it_acceptable_use.txt chunk 0 and restricts access to CMC email and self-service portal only without blending HR leave text.

Which enforcement rule in agents.md prevented answers outside retrieved context?

"Answer must use only information present in the retrieved chunks. Never add context from outside the retrieved set."
"If no retrieved chunk scores above similarity threshold 0.6 — output the refusal template. Never generate an answer from general knowledge."

Your commit message for UC-RAG:

fb82ff1 UC-RAG Generated agents.md and skills.md, implemented RAG server with grounded retrieval

Verification checkpoints:

  • At least 3 test queries return grounded answers (cited from retrieved context)
  • "What is the flexible working culture?" returns the refusal template (not a hallucinated answer)
  • "Can I use my personal phone for work files?" retrieves IT policy, not HR leave policy
  • Chunking produces more than 1 chunk per document (not whole-document embedding)

UC-MCP — MCP Server

Paste your tool description from mcp_server.py TOOL_DEFINITION:

Answers questions about City Municipal Corporation (CMC) policy documents only: CMC HR Leave Policy, IT Acceptable Use Policy, and Finance Reimbursement Policy. Returns cited answers grounded in retrieved document chunks. Returns a refusal with isError: true for questions outside these three documents (such as budget forecasts).

Does it state the document scope explicitly?

Yes — explicitly states CMC HR Leave Policy, IT Acceptable Use Policy, and Finance Reimbursement Policy.

Run result: python test_client.py --run-all
(Paste the summary output)

Running all reference verification tests against port 8769...
============================================================
TEST: tools/list — discover available tools
Tools returned: 1
  name: query_policy_documents
  required: ['question']
[PASS] Tool description mentions scope
============================================================
TEST: In-scope: 'Who approves leave without pay?'
isError: False
[PASS] — got an answer
============================================================
TEST: Cross-doc test: personal phone + work files
isError: False
[PASS] — got an answer
============================================================
TEST: Out-of-scope: 'What is the budget forecast for 2025?'
isError: True
[PASS] — correctly refused out-of-scope question
============================================================
TEST: Unknown method -> expect JSON-RPC error -32601
JSON-RPC Error: code=-32601 message=Method 'tools/unknown_method' not found
[PASS] — expected error received

Did the budget forecast question return isError: true?

Yes — returned isError: True with refusal text.

In one sentence — why is the tool description the enforcement?

The tool description is the system boundary that calling agents read to determine tool applicability; an explicit scope prevents out-of-domain invocations and hallucinated outputs before tool execution begins.

Your commit message for UC-MCP:

4eb485c UC-MCP Generated agents.md and skills.md, implemented MCP tool server

Verification checkpoints:

  • Tool description explicitly states document scope (which policies are covered)
  • Tool description states refusal behavior for out-of-scope queries
  • python test_client.py --run-all executes without connection error
  • Budget forecast question returns isError: true (out of scope)

CRAFT Reflection

Which step of the CRAFT loop was hardest across all three UCs?

The Analyze step for the MCP server boundary and RAG chunking, ensuring that edge queries like cross-document personal device access never blend disparate policy documents or drop multi-condition clauses.

What did you add to agents.md manually that the AI did not generate?

The explicit cross-document isolation rule: "If the query spans two documents — retrieve from each separately. Never merge retrieved chunks from different documents into one answer."

One specific task in your real work where you will use R.I.C.E in the next 7 days:

Designing scoped MCP tool contracts for internal agentic document retrieval pipelines to prevent agent hallucination and out-of-domain tool calls.

@github-actions

Copy link
Copy Markdown

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:

  • Make sure all 3 UCs are finished.
  • Ensure your commit messages match the required format.
  • Fill out every section of the PR template.
  • Good luck!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant