<?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: vivek</title>
    <description>The latest articles on DEV Community by vivek (@vivek_gaindhar_e79f747c46).</description>
    <link>https://dev.to/vivek_gaindhar_e79f747c46</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%2F3660340%2Fd3fd8b13-d8dd-4d78-bb1a-7fdbfe152af7.png</url>
      <title>DEV Community: vivek</title>
      <link>https://dev.to/vivek_gaindhar_e79f747c46</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/vivek_gaindhar_e79f747c46"/>
    <language>en</language>
    <item>
      <title>Engineering a LangGraph UI Pipeline</title>
      <dc:creator>vivek</dc:creator>
      <pubDate>Tue, 17 Mar 2026 17:22:23 +0000</pubDate>
      <link>https://dev.to/vivek_gaindhar_e79f747c46/engineering-a-langgraph-ui-pipeline-1k0n</link>
      <guid>https://dev.to/vivek_gaindhar_e79f747c46/engineering-a-langgraph-ui-pipeline-1k0n</guid>
      <description>&lt;p&gt;Build an Agentic Pipeline for Frontend Development: Design Decisions, Trade-offs, and Practical Lessons&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. The Token Economy&lt;/strong&gt;&lt;br&gt;
Managing tokens is a real challenge, i am using Groq’s free tier (250k TPD)[&lt;br&gt;
&lt;em&gt;openai/gpt-oss-120b&lt;/em&gt;].&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Audit Every Step &lt;br&gt;
Do not wait until the end of the project to optimize. Monitor token consumption at every node. audit at every step (i used langsmith for tracing the node calls)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The best call is the one you never make&lt;br&gt;
A pipeline must treats the LLM as a last resort for reasoning. Every time you replace a prompt with a regex or a hardcoded template, you’re shrinking your ‘LLM Surface Area’ — which is the only real way to kill latency and save your budget&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;LLMs are elite at reasoning and planning. They can architect a component structure or plot a multi-step migration. But (2+3) can be done better by cpu then transformer : llm.invoke(“2 + 3”).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. The “Eraser-First” Workflow&lt;/strong&gt;&lt;br&gt;
Don’t start with code. I found success by extracting raw logic from GPT-4/Claude and then manually refining it on Eraser.io.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Before touching your IDE, define every node by:&lt;br&gt;
Strict Data Contracts: Define the Input/Output schemas clearly.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The Pivot:&lt;br&gt;
Your initial diagram is a hypothesis. As you observe real-world model responses, be prepared to refactor nodes. Rigid architectures fail; adaptive graphs win.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;3. Radical Latency Reduction: Parallelism&lt;/strong&gt;&lt;br&gt;
In a linear graph, your latency is the sum of every node’s response time. In a production-grade graph, your latency should only be the length of the longest path.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Fan-Out/Fan-In Architecture:&lt;br&gt;
I restructured my graph so that independent tasks — like generating components while simultaneously drafting pages code files— run in parallel.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The Multi-Thread Advantage: &lt;br&gt;
Moving from sequential flows to parallel node execution reduced my total execution time by a major factor. If nodes don’t depend on each other’s data, they shouldn’t wait for each other to finish.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;4. Avoiding the Tool-Calling Trap&lt;/strong&gt;&lt;br&gt;
Giving an LLM a massive toolbox feels powerful, but it increase latency . Every tool added introduces a “reasoning cycle” where the model must decide how to frame the call.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Minimize the Toolset: &lt;br&gt;
Only provide tools for tasks the LLM cannot predict or calculate via code.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Deterministic Prediction: &lt;br&gt;
LLMs often call tools in loops to “figure out” a solution. If you can manage that logic via pre-defined code paths or “prediction” nodes, do it. Don’t let the LLM waste time deciding what you, as the developer, already know.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;5. Debugging&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Isolated Debugging: 
I Uses LangSmith from Node #1. Validating each node’s output in isolation prevents “spaghetti logic.” If you wait until the full graph is finished to debug, you will never reach a stable state.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Agentic development is a system optimization problem. By prioritizing parallel node execution (low latency), replacing redundant LLM calls with deterministic logic(saving tokens and latency), and enforcing strict schema contracts(better structured outputs), you move from “experimental wrappers” to production-grade software.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>coding</category>
      <category>softwareengineering</category>
      <category>llm</category>
    </item>
    <item>
      <title>I Tried to Build an Alexa with Real Memory — Here's What I Learned After 3 Months of Failure.</title>
      <dc:creator>vivek</dc:creator>
      <pubDate>Thu, 05 Mar 2026 01:50:13 +0000</pubDate>
      <link>https://dev.to/vivek_gaindhar_e79f747c46/i-tried-to-build-an-alexa-with-real-memory-heres-what-i-learned-after-3-months-of-failure-4f7</link>
      <guid>https://dev.to/vivek_gaindhar_e79f747c46/i-tried-to-build-an-alexa-with-real-memory-heres-what-i-learned-after-3-months-of-failure-4f7</guid>
      <description>&lt;p&gt;&lt;em&gt;A story about LangGraph, memory architecture, and why I stopped fighting LLMs and made the system predictable instead&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;It Started With a Simple Frustration&lt;/strong&gt;&lt;br&gt;
