<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="https://vishwarajanand.com/assets/xslt/rss.xslt" ?>
<?xml-stylesheet type="text/css" href="https://vishwarajanand.com/assets/css/rss.css" ?>
<rss version="2.0" xmlns:atom="https://www.w3.org/2005/Atom">
	<channel>
		<title>Vishwaraj Anand</title>
		<description>»This website is to tell you about me and my work.</description>
		<link>https://vishwarajanand.com/</link>
		<atom:link href="https://vishwarajanand.com/pages/pages-root-folder/feed.xml" rel="self" type="application/rss+xml" />
		
			<item>
				<title>Deleting autogenerated code</title>
				<link>https://vishwarajanand.com/tech/deleting-autogenerated-code/</link>
				<pubDate>Mon, 22 Dec 2025 00:00:00 +0000</pubDate>
				<description>&lt;p&gt;Throughout my career, I’ve found that some of my most impactful work involved deleting code rather than writing it. Systems often run faster and become easier to maintain when we remove unnecessary complexity.&lt;/p&gt;

&lt;p&gt;This contradicts everything I learned early in my career. Fresh out of school, I believed shipping features meant success. More code, more functionality, more value—right? The industry reinforced this: sprint velocity, commit counts, feature flags.&lt;/p&gt;

&lt;p&gt;But production systems don’t care about your velocity. They care about reliability, debuggability, and operational simplicity.&lt;/p&gt;

&lt;hr /&gt;

&lt;h3 id=&quot;the-wake-up-call-when-complexity-becomes-the-enemy&quot;&gt;The Wake-Up Call: When Complexity Becomes the Enemy&lt;/h3&gt;

&lt;p&gt;My perspective shifted during various debugging sessions over the years. Often, performance issues stem from outdated optimizations—caching layers built for use cases that no longer exist, or defensive code that adds overhead without benefit.&lt;/p&gt;

&lt;p&gt;Removing such cruft often improves performance significantly.&lt;/p&gt;

&lt;p&gt;This pattern repeated itself across the codebase. Defensive logging that generated gigabytes of noise. Retry logic layered on retry logic. Configuration toggles for features that never launched. Each addition had seemed reasonable in isolation, but together they formed a maze.&lt;/p&gt;

&lt;p&gt;Here’s what AI coding assistants have made worse: generating plausible-looking code is now trivial. Need a helper function? LLM provides five implementations. Need a config parser? Here’s a robust solution with validation, caching, and extensibility.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The hard part isn’t generating code anymore. It’s deciding what deserves to exist.&lt;/strong&gt;&lt;/p&gt;

&lt;hr /&gt;

&lt;h3 id=&quot;archaeology-in-production-unearthing-dead-code&quot;&gt;Archaeology in Production: Unearthing Dead Code&lt;/h3&gt;

&lt;p&gt;When I joined my current team at Meta, I inherited a service with several dependencies. Each dependency carried weight: security patches to track, breaking changes to monitor, mental overhead for new engineers trying to understand “why do we have three ways to make HTTP calls?”&lt;/p&gt;

&lt;p&gt;The trickiest part wasn’t identifying what to remove—we ran dependency analysis and found dozens of unused imports. The challenge was building confidence that deletion was safe. Legacy systems accumulate defensive code: “I don’t know what this does, but I’m afraid to remove it.”&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;This fear is valid.&lt;/strong&gt; I’ve seen production incidents caused by removing “dead” code that turned out to have one obscure caller. The solution isn’t reckless deletion—it’s systematic verification.&lt;/p&gt;

&lt;p&gt;Building instrumentation to track which code paths actually execute in production is invaluable. You’d be surprised how much code exists that never runs—legacy paths from migrated features or defensive logic for scenarios that can’t occur anymore.&lt;/p&gt;

&lt;hr /&gt;

&lt;h3 id=&quot;the-deletion-sprint-making-it-real-work&quot;&gt;The Deletion Sprint: Making It Real Work&lt;/h3&gt;

&lt;p&gt;Here’s where most cleanup initiatives die: they get prioritized behind feature work, forever postponed as “technical debt we’ll address later.”&lt;/p&gt;

&lt;p&gt;I took a different approach. I framed dependency cleanup not as technical debt, but as &lt;strong&gt;production risk reduction&lt;/strong&gt;. The pitch to leadership was simple:&lt;/p&gt;

&lt;p&gt;&lt;em&gt;“Every unused dependency is a potential CVE waiting to happen. Every obsolete code path is a debugging session that takes 3x longer. This isn’t about code cleanliness—it’s about operational efficiency and security posture.”&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;That language resonated. We got a dedicated sprint.&lt;/p&gt;

&lt;p&gt;My approach:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;&lt;strong&gt;Instrumentation First:&lt;/strong&gt; Added telemetry to confirm zero usage in production&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Incremental Removal:&lt;/strong&gt; One dependency per PR with full regression testing&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Rollback Plan:&lt;/strong&gt; Feature flags for deletions affecting critical paths&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Documentation:&lt;/strong&gt; Updated docs to explain what we removed and why&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The benefits of aggressive pruning often exceed expectations. Fewer dependencies mean faster builds, smaller deployment artifacts, and reduced security surface area. You might be patching CVEs in libraries you’re not even using.&lt;/p&gt;

&lt;p&gt;Incident response becomes more straightforward too. When you have multiple ways to do the same thing, every error requires checking multiple implementations. Consolidation makes diagnosis deterministic.&lt;/p&gt;

&lt;hr /&gt;

&lt;h3 id=&quot;ai-amplifies-the-problem&quot;&gt;AI Amplifies the Problem&lt;/h3&gt;

&lt;p&gt;Generative AI has transformed how we write code, but it’s made the accumulation problem exponentially worse. LLMs are trained on massive codebases and optimize for completeness, not minimalism.&lt;/p&gt;

&lt;p&gt;Ask ChatGPT to “implement user authentication” and you’ll get a full OAuth flow with JWT refresh tokens, role-based access control, and database migrations. Maybe you just needed to check an API key.&lt;/p&gt;

&lt;p&gt;I’ve reviewed pull requests where engineers used AI to generate solutions that duplicate existing functionality—reinventing utilities that already exist in the codebase or standard library, or building complex abstractions for simple problems.&lt;/p&gt;

&lt;p&gt;The code works. It’s even well-commented. But it’s &lt;strong&gt;unnecessary weight&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;My code review filter now includes:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;“Can we use stdlib instead?”&lt;/strong&gt; Modern languages have rich standard libraries. We don’t need lodash for array manipulation.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;“Does this solve a real problem?”&lt;/strong&gt; Premature abstraction is worse than no abstraction. Build it when you need it.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;“What’s the maintenance cost?”&lt;/strong&gt; Custom code means custom debugging, custom documentation, custom onboarding.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;When AI suggests adding a dependency, I ask the engineer: “Have you checked if we already do this somewhere?” The answer is often yes.&lt;/p&gt;

&lt;hr /&gt;

&lt;h3 id=&quot;the-senior-engineers-real-job&quot;&gt;The Senior Engineer’s Real Job&lt;/h3&gt;

&lt;p&gt;Early in your career, you prove yourself by shipping. You write features, fix bugs, close tickets. Your impact is measured in output.&lt;/p&gt;

&lt;p&gt;But seniority isn’t about writing more code—it’s about &lt;strong&gt;making better decisions about what code should exist&lt;/strong&gt;. Sometimes the most impactful contributions aren’t new features, but strategic removals:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Merging redundant services to reduce operational overhead&lt;/li&gt;
  &lt;li&gt;Deprecating configuration systems that have grown beyond their usefulness&lt;/li&gt;
  &lt;li&gt;Consolidating similar utilities scattered across the codebase&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These changes don’t show up in GitHub contribution graphs. They don’t make good demos. But they compound over time: faster CI/CD, easier onboarding, fewer production mysteries.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Here’s my framework for sustainable engineering:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;&lt;strong&gt;Addition requires justification.&lt;/strong&gt; New code must prove its value.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Deletion requires verification.&lt;/strong&gt; Remove safely, but remove aggressively.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Consolidation beats proliferation.&lt;/strong&gt; One excellent solution beats five good ones.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;AI has made creation trivial. The competitive advantage now belongs to engineers who can look at a sprawling system and know exactly what to remove to make it stronger.&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;Your legacy isn’t the code you wrote—it’s the maintainability you left behind.&lt;/p&gt;
&lt;/blockquote&gt;
</description>
				<guid isPermaLink="true">https://vishwarajanand.com/tech/deleting-autogenerated-code/</guid>
			</item>
		
			<item>
				<title>Cracking AI-Based SWE Interviews</title>
				<link>https://vishwarajanand.com/tech/cracking-ai-based-swe-interviews/</link>
				<pubDate>Tue, 02 Dec 2025 00:00:00 +0000</pubDate>
				<description>&lt;p&gt;Recently, a candidate asked me:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;&lt;strong&gt;“How do I prepare for coding interviews where the editor itself is powered by AI? What’s different, and what do interviewers care about?”&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;This is a timely question. As Agentic AI tools become standard in technical interviews, the expectations and evaluation criteria are shifting. Here’s my advice—tailored for the Agentic AI era—on how to excel in these new-style SWE interviews.&lt;/p&gt;

&lt;hr /&gt;

&lt;h2 id=&quot;1-understand-the-interview-format&quot;&gt;1. Understand the Interview Format&lt;/h2&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;Agentic AI coding rounds&lt;/strong&gt; use editors like VS Code, Cursor, or custom platforms with built-in AI agents.&lt;/li&gt;
  &lt;li&gt;You’ll get real-time code suggestions, error detection, and sometimes even hints or documentation from the AI.&lt;/li&gt;
