<?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: PriyanshuValiya</title>
    <description>The latest articles on DEV Community by PriyanshuValiya (@priyanshu_valiya).</description>
    <link>https://dev.to/priyanshu_valiya</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%2F2621418%2F0a8bff4b-57b1-497e-9b18-a2d766be737f.jpg</url>
      <title>DEV Community: PriyanshuValiya</title>
      <link>https://dev.to/priyanshu_valiya</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/priyanshu_valiya"/>
    <language>en</language>
    <item>
      <title>Bigger Context Windows Aren't Making Your AI Smarter (And Here's Why)</title>
      <dc:creator>PriyanshuValiya</dc:creator>
      <pubDate>Tue, 01 Sep 2026 05:10:51 +0000</pubDate>
      <link>https://dev.to/priyanshu_valiya/bigger-context-windows-arent-making-your-ai-smarter-and-heres-why-2b53</link>
      <guid>https://dev.to/priyanshu_valiya/bigger-context-windows-arent-making-your-ai-smarter-and-heres-why-2b53</guid>
      <description>&lt;p&gt;Every few months, another model ships with a bigger context window.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1M tokens. 2M. Someone's already at 10M.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The pitch is always the same:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Feed it more, get better answers.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;I ran into the opposite while building a retrieval system designed to enforce coding guidelines before code generation:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;More context in, worse output out.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Turns out, that's not a fluke.&lt;/p&gt;

&lt;p&gt;It's a consequence of how transformers work.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Problem: Context Rot
&lt;/h2&gt;

&lt;p&gt;Dump a 300-page PDF into a prompt and you'd expect the model to have "read the whole thing."&lt;/p&gt;

&lt;p&gt;What actually happens is degradation.&lt;/p&gt;

&lt;p&gt;Studies from Chroma and Anthropic show a similar pattern: as the surrounding context grows, reasoning accuracy on the actual task can drop.&lt;/p&gt;

&lt;p&gt;Not because the model literally forgot the tokens. They're technically still in the context.&lt;/p&gt;

&lt;p&gt;The problem is that the model is reasoning over a much noisier signal.&lt;/p&gt;

&lt;p&gt;More context doesn't automatically mean more useful context.&lt;/p&gt;

&lt;h2&gt;
  
  
  Lost in the Middle
&lt;/h2&gt;

&lt;p&gt;There's a well-documented effect where models are better at retrieving information from the &lt;strong&gt;beginning or end&lt;/strong&gt; of a long prompt than from the middle.&lt;/p&gt;

&lt;p&gt;If the fact you need is buried somewhere in the middle of a large document, retrieval and reasoning accuracy can drop significantly.&lt;/p&gt;

&lt;p&gt;And that's not a rounding error.&lt;/p&gt;

&lt;p&gt;It's the difference between:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;a demo that impresses a stakeholder, and&lt;/li&gt;
&lt;li&gt;a production system that quietly gives the wrong answer.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The model might technically have access to the information.&lt;/p&gt;

&lt;p&gt;That doesn't mean it can reliably use it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Needle in a Haystack Is the Wrong Benchmark
&lt;/h2&gt;

&lt;p&gt;A lot of the "look how big our context window is" marketing leans heavily on &lt;strong&gt;needle-in-a-haystack&lt;/strong&gt; tests.&lt;/p&gt;

&lt;p&gt;The setup is simple:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Take a huge document.&lt;/li&gt;
&lt;li&gt;Hide one specific fact somewhere inside it.&lt;/li&gt;
&lt;li&gt;Ask the model to find that fact.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;That's useful for measuring retrieval.&lt;/p&gt;

&lt;p&gt;But it doesn't tell us much about reasoning across a large context.&lt;/p&gt;

&lt;p&gt;Real-world tasks are usually more like:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Find three relevant pieces of information from three different sections, understand how they relate, and use them to make a decision.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;A model can ace a needle-in-a-haystack benchmark and still fall apart when it needs to &lt;strong&gt;synthesize multiple pieces of information scattered across the context&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Finding one needle isn't the same as understanding the haystack.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why This Happens: It's Architectural, Not a Bug
&lt;/h2&gt;

&lt;p&gt;This comes down to the attention mechanism itself.&lt;/p&gt;

&lt;p&gt;At a high level, tokens attend to other tokens to determine what's relevant.&lt;/p&gt;