I wanted to build something like Alexa — but smarter. Not just a voice assistant that forgets you the moment the session ends. Not an AI that stores your entire conversation history in a text file and calls it "memory."&lt;br&gt;
I wanted a personal AI that actually knows you — your habits, your preferences, your tasks — and gets smarter over time the way a real assistant would.&lt;br&gt;
Sounds simple. It wasn't.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 1: How Does Alexa Even Work?&lt;/strong&gt;&lt;br&gt;
Before building anything, I went deep on the Alexa cloud architecture. The model is clean: your voice query goes to the cloud, gets processed, hits an LLM, and the response streams back to the device. The device itself is thin — all the intelligence lives on the server.&lt;br&gt;
Okay. So I needed to build the server layer. But when I started thinking about where memory fits in, I hit the first real wall.&lt;br&gt;
Where does memory live? And more importantly — what even IS memory for a personal AI?&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 2: What Should a Personal AI Actually Remember?&lt;/strong&gt;&lt;br&gt;
This is the question most AI projects skip. They just store everything — every message, every session — and call it memory. But that's just a log file. That's not memory.&lt;br&gt;
I spent time thinking about what actually matters for a personal AI. What does a good human assistant remember about you?&lt;br&gt;
After a lot of thinking, I landed on four categories:&lt;br&gt;
Identity — who you are, your name, role, basic facts&lt;br&gt;
Habits — things you do regularly, routines&lt;br&gt;
Preferences — how you like things done, what you enjoy&lt;br&gt;
Events &amp;amp; Tasks — things on your calendar, things you need to do&lt;br&gt;
Everything else is noise. Most of what you say to an AI doesn't need to be stored. This felt like a small insight at the time — it turned out to be the most important design decision in the whole project.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 3: Where to Store It — SQL vs Vector DB&lt;/strong&gt;&lt;br&gt;
Now I had to figure out where to actually store these four types of memory.&lt;br&gt;
My first instinct was a SQL database. Clean tables, structured data, easy to query. But I quickly hit a problem: you can't query a SQL database with natural language directly. You need to know the exact keys, the exact column names. That doesn't work when a user says "remind me what I told you about my gym schedule."&lt;br&gt;
For natural language retrieval, you need vector search — you embed the query and the stored memories as vectors and find semantic matches.&lt;br&gt;
So I ended up with a hybrid:&lt;br&gt;
Postgres (SQL) — for structured memory: identity facts, tasks, calendar events. Things with clear keys you can retrieve directly.&lt;br&gt;
Pinecone (Vector DB) — for semantic memory: habits, preferences, anything you'd retrieve by meaning rather than exact key.&lt;br&gt;
Real data in SQL. Context and meaning in the vector store. Both working together.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 4: The First Approach — Just Give the LLM Everything&lt;/strong&gt;&lt;br&gt;
With the storage figured out, I built version one: give the LLM access to both databases as tools and let it figure out when to read and write.&lt;br&gt;
It was clean in theory. In practice, it was a disaster.&lt;br&gt;
LLMs hallucinate. The model would confidently write memory to the wrong category, retrieve irrelevant things, or — worse — make up memories that didn't exist. When your system's entire job is to be a reliable memory layer, hallucination is fatal.&lt;br&gt;
I needed the system to be predictable. Even if it made mistakes, I needed to know where it would make mistakes.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 5: The Real Architecture — Nodes, Not Magic&lt;/strong&gt;&lt;br&gt;
This is when the project started actually working.&lt;br&gt;
Instead of one LLM doing everything, I broke the pipeline into dedicated nodes, each with one job:&lt;/p&gt;