&lt;/ul&gt;

&lt;hr /&gt;

&lt;h2 id=&quot;2-what-interviewers-rate-upon&quot;&gt;2. What Interviewers Rate Upon&lt;/h2&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;Technical fundamentals:&lt;/strong&gt; Your grasp of algorithms, data structures, and problem-solving remains crucial.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;AI collaboration:&lt;/strong&gt; Interviewers watch how you interact with the AI agent. Do you use its suggestions wisely? Can you spot and correct its mistakes?&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Critical thinking:&lt;/strong&gt; Are you evaluating AI-generated code, or just accepting it blindly?&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Communication:&lt;/strong&gt; Can you explain your reasoning, especially when you accept or reject AI help?&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Adaptability:&lt;/strong&gt; How smoothly do you switch between manual coding and leveraging AI features?&lt;/li&gt;
&lt;/ul&gt;

&lt;hr /&gt;

&lt;h2 id=&quot;3-how-these-interviews-differ-from-traditional-rounds&quot;&gt;3. How These Interviews Differ from Traditional Rounds&lt;/h2&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;AI is your coding partner:&lt;/strong&gt; Instead of a static editor, you’re working with a tool that can suggest, complete, and even debug code.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Process over product:&lt;/strong&gt; Interviewers care about &lt;em&gt;how&lt;/em&gt; you solve problems, not just the final answer.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Real-time feedback:&lt;/strong&gt; Expect questions about your choices—why you used (or ignored) an AI suggestion, how you debugged, etc.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Less focus on memorization:&lt;/strong&gt; The ability to use tools effectively is valued over rote recall.&lt;/li&gt;
&lt;/ul&gt;

&lt;hr /&gt;

&lt;h2 id=&quot;4-tips-to-excel-in-agentic-ai-coding-interviews&quot;&gt;4. Tips to Excel in Agentic AI Coding Interviews&lt;/h2&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;Practice with AI-powered editors:&lt;/strong&gt; Get comfortable with Copilot, Cursor, or similar tools. Learn their strengths and limitations.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Be skeptical, not cynical:&lt;/strong&gt; Review every AI suggestion. Accept what’s correct, modify what’s close, and reject what’s wrong.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Narrate your process:&lt;/strong&gt; Explain your approach out loud, especially your interactions with the AI.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Use AI for speed, not shortcuts:&lt;/strong&gt; Let the agent handle boilerplate, but do the core logic yourself.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Test thoroughly:&lt;/strong&gt; Use the editor’s instant feedback to run edge cases and validate your solution.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Stay calm under feedback:&lt;/strong&gt; If the interviewer challenges your choices, respond thoughtfully and show your reasoning.&lt;/li&gt;
&lt;/ul&gt;

&lt;hr /&gt;

&lt;h2 id=&quot;5-common-pitfalls-in-agentic-ai-coding-interviews&quot;&gt;5. Common Pitfalls in Agentic AI Coding Interviews&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Mistakes candidates often make:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;Over-reliance on AI:&lt;/strong&gt; Accepting AI-generated code without understanding or verifying it.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Ignoring AI errors:&lt;/strong&gt; Failing to spot hallucinations, security risks, or incorrect logic in AI suggestions.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Poor communication:&lt;/strong&gt; Not explaining their reasoning, choices, or why they accepted/rejected AI help.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Lack of testing:&lt;/strong&gt; Relying on walkthroughs instead of thorough in-code verification and edge case testing.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Not asking clarifying questions:&lt;/strong&gt; Jumping into coding without fully understanding the problem or constraints.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;How to avoid these pitfalls:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Use AI as a tool, not a crutch—always review and test its output.&lt;/li&gt;
  &lt;li&gt;Communicate your thought process, especially when using or modifying AI suggestions.&lt;/li&gt;
  &lt;li&gt;Ask clarifying questions before starting, and narrate your approach as you go.&lt;/li&gt;
  &lt;li&gt;Test your code thoroughly, including edge cases.&lt;/li&gt;
  &lt;li&gt;If the AI makes a mistake, point it out and explain your correction to the interviewer.&lt;/li&gt;
&lt;/ul&gt;

&lt;hr /&gt;

&lt;h2 id=&quot;6-real-world-examples-good-vs-bad-approaches&quot;&gt;6. Real-World Examples: Good vs. Bad Approaches&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Example 1: “Implement a function to merge two sorted linked lists.”&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;Bad Approach:&lt;/strong&gt;
    &lt;ul&gt;
      &lt;li&gt;Accepts AI-generated code without reading it.&lt;/li&gt;
      &lt;li&gt;Doesn’t test for edge cases (e.g., one list is empty).&lt;/li&gt;
      &lt;li&gt;Fails to explain why the AI’s approach works or doesn’t.&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Good Approach:&lt;/strong&gt;
    &lt;ul&gt;
      &lt;li&gt;Uses AI to generate a function stub, then manually implements the merge logic.&lt;/li&gt;
      &lt;li&gt;Tests with multiple cases (both lists empty, one empty, both non-empty).&lt;/li&gt;
      &lt;li&gt;Explains the merging process and why each step is necessary.&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Example 2: “Find the longest substring without repeating characters.”&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;Bad Approach:&lt;/strong&gt;
    &lt;ul&gt;
      &lt;li&gt;Asks AI for a solution, copy-pastes it, and runs without understanding.&lt;/li&gt;
      &lt;li&gt;Misses off-by-one errors or fails to handle Unicode/edge cases.&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Good Approach:&lt;/strong&gt;
    &lt;ul&gt;
      &lt;li&gt;Discusses possible algorithms (sliding window, hash set).&lt;/li&gt;
      &lt;li&gt;Uses AI for boilerplate, but writes and explains the core logic.&lt;/li&gt;
      &lt;li&gt;Tests with strings like “abcabcbb”, “bbbbb”, and “pwwkew”.&lt;/li&gt;
      &lt;li&gt;Explains why the chosen approach is optimal.&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;hr /&gt;

&lt;h2 id=&quot;7-sample-scenario-agentic-ai-in-action&quot;&gt;7. Sample Scenario: Agentic AI in Action&lt;/h2&gt;

&lt;blockquote&gt;
  &lt;p&gt;&lt;strong&gt;Prompt:&lt;/strong&gt; “Find the longest palindrome in a string. You have access to an AI agent in the code editor.”&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;Strong approach:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;Use AI to generate a function stub.&lt;/li&gt;
  &lt;li&gt;Discuss possible algorithms (expand around center, dynamic programming).&lt;/li&gt;
  &lt;li&gt;Ask the AI for documentation or hints if needed.&lt;/li&gt;
  &lt;li&gt;Review and test AI-generated code.&lt;/li&gt;
  &lt;li&gt;Explain your reasoning and choices to the interviewer.&lt;/li&gt;
&lt;/ul&gt;

&lt;hr /&gt;

&lt;h2 id=&quot;8-final-thoughts&quot;&gt;8. Final Thoughts&lt;/h2&gt;

&lt;p&gt;Agentic AI coding interviews are not just about writing code—they’re about &lt;strong&gt;collaborating with intelligent tools&lt;/strong&gt;. The best candidates:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Use AI to enhance productivity, not replace their own thinking.&lt;/li&gt;
  &lt;li&gt;Communicate clearly and justify their decisions.&lt;/li&gt;
  &lt;li&gt;Demonstrate adaptability and critical thinking.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Embrace the new format, practice with AI tools, and focus on your problem-solving fundamentals.&lt;/strong&gt;&lt;/p&gt;

&lt;hr /&gt;

&lt;p&gt;&lt;em&gt;If you have more questions or want to discuss your interview prep, feel free to reach out!&lt;/em&gt;&lt;/p&gt;

&lt;hr /&gt;
</description>
				<guid isPermaLink="true">https://vishwarajanand.com/tech/cracking-ai-based-swe-interviews/</guid>
			</item>
		
			<item>
				<title>Relevant CS career building advice</title>
				<link>https://vishwarajanand.com/tech/relevant-cs-career-building-advice/</link>
				<pubDate>Sun, 02 Nov 2025 00:00:00 +0000</pubDate>
				<description>&lt;p&gt;Recently, a CS undergraduate student (pre-final year) approached me with a question that’s on the minds of many undergraduates:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;&lt;strong&gt;“What should I do to excel in my career, especially now that LLMs &amp;amp; AI seem to be changing everything? I’m worried about jobs disappearing.”&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;This is a valid concern. The rise of LLMs and generative AI is transforming the tech landscape, automating some tasks while creating new opportunities—though the nature and number of these opportunities are still evolving. Here’s my advice—updated for the LLM era—on how to build a resilient, future-proof career in computer science.&lt;/p&gt;

&lt;hr /&gt;

&lt;h3 id=&quot;1-understand-the-evolving-tech-landscape&quot;&gt;1. Understand the Evolving Tech Landscape&lt;/h3&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;Learn the basics, but stay curious about AI:&lt;/strong&gt;&lt;br /&gt;
Master core CS concepts (DSA, OOP, OS, DBMS, Networking), but also understand how LLMs and generative AI are being integrated into products and workflows.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Explore new domains:&lt;/strong&gt;&lt;br /&gt;
LLMs are not just for chatbots—they’re used in code generation, data analysis, content creation, and more. Stay updated on how different fields (healthcare, finance, education, etc.) are adopting AI.&lt;/li&gt;
&lt;/ul&gt;

&lt;hr /&gt;