&lt;p&gt;As the amount of input grows, there are more relationships to reason over.&lt;/p&gt;

&lt;p&gt;The model now has to distinguish the useful signal from an increasingly large amount of surrounding information.&lt;/p&gt;

&lt;p&gt;There's no simple patch coming for this.&lt;/p&gt;

&lt;p&gt;It's not necessarily a broken mechanism.&lt;/p&gt;

&lt;p&gt;It's the mechanism doing what it was designed to do, just at a scale where the &lt;strong&gt;signal-to-noise ratio starts working against you&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;And that's an important distinction.&lt;/p&gt;

&lt;p&gt;The problem isn't simply:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"The model isn't smart enough."&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The problem can be:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"We're giving the model too much information to reason over reliably."&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  What Actually Helps (and Where It Breaks)
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;RAG is the obvious mitigation.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Instead of dumping everything into the prompt, filter the data before it reaches the model.&lt;/p&gt;

&lt;p&gt;Retrieve only the information that's likely to matter.&lt;/p&gt;

&lt;p&gt;It works.&lt;/p&gt;

&lt;p&gt;But RAG has its own failure mode.&lt;/p&gt;

&lt;p&gt;Fetch the wrong chunk, or fetch a pile of "almost relevant" chunks, and you've recreated the same dilution problem you were trying to avoid.&lt;/p&gt;

&lt;p&gt;I hit this directly while building a guideline-retrieval system.&lt;/p&gt;

&lt;p&gt;A surprising amount of the engineering work wasn't the retrieval itself.&lt;/p&gt;

&lt;p&gt;It was &lt;strong&gt;ranking&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The system needed to distinguish:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;highly relevant chunks&lt;/li&gt;
&lt;li&gt;partially relevant chunks&lt;/li&gt;
&lt;li&gt;superficially similar chunks&lt;/li&gt;
&lt;li&gt;completely irrelevant chunks&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Because if you return ten "almost relevant" chunks alongside the one chunk that actually matters, you've made the model's job harder again.&lt;/p&gt;

&lt;p&gt;Retrieval quality isn't just about finding relevant information.&lt;/p&gt;

&lt;p&gt;It's also about &lt;strong&gt;not returning information that looks relevant but isn't&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Context Engineering and Recursive Models
&lt;/h2&gt;

&lt;p&gt;Newer approaches like &lt;strong&gt;context engineering&lt;/strong&gt; and &lt;strong&gt;recursive language models&lt;/strong&gt; are trying to address the problem from a different angle.&lt;/p&gt;

&lt;p&gt;Instead of asking:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"How do we fit more tokens into the context window?"&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;the question becomes:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"How should the model ingest, organize, compress, and reason over information?"&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;That's a much more interesting direction.&lt;/p&gt;

&lt;p&gt;These approaches are still relatively early, but they're worth watching because they challenge the assumption that the solution to context limitations is simply &lt;strong&gt;more context&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Takeaway
&lt;/h2&gt;

&lt;p&gt;Sam Altman has talked about AI eventually having perfect context over your entire life.&lt;/p&gt;

&lt;p&gt;Maybe that happens.&lt;/p&gt;

&lt;p&gt;But there's a real gap right now between that promise and what a transformer can &lt;strong&gt;reliably reason over&lt;/strong&gt;, even with tens of thousands of tokens.&lt;/p&gt;

&lt;p&gt;If you're building anything RAG-dependent or long-context-dependent, that gap is where a lot of your bugs are going to come from.&lt;/p&gt;

&lt;p&gt;Not necessarily because the model is "not smart enough."&lt;/p&gt;

&lt;p&gt;But because the architecture is doing exactly what it's built to do at a scale where &lt;strong&gt;more information can actually make the answer worse&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The question isn't:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;How much context can the model handle?&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;It's:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;How much context can the model reliably use?&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Those are very different numbers.&lt;/p&gt;




&lt;p&gt;If you're fighting this in production, &lt;strong&gt;what has actually moved the needle for you?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Better chunking? Re-ranking? Context compression? Something else?&lt;/p&gt;