&lt;p&gt;User Input&lt;br&gt;
     ↓&lt;br&gt;
[Segmentation Node]&lt;br&gt;
Splits input into: memory_to_write | memory_to_fetch | ignore&lt;br&gt;
     ↓&lt;br&gt;
[Classification Node]&lt;br&gt;
Labels each piece: identity | habit | preference | event | task&lt;br&gt;
     ↓&lt;br&gt;
[Router Node]&lt;br&gt;
     ├──→ [Memory Writer] → Pinecone + Postgres (parallel)&lt;br&gt;
     └──→ [Memory Reader] → Fetch relevant context (parallel)&lt;br&gt;
     ↓&lt;br&gt;
[Final Answer Node]&lt;br&gt;
Aggregates context → single LLM call → response&lt;/p&gt;

&lt;p&gt;Two key decisions that made this work:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Read and write in parallel. Running them sequentially was killing latency. Parallelizing both brought response times down significantly.&lt;/li&gt;
&lt;li&gt;Use LLMs only where you have to. Every node that could use regex or deterministic logic instead of an LLM — did. LLMs are expensive in tokens and unpredictable. The classification node, the segmentation logic — wherever I could replace an LLM call with a rule, I did. The only LLM call that has to exist is the final answer generation.
The result: a system that's predictable end to end. If it gets something wrong, I know which node failed and why. That's infinitely better than a black box that hallucinates.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Step 6: The Hardware Dream Dies (For Now)&lt;/strong&gt;&lt;br&gt;
I originally wanted Orion to be a hardware device — a tabletop robot, always listening, always learning. That vision is still there. But 2-3 months in, I made a decision: get the software layer right first.&lt;br&gt;
Hardware is a multiplier. If the memory architecture is broken, a physical device just makes it worse. If the memory architecture is solid, hardware becomes a packaging problem — not a fundamental one.&lt;br&gt;
So Orion is now a software-first memory layer. The hardware will come later, if at all. The memory problem was always the interesting part anyway.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What the Tech Stack Looks Like&lt;/strong&gt;&lt;br&gt;
LangGraph — orchestration framework, manages the node graph and state&lt;br&gt;
Groq — fast LLM inference for the final answer node&lt;br&gt;
Pinecone — vector storage for semantic memory retrieval&lt;br&gt;
Postgres (Supabase) — structured memory storage&lt;br&gt;
Redis — caching and fast in-session state&lt;br&gt;
Jina — embeddings for vectorizing memory content&lt;br&gt;
LangSmith — tracing and debugging the graph (genuinely essential)&lt;br&gt;
FastAPI — serves the whole thing as a REST API&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What I'd Tell Myself 3 Months Ago&lt;/strong&gt;&lt;br&gt;
The question "what to store" matters more than "how to store." Most people jump to the tech before answering the design question. Get the design right first.&lt;br&gt;
Latency is a real problem in memory systems. Parallel retrieval and write is not optional — it's necessary.&lt;br&gt;
Changing the scope is not failure. Dropping the hardware and focusing on the software layer wasn't giving up. It was focusing.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What's Next&lt;/strong&gt;&lt;br&gt;
Orion is still in development. The memory layer works. The next step is making the retrieval smarter — better context injection, memory decay for old/irrelevant entries, and eventually a clean SDK that other developers can drop into their own AI projects.&lt;/p&gt;