&lt;h3 id=&quot;2-build-a-strong-foundationwith-an-ai-twist&quot;&gt;2. Build a Strong Foundation—With an AI Twist&lt;/h3&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;Core skills still matter:&lt;/strong&gt;&lt;br /&gt;
Algorithms, data structures, and system design are the backbone of any tech role.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Add AI/ML fundamentals:&lt;/strong&gt;&lt;br /&gt;
Take introductory courses in machine learning, NLP, and deep learning. Understand how LLMs work at a high level (transformers, embeddings, prompt engineering).&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Learn to use LLMs as tools:&lt;/strong&gt;&lt;br /&gt;
Practice using APIs like OpenAI, Meta Llama, or open-source models to solve real problems.&lt;/li&gt;
&lt;/ul&gt;

&lt;hr /&gt;

&lt;h3 id=&quot;3-project-based-learning-build-with-llms&quot;&gt;3. Project-Based Learning: Build with LLMs&lt;/h3&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;Work on projects that leverage LLMs:&lt;/strong&gt;&lt;br /&gt;
Instead of a generic to-do app, try building a smart assistant, a code review bot, or a content summarizer using LLM APIs.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Showcase your ability to integrate AI:&lt;/strong&gt;&lt;br /&gt;
Employers value candidates who can use LLMs to automate tasks, enhance user experience, or create new products.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Document your process:&lt;/strong&gt;&lt;br /&gt;
Write about your projects, challenges, and learnings—especially how you used LLMs creatively.&lt;/li&gt;
&lt;/ul&gt;

&lt;hr /&gt;

&lt;h3 id=&quot;4-internships-and-real-world-experience&quot;&gt;4. Internships and Real-World Experience&lt;/h3&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;Target companies and teams working with AI:&lt;/strong&gt;&lt;br /&gt;
Look for internships where you can contribute to or learn from projects involving LLMs, data pipelines, or AI-powered products.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Be proactive:&lt;/strong&gt;&lt;br /&gt;
If your internship isn’t AI-focused, find ways to suggest or prototype LLM integrations for existing workflows.&lt;/li&gt;
&lt;/ul&gt;

&lt;hr /&gt;

&lt;h3 id=&quot;5-resume-and-linkedin-optimization-for-the-ai-era&quot;&gt;5. Resume and LinkedIn Optimization for the AI Era&lt;/h3&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;Highlight AI/LLM experience:&lt;/strong&gt;&lt;br /&gt;
List projects, hackathons, or coursework involving LLMs, prompt engineering, or AI APIs.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Show adaptability:&lt;/strong&gt;&lt;br /&gt;
Emphasize your ability to learn new tools and adapt to fast-changing tech.&lt;/li&gt;
&lt;/ul&gt;

&lt;hr /&gt;

&lt;h3 id=&quot;6-technical-interview-preparation-beyond-dsa&quot;&gt;6. Technical Interview Preparation: Beyond DSA&lt;/h3&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;DSA is still important, but…&lt;/strong&gt;&lt;br /&gt;
Some interviews now include questions on AI concepts, prompt design, or even using LLMs to solve problems.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Practice with AI tools:&lt;/strong&gt;&lt;br /&gt;
Use LLMs to help you debug, generate code, or explain concepts as part of your prep—but don’t rely on them blindly.&lt;/li&gt;
&lt;/ul&gt;

&lt;hr /&gt;

&lt;h3 id=&quot;7-soft-skills-and-communication-in-the-age-of-ai&quot;&gt;7. Soft Skills and Communication in the Age of AI&lt;/h3&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;Human skills are more valuable than ever:&lt;/strong&gt;&lt;br /&gt;
LLMs can generate text, but they can’t replace empathy, leadership, or creative problem-solving.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Learn to collaborate with AI:&lt;/strong&gt;&lt;br /&gt;
Treat LLMs as teammates—know when to trust their output and when to question it.&lt;/li&gt;
&lt;/ul&gt;

&lt;hr /&gt;

&lt;h3 id=&quot;8-networking-and-mentorship&quot;&gt;8. Networking and Mentorship&lt;/h3&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;Connect with AI practitioners:&lt;/strong&gt;&lt;br /&gt;
Join AI/ML communities, attend webinars, and participate in hackathons focused on generative AI.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Find mentors who understand the new landscape:&lt;/strong&gt;&lt;br /&gt;
Seek guidance from professionals who are actively working with LLMs.&lt;/li&gt;
&lt;/ul&gt;

&lt;hr /&gt;

&lt;h3 id=&quot;9-continuous-learning-stay-ahead-of-the-curve&quot;&gt;9. Continuous Learning: Stay Ahead of the Curve&lt;/h3&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;Follow AI trends:&lt;/strong&gt;&lt;br /&gt;
Subscribe to newsletters, blogs, and podcasts about LLMs and generative AI.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Experiment with new tools:&lt;/strong&gt;&lt;br /&gt;
Try out the latest open-source models, prompt libraries, and AI platforms.&lt;/li&gt;
&lt;/ul&gt;

&lt;hr /&gt;

&lt;h3 id=&quot;10-explore-career-pathways-beyond-coding&quot;&gt;10. Explore Career Pathways Beyond Coding&lt;/h3&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;LLMs are creating new roles:&lt;/strong&gt;&lt;br /&gt;
Consider careers in prompt engineering, AI product management, AI ethics, or technical writing for AI products.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Interdisciplinary skills are in demand:&lt;/strong&gt;&lt;br /&gt;
Combine your CS knowledge with domain expertise (e.g., healthcare + AI).&lt;/li&gt;
&lt;/ul&gt;

&lt;hr /&gt;

&lt;h3 id=&quot;11-dealing-with-rejection-and-exploring-options&quot;&gt;11. Dealing with Rejection and Exploring options&lt;/h3&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;The landscape is competitive and changing:&lt;/strong&gt;&lt;br /&gt;
Not every application will succeed, and that’s okay. Use feedback to improve and adapt.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Embrace lifelong learning:&lt;/strong&gt;&lt;br /&gt;
The best way to future-proof your career is to keep learning and evolving.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;AI is borderless:&lt;/strong&gt;&lt;br /&gt;
Many AI/LLM projects are open-source and global. Contribute to international projects and consider remote roles.&lt;/li&gt;
&lt;/ul&gt;

&lt;hr /&gt;

&lt;h3 id=&quot;12-work-life-balance-and-mental-health&quot;&gt;12. Work-Life Balance and Mental Health&lt;/h3&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;Don’t let AI hype overwhelm you:&lt;/strong&gt;&lt;br /&gt;
Focus on your growth, not just the headlines. Take breaks, pursue hobbies, and maintain a healthy balance.&lt;/li&gt;
&lt;/ul&gt;

&lt;hr /&gt;

&lt;h3 id=&quot;final-thoughts&quot;&gt;Final Thoughts&lt;/h3&gt;

&lt;p&gt;The rise of LLMs is not the end of tech jobs—it’s the beginning of a new era.&lt;br /&gt;
&lt;strong&gt;Those who learn to work with AI, adapt quickly, and focus on human strengths will thrive.&lt;/strong&gt;&lt;br /&gt;
If you’re a student today, you have a unique opportunity to shape the future. Start building, keep learning, and don’t be afraid to ask questions—just like the student who inspired this post.&lt;/p&gt;

&lt;hr /&gt;

&lt;p&gt;At this point in your career friend, you’ve have selected your domain: CS Tech. I encourage and challenge you to have a growth mindset and break boundaries. If I can do it, you can too.&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;No one has ever started untill they did.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;em&gt;If you have more questions or want to discuss your career path, feel free to reach out!&lt;/em&gt;&lt;/p&gt;

</description>
				<guid isPermaLink="true">https://vishwarajanand.com/tech/relevant-cs-career-building-advice/</guid>
			</item>
		
			<item>
				<title>Leaving Google</title>
				<link>https://vishwarajanand.com/professional/leaving-google/</link>
				<pubDate>Fri, 11 Jul 2025 00:00:00 +0000</pubDate>
				<description>&lt;p&gt;Leaving Google wasn’t an easy decision, and it’s one that many might not fully understand. After much deliberation, I’ve officially joined Meta (formerly Facebook) as a Software Engineer in their Bangalore office. I’m incredibly pumped and inspired to build new things, leaving behind the questions and thoughts that once kept me anchored at Google.&lt;/p&gt;

&lt;p&gt;The transition was a mix of emotions. I genuinely admired my team, peers in India/US and organization at Google. However, my professional compass was pointing elsewhere. For over a year, I’d been immersed in the AI ecosystem, working with various libraries and database tools. While my work was very valuable, I found myself craving to build actual products that solve real-world problems directly.&lt;/p&gt;

&lt;h2 id=&quot;the-journey-to-meta-rigorous-and-rewarding&quot;&gt;The Journey to Meta: Rigorous and Rewarding&lt;/h2&gt;

&lt;p&gt;My journey to Meta began with a recruiter’s outreach. After explaining my current role, I dedicated extra time daily to an exhaustive and extensive preparation process. This involved a recruiter screen, two coding rounds, a system design interview, and a behavioral interview – about five rounds in total. Honestly, after all that, I wasn’t even sure if I’d made it!&lt;/p&gt;

&lt;p&gt;But the good news eventually arrived: I had a team assigned in Bangalore. This was a crucial point for me, as I specifically requested to remain in India to avoid any visa issues.&lt;/p&gt;

&lt;h2 id=&quot;diving-into-ai-powered-recruiting-tools&quot;&gt;Diving into AI-Powered Recruiting Tools&lt;/h2&gt;

&lt;p&gt;My new team, as publicly known, is focused on building AI-powered recruiting tools. I’ve spent a lot of time discussing with AI what all such a team could achieve. It’s clear that a primary goal would be to enhance the efficiency of the recruiting staff while significantly improving the experience for everyone involved in the hiring process.&lt;/p&gt;

&lt;p&gt;Here are some of the exciting possibilities for how Meta can leverage AI in recruiting:&lt;/p&gt;