</description>
      <category>ai</category>
      <category>agentaichallenge</category>
      <category>challenge</category>
    </item>
    <item>
      <title>Your E-Commerce Backend Doesn't Need a New UI. It Needs an MCP Server.</title>
      <dc:creator>PriyanshuValiya</dc:creator>
      <pubDate>Thu, 13 Aug 2026 12:13:30 +0000</pubDate>
      <link>https://dev.to/priyanshu_valiya/your-e-commerce-backend-doesnt-need-a-new-ui-it-needs-an-mcp-server-4ik8</link>
      <guid>https://dev.to/priyanshu_valiya/your-e-commerce-backend-doesnt-need-a-new-ui-it-needs-an-mcp-server-4ik8</guid>
      <description>&lt;p&gt;Every ecommerce admin panel I've worked with has the same shape: a sidebar of menus, a table with filters, a "search" box that only matches exact strings. If the owner wants to know "which products are low on stock and haven't sold in 30 days," they either learn the filter UI cold or they ping a developer to write a query.&lt;/p&gt;

&lt;p&gt;That's the gap MCP closes. Not by replacing the admin panel by giving an LLM a typed, permissioned door into the same business logic your REST API already exposes.&lt;/p&gt;

&lt;h2&gt;
  
  
  The setup most people get wrong
&lt;/h2&gt;

&lt;p&gt;The instinct is to let the model touch the database directly, or worse, generate SQL on the fly. Don't. Your business logic already lives in a service layer for a reason validation, ownership checks, side effects like inventory recalculation. MCP tools should call &lt;em&gt;that&lt;/em&gt; layer, not go around it.&lt;/p&gt;

&lt;p&gt;If you already have a layered backend (controllers → services → repositories), you're not rebuilding anything. You're adding a third entry point next to your REST API:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; Frontend  ─┐
            ├─&amp;gt; Business Services ─&amp;gt; Repository ─&amp;gt; DB
MCP Server ─┘
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Each MCP tool is a thin wrapper: &lt;code&gt;getLowStockProducts&lt;/code&gt;, &lt;code&gt;getOrdersByDateRange&lt;/code&gt;, &lt;code&gt;updateProductPrice&lt;/code&gt;. The tool description is doing real work here it's the only documentation the model has, so vague names and descriptions produce vague tool calls. I've found being almost annoyingly explicit ("returns products where stock &amp;lt; threshold AND no sale in the last N days, sorted ascending by stock") gets far more reliable results than a clever one-liner.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why voice/sentence queries actually work here
&lt;/h2&gt;

&lt;p&gt;This isn't a chatbot bolted onto a search bar. When a business owner says "which products are low on stock and haven't sold this month," Claude Desktop (or any MCP client) doesn't guess an answer it decides which tool(s) to call, calls them with structured params, and reasons over the actual returned data. The natural language is just the interface; the tool call is still a real, typed function invocation hitting your real backend.&lt;/p&gt;

&lt;p&gt;That distinction matters for trust. You're not asking the owner to believe an LLM's memory. You're asking it to translate intent into the same API call a developer would write by hand.&lt;/p&gt;

&lt;h2&gt;
  
  
  Auth is not optional, and it's not free
&lt;/h2&gt;

&lt;p&gt;The part that'll bite you if you skip it: MCP tools inherit whatever access the calling session has, so you need the same ownership/authorization checks your API already enforces not a parallel, weaker set for "the AI path." I've been working through exactly this on a Jira-style project management backend right now, and the honest answer is auth design took longer than writing the tools themselves. Worth it. An MCP server with no scoping is just a very polite SQL injection vector.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I'd actually start with
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Pick 3–5 read-only queries first (stock levels, recent orders, revenue by category). Ship those before touching any write operations.&lt;/li&gt;
&lt;li&gt;Log every tool call with the same audit trail you'd want for a human admin action.&lt;/li&gt;
&lt;li&gt;Write tool descriptions like you're documenting for someone who's never seen your schema because that's exactly the situation the model is in.
The interesting part isn't "AI can query your database now." It's that non-technical operators get to ask business questions in the language they already think in, against data that was previously locked behind a UI someone else designed.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you're exposing an existing backend this way, I'd genuinely like to hear what tripped you up auth scoping, tool granularity, or something else entirely.&lt;/p&gt;

