<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Amol </title>
    <description>The latest articles on DEV Community by Amol  (@amolbhandari).</description>
    <link>https://dev.to/amolbhandari</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1488856%2F95519900-c5a1-435d-9e45-54e8e3322d11.jpeg</url>
      <title>DEV Community: Amol </title>
      <link>https://dev.to/amolbhandari</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/amolbhandari"/>
    <language>en</language>
    <item>
      <title>Mortgage Policy &amp; Guideline Agent — Sanity Challenge Path One</title>
      <dc:creator>Amol </dc:creator>
      <pubDate>Sat, 19 Sep 2026 15:16:15 +0000</pubDate>
      <link>https://dev.to/amolbhandari/mortgage-policy-guideline-agent-sanity-challenge-path-one-1m3a</link>
      <guid>https://dev.to/amolbhandari/mortgage-policy-guideline-agent-sanity-challenge-path-one-1m3a</guid>
      <description>&lt;p&gt;&lt;em&gt;This is a submission for the &lt;a href="https://dev.to/challenges/sanity-2026-09-16"&gt;Sanity Challenge, Path One: Ship an Agent That Queries Real Content&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What I Built
&lt;/h2&gt;

&lt;p&gt;I built a &lt;strong&gt;Mortgage Policy &amp;amp; Guideline Agent&lt;/strong&gt; that answers mortgage eligibility and policy questions using structured mortgage content stored in Sanity.&lt;/p&gt;

&lt;p&gt;Mortgage policy questions can look simple but often depend on several connected pieces of information: loan-product limits, underwriting guidelines, exceptions, and the source supporting each rule.&lt;/p&gt;

&lt;p&gt;Instead of relying only on an LLM's memory, I created a structured Sanity knowledge base containing:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Mortgage Policies&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Guidelines&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Loan Products&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Exceptions&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Sources and citations&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The agent can retrieve the relevant structured content before answering a question.&lt;/p&gt;

&lt;p&gt;For example, a conventional mortgage decision can depend on:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Minimum credit score&lt;/li&gt;
&lt;li&gt;Maximum DTI&lt;/li&gt;
&lt;li&gt;Maximum LTV&lt;/li&gt;
&lt;li&gt;Loan purpose&lt;/li&gt;
&lt;li&gt;Occupancy&lt;/li&gt;
&lt;li&gt;Applicable guideline&lt;/li&gt;
&lt;li&gt;Documented exceptions&lt;/li&gt;
&lt;li&gt;Exception conditions&lt;/li&gt;
&lt;li&gt;Supporting source&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The goal is to make the answer traceable back to structured content rather than simply producing a plausible AI response.&lt;/p&gt;

&lt;h2&gt;
  
  
  Demo
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Live Application
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;&lt;a href="https://mortgage-policy-guideline-agent.vercel.app/" rel="noopener noreferrer"&gt;Mortgage Policy &amp;amp; Guideline Agent&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The companion web application provides a simple interface for asking mortgage questions and viewing:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Eligibility results&lt;/li&gt;
&lt;li&gt;Important rules&lt;/li&gt;
&lt;li&gt;Borrower and product facts&lt;/li&gt;
&lt;li&gt;Source citations&lt;/li&gt;
&lt;li&gt;Sanity-backed responses&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Try These Prompts
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;1. Eligibility&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Conventional purchase, 640 credit score, 47% DTI and 95% LTV. Is the borrower eligible? Explain the rules that determine the answer.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;2. Product Comparison&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Compare the Harborstone 30-year and 15-year conventional products. What are the differences in minimum credit score, maximum DTI and maximum LTV?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;3. Exception Reasoning&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;A conventional borrower has a DTI above the standard limit. What documented exceptions could apply, and what conditions must be satisfied?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;4. Source Verification&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;What source and effective date support the maximum DTI rule for the Harborstone conventional product?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;5. Scenario Change&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;A borrower has 700 credit, 47% DTI and 95% LTV. Does the answer change compared with a borrower with 640 credit? Explain why.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;6. Explain the Decision&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Don't just tell me whether this borrower qualifies. Walk through credit score, DTI, LTV, applicable guideline, exception eligibility and supporting source.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The Harborstone mortgage catalog is &lt;strong&gt;fictional demo data created for this project&lt;/strong&gt; and is not official lending guidance.&lt;/p&gt;

&lt;h2&gt;
  
  
  Code
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;&lt;a href="https://github.com/amolbhandari52/mortgage-policy-guideline-agent" rel="noopener noreferrer"&gt;GitHub — Mortgage Policy &amp;amp; Guideline Agent&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The repository contains the Sanity schemas, structured demo content, GROQ queries, agent instructions, MCP configuration, and companion web application.&lt;/p&gt;

&lt;h2&gt;
  
  
  How I Used Sanity
&lt;/h2&gt;

&lt;p&gt;The core of the project is the structured mortgage knowledge base in Sanity.&lt;/p&gt;