&lt;h4 id=&quot;1-enhanced-candidate-sourcing-and-screening&quot;&gt;1: Enhanced Candidate Sourcing and Screening:&lt;/h4&gt;

&lt;p&gt;A. &lt;strong&gt;Automated Resume Analysis:&lt;/strong&gt; AI can quickly scan and analyze vast numbers of resumes, identifying keywords, skills, and experiences that align with job requirements. This significantly reduces the manual effort for recruiters and helps them focus on the most promising candidates.&lt;/p&gt;

&lt;p&gt;B. &lt;strong&gt;Predictive Matching:&lt;/strong&gt; AI algorithms can match candidates with suitable job roles based on skills, experience, and even potential cultural fit, going beyond simple keyword matching. This can lead to more accurate and efficient shortlisting.&lt;/p&gt;

&lt;p&gt;C. &lt;strong&gt;Passive Candidate Identification:&lt;/strong&gt; AI-powered sourcing tools can scour various online platforms (e.g., LinkedIn, GitHub, academic papers) to identify individuals who may not be actively job searching but possess the desired skills and expertise.&lt;/p&gt;

&lt;p&gt;D. &lt;strong&gt;Bias Mitigation:&lt;/strong&gt; While not foolproof, AI can be designed to reduce unconscious bias in the initial screening process by focusing on objective criteria and minimizing human subjective judgment.&lt;/p&gt;

&lt;h4 id=&quot;2-streamlined-interview-processes&quot;&gt;2: Streamlined Interview Processes:&lt;/h4&gt;

&lt;p&gt;A. &lt;strong&gt;AI-Assisted Interview Assessment:&lt;/strong&gt; Meta is reportedly deploying an AI system to assess coding skills and suggest tailored interview questions. This system can also evaluate human interviewers, flagging inappropriate questions and analyzing feedback quality, aiming for consistency and fairness.&lt;/p&gt;

&lt;p&gt;B. &lt;strong&gt;Virtual Assistants and Chatbots:&lt;/strong&gt; AI-powered chatbots can handle initial candidate queries, provide information about open positions, guide applicants through the application process, and even conduct pre-screening assessments. They can also assist with scheduling interviews.&lt;/p&gt;

&lt;p&gt;C. &lt;strong&gt;Video Interview Analysis:&lt;/strong&gt; AI can analyze video interviews for speech patterns, facial expressions, and body language to provide insights that might be missed by human interviewers. Some AI tools can also detect if answers are original or AI-generated.&lt;/p&gt;

&lt;h4 id=&quot;3-personalized-candidate-experience&quot;&gt;3. Personalized Candidate Experience:&lt;/h4&gt;

&lt;p&gt;A. &lt;strong&gt;Customized Job Postings:&lt;/strong&gt; AI can help generate multiple versions of job descriptions tailored to different demographics, ensuring inclusive language and appealing to a diverse range of candidates.&lt;/p&gt;

&lt;p&gt;B. &lt;strong&gt;Personalized Recommendations:&lt;/strong&gt; AI systems can provide job recommendations to candidates based on in-depth profile analysis and tracked behaviors, making the job search more efficient for applicants.&lt;/p&gt;

&lt;h4 id=&quot;4-strategic-workforce-planning-and-operational-efficiency&quot;&gt;4. Strategic Workforce Planning and Operational Efficiency:&lt;/h4&gt;

&lt;p&gt;A. &lt;strong&gt;Predictive Analytics:&lt;/strong&gt; AI can analyze historical hiring data, market trends, and employee performance to forecast future talent needs. This allows HR teams to proactively source and nurture candidates for critical roles.&lt;/p&gt;

&lt;p&gt;B. &lt;strong&gt;Skills Forecasting:&lt;/strong&gt; AI can anticipate which skills and qualifications will be valuable in the future, helping Meta identify and develop talent pipelines accordingly.&lt;/p&gt;

&lt;p&gt;C. &lt;strong&gt;Automating Administrative Tasks:&lt;/strong&gt; AI can automate repetitive and time-consuming tasks like data entry, scheduling, email communications, and generating initial interview questions, freeing up recruiters to focus on more strategic aspects.&lt;/p&gt;

&lt;p&gt;D. &lt;strong&gt;Onboarding Support:&lt;/strong&gt; AI can streamline onboarding by automating tasks like document management, training scheduling, and providing responses to common new hire questions.&lt;/p&gt;

&lt;p&gt;And it is indeed true and exciting that Meta is heavily investing in attracting top AI researchers and engineers by offering substantial compensation packages and the opportunity to work on ambitious projects like “superintelligence” in their Superintelligence Labs. This directly impacts internal recruitment of highly specialized AI talent. I hope to get the most through my work in the new role.&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;A wise man had once said, when you see a good opportunity, give it your all.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;So, net-net I happily went through this job change. Now, I have so many good friends in Google, the folks with whom I worked and all the friends with whom I shared laughs, I feel the need to go visit the legendary Google offices back just to stay in touch. :relaxed: :relieved:&lt;/p&gt;

&lt;p&gt;Needless to say, if you have ideas or thoughts to share about my new work domain (AI in SWE Recruiting), please do reach out! My team might want to expand soon ~~&lt;/p&gt;
</description>
				<guid isPermaLink="true">https://vishwarajanand.com/professional/leaving-google/</guid>
			</item>
		
			<item>
				<title>Enabling Enterprise-Grade RAG</title>
				<link>https://vishwarajanand.com/tech/enabling-enterprises-with-gen-ai/</link>
				<pubDate>Thu, 15 May 2025 00:00:00 +0000</pubDate>
				<description>&lt;p&gt;While the world is betting &amp;amp; debating, big on agents and higher level use cases, me and my team were building lower level components for AI systems. This is almost all of past 6 months for me at Google. The rise of Generative AI has triggered a profound shift in how developers build intelligent applications. Among the most critical design patterns emerged is Retrieval-Augmented Generation (RAG), which bridges the limitations of large language models (LLMs) by grounding them in external, factual data sources. As this architecture matures, one challenge has become clear: infrastructure for vector search and document retrieval must meet enterprise-grade standards — secure, scalable, compliant, and battle-tested.&lt;/p&gt;

&lt;p&gt;This is where the integrations of LangChain and LlamaIndex with Google’s managed Postgres solutions — &lt;strong&gt;AlloyDB&lt;/strong&gt; and &lt;strong&gt;Cloud SQL&lt;/strong&gt; — play transformative role. These open-source repositories:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://github.com/googleapis/langchain-google-alloydb-pg-python&quot;&gt;langchain-google-alloydb-pg-python&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://github.com/googleapis/langchain-google-cloud-sql-pg-python&quot;&gt;langchain-google-cloud-sql-pg-python&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;…are not just bindings. They are composable primitives that bring AI-native capabilities to the world’s most trusted relational database system — PostgreSQL — backed by Google’s cloud infrastructure.&lt;/p&gt;

&lt;p&gt;This essay explores their architecture, use cases, and long-term implications on enterprise AI adoption, developer workflows, and the future of in-database machine learning.&lt;/p&gt;

&lt;hr /&gt;

&lt;h2 id=&quot;i-background-from-llms-to-rag&quot;&gt;I. Background: From LLMs to RAG&lt;/h2&gt;

&lt;p&gt;When OpenAI released GPT-3 in 2020, developers quickly realized its power — and its constraints. Despite billions of parameters, the model was static and prone to hallucination. The Retrieval-Augmented Generation (RAG) paradigm emerged to fix this. Instead of asking the LLM to “know everything,” RAG retrieves relevant documents from an external store and feeds them as context to the model.&lt;/p&gt;

&lt;p&gt;Two open-source frameworks crystallized this approach:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;LangChain&lt;/strong&gt;: Designed for LLM orchestration and agents, LangChain provides tools to build complex workflows involving memory, tools, and structured reasoning.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;LlamaIndex&lt;/strong&gt;: Focused on data ingestion and indexing, it excels at connecting unstructured data (PDFs, databases, websites) to LLMs for retrieval and summarization.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;However, both requires reliable backend for storing and querying documents and embeddings. While vector databases like Pinecone, Weaviate, and Qdrant emerged to serve this role, enterprises — especially those in regulated industries — demanded something more familiar, observable, and integrated with their existing stack.&lt;/p&gt;

&lt;p&gt;Enter PostgreSQL.&lt;/p&gt;

&lt;hr /&gt;

&lt;h2 id=&quot;ii-why-postgres-why-google&quot;&gt;II. Why Postgres? Why Google?&lt;/h2&gt;

&lt;p&gt;Postgres is the most trusted open-source RDBMS globally. With decades of reliability, an extensive ecosystem, and rich extensions (e.g., &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;pgvector&lt;/code&gt;), it’s uniquely positioned to support modern GenAI workloads.&lt;/p&gt;

&lt;p&gt;Google Cloud offers two managed Postgres solutions:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;strong&gt;Cloud SQL for PostgreSQL&lt;/strong&gt;&lt;/p&gt;

    &lt;ul&gt;
      &lt;li&gt;Fully managed Postgres&lt;/li&gt;
      &lt;li&gt;Ideal for teams looking for convenience, backups, HA&lt;/li&gt;
      &lt;li&gt;Now supports &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;pgvector&lt;/code&gt; for embedding search&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;strong&gt;AlloyDB for PostgreSQL&lt;/strong&gt;&lt;/p&gt;

    &lt;ul&gt;
      &lt;li&gt;Google’s next-gen Postgres-compatible DB&lt;/li&gt;
      &lt;li&gt;Superior performance (up to 100x faster analytical queries)&lt;/li&gt;
      &lt;li&gt;Native vector search&lt;/li&gt;
      &lt;li&gt;Ideal for low-latency, high-throughput RAG pipelines&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;By integrating LangChain and LlamaIndex with these services, developers can build retrieval systems that are:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;Scalable&lt;/strong&gt; (via Google infrastructure)&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Secure&lt;/strong&gt; (IAM, VPC-SC, customer-managed encryption)&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Compliant&lt;/strong&gt; (with HIPAA, FedRAMP, GDPR frameworks)&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Unified&lt;/strong&gt; (no need for separate vector DBs)&lt;/li&gt;