</description>
      <category>mcp</category>
      <category>ai</category>
      <category>backend</category>
      <category>claude</category>
    </item>
    <item>
      <title>Running Claude Code on AWS Bedrock Instead of the Anthropic API (a weekend rabbit hole)</title>
      <dc:creator>PriyanshuValiya</dc:creator>
      <pubDate>Tue, 04 Aug 2026 04:42:25 +0000</pubDate>
      <link>https://dev.to/priyanshu_valiya/running-claude-code-on-aws-bedrock-instead-of-the-anthropic-api-a-weekend-rabbit-hole-jih</link>
      <guid>https://dev.to/priyanshu_valiya/running-claude-code-on-aws-bedrock-instead-of-the-anthropic-api-a-weekend-rabbit-hole-jih</guid>
      <description>&lt;p&gt;I've been learning Claude Code for agentic development lately, but I didn't want to burn through paid API credits while I was still figuring out how the tool actually works. Every wrong prompt, every abandoned session, every "let me just try this real quick" costs money when you're hitting the Anthropic API directly.&lt;/p&gt;

&lt;p&gt;So I spent a weekend building a small LiteLLM proxy that lets the Claude Code CLI talk to Amazon Nova on AWS Bedrock instead. Same agent loop, same tool calling, same workflow you'd get with Claude Code normally just pointed at a different backend, running on AWS credits instead of API billing.&lt;/p&gt;

&lt;h2&gt;
  
  
  The problem I was actually trying to solve
&lt;/h2&gt;

&lt;p&gt;I looked at the usual options for cheap/free agentic coding practice and none of them held up for real sessions:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Ollama locally&lt;/strong&gt; - needs a beefy machine with real RAM and GPU headroom. Most people don't have that sitting around, and I didn't want to buy it just to practice.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Free-tier providers like OpenRouter&lt;/strong&gt; - you hit token limits within a handful of basic prompts. Not nearly enough runway for long-running agentic workflows where the model is calling tools back and forth for a while.
I wanted something that let me learn tool use, agent loops, and long context handling without either of those walls showing up mid-session.&lt;/li&gt;
&lt;/ul&gt;

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

&lt;p&gt;A LiteLLM proxy sitting between Claude Code's CLI and AWS Bedrock, translating requests so Claude Code thinks it's talking to Anthropic's API while it's actually routing to Amazon Nova.&lt;/p&gt;

&lt;p&gt;A few things I locked down on purpose:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;No artificial session caps.&lt;/strong&gt; It's self-hosted, so there's no vendor imposed limit on how long or how often I can run sessions.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Everything runs on AWS credits&lt;/strong&gt;, not API billing.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Roughly 20–35% cheaper per token&lt;/strong&gt; than Claude Haiku pricing, based on current Bedrock rates.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;IAM scoped to a single model.&lt;/strong&gt; I locked the role down so the proxy physically can't invoke anything more expensive, even by accident.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;AWS Budget alerts wired in&lt;/strong&gt;, so I'm not finding out about a runaway bill after the fact.
The Docker image and config are public if you want to poke at it yourself: &lt;a href="https://github.com/PriyanshuValiya/Claude-Code/blob/main/README.md" rel="noopener noreferrer"&gt;https://github.com/PriyanshuValiya/Claude-Code/blob/main/README.md&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Where this actually helps (and where it doesn't)
&lt;/h2&gt;

&lt;p&gt;This is genuinely one of the more practical setups I've found for running long agentic sessions without either buying hardware or hitting a free-tier wall every ten minutes. If you're trying to internalize how these coding agents plan, call tools, and recover from errors, having room to run long sessions matters more than having the "best" model underneath.&lt;/p&gt;

&lt;p&gt;But I want to be straight about what this is not: it's not free Claude. It's a translation layer that lets Claude Code's client talk to a different model entirely. Amazon Nova is not Claude, and the outputs, reasoning quality, and tool-calling behavior won't match what you'd get from Anthropic's actual models. If you're evaluating Claude Code itself, or building something you plan to ship, this setup will give you a skewed picture.&lt;/p&gt;

&lt;p&gt;What it's good for is exactly what I built it for: learning the mechanics of agentic coding tools - the loop, the tool calls, the context management without worrying about a credit card every time a session runs long.&lt;/p&gt;

&lt;h2&gt;
  
  
  Takeaway
&lt;/h2&gt;

&lt;p&gt;If you're in the same spot I was, wanting to learn Claude Code without either buying a GPU rig or getting cut off after three prompts, a Bedrock proxy is a reasonable middle ground. Just don't mistake it for the real thing when it's time to judge the model itself, that comparison only makes sense against Anthropic's actual API.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>aws</category>
      <category>claude</category>
      <category>automation</category>
    </item>
  </channel>
</rss>