&lt;p&gt;I modeled mortgage information as connected content rather than a single collection of unstructured documents.&lt;/p&gt;

&lt;p&gt;The main content types are:&lt;/p&gt;

&lt;h3&gt;
  
  
  Loan Products
&lt;/h3&gt;

&lt;p&gt;Products contain structured underwriting limits such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Minimum credit score&lt;/li&gt;
&lt;li&gt;Maximum DTI&lt;/li&gt;
&lt;li&gt;Maximum LTV&lt;/li&gt;
&lt;li&gt;Minimum down payment&lt;/li&gt;
&lt;li&gt;Loan type&lt;/li&gt;
&lt;li&gt;Occupancy&lt;/li&gt;
&lt;li&gt;Loan purpose&lt;/li&gt;
&lt;li&gt;Product code&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Guidelines
&lt;/h3&gt;

&lt;p&gt;Guidelines contain structured thresholds such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Metric&lt;/li&gt;
&lt;li&gt;Operator&lt;/li&gt;
&lt;li&gt;Value&lt;/li&gt;
&lt;li&gt;Unit&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For example, a guideline can represent a DTI threshold such as &lt;code&gt;DTI &amp;lt;= 45%&lt;/code&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Exceptions
&lt;/h3&gt;

&lt;p&gt;Exceptions contain:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Conditions&lt;/li&gt;
&lt;li&gt;Compensating factors&lt;/li&gt;
&lt;li&gt;Approval requirements&lt;/li&gt;
&lt;li&gt;Exception identifiers&lt;/li&gt;
&lt;li&gt;Relationships to applicable guidelines&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Sources
&lt;/h3&gt;

&lt;p&gt;Sources provide the supporting information used for citations, including:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Source title&lt;/li&gt;
&lt;li&gt;Published/effective date&lt;/li&gt;
&lt;li&gt;Locator&lt;/li&gt;
&lt;li&gt;Excerpt&lt;/li&gt;
&lt;li&gt;URL where applicable&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This structure allows the agent to retrieve the information needed to answer a question instead of treating mortgage policy as plain text.&lt;/p&gt;

&lt;h3&gt;
  
  
  Sanity Context MCP
&lt;/h3&gt;

&lt;p&gt;I connected my &lt;strong&gt;Cursor AI agent to Sanity Context MCP&lt;/strong&gt; for the Path One implementation.&lt;/p&gt;

&lt;p&gt;The agent uses Sanity Context MCP to query the live Sanity dataset and retrieve the structured mortgage content.&lt;/p&gt;

&lt;p&gt;The flow is:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;User question&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;↓&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Cursor AI agent&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;↓&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Sanity Context MCP&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;↓&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Sanity Project &lt;code&gt;krg1w0kt&lt;/code&gt; / &lt;code&gt;production&lt;/code&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;↓&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Structured mortgage content&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;↓&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Product + Guideline + Exception + Source&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;↓&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Grounded answer with supporting information&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The MCP tools used by the agent include document querying and retrieval through the Sanity Context MCP connection.&lt;/p&gt;

&lt;p&gt;I also created project-specific Cursor rules and a mortgage-policy-agent skill that instruct the agent to use Sanity content when answering mortgage policy questions and to provide citations.&lt;/p&gt;

&lt;h3&gt;
  
  
  Why structured content matters
&lt;/h3&gt;

&lt;p&gt;Consider this question:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Conventional purchase, 640 credit score, 47% DTI and 95% LTV. Is the borrower eligible?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The agent needs more than a keyword match.&lt;/p&gt;

&lt;p&gt;It needs to identify the relevant conventional product, retrieve the applicable DTI and credit thresholds, check the borrower's values against those thresholds, and determine whether a documented exception applies.&lt;/p&gt;

&lt;p&gt;That is where the structured Sanity content becomes important.&lt;/p&gt;

&lt;p&gt;The same Sanity dataset is also used by the companion web application, which provides a user-friendly interface for the mortgage agent.&lt;/p&gt;

&lt;h2&gt;
  
  
  Sanity Project Details
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Project ID:&lt;/strong&gt; &lt;code&gt;krg1w0kt&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Dataset:&lt;/strong&gt; &lt;code&gt;production&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;The Sanity project contains the structured mortgage knowledge base used by the agent.&lt;/p&gt;

&lt;p&gt;The primary document types are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Mortgage Policy&lt;/li&gt;
&lt;li&gt;Guideline&lt;/li&gt;
&lt;li&gt;Loan Product&lt;/li&gt;
&lt;li&gt;Exception&lt;/li&gt;
&lt;li&gt;Source&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The project ID is provided so the Sanity team can inspect how the content was modeled and used.&lt;/p&gt;

&lt;h2&gt;
  
  
  Agent Session
&lt;/h2&gt;

&lt;p&gt;The Path One agent was developed and tested in Cursor using Sanity Context MCP.&lt;/p&gt;