&lt;/ul&gt;

&lt;hr /&gt;

&lt;h2 id=&quot;iii-architecture-of-the-integration&quot;&gt;III. Architecture of the Integration&lt;/h2&gt;

&lt;h3 id=&quot;a-langchain-integration&quot;&gt;A. LangChain Integration&lt;/h3&gt;

&lt;p&gt;The &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;langchain-google-alloydb-pg-python&lt;/code&gt; and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;langchain-google-cloud-sql-pg-python&lt;/code&gt; repositories implement:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;A &lt;strong&gt;custom &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;VectorStore&lt;/code&gt; class&lt;/strong&gt; extending LangChain’s base&lt;/li&gt;
  &lt;li&gt;Automatic &lt;strong&gt;embedding storage&lt;/strong&gt;, metadata management, and vector indexing&lt;/li&gt;
  &lt;li&gt;Integration with Google’s &lt;strong&gt;IAM Auth&lt;/strong&gt;, &lt;strong&gt;pgvector&lt;/strong&gt; extension, and standard SQL connectors&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Key design decisions:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;Batching&lt;/strong&gt;: Inserts and queries are optimized to run in bulk, improving throughput.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Resiliency&lt;/strong&gt;: Leveraging Google Cloud’s retry/backoff policies.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Hybrid Search Support&lt;/strong&gt;: Embeddings + metadata filters and TSV based filtering, all in a single SQL query.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Example workflow:&lt;/p&gt;

&lt;div class=&quot;language-python highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;kn&quot;&gt;from&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;langchain_google_alloydb_pg&lt;/span&gt; &lt;span class=&quot;kn&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;AlloyDBVectorStore&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;store&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;AlloyDBVectorStore&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;from_texts&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;LLMs are great&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;AlloyDB supports vector search&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;],&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;embedding&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;OpenAIEmbeddings&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(),&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;collection_name&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;rag_docs&quot;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;retriever&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;store&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;as_retriever&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h3 id=&quot;b-llamaindex-integration&quot;&gt;B. LlamaIndex Integration&lt;/h3&gt;

&lt;p&gt;These repositories expose:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;A &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;PGVectorStore&lt;/code&gt; implementation&lt;/li&gt;
  &lt;li&gt;A &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;DocumentLoader&lt;/code&gt; optimized for loading AlloyDB/Cloud SQL query results&lt;/li&gt;
  &lt;li&gt;Integration with &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;StorageContext&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;VectorStoreIndex&lt;/code&gt;, and metadata filtering&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Key highlights:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;Index persistence&lt;/strong&gt; with &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;doc_id&lt;/code&gt; tracking&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;In-DB schema design&lt;/strong&gt; tailored for vector workloads&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Streaming query support&lt;/strong&gt; for large datasets (planned)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Example usage:&lt;/p&gt;

&lt;div class=&quot;language-python highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;kn&quot;&gt;from&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;llama_index.vector_stores&lt;/span&gt; &lt;span class=&quot;kn&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;PGVectorStore&lt;/span&gt;
&lt;span class=&quot;kn&quot;&gt;from&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;llama_index&lt;/span&gt; &lt;span class=&quot;kn&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;VectorStoreIndex&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;SimpleDirectoryReader&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;StorageContext&lt;/span&gt;

&lt;span class=&quot;n&quot;&gt;pg_store&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;PGVectorStore&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;from_params&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(...)&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;docs&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;SimpleDirectoryReader&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;./data&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;load_data&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;index&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;VectorStoreIndex&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;from_documents&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;docs&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;storage_context&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;StorageContext&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;from_defaults&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;vector_store&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;pg_store&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;hr /&gt;

&lt;h2 id=&quot;iv-use-cases-from-prototypes-to-production&quot;&gt;IV. Use Cases: From Prototypes to Production&lt;/h2&gt;

&lt;h3 id=&quot;1-enterprise-rag-apps&quot;&gt;1. &lt;strong&gt;Enterprise RAG Apps&lt;/strong&gt;&lt;/h3&gt;

&lt;p&gt;Many large companies already use Cloud SQL or AlloyDB as part of their backend. With these integrations, they can now:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Ingest internal documentation&lt;/li&gt;
  &lt;li&gt;Run hybrid search (embedding + metadata)&lt;/li&gt;
  &lt;li&gt;Answer queries via LLMs with traceability&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Example&lt;/strong&gt;: An insurance company builds a chatbot to answer policy-specific questions based on documents stored in their AlloyDB instance — without exporting sensitive data to external vector DBs.&lt;/p&gt;

&lt;h3 id=&quot;2-in-database-agent-workflows&quot;&gt;2. &lt;strong&gt;In-Database Agent Workflows&lt;/strong&gt;&lt;/h3&gt;

&lt;p&gt;LangChain’s agents can be extended to run SQL queries against AlloyDB and then re-ingest the results into vector stores. This enables &lt;strong&gt;self-improving agents&lt;/strong&gt; that learn from operational data.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example&lt;/strong&gt;: A customer support bot retrieves prior resolved tickets from Cloud SQL, summarizes resolution patterns, and offers improved answers.&lt;/p&gt;

&lt;h3 id=&quot;3-ai-powered-bi-and-analytics&quot;&gt;3. &lt;strong&gt;AI-Powered BI and Analytics&lt;/strong&gt;&lt;/h3&gt;

&lt;p&gt;Using LlamaIndex with AlloyDB enables natural language interfaces over structured and semi-structured data. It supports:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Document loaders for SQL results&lt;/li&gt;
  &lt;li&gt;Vectorization of analytical outputs&lt;/li&gt;
  &lt;li&gt;Multi-hop reasoning over relational data&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Example&lt;/strong&gt;: A sales team queries past quarterly data using plain English and receives auto-generated insights powered by RAG and LLM summarization.&lt;/p&gt;

&lt;h3 id=&quot;4-multilingual-search-across-documents&quot;&gt;4. &lt;strong&gt;Multilingual Search Across Documents&lt;/strong&gt;&lt;/h3&gt;

&lt;p&gt;Thanks to OpenAI/BGE embeddings and in-DB filtering, developers can build multilingual search portals on top of these integrations without any proprietary hosting infrastructure.&lt;/p&gt;

&lt;hr /&gt;

&lt;h2 id=&quot;v-implications&quot;&gt;V. Implications&lt;/h2&gt;

&lt;h3 id=&quot;a-for-enterprises&quot;&gt;A. For Enterprises&lt;/h3&gt;

&lt;p&gt;These integrations remove key blockers for AI adoption: &lt;strong&gt;data gravity&lt;/strong&gt;. Enterprises no longer need to move data to an unfamiliar stack. Instead, AI apps now run close to the data, respecting existing access policies and governance frameworks.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;Security&lt;/strong&gt;: IAM-based connections, encryption at rest, and VPC access ensure compliance.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Observability&lt;/strong&gt;: Postgres-native logging and metrics simplify debugging.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Cost-efficiency&lt;/strong&gt;: No need to pay for expensive third-party vector DBs.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;b-for-developers&quot;&gt;B. For Developers&lt;/h3&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;Rapid prototyping&lt;/strong&gt;: Use the same infra for dev and prod.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Unified stack&lt;/strong&gt;: One database, multiple modalities — structured, vector, metadata.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Better tooling&lt;/strong&gt;: These open-source repos provide idiomatic APIs, CI/CD support, and reference examples.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;c-for-the-open-source-ecosystem&quot;&gt;C. For the Open-Source Ecosystem&lt;/h3&gt;

&lt;p&gt;This sets precedent for &lt;strong&gt;composable, cloud-native GenAI integrations&lt;/strong&gt;. Instead of vendor lock-in, these repos embrace standard interfaces (LangChain/LlamaIndex APIs, SQL dialects) and contribute upstream improvements.&lt;/p&gt;

&lt;p&gt;It also encourages other cloud providers and database vendors to follow suit — building GenAI-ready, open integrations with LLM frameworks.&lt;/p&gt;

&lt;hr /&gt;

&lt;h2 id=&quot;vi-future-directions&quot;&gt;VI. Future Directions&lt;/h2&gt;

&lt;p&gt;While these repositories already cover core functionality, several advanced features are planned or possible:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;Streaming document ingestion&lt;/strong&gt; with support for &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;COPY FROM STDIN&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Embedding index maintenance&lt;/strong&gt; via background jobs or triggers&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Temporal document versioning&lt;/strong&gt; and time-aware retrieval&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;LLM cost tracking per query&lt;/strong&gt;&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Integrated caching for repeat queries&lt;/strong&gt;&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Hybrid search optimizers&lt;/strong&gt; using learned ranking functions&lt;/li&gt;
&lt;/ul&gt;

&lt;hr /&gt;

&lt;h2 id=&quot;vii-conclusion&quot;&gt;VII. Conclusion&lt;/h2&gt;

