Skip to content

[TechM] Ravi Devulapalli — Vibe Coding Submission#10

Open
RaviDevulapalli wants to merge 25 commits intonasscomAI:mainfrom
RaviDevulapalli:participant/ravidevulapalli-techm
Open

[TechM] Ravi Devulapalli — Vibe Coding Submission#10
RaviDevulapalli wants to merge 25 commits intonasscomAI:mainfrom
RaviDevulapalli:participant/ravidevulapalli-techm

Conversation

@RaviDevulapalli
Copy link
Copy Markdown

@RaviDevulapalli RaviDevulapalli commented Apr 16, 2026

UC-0A — Complaint Classifier

Approach

Implemented a rule-based classifier using strict category mapping and severity keyword detection. Ensured exact category enforcement and consistent priority assignment.

Fixes Applied

  • Fixed input parsing by using the correct 'description' column
  • Added strict severity keyword handling for Urgent classification
  • Enforced single-sentence reason generation citing keywords
  • Simplified ambiguity handling to avoid false NEEDS_REVIEW flags

Output Validation

  • All categories match allowed values
  • Urgent priority correctly assigned based on severity keywords
  • Reason field present for all rows
  • No incorrect ambiguity flags

Enforcement

  • Category must strictly match one of the allowed taxonomy values (no new or inferred categories)
  • Presence of severity keywords (e.g., injury, child, school, hospital, ambulance, fire, hazard, fell, collapse) must always result in Urgent priority
  • Reason must be exactly one sentence and must include at least one word from the complaint description
  • NEEDS_REVIEW flag must be set only when multiple distinct categories are detected; otherwise it must remain empty
  • Classification must rely only on the description field with no external inference or additional context

Notes

Focused on preventing taxonomy drift by enforcing exact category values, ensuring severity keywords always trigger Urgent priority, and minimizing false ambiguity by restricting NEEDS_REVIEW to genuine multi-category cases.

UC-RAG — RAG Server

Approach

Implemented a retrieval-augmented generation (RAG) pipeline using sentence-transformers and ChromaDB. Ensured strict grounding so answers are generated only from retrieved chunks.

Fixes Applied

  • Fixed chunk boundary issues using sentence-aware chunking (max 400 tokens)
  • Improved retrieval by normalizing similarity scores and adjusting threshold to 0.4
  • Prevented hallucination using strict sentence-level extraction
  • Enforced single-document selection to avoid cross-policy blending

Output Validation

  • Leave approval → HR policy (Dept Head + HR Director)
  • Personal phone → IT policy (email + portal only)
  • Flexible culture → Refusal
  • Equipment allowance → Finance policy (Rs 8,000, permanent WFH)

Enforcement

  • Max 400 tokens per chunk, no mid-sentence split
  • Answers strictly derived only from retrieved chunks (no external knowledge)
  • Mandatory citations
  • Refusal if no chunk above threshold
  • Single-document enforcement

Notes

  • Threshold tuned from 0.6 to 0.4
  • Rule-based grounding avoids hallucination
  • LLM kept swappable

UC-X — Ask My Documents

Approach

Implemented a deterministic, policy-grounded question answering system over three fixed documents. Replaced scoring-based retrieval with intent-to-section mapping to ensure strict single-section grounding and eliminate ambiguity in retrieval.

Fixes Applied

  • Fixed incorrect section selection caused by token-overlap scoring (e.g., Section 2.4 vs 5.2 for LWP)
  • Eliminated cross-document blending by enforcing single-section answer constraint
  • Added strict refusal handling for incomplete or multi-source queries
  • Replaced retrieval scoring with deterministic intent-to-section mapping to resolve ambiguity (especially LWP case)
  • Ensured exact refusal template usage with no variation

Output Validation

  • Carry forward leave → HR policy (Section 2.6)
  • Slack installation → IT policy (Section 2.3)
  • Equipment allowance → Finance policy (Section 3.1, Rs 8,000)
  • Personal phone usage → Refusal (no cross-policy blending)
  • Flexible working culture → Refusal (not present in documents)
  • DA and meal claims → Finance policy (Section 2.6, explicitly prohibited)
  • Leave without pay approval → HR policy (Section 5.2, Dept Head + HR Director)

