<?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: Yasith wijesuriya</title>
    <description>The latest articles on DEV Community by Yasith wijesuriya (@yasith_wijesuriya_6fdf379).</description>
    <link>https://dev.to/yasith_wijesuriya_6fdf379</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.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3682148%2Ffbb61ad8-49c0-4573-b2e5-9658dfbc2067.png</url>
      <title>DEV Community: Yasith wijesuriya</title>
      <link>https://dev.to/yasith_wijesuriya_6fdf379</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/yasith_wijesuriya_6fdf379"/>
    <language>en</language>
    <item>
      <title>Efficient Vector Storage for AI: Why I Chose Pinecone with AWS</title>
      <dc:creator>Yasith wijesuriya</dc:creator>
      <pubDate>Fri, 02 Jan 2026 04:52:53 +0000</pubDate>
      <link>https://dev.to/yasith_wijesuriya_6fdf379/efficient-vector-storage-for-ai-why-i-chose-pinecone-with-aws-3pnh</link>
      <guid>https://dev.to/yasith_wijesuriya_6fdf379/efficient-vector-storage-for-ai-why-i-chose-pinecone-with-aws-3pnh</guid>
      <description>&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;       When building Generative AI applications, one of the biggest challenges is managing massive amounts of vector embeddings. Recently, I integrated Pinecone with an AWS-based AI pipeline, and the results were impressive. In this article, I want to share my hands-on experience and why this combination is a "game-changer" for AI engineers.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Why Pinecone?&lt;/strong&gt;&lt;br&gt;
While AWS offers OpenSearch, I found Pinecone to be exceptionally developer-friendly for vector storage. It is a managed, cloud-native vector database designed specifically for high-performance AI applications.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgagg8rzxaxjbmvhmvphv.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgagg8rzxaxjbmvhmvphv.jpg" alt=" " width="768" height="1196"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Seamless Integration with AWS&lt;br&gt;
What I love about Pinecone is how easily it "plugs" into the AWS ecosystem. Here are three ways I used it:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Serverless Scaling with AWS Lambda&lt;/strong&gt;: I used AWS Lambda to trigger Pinecone API calls. Since both are serverless, you don’t have to manage any infrastructure. You simply scale your logic and your storage as needed.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Using Amazon Bedrock for Embeddings&lt;/strong&gt;: I connected Amazon Bedrock (using models like Titan) to generate embeddings from raw data and then stored those vectors directly in Pinecone. This makes building RAG (Retrieval-Augmented Generation) applications much simpler.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Connectivity with LangChain &amp;amp; LlamaIndex&lt;/strong&gt;: If you are using frameworks like LangChain, Pinecone serves as a robust vector store that can be initialised with just a few lines of code while running on AWS EC2 or ECS.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;My Key Takeaways&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Speed:&lt;/strong&gt; The retrieval latency is incredibly low, which is crucial for real-time AI chat applications.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Simplicity:&lt;/strong&gt; You don’t need to be a database expert to set up an index in Pinecone.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Cost-Effective:&lt;/strong&gt; With the serverless tier, you only pay for what you use, making it ideal for startups and individual builders.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Conclusion&lt;/strong&gt;&lt;br&gt;
If you are building AI on AWS, I highly recommend giving Pinecone a try as your vector database. It removes the operational overhead, allowing you to focus on building better AI models.&lt;/p&gt;

</description>
      <category>aws</category>
      <category>pinecone</category>
      <category>genai</category>
      <category>vectordatabase</category>
    </item>
    <item>
      <title>Using ChatPromptTemplate with create_tool_calling_agent in LangChain (Instead of create_agent)</title>
      <dc:creator>Yasith wijesuriya</dc:creator>
      <pubDate>Mon, 29 Dec 2025 15:58:05 +0000</pubDate>
      <link>https://dev.to/yasith_wijesuriya_6fdf379/using-chatprompttemplate-with-createtoolcallingagent-in-langchain-instead-of-createagent-48lo</link>
      <guid>https://dev.to/yasith_wijesuriya_6fdf379/using-chatprompttemplate-with-createtoolcallingagent-in-langchain-instead-of-createagent-48lo</guid>
      <description>&lt;p&gt;If you’ve used LangChain before, you’ve probably started with create_agent().&lt;/p&gt;