&lt;p&gt;The LangChain and LlamaIndex integrations for Google AlloyDB and Cloud SQL for Postgres are more than just connectors — they are foundational building blocks for secure, scalable, and performant RAG applications. By combining the flexibility of Postgres, the scalability of Google Cloud, and the composability of GenAI frameworks, these repos unlock new frontiers: &lt;strong&gt;AI-native databases that serve both structured and unstructured workloads&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;In a world where every app becomes an AI app, developers need primitives they can trust, at scale, with clarity. These integrations offer exactly that.&lt;/p&gt;
</description>
				<guid isPermaLink="true">https://vishwarajanand.com/tech/enabling-enterprises-with-gen-ai/</guid>
			</item>
		
			<item>
				<title>Postgres with Gen AI</title>
				<link>https://vishwarajanand.com/tech/postgres-with-genai/</link>
				<pubDate>Thu, 24 Apr 2025 00:00:00 +0000</pubDate>
				<description>&lt;p&gt;I’ve been working in the Gen AI space, especially for Postgres Databases enterprise customers, and I really love the optimism. Although the earlier hype was a little overwhelming, I see shoots to productionize AI in various industries. I met engineers from a couple of companies and attended a couple of companies’ conference calls around APAC. In this blog, I will cover what I’ve been doing in the space of AI/LLMs and what areas still need further clarity. All the contents written here are already announced as part of Google’s public developer summits and events, so please don’t expect any leaks here. :smile:&lt;/p&gt;

&lt;p&gt;I took a closer look at how prevalent Postgres databases are in terms of the number of deployments across various industry verticals and are still growing. For example, a recent &lt;a href=&quot;https://www.enterprisedb.com/blog/postgres-most-admired-database-in-stack-overflow-2023&quot;&gt;StackOverflow survey&lt;/a&gt; of 2023 and 2024 both claims that Postgres is used by 49% of developers, with the popularity only growing in recent years. Professional developers use Postgres more than any other database, and it is the most admired as well as desired database for enterprises. In the overall databases market, Postgres stands at roughly 20% share, if we include the on-premise database and local databases like Sqlite or NoSQL databases.&lt;/p&gt;

&lt;p&gt;Based on its popularity and robust features, particularly with extensions like &lt;a href=&quot;https://github.com/pgvector/pgvector&quot;&gt;pgvector&lt;/a&gt;, PostgreSQL is increasingly used in various AI and Large Language Model (LLM) applications. PgVector defines the embedding datatype in PG and allows for various indexing (HNSW, IVFFlat) and querying methods on top of dense or sparse vectors. Google has actively contributed to PgVector.&lt;/p&gt;

&lt;p&gt;Some customers with a larger corpus of data experience issues with index build time (hours for billions of records) and high memory usage (1M vectors is ~6GB); others need fast, real-time index updates or better vector query performance. Google has its proprietary indexing called Scann, which is the most &lt;a href=&quot;https://cloud.google.com/blog/products/databases/understanding-the-scann-index-in-alloydb?e=48754805&quot;&gt;advanced leading to faster&lt;/a&gt; vector queries on PG databases since it uses Approximate Nearest Neighbour (ANN) vector queries. This gives Google a significant edge over all other PG providers for AI / LLM use cases. But PG itself is a little laggard compared to vector-first databases such as Pinecone, Milvus, ChromaDB, Qdrant, and Weaviate, to name a few.&lt;/p&gt;

&lt;p&gt;Currently, PG enterprise customers are hosting the data in PG but for experimentation, they dump some parts of the data (a few records/tables as samples) into some vector-first database assuming that PG won’t scale at their requirements, either in terms of long indexing time or slow query performance. Another problem is that the LLM prototypes are not being productionized because data migrations are hard and AI applications are only good if they can see a sizeable volume of data!&lt;/p&gt;

&lt;p&gt;As part of “AI first Databases” strategy, Google released AI and LLM integrations for Alloy DB and Cloud SQL PG database, such as &lt;a href=&quot;https://cloud.google.com/alloydb/docs/reference/model-endpoint&quot;&gt;Model Endpoint Management&lt;/a&gt;, &lt;a href=&quot;https://cloud.google.com/alloydb/docs/ai/langchain&quot;&gt;LangChain integrations&lt;/a&gt; and &lt;a href=&quot;https://cloud.google.com/blog/products/databases/llamaindex-integrates-with-alloydb-and-cloud-sql-for-postgresql&quot;&gt;Llama-Index integration&lt;/a&gt;. These initiatives promise the PG developers that Google is in the “AI/LLM for Databases” game and it is in there for a long term.&lt;/p&gt;

&lt;p&gt;Let’s look at the road ahead. There are no clear winners in the PG world for AI/LLM, but there are only initiatives to unlock use cases and efforts to win market share. I have already written about &lt;a href=&quot;https://vishwarajanand.com/tech/current-issues-with-gen-ai/&quot;&gt;the current issues with Gen AI&lt;/a&gt; and they are still unsolved problems. But for certain enterprises who want to experiment and find their market fit, the AI/LLM ground is an open game. To them, AI is costly, but not impossible and potentially a cost-saving investment for automation in the long term.&lt;/p&gt;

&lt;p&gt;I see following areas where AI and LLM deployments would contonue to shine:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;strong&gt;Non-business critical systems that require big human time investment&lt;/strong&gt;&lt;/p&gt;

    &lt;p&gt;Think of having an LLM application look into past issues and summarize the past fixes done. Example, IT dev tools, customer supports executive support, etc. I saw an example of this being developed for a US automaker OEM’s service centres too, for car technicians to chat before starting to work on an issue.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;strong&gt;Cost of AI can be directly passed onto customers&lt;/strong&gt;&lt;/p&gt;

    &lt;p&gt;The recurring infrastructure (servers) cost of running Gen AI applications is often more than the users’ subscription fees. Think of having an admin query, which traditionally requires a data analyst to pull sales reports and crunch data for a management report. Those premium tasks can use a paid AI.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;strong&gt;Using a locally hosted AI&lt;/strong&gt;&lt;/p&gt;

    &lt;p&gt;I don’t know about others but I do suffer from &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Model Fatigue&lt;/code&gt; (the challenge of constantly evaluating and choosing from a vast, rapidly evolving landscape of open-source models) and I often find myself unable to select the best open source models for my usecase. For low volume usecases (example for my own local usage) I can deploy a specific model until it critically suffers from hallucinations and accuracy issues.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;strong&gt;LLMs for efficient querying&lt;/strong&gt;&lt;/p&gt;

    &lt;p&gt;Usually powered by vector or embedding search over the data stored in PG, developers can create much more powerful applications. Vector search operations are more compute-intensive than traditional word-based search, so a query can define the degree of AI to be used for DB querying. For example, I worked on a LangChain integration with AlloyDB that used Postgres vector stores for embeddings. The performance gains were significant, but optimizing for latency required careful batching and indexing strategies.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;strong&gt;Agentic workflows are catching up&lt;/strong&gt;&lt;/p&gt;

    &lt;p&gt;&lt;a href=&quot;https://modelcontextprotocol.io/introduction&quot;&gt;MCP&lt;/a&gt; by Anthropic these days has emerged as a critical way to solve agent-to-agent communication. With MCP, atleast LLMs are quite accurate to call one layer of tools. It’s not yet very good when tools need to call other tools though. Google has released &lt;a href=&quot;https://cloud.google.com/blog/products/ai-machine-learning/announcing-gen-ai-toolbox-for-databases-get-started-today?e=48754805&quot;&gt;Gen AI Toolbox&lt;/a&gt; which aims to resolve issues with scaling and updating tools. This space is exciting and very promising. A lot can be done here and I am also interested in how this space unfolds.&lt;/p&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In essence, while the Gen AI landscape is still rapidly evolving with its share of unsolved challenges, its integration with a steadfast and popular database like PostgreSQL is undeniably a game-changer. The strategic initiatives by Google, focusing on enhancing vector capabilities with innovations like Scann and streamlining development through comprehensive Gen AI Toolbox, underscore a strong commitment to making AI more accessible and powerful within the database itself. For enterprises and developers ready to navigate the costs and complexities, the potential to unlock significant efficiencies and build truly intelligent applications by leveraging their existing Postgres data is immense, paving the way for a future where AI and data are more deeply and seamlessly intertwined.&lt;/p&gt;
</description>
				<guid isPermaLink="true">https://vishwarajanand.com/tech/postgres-with-genai/</guid>
			</item>
		
			<item>
				<title>Current issues with gen ai</title>
				<link>https://vishwarajanand.com/tech/current-issues-with-gen-ai/</link>
				<pubDate>Thu, 08 Aug 2024 00:00:00 +0000</pubDate>
				<description>&lt;p&gt;I’ve recently started working in the Gen AI space and am really loving the optimism. But to some degree, I find the hype a little overwhelming. I attended several Google Developer Network events, AWS events, startup events, and a host of other conference calls around Asia. It was surprising to me that AI brings out very polarizing opinions from several well-known speakers. Some call it the end of the world, while others see it as a productivity boon that will usher in an age of prosperity and sufficiency.&lt;/p&gt;