Enforcement

  • Answers must be derived from exactly one section within one document
  • No cross-document or cross-section aggregation allowed
  • No hedging or inferential language permitted
  • Refusal required if answer is not explicitly and completely available in a single section
  • Mandatory citation format: Source: <document_name>, Section <X.X>

Notes

  • Initial scoring-based retrieval failed due to generic keyword dominance (e.g., “leave”, “approval”)
  • Iterative fixes included threshold filtering and strict refusal enforcement
  • Final solution uses deterministic intent mapping to guarantee correctness and eliminate ambiguity
  • Design prioritizes correctness and grounding over generalization

UC-MCP — Expose RAG as MCP Tool

Approach

Implemented a plain HTTP MCP server using JSON-RPC 2.0 to expose the RAG system as a callable tool. Ensured strict tool scoping through description and input schema so that agents invoke the tool only for CMC HR, IT, and Finance policy queries.

Fixes Applied

  • Fixed false refusal for valid queries by correcting RAG logic to return answers when relevant chunks are retrieved
  • Fixed retrieval failure caused by incorrect ChromaDB path resolution when invoked from MCP server
  • Improved retrieval reliability by lowering similarity threshold to avoid missing relevant chunks
  • Fixed scope leakage (out-of-scope queries returning answers) by adding relevance validation before answering
  • Enforced MCP protocol compliance:
    • JSON-RPC 2.0 response structure
    • HTTP 200 for all application-level responses
    • Proper error handling using isError and JSON-RPC error codes

Output Validation

  • Leave without pay approval → HR policy answer with citations
  • Personal phone usage for work → IT policy answer
  • Budget forecast query → Refusal (out-of-scope)
  • Unknown method → JSON-RPC error -32601

Enforcement

  • Tool description explicitly restricts scope to CMC HR Leave Policy, IT Acceptable Use Policy, and Finance Reimbursement Policy
  • Input schema enforces non-empty question field
  • Refusal enforced when no relevant chunks are retrieved or retrieved content is not relevant to the query
  • No empty responses — always return content with isError flag
  • Strict separation of responsibilities: RAG determines answer vs refusal, MCP enforces protocol and tool contract

Notes

  • Initial implementation failed due to incorrect database path causing empty retrieval and over-reliance on LLM output for refusal decisions.
  • Final solution ensures retrieval-driven decision making, explicit relevance validation, and strict tool-level enforcement to prevent misuse by agents

@github-actions
Copy link
Copy Markdown

👋 Hi there, participant! Thanks for joining our Vibe Coding Session!

We're reviewing your PR for the 4 User Cases. Once your submission is validated and merged, you'll be awarded your completion badge! 🏆

Next Steps:

  • Make sure all 4 UCs are finished.
  • Ensure your commit messages match the required format.
  • Good luck!

@github-actions
Copy link
Copy Markdown

👋 Hi there, participant! Thanks for joining our Vibe Coding Session!

We're reviewing your PR for the 4 User Cases. Once your submission is validated and merged, you'll be awarded your completion badge! 🏆

Next Steps:

  • Make sure all 4 UCs are finished.
  • Ensure your commit messages match the required format.
  • Good luck!

@github-actions
Copy link
Copy Markdown

👋 Hi there, participant! Thanks for joining our Vibe Coding Session!

We're reviewing your PR for the 4 User Cases. Once your submission is validated and merged, you'll be awarded your completion badge! 🏆

Next Steps:

  • Make sure all 4 UCs are finished.
  • Ensure your commit messages match the required format.
  • Good luck!

@github-actions
Copy link
Copy Markdown

👋 Hi there, participant! Thanks for joining our Vibe Coding Session!

We're reviewing your PR for the 4 User Cases. Once your submission is validated and merged, you'll be awarded your completion badge! 🏆

Next Steps:

  • Make sure all 4 UCs are finished.
  • Ensure your commit messages match the required format.
  • Good luck!

@github-actions
Copy link
Copy Markdown