&lt;p&gt;It works.&lt;br&gt;
It’s fast.&lt;br&gt;
But once you move into real agent systems (tools, memory, multi-agent, LangGraph), it starts to feel… limiting.&lt;/p&gt;

&lt;p&gt;This post explains why I stopped using &lt;strong&gt;create_agent()&lt;/strong&gt; and switched to&lt;br&gt;
&lt;strong&gt;ChatPromptTemplate + create_tool_calling_agent&lt;/strong&gt; instead.&lt;/p&gt;

&lt;h2&gt;
  
  
  What’s wrong with create_agent()?
&lt;/h2&gt;

&lt;p&gt;Nothing is wrong with it — it’s just too abstract.&lt;/p&gt;

&lt;p&gt;Some pain points I hit:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;❌ Hard to control the actual prompt

❌ Message roles feel hidden

❌ Tool calls are difficult to debug

❌ Doesn’t scale well for multi-agent or graph-based flows
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;If you want full control over how your agent thinks, you need to build it more explicitly.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. ChatPromptTemplate (No hidden prompts)
&lt;/h2&gt;

&lt;p&gt;Instead of relying on built-in agent prompts, I define everything myself.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fs83w19jjz3gr6j9rmgdv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fs83w19jjz3gr6j9rmgdv.png" alt=" " width="628" height="50"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frnfbugtzcr1njbgj8esa.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frnfbugtzcr1njbgj8esa.png" alt=" " width="644" height="320"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Why I like this:&lt;br&gt;
         - I control system rules&lt;br&gt;
         - I control where history goes&lt;br&gt;
         - I control where tool reasoning lives&lt;/p&gt;

&lt;p&gt;Nothing is magic. Everything is visible.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. MessagesPlaceholder (This part is important)
&lt;/h2&gt;

&lt;p&gt;Two placeholders matter the most: &lt;br&gt;
      - chat_history - Keeps conversation context&lt;br&gt;
      - agent_scratchpad- Stores tool calls + reasoning&lt;/p&gt;

&lt;h2&gt;
  
  
  3. create_tool_calling_agent (The real upgrade)
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fonl6wbgag8fk6wi2vew6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fonl6wbgag8fk6wi2vew6.png" alt=" " width="488" height="42"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2hmq922fl85rkcseadm7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2hmq922fl85rkcseadm7.png" alt=" " width="284" height="96"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This agent:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Understands tool schemas&lt;/li&gt;
&lt;li&gt;Decides when to call tools&lt;/li&gt;
&lt;li&gt;Uses tool results in its reasoning loop
Compared to create_agent(), this feels way more intentional.
No guessing. No hidden behaviour.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  4. AgentExecutor (Run the loop)
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ft7rqwamg909mgn1yqa89.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ft7rqwamg909mgn1yqa89.png" alt=" " width="412" height="47"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1kqub2fmy8gxi3b8vt96.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1kqub2fmy8gxi3b8vt96.png" alt=" " width="255" height="103"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Set verbose=True.&lt;br&gt;
Seriously. It saves hours when debugging tool behavior.&lt;/p&gt;

&lt;h2&gt;
  
  
  When this approach actually makes sense
&lt;/h2&gt;

&lt;p&gt;Use this if you’re building:&lt;br&gt;
     - Research agents&lt;br&gt;
     - Tool-heavy workflows&lt;br&gt;
     - Multi-agent systems&lt;br&gt;
     - LangGraph pipelines&lt;/p&gt;

&lt;p&gt;If you just want a quick demo, create_agent() is fine.&lt;br&gt;
But for real systems, this pattern scales much better.&lt;/p&gt;