&lt;p&gt;I took a closer look at the large language models (LLMs) of today and noted some key facts and issues that organizations and their engineering teams often overlook while talking about the much-touted productivity:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;strong&gt;LLMs are just tools to predict the next word and require significant manual effort to engineer into usable applications.&lt;/strong&gt; There is no superhuman intelligence underneath. For example, embedding an LLM in a customer support workflow often requires custom logic for context retention, handling out-of-scope queries, and escalation paths.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;strong&gt;LLMs are generally embedded into very data-intensive and sensitive applications.&lt;/strong&gt; These applications need careful tuning with a huge amount of clean and relevant data, which is always a challenge to procure and maintain. A key challenge I encountered was integrating sensitive healthcare data into an AI chatbot, where compliance with HIPAA and GDPR required extensive anonymization and redaction processes.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;strong&gt;AI applications need a lot of GPUs to function, and they are very costly to purchase and run.&lt;/strong&gt; Not a lot of companies can afford them, so they survive on APIs provided by cloud providers or OpenAI. At Google, I’ve seen small startups rely heavily on Vertex AI for GPU access, often limiting their scale due to rising API costs. This creates an ecosystem where only well-funded companies can afford to innovate at scale.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;strong&gt;The recurring infrastructure (servers) cost of running Gen AI applications is often more than the users’ subscription fees.&lt;/strong&gt; Even when companies want to subsidize Gen AI feature development, it often ends up being unaffordable for users. For instance, a Gen AI-powered analytics platform I worked with spent 70% of its revenue on infrastructure costs, forcing them to redesign their pricing and architecture.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;strong&gt;Despite being around for several years, LLMs still critically suffer from hallucinations and accuracy issues.&lt;/strong&gt; In one case, an LLM incorrectly summarized a financial report, leading to misinformation being propagated in decision-making.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;strong&gt;Any specialized Gen AI use case needs grounding with business data,&lt;/strong&gt; usually powered by vector or embedding search over the data stored somewhere (preferably a database). Vector search operations are more compute-intensive than traditional word-based search. For example, I worked on a LangChain integration with AlloyDB that used Postgres vector stores for embeddings. The performance gains were significant, but optimizing for latency required careful batching and indexing strategies.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;strong&gt;Agentic workflows are slow and unreliable.&lt;/strong&gt; Often, key issues remain within discussions among agents. Developers feel like fixing one last issue will get the tool working end-to-end, but new users often break the entire flow. In a recent demo, I showcased an agent-based system for automating customer onboarding. While the agents performed well in controlled scenarios, unexpected user inputs frequently caused breakdowns, necessitating fallback mechanisms.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;As of today, AI tools need AI engineers to function. AutoML solutions are bridging the gap for non-technical users, but deploying robust, scalable AI systems still demands expertise in data pipelines, model optimization, and monitoring.&lt;/p&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;While these challenges are significant, they also represent opportunities for innovation and collaboration in the developer community. By addressing these issues—through better tools, cost optimization, and improved reliability—we can unlock AI’s full potential to drive meaningful change.&lt;/p&gt;
</description>
				<guid isPermaLink="true">https://vishwarajanand.com/tech/current-issues-with-gen-ai/</guid>
			</item>
		
			<item>
				<title>Google and its reorgs</title>
				<link>https://vishwarajanand.com/professional/google-and-its-reorgs/</link>
				<pubDate>Sat, 22 Jun 2024 00:00:00 +0000</pubDate>
				<description>&lt;p&gt;Just when I felt settled, Google decided to move me from Cloud SWE to GCS SWE (Google Cloud Storage). The transition was bittersweet…&lt;/p&gt;

&lt;p&gt;The process to move was mired with mixed feelings. I really admired my new manager and the new org, but I had my destination set elsewhere. I want to talk about what’s happening professionally and what I am doing to accommodate it.&lt;/p&gt;

&lt;p&gt;I’ve already talked about my training in Microsoft about &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Embracing Change&lt;/code&gt;. But this time, I needed some extra dose of motivation. I was sort of pushed out of my org into another one. No human can stay motivated after this. For the first time, my optimism dipped to the core. This re-org was not about any tech adoption/deprecation or process improvement, it was about structure, Lol what!! One cannot do anything about re-org obviously, coz the answer to every question is “talk to your manager”. The only good thing was I met many great new people in the GCS org, but that was it.&lt;/p&gt;

&lt;p&gt;The weirdness engulfed me, and I found myself constantly complaining about work and feeling disconnected. So, I applied internally to other roles and got into Databases org which is making ecosystem libraries for Gen AI. My decision point was, at least this sounds cool and comes out as closer to AI. Maybe I believed that everyone needs to be an AI engineer soon so better late than never. I was thinking about the levels and expectations as well and it seemed promising. On the surface, it looks optimistic, do work, travel to conferences, seek ideas externally, and spread ideas internally. But ultimately, my career now hinges upon the AI’s growth. Some customers have no idea why they want to do AI, others want god knows what level of intelligence with LLMs. But the sweet spot is with those who understand the space and are struggling with minute details. I hope to help atleast one such company through my work in the new role.&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;A wise man had once said, when you see a good opportunity, give it your all.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;So, net-net I happily went through this re-org with no mixed feelings, because I had to change teams and any country move took a backside. I am putting little to no emphasis on customer engagement, but I do need to fetch feedback from them. So, I am friends with benefits with Database customers. With all the saved time, I am investing it into learning something new every day. Maybe I will need to re-read the book - DBMS. :smile:&lt;/p&gt;
</description>
				<guid isPermaLink="true">https://vishwarajanand.com/professional/google-and-its-reorgs/</guid>
			</item>
		
			<item>
				<title>Python, Python, dear Python</title>
				<link>https://vishwarajanand.com/tech/python-python-python/</link>
				<pubDate>Wed, 08 May 2024 00:00:00 +0000</pubDate>
				<description>&lt;p&gt;Python, a behemoth in the AI development world, has an undeniable dominance. Yet, a glaring omission has plagued it for years: native, seamless support for parallelism. In an era where hardware boasts multiple cores and users expect snappy responses, this limitation is increasingly conspicuous.&lt;/p&gt;

&lt;h2 id=&quot;the-need-for-speed-and-parallelism&quot;&gt;The Need for Speed (and Parallelism):&lt;/h2&gt;

&lt;p&gt;Past few months, I have been contemplating approaches that can give a performance boost to &lt;a href=&quot;https://github.com/googleapis/python-storage&quot;&gt;Google’s Python libraries, for example&lt;/a&gt;. I stumbled on issues with the GIL (global interpreter lock). I stumbled upon a problem that I cannot just accept is there in the world, the same as the one described in my earlier PHP’s lack of parallelism blog. We all know the famous stats on how &lt;a href=&quot;https://github.blog/developer-skills/programming-languages-and-frameworks/why-python-keeps-growing-explained/&quot;&gt;Python is THE most common language in the world&lt;/a&gt;, but I am always amazed that it still lacks parallelism out of the box. It was so weird that I am thinking of switching teams internally within Google, rather than being optimistic about changing the state of affairs.&lt;/p&gt;

&lt;h2 id=&quot;tackling-the-global-interpreter-lock&quot;&gt;Tackling the Global Interpreter Lock:&lt;/h2&gt;

&lt;p&gt;&lt;a href=&quot;https://realpython.com/python-gil/&quot;&gt;The GIL&lt;/a&gt;, designed to simplify memory management, becomes a bottleneck in multi-threaded applications. This design choice impacts the performance of CPU-bound tasks, leaving developers to seek workarounds like multiprocessing or leveraging external libraries such as &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;NumPy&lt;/code&gt;. While these solutions offer some relief, they don’t address the core issue.&lt;/p&gt;

&lt;p&gt;So, as &lt;a href=&quot;https://discuss.python.org/t/a-steering-council-notice-about-pep-703-making-the-global-interpreter-lock-optional-in-cpython/30474&quot;&gt;the news suggests&lt;/a&gt;, it appears Python version 3.13 (or possibly 3.14), will have no GIL versions. :revolving_hearts: :confetti_ball:&lt;/p&gt;

&lt;h2 id=&quot;exploring-alternatives&quot;&gt;Exploring Alternatives:&lt;/h2&gt;

&lt;p&gt;Several solutions have been proposed to mitigate Python’s parallelism woes:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Multiprocessing&lt;/code&gt;: By spawning multiple processes, developers can bypass the GIL. However, this approach has its drawbacks, including increased memory usage and inter-process communication overhead.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Asyncio&lt;/code&gt;: Suitable for I/O-bound tasks, asyncio enables concurrency without parallelism, allowing developers to write asynchronous code that scales efficiently.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Cython&lt;/code&gt;: By compiling Python code to C, Cython can help achieve parallelism. It requires additional effort to convert and optimize code, but the performance gains can be significant.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Alternative Interpreters: &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;PyPy&lt;/code&gt;, a just-in-time compiler, and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Jython&lt;/code&gt;, which runs on the Java platform (really! but why?), offer performance improvements. Yet, they come with their own set of compatibility issues and limitations.&lt;/p&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;the-future-of-python&quot;&gt;The Future of Python:&lt;/h2&gt;

&lt;p&gt;The Python community is actively exploring ways to overcome the GIL. Projects like &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;PEP 554&lt;/code&gt;, which proposes multiple sub-interpreters to allow concurrent execution of Python code, are steps in the right direction. However, these changes will take time to mature and be widely adopted.&lt;/p&gt;

&lt;p&gt;Python has tentacles too. I am following the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;pyscript&lt;/code&gt; project, which aims to run Python and its packages in a browser environment. Given so much community effort to have Python rule the world, I am sure it has an amazingly fast future. Just that it’s nowhere in sight yet!&lt;/p&gt;

&lt;h2 id=&quot;conclusion&quot;&gt;Conclusion:&lt;/h2&gt;

&lt;p&gt;Python’s ease of use, readability, and extensive library support make it a favourite among developers for several years in a row, especially in the AI space. However, its struggle with parallelism remains a significant hurdle and nuisance for developers like me. While workarounds exist, they often complicate development and introduce new challenges. The hope is that ongoing efforts within the Python community will eventually address these issues, allowing Python to fully leverage modern hardware capabilities.&lt;/p&gt;