&lt;p&gt;An agent-session transcript is optional for this submission. If included, it will be curated to show the relevant parts of the development process and Sanity MCP interaction.&lt;/p&gt;

&lt;p&gt;Any published transcript will be checked for API keys, tokens, credentials, or other sensitive information before publication.&lt;/p&gt;

&lt;h1&gt;
  
  
  sanitychallenge
&lt;/h1&gt;

</description>
      <category>devchallenge</category>
      <category>sanitychallenge</category>
      <category>sanity</category>
      <category>ai</category>
    </item>
    <item>
      <title>Fetch - scan your dog, then chat, plan, and hear their story</title>
      <dc:creator>Amol </dc:creator>
      <pubDate>Sun, 16 Aug 2026 10:30:00 +0000</pubDate>
      <link>https://dev.to/amolbhandari/fetch-scan-your-dog-then-chat-plan-and-hear-their-story-2dpk</link>
      <guid>https://dev.to/amolbhandari/fetch-scan-your-dog-then-chat-plan-and-hear-their-story-2dpk</guid>
      <description>&lt;p&gt;&lt;em&gt;This is a submission for &lt;a href="https://dev.to/challenges/weekend-2026-08-13"&gt;Weekend Challenge: Dog Days Edition&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What I Built
&lt;/h2&gt;

&lt;p&gt;Fetch is an AI dog companion that starts with a single photo and turns it into a small toolkit for looking after your dog.&lt;/p&gt;

&lt;p&gt;You upload a photo, and Fetch identifies the most likely breed along with temperament, size, energy level, and a few care tips. From there, everything stays connected to that same dog:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A chat assistant that already knows the breed, so the advice you get is specific to your dog instead of generic. After a scan it also suggests breed-specific questions about grooming, feeding, exercise, environment, training, and health.&lt;/li&gt;
&lt;li&gt;A one-tap care plan covering feeding, grooming, exercise, environment, training, and vet care, which you can read in the app, download as a PDF, or print.&lt;/li&gt;
&lt;li&gt;A storybook that writes a short story starring your dog and reads it aloud in a natural voice.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The idea was to make something that feels less like four separate tools and more like one companion that actually remembers your dog across the whole app. I wanted a new dog owner to be able to point their camera at their pup and immediately have somewhere to ask questions and get a plan.&lt;/p&gt;

&lt;h2&gt;
  
  
  Demo
&lt;/h2&gt;

&lt;p&gt;Live app: &lt;a href="https://fetch-dog-ai.vercel.app/" rel="noopener noreferrer"&gt;https://fetch-dog-ai.vercel.app/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Try it by uploading a clear photo of a dog on the Scan tab, then move through Ask Fetch, Care Plan, and Storybook. The storybook narration plays right in the browser.&lt;/p&gt;

&lt;h2&gt;
  
  
  Code
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://github.com/amolbhandari52/fetch-dog-ai" rel="noopener noreferrer"&gt;https://github.com/amolbhandari52/fetch-dog-ai&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  How I Built It
&lt;/h2&gt;

&lt;p&gt;The frontend is a single HTML file with plain JavaScript and CSS. No framework, no build step, so it loads fast and works the same on a phone as on a laptop. The scanned dog's profile is held in a small shared state object, which is what lets the chat, care plan, and storybook all stay aware of the same dog.&lt;/p&gt;

&lt;p&gt;All the AI calls go through serverless functions on Vercel so that the API keys stay on the server and never reach the browser. There are two functions: one for Google Gemini and one for ElevenLabs.&lt;/p&gt;

&lt;p&gt;A couple of decisions I am happy with:&lt;/p&gt;

&lt;p&gt;Rather than hard-code a Gemini model name, the function asks the API which models the key can use and picks a current one. I ran into a model being retired mid-build, so I made it self-correct instead of breaking. It also retries with backoff and falls back to another model when Gemini returns a temporary high-demand error, which kept the care plan and storybook reliable during testing.&lt;/p&gt;

&lt;p&gt;For structured output like the breed profile and the care plan, I use Gemini's JSON response mode so the app can render the results directly instead of parsing loose text.&lt;/p&gt;

&lt;p&gt;The storybook narration is generated per page and streamed back as audio. The ElevenLabs function auto-selects an available voice on the account, so it works without me hard-coding a voice ID.&lt;/p&gt;

&lt;p&gt;Best Use of Google AI - Gemini handles four separate jobs: vision breed identification, the breed-aware chat, the structured care plan, and the story generation, all through one endpoint.&lt;/p&gt;

&lt;p&gt;Best Use of ElevenLabs - the storybook narration is powered by ElevenLabs text to speech, which is what turns the generated story into something you actually listen to.&lt;/p&gt;

</description>
      <category>devchallenge</category>
      <category>weekendchallenge</category>
      <category>googleai</category>
      <category>elevenlabs</category>
    </item>
  </channel>
</rss>