&lt;p&gt;If you're building something with LangGraph or agentic memory, I'd genuinely love to talk. The GitHub repo is open: &lt;strong&gt;&lt;em&gt;github.com/vivek-1314/orion-py&lt;/em&gt;&lt;/strong&gt;&lt;br&gt;
&lt;em&gt;Pre-final year CSE student. Building things that probably shouldn't work yet&lt;/em&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>webdev</category>
      <category>langchain</category>
      <category>python</category>
    </item>
    <item>
      <title>The leetcode comfort trap</title>
      <dc:creator>vivek</dc:creator>
      <pubDate>Sun, 28 Dec 2025 07:09:35 +0000</pubDate>
      <link>https://dev.to/vivek_gaindhar_e79f747c46/the-leetcode-comfort-trap-1h5m</link>
      <guid>https://dev.to/vivek_gaindhar_e79f747c46/the-leetcode-comfort-trap-1h5m</guid>
      <description>&lt;p&gt;Solving 2–3 LeetCode problems and going to sleep feeling accomplished is the same dopamine loop as &lt;strong&gt;hitting the gym&lt;/strong&gt;, training hard, and going home for a nice sleep. It feels productive, but it’s safe.&lt;/p&gt;

&lt;p&gt;You’re grinding in a **sandbox **where failure has the weight of a feather. You spend three hours "deeply thinking" about an O(n \log n) solution, close the tab, and the universe remains unchanged.&lt;/p&gt;

&lt;p&gt;That’s not engineering; that’s &lt;strong&gt;paper trading.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;It’s easy to feel like a genius when the constraints are pre-defined and the "End" button is always in reach.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Real Difficulty is Sustained Pressure&lt;/strong&gt; LeetCode isn’t bad—it’s a sharp tool, a necessary warm-up. But if you're settling for green checkmarks, you’re rotting in your comfort zone. Real growth happens when:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Verdict&lt;/strong&gt; LeetCode is the gym; it is not the sport. Use it to sharpen your blade, but don't spend your life polishing the metal while the monsters are outside the door. If your practice feels flat, move to something heavier. If the project scares you, you’re finally aiming right.&lt;/p&gt;

&lt;p&gt;I can tell you this with respect because I’m currently in the trenches—grinding on a real, project while managing LeetCode side by side.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>programming</category>
      <category>ai</category>
      <category>javascript</category>
    </item>
    <item>
      <title>I Tried to Give Memory to an AI… and Learned the Hard Way</title>
      <dc:creator>vivek</dc:creator>
      <pubDate>Sat, 13 Dec 2025 17:56:34 +0000</pubDate>
      <link>https://dev.to/vivek_gaindhar_e79f747c46/i-tried-to-give-memory-to-an-ai-and-learned-the-hard-way-17cb</link>
      <guid>https://dev.to/vivek_gaindhar_e79f747c46/i-tried-to-give-memory-to-an-ai-and-learned-the-hard-way-17cb</guid>
      <description>&lt;p&gt;I’m building Orion, a proactive AI companion. Not just a chatbot — something that actually remembers things over time and can act intelligently before being asked.&lt;/p&gt;

&lt;p&gt;**My first attempt was naïve:&lt;br&gt;
  “Let’s pass all past memory to the LLM!”&lt;/p&gt;

&lt;p&gt;Result: 💸 Massive token usage, 🤯 polluted context, 😅 nonsense answers.&lt;/p&gt;

&lt;p&gt;**Second attempt:&lt;/p&gt;

&lt;p&gt;“More retrieval = better answers”&lt;/p&gt;

&lt;p&gt;Result: LLM got distracted, important memories got buried, cost went up, and I learned that more isn’t always better.&lt;/p&gt;

&lt;p&gt;What finally started working: structured memory layers&lt;br&gt;
Short-term memory → current session, quick context&lt;br&gt;
Long-term memory → structured facts like preferences, events&lt;br&gt;
Vector memory → semantic recall for similar past situations&lt;br&gt;
TTL + scoring → forgetting intentionally is a feature&lt;/p&gt;

&lt;p&gt;The tricky part isn’t the LLM or the vector DB — it’s deciding what to remember, when to update, and what to forget.&lt;/p&gt;

&lt;p&gt;I documented everything: &lt;br&gt;
architecture diagrams, memory flows, mistakes, lessons learned. It’s messy, but real.&lt;/p&gt;

&lt;p&gt;Repo (full system + docs + diagrams):&lt;br&gt;
👉 &lt;a href="https://github.com/vivek-1314/orion-py" rel="noopener noreferrer"&gt;https://github.com/vivek-1314/orion-py&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