&lt;p&gt;As developers, it’s crucial to stay informed about these developments and adapt our strategies accordingly. While Python’s parallelism problem is a current pain point, its potential solutions promise a brighter, more efficient future.&lt;/p&gt;
</description>
				<guid isPermaLink="true">https://vishwarajanand.com/tech/python-python-python/</guid>
			</item>
		
			<item>
				<title>PHP and the lack of parallelism</title>
				<link>https://vishwarajanand.com/tech/php-lack-of-parallelism/</link>
				<pubDate>Mon, 25 Dec 2023 00:00:00 +0000</pubDate>
				<description>&lt;p&gt;PHP, a behemoth in the web development world, has an undeniable dominance. Yet, a glaring omission has plagued it for years: native, seamless support for parallelism. In an era where hardware boasts multiple cores and users expect snappy responses, this limitation is increasingly conspicuous.&lt;/p&gt;

&lt;h2 id=&quot;the-need-for-speed-and-parallelism&quot;&gt;The Need for Speed (and Parallelism):&lt;/h2&gt;

&lt;p&gt;Past few months, I was contemplating approaches that can give a performance boost to &lt;a href=&quot;https://github.com/googleapis/google-cloud-php&quot;&gt;Google’s PHP libraries&lt;/a&gt;. Especially the handwritten ones which are for Spanner, Cloud Storage, BigQuery, Firestore, Datastore, to name a few. I stumbled on a problem that I cannot just accept is there in the world. We all know the famous stats on how &lt;a href=&quot;https://benjamincrozat.com/php-is-dead-2022#php-versions-market-share-in-2022&quot;&gt;PHP powers as much as 70% of the web&lt;/a&gt;, but I am always amazed that it still lacks parallelism out of the box. It was so weird that I am thinking of switching teams internally within Google, rather than being optimistic about changing the state of affairs.&lt;/p&gt;

&lt;h2 id=&quot;phps-parallelism-predicament&quot;&gt;PHP’s Parallelism Predicament:&lt;/h2&gt;

&lt;p&gt;So, How big is the impact? See PHP was created to support websites. And PHP considers each thread of execution as a single web request. While this may have been the case for pre-historic websites, even popular browsers allow parallelism nowadays. But PHP does NOT! It has developed a whole ecosystem without parallelism. PHP’s philosophy seems to be that if there’s anything which needs parallel execution (like downloading large files in chunks in non-blocking parallel scripts), do NOT do it using PHP.&lt;/p&gt;

&lt;h2 id=&quot;simple-goals-in-life&quot;&gt;Simple goals in life:&lt;/h2&gt;

&lt;p&gt;My goal was to upgrade &lt;a href=&quot;https://github.com/googleapis/google-cloud-php/blob/8900cd7673a131285df4a87a1ca202a5f53c0ae1/Core/src/Upload/MultipartUploader.php#L77-L108&quot;&gt;MultipartUploader&lt;/a&gt; to somehow do parallel calls. There were several approaches I considered before jumping off the ship and not doing anything in this domain:&lt;/p&gt;

&lt;h4 id=&quot;1-php-implementation-based-on-curl-multi-promising&quot;&gt;1. PHP implementation based on curl-multi (promising)&lt;/h4&gt;

&lt;p&gt;&lt;a href=&quot;https://www.php.net/manual/en/function.curl-multi-exec.php&quot;&gt;Curl multi&lt;/a&gt; is already available in PHP, but requires a redesign of &lt;a href=&quot;https://github.com/googleapis/google-cloud-php/blob/8900cd7673a131285df4a87a1ca202a5f53c0ae1/Core/src/Upload/MultipartUploader.php#L77-L108&quot;&gt;MultipartUploader&lt;/a&gt; to achieve results. Currently, Google’s libraries create a multipart guzzle stream and send it over to network requests.&lt;/p&gt;

&lt;p&gt;I was hopeful that if I initialize several &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;curl_multi_*&lt;/code&gt; handles and assigns each part of the network request to a handle, it can theoretically parallelize the uploads. But it actually just uses concurrency.&lt;/p&gt;

&lt;div class=&quot;language-php highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c1&quot;&gt;// create both cURL resources&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;$ch1&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;curl_init&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;$ch2&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;curl_init&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;// set URL and other appropriate options&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;curl_setopt&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$ch1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;CURLOPT_URL&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;http://example.com/&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;curl_setopt&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$ch1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;CURLOPT_HEADER&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;curl_setopt&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$ch2&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;CURLOPT_URL&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;http://www.php.net/&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;curl_setopt&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$ch2&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;CURLOPT_HEADER&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;//create the multiple cURL handle&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;$mh&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;curl_multi_init&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;//add the two handles&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;curl_multi_add_handle&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$mh&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$ch1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;curl_multi_add_handle&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$mh&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$ch2&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;//execute the multi handle&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;do&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;nv&quot;&gt;$status&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;curl_multi_exec&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$mh&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$active&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$active&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;c1&quot;&gt;// Wait a short time for more activity&lt;/span&gt;
        &lt;span class=&quot;nb&quot;&gt;curl_multi_select&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$mh&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;while&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$active&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$status&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;CURLM_OK&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h4 id=&quot;2-redesigning-multipartuploader-with-fibers&quot;&gt;2. Redesigning MultipartUploader with Fibers&lt;/h4&gt;

&lt;p&gt;PHP recently released &lt;a href=&quot;https://php.watch/versions/8.1/fibers&quot;&gt;Fibers as of PHP8.1&lt;/a&gt;, which offers controlled concurrency to PHP. Though the min php version currently supported by Google is php8.0, once it’s upgraded to php8.1, (already reached end-of-life EOL) I saw merits in this approach for consurrency. But once I read about it, I was disappointed with Fibers being just a lollipop and not much else to PHP developers. It’s CONCURRENT. After all these years, Fibers was released and it proved to be such a dud for my use case.
    &lt;img src=&quot;https://i.php.watch/static/cr/106/fiber-concurrency.svg#chart&quot; alt=&quot;PHP Fibers&quot; height=&quot;600&quot; width=&quot;600&quot; /&gt;&lt;/p&gt;

&lt;h4 id=&quot;3-writing-my-own-extension&quot;&gt;3. Writing my own extension&lt;/h4&gt;

&lt;p&gt;At one point, I did really consider my own zend extension (&lt;a href=&quot;https://github.com/grpc/grpc/blob/f8cfe1c16dc268ea4a8054851367a6deaa613a2a/src/php/ext/grpc/call.h#L37&quot;&gt;GRPC is also a zend extension&lt;/a&gt;) to allow parallelism. I learnt that even though PHP extensions are written in C, it becomes a part of the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;php-fpm&lt;/code&gt; process and the code lives in the same address space. So, it seemed like adding a &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;pthread&lt;/code&gt; would be magical. But I was met with surprises even here. I would have to handle all the resources across threads, which means synchronization problems, memory leaks and what not! It’s really not easy to do this. I realized I am drifting towards re-inventing &lt;a href=&quot;https://github.com/krakjoe/pthreads&quot;&gt;pThreads&lt;/a&gt;, which is only available via PHP CLI.&lt;/p&gt;

&lt;h4 id=&quot;4-inspiration-from-awscommandpool&quot;&gt;4. Inspiration from &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Aws\CommandPool&lt;/code&gt;&lt;/h4&gt;

&lt;p&gt;I observed that &lt;a href=&quot;https://github.com/aws/aws-sdk-php/blob/d04da330b0201edab71edd33a03b8d5ad6e4a313/src/S3/Transfer.php#L284-L291&quot;&gt;Aws\CommandPool&lt;/a&gt; does a lot of magic to achieve my requirements. AWS libraries employ an async pool to achieve concurrency. Frankly, I was not at all happy with the state of affairs even with AWS libs.&lt;/p&gt;

&lt;h4 id=&quot;5-external-libraries-reactphp-spatie-parallel&quot;&gt;5. External Libraries (ReactPHP, Spatie, Parallel)&lt;/h4&gt;
&lt;p&gt;As a library developer, I cannot afford to have a dependency on these packages, especially those whose maintenance is not guaranteed and ours have to be because of Enterprise agreements. But it was really heartening that there are so many people who echo my pain and go as deep as creating their own libraries. :salute:&lt;/p&gt;

&lt;h2 id=&quot;what-does-this-mean-for-developers&quot;&gt;What Does This Mean for Developers?&lt;/h2&gt;

&lt;ol&gt;
  &lt;li&gt;
    &lt;p&gt;I realized that some developer (me) users might be happier using other language libraries, their code and system utilization might be more optimal given they use any other language library.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Embrace Asynchronous Programming to work with limitations. But this also means adding software development costs (think of higher debugging time as costs).&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Really consider ReactPHP, AmpPHP, or similar libraries to work with limitations. Otherwise, you will waste a lot of your time.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Consider running a performance sensitive workload via a more promising language. Say, Go or Node.js. However, you might be paying for serializing and de-serializing the data.&lt;/p&gt;
  &lt;/li&gt;
&lt;/ol&gt;

&lt;h2 id=&quot;conclusion&quot;&gt;Conclusion&lt;/h2&gt;

&lt;p&gt;So, who’s to blame? IMHO, it’s the PHP maintainers who should take a call to modernize the language. The historical design of PHP prioritized simplicity and ease of use, which has contributed to its widespread adoption. However, modern web applications require more advanced concurrency and parallelism capabilities.&lt;/p&gt;

&lt;p&gt;Parallelism was one key reason Facebook was forced to fork their own programming language called Hacklang based on PHP. And believe it or not, it’s much more performant than PHP itself. Take a bow, Mr. Zuckerberg.&lt;/p&gt;

&lt;p&gt;The PHP community and maintainers are aware of these limitations and are making incremental improvements (Ex Fibers). As developers, we should push for these changes while also exploring existing tools and libraries that can help us bridge the gap in the meantime.&lt;/p&gt;
</description>
				<guid isPermaLink="true">https://vishwarajanand.com/tech/php-lack-of-parallelism/</guid>
			</item>
		
	</channel>
</rss>