&lt;h2&gt;
  
  
  Final thoughts
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;&amp;gt; Agents don’t become powerful because of the model&lt;/strong&gt;&lt;br&gt;
They become powerful because of:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;clear prompts&lt;/li&gt;
&lt;li&gt;clear memory&lt;/li&gt;
&lt;li&gt;clear tool usage&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;ChatPromptTemplate + create_tool_calling_agent gives you all three.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;(This post is based on my own experience and opinions while working with LangChain.There’s no single “right way” to build agents — this is just the approach that worked best for me.)&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>langchain</category>
      <category>aiagents</category>
      <category>python</category>
      <category>llm</category>
    </item>
    <item>
      <title>Optimized Image Hosting: Why I Integrated Cloudflare R2 with my AWS Backend</title>
      <dc:creator>Yasith wijesuriya</dc:creator>
      <pubDate>Sun, 28 Dec 2025 05:53:32 +0000</pubDate>
      <link>https://dev.to/yasith_wijesuriya_6fdf379/optimized-image-hosting-why-i-integrated-cloudflare-r2-with-my-aws-backend-11j3</link>
      <guid>https://dev.to/yasith_wijesuriya_6fdf379/optimized-image-hosting-why-i-integrated-cloudflare-r2-with-my-aws-backend-11j3</guid>
      <description>&lt;p&gt;As a developer, choosing the right storage solution is always a balance between performance, ease of use, and cost. For my latest project, I decided to take a Hybrid Cloud approach by combining the power of AWS with the cost-efficiency of Cloudflare R2.&lt;/p&gt;

&lt;p&gt;In this article, I’ll explain why I made this choice and how it benefits my application's architecture.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Challenge: AWS S3 vs. Cloudflare R2
&lt;/h2&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;When I started building my backend on AWS, Amazon S3 was my first thought for image storage. It is the industry standard for durability and security. However, for my specific use case, two factors led me to explore Cloudflare R2:
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Egress Fees:&lt;br&gt;
AWS S3 charges for data transferred out to the internet. For an image-heavy site, these "egress fees" can become unpredictable as traffic grows.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Simplicity: &lt;br&gt;
Cloudflare R2 offers a zero-egress fee model and a very simplified setup process.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Why this Hybrid Approach Works
&lt;/h2&gt;

&lt;p&gt;I still believe AWS is the king of compute and AI. By using AWS Lambda to handle my backend logic (and OpenAI API integrations), I get the best performance. But by pointing my image storage to Cloudflare R2, I save significantly on bandwidth costs.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Key Benefits I Noticed:&lt;/em&gt;&lt;/p&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;1. S3 Compatibility: Since Cloudflare R2 is S3-compatible, I could use the standard AWS SDKs to interact with it.

&lt;ol&gt;
&lt;li&gt;Global Speed: Leveraging Cloudflare’s global network ensures my images load fast for users everywhere without needing to configure complex CDN distributions.
&lt;/li&gt;
&lt;/ol&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h2&gt;


A Look at My Setup
&lt;/h2&gt;


&lt;p&gt;Here is a glimpse of my Cloudflare R2 dashboard where I manage the assets for my project, "Mebius":&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fv7lk6x99hknc1qkogb02.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fv7lk6x99hknc1qkogb02.jpg" alt=" " width="800" height="355"&gt;&lt;/a&gt;&lt;br&gt;
_&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"Figure: Managing image assets within the Cloudflare R2 'mebius' bucket."&lt;br&gt;
_&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  When Would I Stick to Pure AWS S3?
&lt;/h2&gt;

&lt;p&gt;Even though I used R2 here, AWS S3 remains my go-to choice for:&lt;/p&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;- Deep Integration: If I were using AWS Rekognition for image analysis or SageMaker for ML, keeping data in S3 is much more efficient.

&lt;ul&gt;
&lt;li&gt;Strict Security: For enterprise apps requiring complex IAM policies, AWS S3's security granularity is unmatched.
&lt;/li&gt;
&lt;/ul&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h2&gt;


Conclusion
&lt;/h2&gt;


&lt;p&gt;Cloud architecture is not about choosing one provider and sticking to it; it's about choosing the right tool for the right job. By combining AWS's computational strength with Cloudflare's affordable storage, I built a solution that is both powerful and cost-effective.&lt;/p&gt;

&lt;p&gt;I am excited to keep exploring more AWS services as I grow this project!&lt;/p&gt;

</description>
      <category>aws</category>
      <category>cloudflare</category>
      <category>serverless</category>
      <category>architecture</category>
    </item>
  </channel>
</rss>