👋 Hi there, participant! Thanks for joining our Vibe Coding Session!

We're reviewing your PR for the 4 User Cases. Once your submission is validated and merged, you'll be awarded your completion badge! 🏆

Next Steps:

  • Make sure all 4 UCs are finished.
  • Ensure your commit messages match the required format.
  • Good luck!

…undaries → added RICE-compliant agents.md with strict grounding, citation, and refusal constraints
…chunking failure modes → defined chunk_documents and retrieve_and_answer with thresholding, metadata, and error handling
…across chunks → implemented sentence-aware chunking with max 400 token limit
… chunks to fall below threshold → introduced 1/(1+dist) similarity scoring and adjusted threshold to 0.4 based on observed embedding distribution
…t sections → implemented strict sentence-level extraction limited to retrieved context only
…cuments → enforced single highest-scoring document selection per query
@github-actions
Copy link
Copy Markdown

👋 Hi there, participant! Thanks for joining our Vibe Coding Session!

We're reviewing your PR for the 4 User Cases. Once your submission is validated and merged, you'll be awarded your completion badge! 🏆

Next Steps:

  • Make sure all 4 UCs are finished.
  • Ensure your commit messages match the required format.
  • Good luck!

@github-actions
Copy link
Copy Markdown

👋 Hi there, participant! Thanks for joining our Vibe Coding Session!

We're reviewing your PR for the 4 User Cases. Once your submission is validated and merged, you'll be awarded your completion badge! 🏆

Next Steps:

  • Make sure all 4 UCs are finished.
  • Ensure your commit messages match the required format.
  • Good luck!

@RaviDevulapalli RaviDevulapalli changed the title [TechM] [Ravi Devulapalli] — Vibe Coding Submission [TechM] Ravi Devulapalli — Vibe Coding Submission Apr 17, 2026
…defined single-section enforcement, no blending, and exact refusal template in agents.md
…ambiguous → defined retrieve_documents and answer_question with strict single-section and refusal rules
…nted initial retrieval and scoring-based answer system
…eading to wrong answers → added threshold-based filtering to improve retrieval precision
… responses for weak matches → enforced strict refusal when answer not fully grounded in one section
… matching failed to resolve intent → replaced with deterministic intent-to-section mapping ensuring strict single-section grounding
@github-actions
Copy link
Copy Markdown

👋 Hi there, participant! Thanks for joining our Vibe Coding Session!

We're reviewing your PR for the 4 User Cases. Once your submission is validated and merged, you'll be awarded your completion badge! 🏆

Next Steps:

  • Make sure all 4 UCs are finished.
  • Ensure your commit messages match the required format.
  • Good luck!

…valid queries and answered out-of-scope queries → fixed retrieval path, lowered threshold, added relevance check, and enforced strict MCP tool behavior
@github-actions
Copy link
Copy Markdown

👋 Hi there, participant! Thanks for joining our Vibe Coding Session!

We're reviewing your PR for the 4 User Cases. Once your submission is validated and merged, you'll be awarded your completion badge! 🏆

Next Steps:

  • Make sure all 4 UCs are finished.
  • Ensure your commit messages match the required format.
  • Good luck!

…missing urgency enforcement caused inconsistent classification → switched to description field, added severity keywords, enforced reason generation, and simplified ambiguity handling
… similarity scoring, and lack of enforcement caused missed context and cross-document blending → implemented sentence-aware chunking, normalized similarity scoring with threshold tuning, enforced single-document retrieval, added strict sentence-level extraction, and defined RICE-compliant agent and skill constraints
… retrieval and missing constraints caused incorrect section selection and blended answers → replaced with deterministic intent-to-section mapping, enforced strict single-section grounding, added refusal for incomplete matches, and defined agent and skill contracts
@github-actions
Copy link
Copy Markdown

👋 Hi there, participant! Thanks for joining our Vibe Coding Session!

We're reviewing your PR for the 4 User Cases. Once your submission is validated and merged, you'll be awarded your completion badge! 🏆

Next Steps:

  • Make sure all 4 UCs are finished.
  • Ensure your commit messages match the required format.
  • 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