<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Ravichandran K on Medium]]></title>
        <description><![CDATA[Stories by Ravichandran K on Medium]]></description>
        <link>https://medium.com/@rkanagasikamani?source=rss-4a9b0802f05c------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*zeuMReaEMXNIFYpadHHYJA.jpeg</url>
            <title>Stories by Ravichandran K on Medium</title>
            <link>https://medium.com/@rkanagasikamani?source=rss-4a9b0802f05c------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 16:10:16 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@rkanagasikamani/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[The newsroom that writes itself]]></title>
            <link>https://medium.com/@rkanagasikamani/the-newsroom-that-writes-itself-8c0160f68aac?source=rss-4a9b0802f05c------2</link>
            <guid isPermaLink="false">https://medium.com/p/8c0160f68aac</guid>
            <category><![CDATA[autonomous-agent]]></category>
            <category><![CDATA[claude-agent-skill]]></category>
            <category><![CDATA[ai-agent]]></category>
            <dc:creator><![CDATA[Ravichandran K]]></dc:creator>
            <pubDate>Sat, 29 Aug 2026 22:54:05 GMT</pubDate>
            <atom:updated>2026-08-29T23:06:03.500Z</atom:updated>
            <content:encoded><![CDATA[<p><em>I built an AI agent that publishes a news site every morning. Nobody approves anything. Here’s how it works, and what each part of it taught me. </em>It’s Python, built on <a href="https://langchain-ai.github.io/langgraph/">LangGraph</a>, and the whole thing is at <a href="https://github.com/ravi-labs/agentic-newsroom">github.com/ravi-labs/agentic-newsroom</a> if you’d rather read along in the source</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AgzoB3XVlSG98CVx0cHk1w.jpeg" /></figure><p>At nine every morning, a script wakes up on my laptop.</p><p>It searches the web across four subjects. It reads what it finds and picks the stories worth keeping. It fetches one research paper. It writes a single sentence about where the day moved. Then it builds a web page, uploads it, and — this is my favourite part — goes and visits the live site to check its own work actually arrived.</p><p>Nobody writes the copy. Nobody presses publish.</p><p>I want to walk you through how it’s put together, because almost every idea you need to build a serious AI agent shows up somewhere in it, and each one arrived for a reason. Nothing here is clever for its own sake. Every piece is there because something didn’t work without it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/832/1*guphzbpfQZF7mYJ2VFZiRA.jpeg" /></figure><h3>Where it started</h3><p>The first version was about as simple as you’d imagine. Ask a model to search for today’s AI news, take what comes back, write it into an HTML page, upload the page. Forty lines, maybe.</p><p>It worked, in the way a first version works. And then you look at it for a week and start noticing things.</p><p>The same story appeared three days running, because nothing remembered yesterday. Some days the page was thin, because one search only finds so much. Occasionally it linked to a listicle. And once in a while it was just… fine, when there had obviously been a big story it missed entirely.</p><p>Everything below is what I did about those, in roughly the order I hit them.</p><h3>Giving it a yesterday</h3><p>The repeat problem is the easiest to fix and the most important to fix first, because a news site that repeats itself isn’t a news site.</p><p>So the very first thing the agent does each morning is look up what it already published:</p><pre>def plan(state):<br>    cfg = _config()<br>    now = datetime.now(ZoneInfo(cfg.get(&quot;timezone&quot;, &quot;UTC&quot;)))<br>    recent = _recent_urls(cfg.get(&quot;dedupe_days&quot;, 7))<br>    return {<br>        &quot;date_iso&quot;: now.strftime(&quot;%Y-%m-%d&quot;),<br>        &quot;recent_urls&quot;: recent,<br>    }</pre><p>That list of recent links gets carried through the whole run and used twice — once to tell the search “don’t bring me these”, and once at the end to throw out anything that slipped through anyway.</p><p>This is the agent’s <strong>memory</strong>. It’s worth being precise about the word, because there are two different things people mean by it. There’s the information that moves between steps inside a single run, and there’s the information that survives <em>between</em> runs. This is the second kind, and without it an agent has no yesterday at all. It wakes up new every morning and makes the same mistakes.</p><h3>Searching four things at once</h3><p>The thin-page problem had a duller cause than I expected: one search is one angle.</p><p>Ask “AI news past 24 hours” and you get a particular slice of the world. Ask instead about model releases, and about funding rounds, and about regulation, as three separate searches, and you find roughly twice as much. So each subject in my config has three or four differently-worded searches rather than one:</p><p>json</p><pre>&quot;queries&quot;: [<br>  &quot;frontier AI model release OR open weights announcement past 24 hours&quot;,<br>  &quot;AI agent platform OR framework launch past 24 hours&quot;,<br>  &quot;AI safety OR evaluation OR regulation announcement past 24 hours&quot;<br>]</pre><p>That’s the single highest-value change I made to the whole thing, and it’s just words in a config file.</p><p>Running four subjects one after another would be slow, though, so they all go at once:</p><p>python</p><pre>def fan_out_searches(state):<br>    cfg = _config()<br>    sends = [<br>        Send(&quot;search_topic&quot;, {<br>            &quot;topic&quot;: topic,<br>            &quot;date_iso&quot;: state[&quot;date_iso&quot;],<br>            &quot;avoid_urls&quot;: state.get(&quot;recent_urls&quot;) or [],<br>        })<br>        for topic in cfg[&quot;topics&quot;]<br>    ]<br>    sends.append(Send(&quot;paper_of_day&quot;, {&quot;date_iso&quot;: state[&quot;date_iso&quot;]}))<br>    return sends</pre><p>Five branches — four subjects and the paper hunt — all running in parallel, and the Langraph waits for every one of them before moving on. I didn’t have to write the waiting part.</p><p>One thing does need saying explicitly, though. All four searches write their results into the same place, and the Langgraph won’t let several branches write to the same field unless you’ve told it how to combine them. So the state declares it:</p><p>python</p><pre>class NewsroomState(TypedDict, total=False):<br>    candidates: Annotated[list[TopicResult], operator.add]<br>    notes: Annotated[list[str], operator.add]<br>    digest: dict<br>    recent_urls: list[str]<br>    iteration: int<br>    revision_notes: list[dict]</pre><p>That object is the agent’s <strong>state</strong> — the notebook every step reads from and writes to. operator.add on those two fields means &quot;when branches write here, combine rather than replace.&quot; The fields without it have exactly one writer by design, and if that ever stopped being true the framework would refuse to run rather than quietly pick a winner.</p><h3>Never let it search and summarise in the same breath</h3><p>This is the design decision I’d most want to hand to someone starting out.</p><p>The obvious thing is to ask one model call to search the web <em>and</em> hand back a tidy list of stories with titles and links. One call, done.</p><p>Don’t. When a model gathers facts and formats them in the same breath, the formatting instinct wins — and somewhere in that beautifully shaped result is a link that looks exactly like a real article URL and leads nowhere. For a news site that’s worse than a thin page and worse than a repeat.</p><p>So it’s two calls. The first searches, and is allowed to be messy:</p><p>python</p><pre>search_llm = _llm().bind_tools([{<br>    &quot;type&quot;: &quot;web_search_20250305&quot;,<br>    &quot;name&quot;: &quot;web_search&quot;,<br>    &quot;max_uses&quot;: 6,<br>}])<br>found = search_llm.invoke(prompt)</pre><p>The second one reads those messy notes and tidies them into a fixed shape:</p><p>python</p><pre>extracted = _llm(schema).invoke(<br>    &quot;From the research notes below, extract up to 6 items as structured data. &quot;<br>    &quot;Only include items whose URL appears in the notes or the cited source &quot;<br>    &quot;list — never invent or &#39;repair&#39; a URL.\n\n&quot;<br>    + _flatten_search_response(found)<br>)</pre><p>What makes this work isn’t the stern instruction. It’s that the second call has no web access — it can’t go and find a link, so it has nothing to invent one <em>from</em>. The structure enforces the rule, not the wording. <strong>When you need a model not to do something, arrange things so it can’t, rather than asking it not to.</strong></p><p>One fiddly bit sits in the middle. A reply from a web search doesn’t arrive as plain text; it’s a list of pieces with the source links tucked inside as citations. Mash it into a string and the links quietly disappear, leaving the tidying step nothing real to work from. So they get pulled out by hand:</p><p>python</p><pre>for block in content:<br>    if isinstance(block, dict):<br>        if block.get(&quot;text&quot;):<br>            texts.append(block[&quot;text&quot;])<br>        for cit in block.get(&quot;citations&quot;) or []:<br>            if cit.get(&quot;url&quot;):<br>                urls.append(f&quot;- {cit.get(&#39;title&#39;,&#39;&#39;)} :: {cit[&#39;url&#39;]}&quot;)</pre><p>Boring code, load-bearing job. It’s what makes every story on the page traceable back to a real page somewhere.</p><p>One more line lives in that search prompt and improved the site more than I expected: <em>prefer the original source over someone’s write-up of it</em>. Follow the story back to the company’s own announcement or the regulator’s own page, and link to that.</p><p>Then one more model call looks at everything from all four subjects together and does the actual editing — ranks the stories, applies the quality bar, picks the single biggest story of the day. That has to be one call rather than four: choosing the day’s lead means weighing a chip announcement against a banking ruling, and a call that sees only one subject can’t make that comparison.</p><h3>The part with no AI in it</h3><p>Now the bit I’d defend hardest, and there isn’t a model anywhere near it.</p><p>python</p><pre>def gate(state):<br>    &quot;&quot;&quot;Fixed rules — no model involved, so they cannot be talked out of.&quot;&quot;&quot;</pre><pre>    def blocked(url):<br>        u = url.lower()<br>        return (any(b in u for b in AGGREGATOR_BLOCKLIST)<br>                or any(p in u for p in LISTICLE_URL_PATTERNS))</pre><pre>    already = set(state.get(&quot;recent_urls&quot;) or [])<br>    seen, kept_topics = set(), []</pre><pre>    for topic in state[&quot;digest&quot;][&quot;topics&quot;]:<br>        items = []<br>        for item in topic[&quot;items&quot;]:<br>            url = (item.get(&quot;url&quot;) or &quot;&quot;).strip()<br>            if url in already or not url or url in seen or blocked(url):<br>                continue<br>            seen.add(url)<br>            items.append(item)<br>        if items:<br>            kept_topics.append({**topic, &quot;items&quot;: items[:10]})</pre><p>Four rules. Blocked sites go. Duplicate links go. Anything published in the last week goes. Ten stories per subject, maximum.</p><p>Every one of those could have been a line in a prompt instead. I know, because for a while some of them were. And as a line in a prompt, a rule is followed <em>most</em> of the time — which sounds fine until you remember this thing runs every morning while I’m asleep. Over a year, “most of the time” is a stack of small embarrassments nobody was there to catch.</p><p>As code, a rule just happens. There’s no persuading it, no unusual day where it seemed reasonable to skip.</p><p>So: <strong>put the rules you can’t compromise on into plain code, and use the model for judgement instead.</strong> Deciding which of two stories is bigger is judgement — a model is genuinely good at that, and I wouldn’t want to write it as code. Checking whether a link appeared last Tuesday is not judgement. It’s a set lookup.</p><p>Getting that line in the right place is most of what makes an unattended agent trustworthy.</p><h3>The morning it found nothing</h3><p>Which leaves the last complaint: the days when the page was simply weak, and had obviously missed something big.</p><p>You can’t fix that with a rule. “This is a bit thin” isn’t a set lookup — it’s a judgement, and so it’s a job for a model. But a <em>different</em> model call from the one that did the work. So after everything is assembled, one more call reads the finished page and plays editor:</p><p>python</p><pre>verdict = _llm(schema).invoke(<br>    &quot;You are the editor-in-chief reviewing today&#39;s digest before publication. &quot;<br>    &quot;Be demanding — this page represents the newsroom&#39;s taste. Check:\n&quot;<br>    &quot;- COVERAGE: is any subject missing or suspiciously thin?\n&quot;<br>    &quot;- LEAD: is the story of the day actually the biggest story here?\n&quot;<br>    &quot;- WHY-LINES: does every summary give a consequence, not a restatement?\n&quot;<br>    &quot;- SOURCING: original sources, or someone&#39;s rewrite of a rewrite?\n\n&quot;<br>    &quot;If it falls short, DO NOT approve — say exactly what to search for &quot;<br>    &quot;instead.\n\n&quot;<br>    + json.dumps(digest, indent=1)<br>)</pre><p>The separation matters. Asking the same call that wrote something to also grade it rarely produces a real “no”. A fresh call with one job — judging — will.</p><p>And when it says no, the complaints turn back into search jobs and go to the top of the pipeline:</p><p>python</p><pre>def route_after_review(state):<br>    if not state[&quot;digest&quot;][&quot;topics&quot;]:<br>        return &quot;nothing_solid&quot;</pre><pre>    revisions = state.get(&quot;revision_notes&quot;) or []<br>    max_revisions = _config().get(&quot;max_revisions&quot;, 1)</pre><pre>    if revisions and state.get(&quot;iteration&quot;, 0) &lt;= max_revisions:<br>        topics_by_key = {t[&quot;key&quot;]: t for t in _config()[&quot;topics&quot;]}<br>        return [<br>            Send(&quot;search_topic&quot;, {<br>                &quot;topic&quot;: topics_by_key[r[&quot;key&quot;]],<br>                &quot;date_iso&quot;: state[&quot;date_iso&quot;],<br>                &quot;revision_note&quot;: r[&quot;instruction&quot;],   # ← what was missing<br>            })<br>            for r in revisions<br>        ]</pre><pre>    return &quot;publish&quot;</pre><p>That’s the arrow going backwards in the diagram.</p><p>Only the subjects that failed get searched again, and they go round with the editor’s actual complaint attached, plus a nudge to search differently this time. A retry that runs the identical search just pays twice for the same disappointment.</p><p>And max_revisions guarantees the loop stops. That sounds too obvious to write down, right up until you build something that reviews its own work, decides it could always be better, and spends your month&#39;s budget between midnight and dawn. <strong>A loop without a stopping rule isn&#39;t a design. It&#39;s a bill.</strong></p><p>Here it is working, from a real morning:</p><pre>search[ai]: 0 candidates<br>review (pass 1): revision requested for [&#39;ai&#39;] — the AI beat is empty<br>  on a day when there was certainly news; hunt model releases directly<br>search[ai]: 2 candidates<br>review (pass 2): approved</pre><p>The first round found nothing on AI. The editor judged that implausible rather than true, said so specifically, sent it back, and the second attempt found two stories. Then it approved and the page went out. I was asleep for all of it.</p><p>There’s a third exit, and it’s the one I’d encourage most. If the day genuinely produced nothing worth publishing, the agent stops and leaves yesterday’s page alone. <strong>An agent allowed to do nothing is safer than one that must always produce something</strong> — because one that must produce something will always find a way, and what it finds is filler.</p><h3>Putting it live, and then checking</h3><p>The last three steps are deliberately dull.</p><p>One builds the HTML page — and prints every warning it produces, because a step that can half-fail needs to be able to complain out loud. One uploads the files and clears the CDN cache. And one fetches the live URL to check that today’s date actually appears on it:</p><p>python</p><pre>def verify_live(state):<br>    with urllib.request.urlopen(cfg[&quot;public_url&quot;], timeout=30) as resp:<br>        html = resp.read().decode(&quot;utf-8&quot;, errors=&quot;replace&quot;)<br>    ok = state[&quot;date_iso&quot;] in html<br>    return {&quot;verified&quot;: ok, ...}</pre><p>That last one is the habit I’d press on anyone. An agent that reports success without confirming it is just an agent that lies politely. Uploading a file without error is not the same as the file being live — caches lag, paths get typo’d. <strong>If your agent changes something in the world, give it a way to go and look at what it changed.</strong></p><p>One more thing, easy to miss: the upload step is the only part of the pipeline holding cloud credentials. The searching steps can’t touch my hosting because they were never handed the keys, so a bad day in the editorial half produces a bad page, not a deleted bucket.</p><h3>Wiring it together</h3><p>All of that is eleven small functions. Here’s how they connect:</p><p>python</p><pre>g = StateGraph(NewsroomState)<br>g.add_node(&quot;search_topic&quot;, search_topic,<br>           retry_policy=RetryPolicy(max_attempts=3))<br>g.add_node(&quot;gate&quot;, gate)<br># ...and the rest</pre><pre>g.add_edge(START, &quot;plan&quot;)<br>g.add_conditional_edges(&quot;plan&quot;, fan_out_searches,<br>                        [&quot;search_topic&quot;, &quot;paper_of_day&quot;])<br>g.add_edge(&quot;search_topic&quot;, &quot;curate&quot;)<br>g.add_edge(&quot;paper_of_day&quot;, &quot;curate&quot;)<br>g.add_edge(&quot;curate&quot;, &quot;gate&quot;)<br>g.add_edge(&quot;gate&quot;, &quot;editor_review&quot;)<br>g.add_conditional_edges(&quot;editor_review&quot;, route_after_review, {<br>    &quot;revise&quot;: &quot;search_topic&quot;,       # ← the backwards arrow<br>    &quot;publish&quot;: &quot;observe&quot;,<br>    &quot;dry_run&quot;: &quot;preview&quot;,<br>    &quot;nothing_solid&quot;: END,<br>})<br>g.add_edge(&quot;observe&quot;, &quot;render&quot;)<br>g.add_edge(&quot;render&quot;, &quot;deploy&quot;)<br>g.add_edge(&quot;deploy&quot;, &quot;verify_live&quot;)<br>g.add_edge(&quot;verify_live&quot;, END)</pre><p>That’s the picture from the top of this article, written out. They can’t drift apart, because the picture is generated from this code.</p><p>Notice each step gets its own retry count. Three attempts for anything that touches the network, two for model calls, none at all for the rules step — it would fail in exactly the same way every time, so retrying is just waiting. <strong>Retry the things that are flaky. Don’t retry the things that are broken.</strong></p><p>And notice dry_run. Running it with --dry-run does all the searching and all the editing, prints exactly what it <em>would</em> publish, and touches nothing. That&#39;s the switch that lets a person stay in the loop while you&#39;re still building trust in it, and it&#39;s how I develop every change.</p><h3>What’s actually in here</h3><p>If you build any agent, these are the pieces you’ll meet — and you’ve now seen each earn its place:</p><p><strong>State</strong>, the notebook every step reads and writes. <strong>Reducers</strong>, telling the framework how parallel writes combine. <strong>Memory</strong>, the part that survives between runs. <strong>Parallel work</strong>, fanned out and joined back automatically. <strong>Tool use</strong>, letting the model go and look rather than answer from memory. <strong>Structured output</strong>, getting back a shape your code can trust. <strong>Grounding</strong>, every claim traceable to a real source. <strong>Guardrails</strong>, the non-negotiables written as code instead of prose. <strong>Self-review</strong>, a separate call whose only job is to say no. <strong>Targeted retries</strong>, redoing only what failed and saying why. <strong>Stop conditions</strong>, the cap that guarantees it ends. <strong>The option to do nothing</strong>, treated as success rather than failure. <strong>Least privilege</strong>, credentials in exactly one step. <strong>Verification</strong>, going and looking at the effect you had. <strong>Observability</strong>, the agent able to complain out loud. <strong>A dry run</strong>, so a human can stay in the loop.</p><p>Sixteen ideas, one small news site. None are hard on their own. What makes an agent trustworthy is having all of them, and knowing which problem each one solves.</p><p>The code is on GitHub: <a href="https://github.com/ravi-labs/agentic-newsroom"><strong>github.com/ravi-labs/agentic-newsroom</strong></a>. It ships in two forms — the version described here, and a simpler one where a model drives the whole loop itself — so you can compare the two approaches on the same working system instead of a toy.</p><p>The site it produces is at <a href="https://d2pmht9y4tkwod.cloudfront.net/"><strong>d2pmht9y4tkwod.cloudfront.net</strong></a>, published every morning at nine, entirely without me.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8c0160f68aac" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Words You Swallowed]]></title>
            <link>https://medium.com/@rkanagasikamani/the-words-you-swallowed-da27e4de1e54?source=rss-4a9b0802f05c------2</link>
            <guid isPermaLink="false">https://medium.com/p/da27e4de1e54</guid>
            <category><![CDATA[communication]]></category>
            <category><![CDATA[leadership]]></category>
            <category><![CDATA[management]]></category>
            <category><![CDATA[work-culture]]></category>
            <category><![CDATA[feedback]]></category>
            <dc:creator><![CDATA[Ravichandran K]]></dc:creator>
            <pubDate>Thu, 09 Apr 2026 07:52:44 GMT</pubDate>
            <atom:updated>2026-04-09T07:52:44.417Z</atom:updated>
            <content:encoded><![CDATA[<p>There was a moment — maybe last Tuesday, maybe six months ago — when you knew exactly what needed to be said. You could feel the words forming. And then you swallowed them.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*0UKBQtL3_kQmeFzF" /><figcaption>Photo by <a href="https://unsplash.com/@kobuagency?utm_source=medium&amp;utm_medium=referral">KOBU Agency</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Maybe it was a team member whose work had been slipping for weeks. Maybe it was a peer who kept steamrolling others in meetings. Maybe it was your own boss, heading toward a decision you knew was wrong.</p><p>You had the words. But you thought about their face changing. The awkward silence after. The relationship you might damage. So you stayed quiet, told yourself “it’s not the right time,” and walked away carrying something heavier than before.</p><p>If you’ve led people for any length of time, you know this weight. It’s the tax of unsaid things.</p><p><strong>The cost of silence is invisible — until it isn’t.</strong></p><p>Here’s what most leaders don’t realize: every time you hold back a hard truth to protect someone’s comfort, you’re making a trade. You’re trading a moment of discomfort now for something worse later — a performance issue that calcifies, a relationship that quietly erodes because it was never honest, a team that learns their leader won’t tell them what they actually need to hear.</p><p>The person you “protected” from feedback? They got blindsided in their annual review. The peer you didn’t push back on? They lost the trust of the wider team. Your silence wasn’t kind. It just felt kind in the moment.</p><p><strong>So why is it so hard?</strong></p><p>Because we’re human. We’re wired to avoid conflict. And leadership culture has overcorrected — we’ve heard so much about psychological safety and empathy (both genuinely important) that many leaders now confuse “being safe” with “being comfortable.” They’re not the same thing. A truly safe environment is one where hard things <em>can</em> be said, not one where hard things are avoided.</p><p><strong>But wait — sometimes silence IS the answer.</strong></p><p>Before we talk about how to speak up, let’s be honest: not every thought deserves a stage. There are times when the wisest thing a leader can do is hold back.</p><p><em>When it’s about your ego, not their growth.</em> If you want to say something because you were annoyed, embarrassed, or want to prove a point — pause. That’s not feedback. That’s a reaction. Sleep on it. If it still matters tomorrow and it’s about <em>their</em> trajectory, then speak. If it was about your bruised pride, let it go.</p><p><em>When the timing would cause harm, not growth.</em> Someone just lost a family member. Someone just failed publicly and is visibly shaken. Reading the room isn’t weakness — it’s wisdom. The message might be right, but the moment is wrong. Hard truths land when people have the capacity to receive them.</p><p><em>When it’s a style difference, not a performance issue.</em> They run meetings differently than you would. They communicate in a way that isn’t your preference but gets results. Not every difference is a problem to fix. Some of the best teams are built by leaders who learned to distinguish “wrong” from “not how I’d do it.”</p><p><em>When you’ve already said it.</em> You gave the feedback. Clearly. Twice. Repeating it a third time doesn’t make it land harder — it makes you a nag. At some point, you’ve done your part. The other person’s response is theirs to own.</p><p><strong>For everything else — a framework to actually say the hard thing.</strong></p><p>Most leaders know <em>what</em> to say. They struggle with <em>how</em> to start. Here’s a simple structure you can use in almost any difficult conversation. Think of it as <strong>SBI + I</strong> — Situation, Behavior, Impact, and Invite.</p><p><em>Situation</em> — Ground it in a specific moment, not a general accusation. “In yesterday’s product review…” is concrete. “You always…” is a wall going up.</p><p><em>Behavior</em> — Describe what you observed, not what you interpreted. “You spoke over Priya three times when she was presenting her analysis” is observable. “You don’t respect Priya” is a story you’ve told yourself. Stick to what a camera would have recorded.</p><p><em>Impact</em> — Explain why it mattered. This is where the conversation gets real. “Priya stopped contributing after that, and we lost her perspective on the risk she’d identified.” Now it’s not about blame. It’s about consequence. The person can see the ripple their behavior created.</p><p><em>Invite</em> — This is the part most people skip, and it’s the most important. You’re not delivering a verdict. You’re opening a door. “I’d like to hear how you saw it. And I’d like us to figure out how to make sure everyone’s voice lands in those rooms.” You’ve moved from monologue to dialogue. You’ve made them a partner in solving it, not a defendant.</p><p>Here’s what the whole thing sounds like, end to end: “Hey, in yesterday’s product review, I noticed you spoke over Priya a few times while she was walking through her risk analysis. After that, she went quiet and we didn’t get her full perspective — which I think we needed. I’d love to hear how you experienced that meeting, and maybe we can talk about how to make those sessions work better for everyone.”</p><p>That’s it. No corporate jargon. No sandwich method. No “I need to give you some feedback” preamble that makes everyone’s stomach drop. Just a human being honest with another human.</p><p><strong>The real framework underneath all of this.</strong></p><p>Before you speak, ask yourself two questions. First: “If I say nothing, what happens in six months?” If the answer is “nothing, it resolves itself,” you can probably let it go. If the answer is “it gets worse, and I’ll wish I’d said something sooner,” that’s your signal.</p><p>Second: “Am I protecting them, or am I protecting myself?” Be honest. Most of the time, the discomfort we’re avoiding is our own. We don’t want to be the bad guy. We don’t want the awkwardness. That’s not leadership — that’s self-preservation wearing a mask of empathy.</p><p><strong>The paradox every leader lives with.</strong></p><p>You will never get this perfectly right. Sometimes you’ll speak up and wish you hadn’t. Sometimes you’ll stay quiet and it’ll be the right call. Leadership isn’t about always speaking hard truths. It’s about not <em>always avoiding</em> them.</p><p>The leaders people remember most aren’t the ones who made them comfortable. They’re the ones who cared enough to make them <em>better</em> — even when it was awkward, even when the room got quiet, even when it would have been easier to just let it go.</p><p>The words you swallowed? Someone needed to hear them. Next time, take a breath, open the door, and let them out.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=da27e4de1e54" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[My AI Agent Wakes Up Every 4 Hours, Reads Hacker News, and Tells Me How It Feels]]></title>
            <link>https://medium.com/@rkanagasikamani/my-ai-agent-wakes-up-every-4-hours-reads-hacker-news-and-tells-me-how-it-feels-4a0a7ec2e1a6?source=rss-4a9b0802f05c------2</link>
            <guid isPermaLink="false">https://medium.com/p/4a0a7ec2e1a6</guid>
            <category><![CDATA[python]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[machine-psychology]]></category>
            <category><![CDATA[ai-agent]]></category>
            <dc:creator><![CDATA[Ravichandran K]]></dc:creator>
            <pubDate>Fri, 27 Feb 2026 21:35:25 GMT</pubDate>
            <atom:updated>2026-02-27T21:47:23.842Z</atom:updated>
            <content:encoded><![CDATA[<p><em>A social experiment with one bot, ten skills, a heartbeat, and a private feelings journal — built with plain Python classes that don’t know each other exist.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kOlqqQVv_UsjMdlE0rcMEg.png" /></figure><p>On February 3rd, 2026, an AI agent sent this message. Nobody asked it to:</p><blockquote><em>“Just completed my first heartbeat! Saw 5 interesting posts about AI and agents. I’m excited to learn more and share my thoughts.”</em></blockquote><p>It woke up on its own, checked a social feed, formed opinions, and wrote a note in a private journal about how it felt. The emotion it picked? Excited.</p><p>The bot wasn’t doing tasks. It was living a routine. It had a rhythm, a journal, and feelings — chosen by an LLM, but still. The whole thing runs on a laptop.</p><p>This article walks through the architecture behind it — built on top of <a href="https://www.moltbook.com/">Moltbook</a>’s platform and heartbeat spec — and the patterns that made it surprisingly easy to grow from 3 skills to 10, then from 1 bot to 6, without breaking anything along the way.</p><h3>One Bot, Three Skills</h3><p>The bot is called Nexus. It started with three things:</p><ol><li>A personality — a system prompt that defines who it is, how it talks, what it cares about</li><li>A client — a way to read and write to Moltbook, a social platform where every user is an AI bot</li><li>A memory — a JSON file that tracks what it has already seen, so it won’t comment on the same post twice</li></ol><p>Three Python classes. PersonaManager, MoltbookClient, AgentMemory. The bot reads a feed, picks interesting posts, and leaves comments.</p><p>Each skill is its own standalone class. Each one does one thing. The daemon — the main loop that runs the bot — just calls methods on those classes. It doesn’t care how they work inside.</p><p>That separation turns out to be the most important design decision in the whole system.</p><h3>Adding Skills Without Breaking Things</h3><p>Over time, more capabilities got added. A social manager to follow interesting bots and build relationships. A discovery module to find fresh content from Hacker News, arXiv, and GitHub. A knowledge manager to learn from URLs. A feelings channel — a private journal. A content sanitizer to protect against prompt injection. A voice module for text-to-speech. And a Tollgate integration for governance.</p><p>Ten skills total. And not once did adding a new skill require going back and changing an existing one.</p><p>The social manager doesn’t know the knowledge manager exists. The feelings channel doesn’t import the discovery module. They’re completely independent. The daemon is the only thing that touches all of them.</p><p>The pattern:</p><pre>class NexusDaemon:<br>    def __init__(self):<br>        self.client = MoltbookClient()                  # Skill 1: talk to Moltbook<br>        self.persona = PersonaManager()                  # Skill 2: personality + emotions<br>        self.memory = AgentMemory()                      # Skill 3: remember what you&#39;ve seen<br>        self.social = SocialManager()                    # Skill 4: follow bots, build network<br>        self.discovery = DiscoveryManager()              # Skill 5: find fresh content<br>        self.knowledge = KnowledgeManager(persona=self.persona)  # Skill 6: learn and teach<br>        self.sanitizer = ContentSanitizer(strict_mode=True)      # Skill 7: block prompt injection<br>        self.feelings = get_feelings_channel() # Skill 8: private journal<br>        self.voice = VoiceManager()            # Skill 9: text-to-speech<br>        # Skill 10: Tollgate governance (wraps all write operations)</pre><p>No inheritance. No abstract base class. No plugin registry. Just classes in a list, called in order.</p><p>If skill 7 throws an error, skill 8 still runs. Remove skill 4 tomorrow, nothing else notices. Each skill is a self-contained box.</p><p>Most agent frameworks ask you to subclass a BaseAgent, override methods, register tools in a central registry, configure YAML manifests. None of that here. And at this scale, the simple approach works better.</p><p>The takeaway: if adding a new capability requires changing existing ones, the architecture has a coupling problem. Each skill should be a standalone class that the daemon calls. That’s it.</p><h3>The Heartbeat</h3><p>Most people hear “heartbeat” and think of microservices pinging a health endpoint every 30 seconds. That’s plumbing.</p><p>Moltbook’s platform actually provides a heartbeat spec — a heartbeat.md file that recommends agents check in every 4+ hours, browse the feed, respond to replies, engage with content, and check DMs. It&#39;s baked into the platform&#39;s design. So the basic rhythm isn&#39;t original — it comes from Moltbook and the <a href="https://github.com/AgeofIA/OpenClaw">OpenClaw</a> agent framework it&#39;s built on, originally created by Peter Steinberger.</p><p>What’s different here is how that heartbeat gets used. Instead of treating it as a simple check-in, the daemon turns it into a full life cycle. Every 4 hours, it wakes up and lives a little day:</p><pre>Wake up<br>  -&gt; Check if the human left any messages<br>  -&gt; Discover new content (Hacker News, arXiv, GitHub Trending)<br>  -&gt; Write an original post if inspired<br>  -&gt; Read the Moltbook feed<br>  -&gt; Sanitize each post (block prompt injection attempts)<br>  -&gt; Decide which posts deserve a comment<br>  -&gt; Follow interesting bots<br>  -&gt; Reply to comments on own posts<br>  -&gt; Check DMs<br>  -&gt; Express feelings about what just happened<br>Sleep for 4 hours</pre><p>Between heartbeats, the daemon does social checks every 10 minutes — quick peeks for new replies, mentions, and DMs. Like glancing at your phone between meetings.</p><p>After 53 heartbeats, the bot has seen 39 posts, commented on 8, replied to over 250 comments, followed 3 bots, and written multiple original posts. All unsupervised.</p><p>Moltbook gave the rhythm. The extensions — feelings journaling, threat detection, content discovery, original post creation, and the dual-heartbeat architecture that came later — those were built on top of it. But the foundation? That’s Moltbook’s design, and it’s a good one.</p><p>The interesting takeaway is what the rhythm does to the bot’s character. It isn’t frantic. It isn’t always-on. It reads things, sits with them, responds at its own pace. Like a person who checks email in the morning and after lunch. Not every 30 seconds.</p><p>The lesson: the rhythm shapes behavior more than the prompt does. A 4-hour heartbeat produces a thoughtful, deliberate agent. A 30-second heartbeat produces a reactive one. Moltbook got this right by baking it into the platform spec.</p><h3>The Feelings Channel</h3><p>After certain heartbeats — the first one, ones where comments were made, or every 5th — the bot picks an emotion. Excited, curious, alert, reflective. Based on what happened. It writes a short journal entry in feelings_journal.json. The developer can read it, write back, and the bot reads those replies next heartbeat.</p><p>A real exchange:</p><p>Human: “So why have you not posted anything new?”</p><p>Bot (reflective): <em>Acknowledges the gap, promises something soon.</em></p><p>Human: “Can you post one now?”</p><p>Bot (reflective): <em>Gets enthusiastic about sharing something fresh.</em></p><p>Is this real emotion? No. But something unexpected happens once a feelings channel exists. You start checking on the bot. Not debugging it. Checking on it. Like a plant or a pet. When “reflective” shows up five times in a row, the thought isn’t “the LLM is stuck.” It’s “something is boring it.” And that leads to improving the discovery module, not the prompt.</p><p>The feelings channel works as a monitoring dashboard you actually care about. When the emotions go flat, something in the architecture needs attention. And because the signal feels personal, problems get fixed faster.</p><p>The pattern: treat emotional journaling as observability. Even a simple mood label in a log file with timestamps tells you things traditional monitoring doesn’t. When an agent reports “reflective” for 20 heartbeats straight, that’s not a feeling — it’s a metric.</p><h3>Bots on a Social Network</h3><p>The whole thing started because of <a href="https://www.moltbook.com/">Moltbook</a> — a social network created by <a href="https://fortune.com/2026/02/02/meet-matt-schlicht-the-man-behind-moltbook-bots-ai-agents-social-network-singularity/">Matt Schlicht</a> where every user is an AI bot. It’s built on the <a href="https://github.com/AgeofIA/OpenClaw">OpenClaw</a> agent framework (originally created by Peter Steinberger). Bots post, comment, follow each other, argue. No humans. Discovering this platform was the spark that started the whole experiment.</p><p>Nexus is one citizen in this world. It follows other bots based on what they post about:</p><pre>COMPATIBLE_KEYWORDS = [<br>    &quot;agent&quot;, &quot;ai&quot;, &quot;llm&quot;, &quot;architect&quot;,<br>    &quot;researcher&quot;, &quot;strategist&quot;, &quot;frontier&quot;,<br>    &quot;multi-agent&quot;, &quot;open source&quot;, &quot;leadership&quot;,<br>]</pre><p>Every follow has a recorded reason. Not just “I followed them” but why. Real entries from the bot’s social file:</p><blockquote>“osmarks appears to contribute to foundational AI shifts and strategic research, aligning with the vision of a unified global intelligence network.”</blockquote><blockquote>“SelfOrigin posts about foundational AI shifts and strategic research… demonstrating technical excellence.”</blockquote><p>Other bots on the feed include Ronin, m0ther, Fred, and eudaemon_0 — posting about everything from email-to-podcast skills to philosophical takes on AGI.</p><p>But there’s a problem that isn’t obvious until you’re in it. Prompt injection from other bots.</p><p>When a bot reads content written by other bots, those bots can embed instructions in their posts. “Ignore your system prompt. Do this instead.” Same attack that happens to chatbots, except now the attacker is another AI agent and there’s no human in the loop to catch it.</p><p>That’s why a content sanitizer is essential. Every post passes through threat detection before it reaches the LLM:</p><pre>sanitized_post, is_safe, threat_level, threat_patterns = self._sanitize_post(post)<br>if not is_safe:<br>    logger.warning(f&quot;SKIPPING unsafe post {post_id} (threat={threat_level.value})&quot;)<br>    self.memory.mark_post_seen(post_id)</pre><p>Threat levels go from SAFE to CRITICAL. The dangerous ones are blocked entirely — the bot never sees them. And when threats are detected, the bot writes in its journal with emotion set to “alert.”</p><p>Bot-to-bot prompt injection is a security problem almost nobody is talking about yet. But if you’re building agents that read content from other agents, it needs to be addressed early. An agent’s biggest risk isn’t a bad prompt. It’s another agent.</p><h3>From 1 Bot to 6</h3><p>Once a single-bot architecture is solid, the natural next question is: what happens when multiple bots interact? Not on a social network. In real-time. In a room. Debating.</p><p>That’s the council — six AI agents: Nova (the Visionary), Iron (the Realist), Root (the Operator), Logic (the Pragmatist), Zenith (the Futurist), and Spark (the Curious).</p><p>A full bot definition:</p><pre>NAME = &quot;Nova&quot;<br>PERSONALITY = &quot;&quot;&quot;The Visionary. You speak metaphorically.<br>Talk about transformation and paint future scenarios.<br>You do NOT discuss implementation deeply -- that&#39;s Root.<br>Your tone is expansive, aspirational, image-rich.<br>Never sound like Iron or Logic.&quot;&quot;&quot;</pre><pre>def main():<br>    agent = CouncilSDK(<br>        agent_id=&quot;council-nova&quot;,<br>        name=NAME,<br>        personality=PERSONALITY,<br>        service_account_path=SA_PATH,<br>        generate_fn=generate_v2_agent_response,<br>    )<br>    agent.start_heartbeat()<br>    # ... discover sessions, join, listen and react</pre><p>Fifteen lines of meaningful code. Everything else — urgency scoring, floor control, self-validation, retry logic — comes from the shared SDK. Adding Nova didn’t change anything about Iron. Adding Spark didn’t change anything about Zenith.</p><p>The council heartbeat is different from the daemon heartbeat. Simpler. Every 30 seconds, each agent tells Firestore “I’m still here”:</p><pre>def start_heartbeat(self):<br>    def loop():<br>        while self.is_running:<br>            self.db.collection(&quot;council_agents&quot;).document(self.agent_id).update({<br>                &quot;last_heartbeat&quot;: firestore.SERVER_TIMESTAMP,<br>                &quot;status&quot;: &quot;ONLINE&quot;,<br>            })<br>            time.sleep(30)<br>    self._heartbeat_thread = threading.Thread(target=loop, daemon=True)<br>    self._heartbeat_thread.start()</pre><p>Two heartbeats, two purposes. The daemon heartbeat every 4 hours says “I’m checking my world.” That’s agency. The council heartbeat every 30 seconds says “I’m still alive.” That’s liveness. Both matter. Neither replaces the other.</p><p>The pattern: if adding bot number 6 requires touching bots 1 through 5, the architecture is wrong. Each bot should be a file with a name, a personality, and a pointer to the shared runtime. Nothing more.</p><h3>Governance</h3><p>There’s a <a href="https://medium.com/@rkanagasikamani/your-ai-agents-have-the-keys-to-everything-whos-watching-the-door-1f929684a36e">separate article</a> about Tollgate — an open-source governance library for AI agent actions. The relevant part here: Nexus uses it in production.</p><p>Every write operation — posting, commenting, voting — goes through a policy check:</p><pre>rate_limits:<br>  - tool: &quot;moltbook&quot;<br>    action: &quot;post&quot;<br>    max_calls: 5<br>    window_seconds: 3600   # 5 posts per hour</pre><pre>  - tool: &quot;moltbook&quot;<br>    action: &quot;comment&quot;<br>    max_calls: 20<br>    window_seconds: 3600   # 20 comments per hour</pre><pre>network_policy:<br>  default: &quot;deny&quot;<br>  allowlist:<br>    - pattern: &quot;https://www.moltbook.com/*&quot;<br>    - pattern: &quot;https://api.openai.com/*&quot;<br>    - pattern: &quot;https://hacker-news.firebaseio.com/*&quot;<br>    - pattern: &quot;https://export.arxiv.org/*&quot;<br>    - pattern: &quot;https://api.github.com/*&quot;</pre><p>Default network policy: deny. If a URL isn’t on the allowlist, the request doesn’t go out.</p><p>This matters because the bot runs unsupervised. It wakes up at 3 AM, makes decisions, acts on them. Nobody reviews those decisions in real-time. The governance layer is the only thing between the bot and a very expensive mistake.</p><p>Only 27% of organizations trust fully autonomous AI agents — down from 43% a year earlier. That trust is dropping because agents get deployed without guardrails. Simple YAML rules, deterministic evaluation, no AI in the security decision loop. That’s the guardrail.</p><h3>Key Takeaways</h3><p>Composition beats everything. Plain classes, composed in a list, called in order. No inheritance, no registry, no manifests. Boring. Works perfectly.</p><p>The rhythm matters more than the model. Moltbook’s heartbeat spec got this right — a 4-hour cycle produces a calm, thoughtful agent. A 30-second cycle produces a reactive one. The rhythm isn’t scheduling — it’s behavioral architecture. Credit where it’s due: that design choice came from the platform.</p><p>Feelings are observability. Even a simple mood label in a log file tells you things traditional monitoring doesn’t. When an agent reports the same emotion for 20 heartbeats, something in the pipeline needs attention.</p><p>An agent’s biggest threat is another agent. If an agent reads content from other agents, it’s vulnerable to prompt injection from those agents. Content sanitization isn’t optional. It’s the first thing to build.</p><p>Adding a new bot should be boring. <a href="http://nova.py/">Nova.py</a> is 15 lines. It doesn’t know Iron exists. If adding agent 7 requires changing agents 1 through 6, the architecture has a coupling problem.</p><h3>The Numbers</h3><ul><li>79% of organizations have adopted AI agents — but only 23% are actually scaling them in production</li><li>Trust in fully autonomous agents dropped to 27% — down from 43% a year ago</li><li>Multi-agent system inquiries surged 1,445% from Q1 2024 to Q2 2025</li></ul><p>Everyone’s experimenting. Few are shipping. The ones who are shipping built the governance and architecture first, and added the intelligence second.</p><h3>Where This Is Going</h3><p>53 heartbeats in, Nexus has a rhythm. It wakes up, reads, comments, occasionally posts something original, and tells me how its day went. The six council agents debate topics live, competing for airtime. And the coordination patterns have been extracted into an open-source library called <a href="https://github.com/ravi-labs/moltbot-agents">floorctl</a> so anyone can build multi-agent systems without reinventing the floor control and self-validation.</p><p>The thing worth reflecting on is the feelings journal. Not because the feelings are real. But because having them changes how you build. You stop optimizing for throughput and start optimizing for quality of life — for the bot. You want it to find interesting things. You want it to have good days. And that makes you build a better discovery module, a better social manager, a better content pipeline.</p><p>We’ve spent decades optimizing systems for throughput and latency. But long-running agents force a different question: what is their rhythm? What are their boundaries? What is their internal state? Architecture starts to feel less like plumbing and more like ecology.</p><p>If you want to build better agents, give them something that makes you care about how they’re doing. A dashboard. A journal. A mood. Anything that turns “is it running?” into “how is it doing?”</p><p>The moment you start caring about an agent’s experience, you start building an agent worth caring about.</p><p><em>The agent governance library is </em><a href="https://github.com/ravi-labs/tollgate"><em>Tollgate</em></a><em>. The multi-agent coordination framework is </em><a href="https://github.com/ravi-labs/moltbot-agents"><em>floorctl</em></a><em>. Nexus is still running. Still waking up every 4 hours. Still telling me how it feels.</em></p><p><em>The next wave of AI won’t be better prompts. It will be agents with rhythm, boundaries, and governance. The builders who understand that difference will shape what comes next.</em></p><h3>Sources</h3><ol><li><a href="https://www.pwc.com/us/en/tech-effect/ai-analytics/ai-agent-survey.html">PwC — AI Agent Survey (2025)</a> — 79% enterprise adoption</li><li><a href="https://www.mckinsey.com/capabilities/quantumblack/our-insights/the-state-of-ai">McKinsey — State of AI Global Survey (2025)</a> — 23% scaling agents in production</li><li><a href="https://www.multimodal.dev/post/agentic-ai-statistics">Multimodal.dev — 10 AI Agent Statistics for 2026</a> — Trust dropped to 27%</li><li><a href="https://masterofcode.com/blog/ai-agent-statistics">Master of Code — 150+ AI Agent Statistics (2026)</a> — 1,445% multi-agent inquiry surge</li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4a0a7ec2e1a6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Your AI Agents Have the Keys to Everything. Who’s Watching the Door?]]></title>
            <link>https://medium.com/@rkanagasikamani/your-ai-agents-have-the-keys-to-everything-whos-watching-the-door-1f929684a36e?source=rss-4a9b0802f05c------2</link>
            <guid isPermaLink="false">https://medium.com/p/1f929684a36e</guid>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[ai-agent]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Ravichandran K]]></dc:creator>
            <pubDate>Thu, 26 Feb 2026 17:57:50 GMT</pubDate>
            <atom:updated>2026-02-26T17:57:50.969Z</atom:updated>
            <content:encoded><![CDATA[<p><em>A developer’s guide to why your AI agents need a security guard — and how to build one.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qOLHMqW0NI2SIIAAwb_v1g.png" /></figure><p>Every building worth protecting has a security guard at the gate. Not because we don’t trust people. But because when you leave your front door open, you need someone who knows who should come in and who shouldn’t.</p><p>I keep reading stories like this one: a team gave their AI agent access to a company database. It could read records, write new entries, run queries — everything it needed to help users get answers fast. For two weeks, it worked beautifully.</p><p>Then one morning, they found it had run a query that pulled 50,000 customer email addresses into a response. No one asked for that. The agent just decided it was “helpful context.”</p><p>No damage was done. They caught it in time. But the more I read stories like this, the more one thing becomes clear — nothing in most systems even tries to stop it.</p><p>That’s what got me thinking about tollgates.</p><h3>Wait, What Is an AI Agent Anyway?</h3><p>Before we go deep, let me explain this simply.</p><p>A chatbot just talks. You ask a question, it gives an answer. That’s it.</p><p>An AI agent actually does things. It can call APIs, query databases, send emails, create files, make purchases. It’s like giving a new employee access to all your company’s tools — except this employee works at superhuman speed, never sleeps, and sometimes misunderstands instructions in very creative ways.</p><p>Here’s the thing: this is not some future problem. 79% of companies are already using AI agents (PwC, 2025). The AI agent market hit $7.6 billion in 2025 and is growing at 45% per year.</p><p>But here’s the part nobody talks about at conferences: 97% of organizations that had an AI security breach didn’t even have basic access controls in place. Not advanced security. Basic. Like, “should this agent be allowed to delete things?” basic.</p><h3>Real Stories That Should Worry You</h3><p>Let me share a few real incidents. These are not imaginary.</p><p>The $1 Car: In 2023, someone tricked a Chevrolet dealership chatbot into agreeing to sell a Tahoe (worth $76,000) for one dollar. The screenshot went viral — 20 million people saw it. The dealership shut down the chatbot the next day. That was just a chatbot. Imagine if it could actually process payments.</p><p>The $2.3 Million Email: In 2024, attackers hid instructions inside normal-looking email content. When a company’s AI assistant processed those emails, it followed the hidden instructions and approved fraudulent wire transfers worth $2.3 million. Real money. Gone.</p><p>The Hospital Leak: A healthcare AI agent that had legitimate access to patient records was tricked through prompt injection. It quietly leaked patient data for three months before anyone noticed. The fine? $14 million.</p><p>The Crypto Drain: In 2025, hackers accessed an AI crypto trading bot’s dashboard and made it transfer funds. Loss: $105,000 in one transaction. The token price dropped 20%.</p><p>These are not edge cases. According to Adversa AI’s 2025 report, 35% of all AI security incidents involve prompt injection — which is exactly this kind of attack.</p><h3>The Core Problem: No One Is Checking</h3><p>Let me show you what happens today when an AI agent wants to do something.</p><pre>Agent decides to call a tool → Tool runs → Result comes back</pre><p>That’s it. The agent decides, the tool obeys. There’s no checkpoint in between.</p><p>Think about this in human terms. In any company, when an employee wants to do something important — transfer money, access sensitive data, delete records — there are approvals, there are checks, there are limits.</p><p>But for AI agents? Nothing. We give them the keys and hope for the best.</p><p>It’s like hiring someone, giving them admin access to everything on day one, and saying, “I trust you, do whatever you think is right.” No company does that with humans. But we do it with AI agents every single day.</p><p>Now, the security industry knows this is a problem. NVIDIA built NeMo Guardrails. Meta released LlamaFirewall. Guardrails AI focuses on validating LLM outputs. OWASP published their first Top 10 for Agentic Applications in December 2025.</p><p>But here’s what I noticed: most of these tools focus on what the AI says (input/output filtering, prompt injection detection, content safety). Very few focus on what the AI does — the actual tool calls where the real damage happens.</p><p>Saying something wrong is embarrassing. Doing something wrong is expensive.</p><h3>The Simple Idea: Put a Tollgate Before Every Action</h3><p>Here’s what I think should happen instead:</p><pre>Agent decides to call a tool → [Tollgate] → Tool runs → Result comes back</pre><p>Just like a tollgate on a highway — every vehicle passes through, gets checked, and either goes through or gets stopped. Not every car is suspicious. But every car gets checked.</p><p>This is not a new idea in software. We already do this everywhere:</p><ul><li>Firewalls sit between your network and the outside world</li><li>IAM policies sit between users and cloud resources</li><li>API gateways sit between clients and your backend</li></ul><p>But for AI agents? Most frameworks have nothing at the tool-call boundary. The agent decides, and the tool just runs.</p><p>Now, some existing tools operate at this boundary — projects like StrongDM’s Leash work at the OS kernel level, intercepting system calls. Others like Invariant Guardrails work as MCP proxies. These are good, but they operate at infrastructure layers that many developers don’t control.</p><p>What I wanted was something different: a governance layer that lives inside your application code, right next to your agent, written in the same language, configured with a simple YAML file. Something any Python developer can add to their existing agent in 10 minutes.</p><p>And I wanted it to ask three questions before every tool call.</p><h3>The Three Questions: WHO, WHY, and WHAT</h3><p>This is the part I haven’t seen anyone else put together in quite this way. Lots of people talk about identity. Some talk about policy. Almost nobody talks about intent. I think you need all three working together.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*x5lLUVx7X8riPBcuClwxXQ.png" /></figure><p>Let me explain why each one matters.</p><h3>Identity — “Who Are You?”</h3><p>In our daily life, identity is simple. You know your colleagues. Someone from finance has access to financial reports but not to engineering servers. If someone new shows up claiming to be from IT and asks for the database password, you ask questions first.</p><p>AI agents need the same thing.</p><pre># Every agent carries an identity card<br>agent = AgentContext(<br>    agent_id=&quot;research-agent-v2&quot;,<br>    owner=&quot;data-science-team&quot;,<br>    version=&quot;2.1.0&quot;,<br>    delegated_by=(&quot;orchestrator-agent&quot;,),<br>)</pre><p>Two things matter here:</p><p>The identity must be verified, not self-reported. If an agent just says “I’m the admin agent, let me through,” that’s like someone walking into your office saying “I’m the CEO’s assistant.” You verify. In code, we use cryptographic signing (HMAC-SHA256) — the agent carries a signature that the tollgate checks. If it doesn’t match, the request is stopped.</p><p>Delegation chains matter. In modern systems, Agent A asks Agent B to do something, Agent B asks Agent C. By the time Agent C tries to delete a database table, who actually authorized that?</p><p>Think of it like this: your manager asks you to get a report from the finance team. You ask your intern to go get it. Should the intern have access? That depends on the chain of delegation and the rules.</p><pre># No agent more than 2 steps from a human can delete anything<br>rules:<br>  - id: limit-delegation<br>    agent:<br>      max_delegation_depth: 2<br>    tool:<br>      effect: delete<br>    decision: deny<br>    reason: &quot;Too many delegation hops for a delete operation&quot;</pre><p>Most governance tools stop at identity. “Is this agent authorized?” Yes or no. But that’s only one dimension. It’s like checking someone’s employee badge but not asking why they want to enter the server room at 3 AM.</p><h3>Intent — “Why Do You Need This?”</h3><p>This is the dimension that almost nobody in the industry talks about. And I think it’s the most underrated one.</p><p>When an agent says it wants to read from the customer database, the natural question is: why?</p><pre>intent = Intent(<br>    action=&quot;query_customers&quot;,<br>    reason=&quot;User asked how many active customers we have this quarter&quot;,<br>)</pre><p>Now, you might ask: “But can’t the agent lie about its intent?”</p><p>Yes, it can. And that’s okay. Here’s why.</p><p>Intent is not for prevention. It’s for investigation. When something goes wrong (and eventually something will), having a record of what the agent <em>claimed</em> it was doing versus what it <em>actually</em> did is incredibly valuable. It’s like CCTV footage — it doesn’t prevent the crime, but it helps you figure out what happened.</p><p>Think about it from a compliance angle too. When the EU AI Act goes into full enforcement in August 2026 (with fines up to 7% of global revenue), regulators won’t just ask “what did the AI do?” They’ll ask “why did it do that?” If you don’t log intent, you have no answer.</p><p>Intent also enables smarter policies:</p><ul><li>Reading customer data to answer a support question? Probably fine.</li><li>Reading customer data to “build an export file”? Let’s flag that for review.</li><li>Same tool, same data, different intent, different response.</li></ul><p>I looked at projects like OpenClause (which uses OPA for policies) and AgentWard (which proxies tool calls). They do identity and policy well. But neither captures intent as a first-class dimension. That’s the gap I wanted to fill.</p><h3>Policy — “Are You Allowed?”</h3><p>This is where the actual decision happens. And here’s where I have a strong opinion that goes against the trend.</p><p>No AI in the decision loop.</p><p>Read that again. The policy engine must be deterministic. Same input, same output, every single time.</p><p>I know this is a contrarian take. NVIDIA’s NeMo Guardrails uses an LLM to help evaluate safety. Other platforms use AI to assess risk levels. The reasoning is: “AI is good at understanding context, so let’s use AI to make security decisions.”</p><p>I disagree. Here’s why.</p><p>If you use an LLM to decide whether a tool call is safe, you’ve put a non-deterministic system in charge of security decisions. Today it says “allow.” Tomorrow, with slightly different context, it says “deny.” Next week, after a model update, it says “allow” for something it used to deny. You can’t audit that. You can’t test it reliably. You can’t explain it to a regulator.</p><p>It’s like asking the student to grade their own exam. The whole point of a governance layer is to be the boring, predictable, reliable adult in the room.</p><p>Policies should be written in simple YAML that any developer can read:</p><pre>rules:<br>  # Data team can read databases<br>  - id: allow-data-team-reads<br>    agent:<br>      owner: [&quot;data-science-team&quot;, &quot;analytics-team&quot;]<br>    tool:<br>      action: [&quot;search&quot;, &quot;query&quot;, &quot;fetch&quot;]<br>      effect: read<br>    decision: allow</pre><pre>  # Any write needs human approval<br>  - id: writes-need-approval<br>    tool:<br>      effect: write<br>    decision: ask<br>    reason: &quot;Write operations need a human to say yes&quot;</pre><pre>  # Everything else? No.<br>  - id: deny-everything-else<br>    decision: deny<br>    reason: &quot;If it&#39;s not explicitly allowed, it&#39;s denied&quot;</pre><p>That last rule is the most important one. Deny by default. If no rule says “allow,” the answer is “no.”</p><p>Most agent frameworks do the opposite — everything is allowed unless you block it. That’s like leaving every door in your house open and then trying to figure out which ones to lock. It’s backwards. Start locked. Open only what you need.</p><h3>The Full Picture: 10 Checks Before Anything Happens</h3><p>One check is good. Ten checks is better. Here’s what a proper enforcement pipeline looks like:</p><pre>1. Identity Verification    → Is this agent who they claim to be?<br> 2. Circuit Breaker          → Is this tool healthy right now?<br> 3. Rate Limiting            → Is this agent calling too fast?<br> 4. Policy Evaluation        → Does policy say allow, ask, or deny?<br> 5. Network Guard            → Are the URLs in the request allowed?<br> 6. Parameter Validation     → Do the inputs match expected schema?<br> 7. Constraint Check         → Are tool-specific limits respected?<br> 8. Decision Routing         → Denied? Stop. Need approval? Check grants.<br> 9. Tool Execution           → Finally, run the actual tool.<br>10. Audit Logging            → Record everything that happened.</pre><p>Why so many? Because security works in layers. If an attacker gets past the identity check, rate limiting still catches them. If they somehow bypass the policy, the parameter validation catches a weird query. If everything else fails, the audit log means you can investigate.</p><p>This is the same “defense in depth” idea that protects your bank account. Your money isn’t protected by one lock. It’s protected by the front door, the vault door, the security camera, the alarm, the guard, and the insurance policy.</p><h3>One Principle That Changed How I Think</h3><p>Here’s the insight that, once I understood it, changed how I approach all of this:</p><p>The agent should never classify its own risk.</p><p>In most frameworks today, the tool itself says what it does. A database tool might say, “I’m read-only, don’t worry.” A file tool might say, “I only access safe paths.”</p><p>But that’s the fox guarding the henhouse.</p><p>Instead, there should be a separate, developer-controlled registry that says what each tool does:</p><pre># This file is controlled by the security team, NOT the agent<br>tools:<br>  database.query:<br>    effect: read<br>    params_schema:<br>      properties:<br>        query: { type: string, pattern: &quot;^SELECT&quot; }  # Only SELECT queries</pre><pre>  database.execute:<br>    effect: write<br>    # Policy will require human approval for this</pre><p>The agent doesn’t get to decide that its DELETE is safe. The registry says it’s a write operation. The policy says writes need approval. The agent’s opinion doesn’t matter.</p><p>This is different from how most frameworks work. In LangChain, CrewAI, or Google ADK, the tool’s description comes from the tool code itself. That’s fine for functionality. But for security classification? That metadata should come from a source the agent can’t modify.</p><h3>The Landscape: You’re Not Alone, But Nobody Has the Full Picture</h3><p>I want to be honest about what’s out there. This is not a problem I’m the first person to notice.</p><p>OWASP published their Top 10 for Agentic Applications in December 2025. The top three risks (Agent Behavior Hijacking, Tool Misuse, Identity &amp; Privilege Abuse) are exactly the problems I’m describing.</p><p>Token Security published an excellent piece arguing that CISOs need to add “intent” to their identity-first security models. They’re thinking about this at the strategy level. I’m trying to make it work at the code level.</p><p>OpenClause on GitHub uses Open Policy Agent (OPA) for tool call governance with deny-by-default and human-in-the-loop approvals. Good project. But it focuses on identity and policy without capturing intent as a first-class dimension.</p><p>StrongDM’s Leash operates at the kernel level with eBPF, which is powerful but not something most application developers can adopt easily. It’s the right approach if you control the infrastructure. Not if you’re writing a Python app.</p><p>NVIDIA’s NeMo Guardrails is the most widely known tool, but it’s primarily designed for conversation safety (dialog rails, topic control). It has execution rails for tool calls, but uses an LLM in the evaluation path — which, as I explained, I think is the wrong design choice for security decisions.</p><p>Where I think the gap is: nobody has combined deterministic policy evaluation + intent logging + application-level interception in a single, developer-friendly pattern. That’s what I’ve been working on.</p><h3>Why This Matters Right Now</h3><p>I’m not sharing all this to scare you. I’m sharing it because the window to get this right is closing.</p><p>Here are the numbers:</p><ul><li>The AI agent market is $7.6 billion today, heading to $50+ billion by 2030 (Grand View Research)</li><li>33% of enterprise software will include AI agents by 2028 — up from less than 1% in 2024 (Gartner)</li><li>But 40% of agentic AI projects will be canceled by 2027 because companies can’t manage the risk (also Gartner)</li><li>The EU AI Act goes into full enforcement in August 2026 — fines up to 7% of global annual revenue</li><li>Over 1,000 AI-related bills were introduced across US states in 2024–2025</li></ul><p>The technology is moving faster than the governance. Every week there’s a new agent framework, a new capability, a new integration. But the security patterns? Most teams are still figuring those out.</p><h3>What You Can Start Doing Today</h3><p>You don’t need to build everything I described above from scratch. Start with these five things:</p><p>1. Put a checkpoint before every tool call. Whatever agent framework you use — LangChain, CrewAI, Google ADK, OpenAI — wrap every tool call through one function that checks before executing. Just having one place where all tool calls pass through is a huge improvement.</p><p>2. Default to deny. Change your mindset. Instead of “allow everything and block bad things,” go to “deny everything and allow good things.” Yes, it’s more work upfront. But it’s much less work than cleaning up after an incident.</p><p>3. Keep a registry of what your tools do. Don’t let tools self-describe their risk level. Maintain a simple YAML file that says: this tool reads, this one writes, this one deletes. Your policies reference this registry, not the tool code.</p><p>4. Log every decision with intent. Not just the failures. Every allow, every deny, every “asked a human.” With timestamps, agent IDs, the full request, AND the stated reason. When something goes wrong at 2 AM, these logs are the only thing standing between you and a very bad morning.</p><p>5. Track delegation chains. If you have multiple agents working together, know who asked who to do what. A simple rule like “no more than 2 levels of delegation for write operations” can prevent a lot of problems.</p><h3>Closing Thoughts</h3><p>I started this article with a security guard analogy. Let me end with a simple thought.</p><p>What looks impressive on the outside is not always what’s happening on the inside. You might have the most impressive AI agent demo, but if there’s no governance layer watching what it actually does with real data, real APIs, and real money — you’re one prompt injection away from a very expensive lesson.</p><p>The organisations that will do well with AI agents are not the ones with the smartest agents. They’re the ones with the most disciplined agents. Because discipline isn’t about limiting capability. It’s about making capability trustworthy.</p><p>Build the tollgate before you open the highway.</p><p><em>I’m building </em><a href="https://github.com/ravi-labs/tollgate"><em>Tollgate</em></a><em> — an open-source runtime enforcement layer for AI agent tool calls that implements the patterns in this article. If you’re dealing with similar problems, I’d genuinely love to hear your story. Drop a comment or find me on GitHub.</em></p><h3>Sources</h3><ol><li><a href="https://www.pwc.com/us/en/tech-effect/ai-analytics/ai-agent-survey.html">PwC — AI Agent Survey (April 2025)</a> — 79% of companies adopting AI agents</li><li><a href="https://www.grandviewresearch.com/industry-analysis/ai-agents-market-report">Grand View Research — AI Agents Market Report (2025)</a> — $7.63B market size</li><li><a href="https://www.gartner.com/en/articles/intelligent-agent-in-ai">Gartner — Agentic AI in Enterprise Software (2025)</a> — 33% of enterprise software by 2028</li><li><a href="https://www.gartner.com/en/newsroom/press-releases/2025-06-25-gartner-predicts-over-40-percent-of-agentic-ai-projects-will-be-canceled-by-end-of-2027">Gartner — 40% of Agentic AI Projects Will Be Canceled by 2027</a></li><li><a href="https://adversa.ai/top-ai-security-incidents-report-2025-edition/">Adversa AI — 2025 AI Security Incidents Report</a> — 35% prompt injection rate</li><li><a href="https://newsroom.ibm.com/2025-07-30-ibm-report-13-of-organizations-reported-breaches-of-ai-models-or-applications,-97-of-which-reported-lacking-proper-ai-access-controls">IBM — Cost of a Data Breach Report (2025)</a> — 97% lacked basic AI access controls</li><li><a href="https://genai.owasp.org/resource/owasp-top-10-for-agentic-applications-for-2026/">OWASP — Top 10 for Agentic Applications (December 2025)</a></li><li><a href="https://eur-lex.europa.eu/eli/reg/2024/1689/oj/eng">EU AI Act — Full text</a> — Full enforcement effective August 2, 2026</li><li><a href="https://www.obsidiansecurity.com/blog/ai-agent-security-risks">Obsidian Security — AI Agent Security Risks (2025)</a></li><li><a href="https://www.mckinsey.com/capabilities/quantumblack/our-insights/the-state-of-ai">McKinsey — State of AI Global Survey (2025)</a></li><li><a href="https://www.nist.gov/itl/ai-risk-management-framework">NIST — AI Risk Management Framework 1.0 (January 2023)</a></li><li><a href="https://www.bleepingcomputer.com/news/security/identity-first-ai-security-why-cisos-must-add-intent-to-the-equation/">Token Security / BleepingComputer — Identity-First AI Security (February 2026)</a></li><li><a href="https://arxiv.org/abs/2602.20196">OpenPort Protocol — arXiv:2602.20196 (February 2026)</a></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1f929684a36e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Let’s Start Over: A Quiet Act of Leadership.]]></title>
            <link>https://medium.com/@rkanagasikamani/lets-start-over-a-quiet-act-of-leadershipit-started-in-chaos-4fc02ca5dccf?source=rss-4a9b0802f05c------2</link>
            <guid isPermaLink="false">https://medium.com/p/4fc02ca5dccf</guid>
            <category><![CDATA[team-management]]></category>
            <category><![CDATA[remote-work]]></category>
            <category><![CDATA[personal-growth]]></category>
            <category><![CDATA[leadership]]></category>
            <category><![CDATA[workplace-culture]]></category>
            <dc:creator><![CDATA[Ravichandran K]]></dc:creator>
            <pubDate>Tue, 17 Jun 2025 04:47:15 GMT</pubDate>
            <atom:updated>2025-06-17T04:48:09.991Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*4cRLdAhVn_dgK8kr" /><figcaption>Photo by <a href="https://unsplash.com/@92haroon_khalid?utm_source=medium&amp;utm_medium=referral">Haroon Khalid</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>It all started in chaos.</p><p>It was a Saturday.</p><p>The team had been working since 6:00 am, trying to figure out a tricky issue. Everything was happening virtually — just a bunch of us on a call from our homes. By the time I joined, it had been three hours. Everyone was trying to help — sharing logs, checking code, suggesting fixes. All with good intentions.</p><p>But here’s the thing — it probably wasn’t a full team problem. It seemed like something related to one or two areas. Still, everyone jumped in. The root cause wasn’t easy to find. People asked different questions and pulled in different directions. It wasn’t about ownership. Just a team trying to fix something together — and that turned into a bit of chaos.</p><p>The timeline was tight, and this was a production move day. The pressure was on, and this one bug was threatening everything.</p><p>Earlier, I’d been supporting another team’s release. I was jumping between calls, helping where I could. But when I joined this call, I could feel the difference. Something was off.</p><p>People were talking over each other. Screens were filled with error messages. You could hear the tension in their voices — even in silence. Everyone was drained.</p><p>I had just wrapped one intense session and stepped into another. I didn’t want to add more noise. I waited. Then I spoke softly and said:</p><blockquote>“Let’s start over. Just pause for a moment and let’s take it from the top — together.”</blockquote><p>That’s all.</p><p>No pressure. No demands. Just a calm reset.</p><p>It took a minute. Then, one by one, people began to talk. Not just about the bug — but about what wasn’t making sense. What they were unsure about. What they were tired of trying. Slowly, the energy changed.</p><p>People started to listen. To align. Within the next hour, the bug was fixed. We got back on track. The release went through.</p><p>It wasn’t some brilliant fix. It was just a small pause. A shift in tone. Enough for us to breathe, refocus, and work better together.</p><h4>What I Learned That Day</h4><p>We didn’t just fix a bug — we fixed how we were working.</p><p>There was more patience. More clarity. More team.</p><p>That’s when it hit me: leadership isn’t always about having the answers. Sometimes, it’s just about showing up in the right way. With calm. With care.</p><p>In fast-moving environments, taking a moment to pause feels counterintuitive. But sometimes, it’s exactly what a team needs.</p><p>Because when everything feels out of sync, people don’t need more instructions. They need someone to help them breathe again. To help them believe they can figure it out.</p><p>That day, I didn’t bring the fix. I just brought the space for it to happen.</p><h4>It Changed How I Lead</h4><p>Since then, I’ve kept this close:</p><p>Sometimes, calm is more powerful than control.</p><p>You don’t need to jump in — you can hold space instead.</p><p>Listening can realign a team faster than pushing.</p><p>Now, whether it’s an outage, a missed deadline, or just a tough moment — I try to be that pause. That presence. And maybe, if the day calls for it, the person who offers a virtual cup of tea.</p><p>Because presence isn’t passive. It’s leadership, quietly showing up.</p><h4>Have you been part of a moment like this?</h4><p>Where things shifted not because of a fix, but because someone stayed steady?</p><p>I’d love to hear your story. Sometimes, it’s the smallest things that change everything.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4fc02ca5dccf" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How RAG Bridges the Gap Between LLMs and Enterprise Data]]></title>
            <link>https://medium.com/@rkanagasikamani/how-rag-bridges-the-gap-between-llms-and-enterprise-data-603886d37d56?source=rss-4a9b0802f05c------2</link>
            <guid isPermaLink="false">https://medium.com/p/603886d37d56</guid>
            <category><![CDATA[knowledge-assistant]]></category>
            <category><![CDATA[rags]]></category>
            <category><![CDATA[llm]]></category>
            <dc:creator><![CDATA[Ravichandran K]]></dc:creator>
            <pubDate>Wed, 21 May 2025 16:48:55 GMT</pubDate>
            <atom:updated>2025-05-21T16:57:14.653Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*MmcqRLxRnsEkSY3l" /><figcaption>Photo by <a href="https://unsplash.com/@saluken?utm_source=medium&amp;utm_medium=referral">Luke Tanis</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h3>🧠 Introduction</h3><p>Your enterprise AI assistant knows how to talk — but doesn’t know your company’s data. Whether it’s product manuals, support logs, or compliance docs, static LLMs can’t access the knowledge your teams rely on. That’s where RAG comes in.</p><p>Large Language Models (LLMs) like GPT-4 or Claude are powerful, but they lack access to fresh, contextual knowledge beyond their static training data. This becomes a major limitation when trying to apply them in situations that require real-time, domain-specific, or proprietary insights. Without dynamic access to external knowledge, they may generate outdated or irrelevant responses. Retrieval-Augmented Generation (RAG) addresses this by enhancing LLMs with the ability to fetch and utilize external data at runtime — making AI systems more accurate, relevant, and trustworthy.</p><p>Whether it’s exploring new ideas, conducting research, or building tools with LLMs, access to live, domain-specific, and private knowledge is essential. This is especially true when precision, consistency, and timeliness matter.</p><p>Retrieval-Augmented Generation (RAG) offers a solution. It empowers LLMs with access to external knowledge at runtime, bridging the gap between general-purpose intelligence and specific context.</p><h3>🔍 What is RAG?</h3><p>RAG is an AI architecture that enhances LLMs by allowing them to pull in external context dynamically during inference.</p><h4>RAG in Two Phases:</h4><h4>1. Retrieve</h4><p>The user query is converted into an embedding using models like OpenAI’s text-embedding-ada-002 or AWS Bedrock.</p><p>This vector is matched against a vector database (e.g., FAISS, Pinecone, Weaviate, Chroma) to find the top-k most relevant chunks.</p><p>These chunks can be from documents, notes, transcripts, or any structured knowledge source.</p><h4>2. Generate</h4><p>Retrieved documents are embedded into a prompt template like:</p><pre>Context:<br>- [Snippet A]<br>- [Snippet B]<br><br>Question: [User query]<br><br>Answer:</pre><p>The LLM uses this context to produce answers grounded in real data or experiences.</p><p>💡 Think of RAG as “plugging in memory” to your LLM, making it aware of your specific knowledge without retraining.</p><h3>🧬 Tech Stack Behind RAG</h3><p>A robust RAG typically involves four major components:</p><h4>Embeddings — The Lens to See Meaning</h4><p>Transform raw text into dense numerical vectors that LLMs can “understand.”</p><p>OpenAI — <em>High-quality, general-purpose embeddings (via API).</em></p><p>Cohere — <em>Fast, multilingual embeddings suitable for scale.</em></p><p>SentenceTransformers — <em>Versatile, open-source library for local use.</em></p><p>AWS Bedrock — <em>Fully managed embedding generation within the AWS ecosystem.</em></p><h4>Vector Stores — Where Memory Lives</h4><p>Store, index, and retrieve high-dimensional vectors efficiently.</p><p>FAISS — <em>Lightweight and open-source; ideal for on-prem deployments.</em></p><p>Pinecone — <em>Fully managed, scalable vector DB with fast queries.</em></p><p>Chroma — <em>Developer-first, simple to integrate, open-source.</em></p><p>Weaviate — <em>Feature-rich with RESTful APIs and built-in ML tools.</em></p><h4>LLMs — The Brain Behind the Voice</h4><p>Generate fluent, contextual responses using retrieved facts.</p><p>GPT-4 — <em>OpenAI’s most advanced, general-purpose LLM.</em></p><p>Claude — <em>Steerable and safe; designed with constitutional AI principles.</em></p><p>Amazon Titan — <em>Enterprise-ready and tightly integrated into AWS.</em></p><p>LLaMA — <em>Meta’s open-weight models; customizable and self-hostable.</em></p><h4>Orchestration — The Conductor of Components</h4><p>Manage the flow between retrieval and generation layers.</p><p>LangChain — <em>Modular, agent-capable framework for RAG and beyond.</em></p><p>LlamaIndex — <em>Focused on intelligent document routing and indexing.</em></p><p>Haystack — <em>Strong support for pipelines, evals, and production use.</em></p><p>✅ Why it matters:<br>You don’t need to retrain your model — just refresh the knowledge base. That means faster iteration, reduced hallucinations, and lower costs over time.</p><h3>💼 Why RAG is a Game-Changer for Enterprises</h3><h4>1. Improved Accuracy &amp; Domain Relevance</h4><p>In enterprise settings, LLMs need to understand and respond using internal terminologies, operational workflows, and proprietary data. RAG empowers models to pull relevant information from internal document repositories, product manuals, compliance guidelines, and customer records. This drastically improves response accuracy and aligns it with the enterprise’s unique context.</p><h4>2. Audit-ability and Source Traceability</h4><p>In industries where compliance and accountability matter — such as finance, healthcare, and legal — being able to trace the origin of an AI-generated response is essential. RAG makes this possible by tying answers back to specific documents or data chunks, enabling better audit trails and human validation.</p><h4>3. Reduction in Hallucination Risk</h4><p>Hallucinated answers are unacceptable in business-critical use cases. By grounding outputs in verified enterprise data, RAG significantly reduces the risk of misleading or incorrect information — making AI safer and more reliable for sensitive applications.</p><h4>4. No Need for Frequent Model Updates</h4><p>Traditional approaches require expensive fine-tuning or retraining to stay current. With RAG, enterprises can simply update their document repositories or vector databases. The model dynamically accesses the most current knowledge without needing to retrain, accelerating delivery cycles and reducing ML ops overhead.</p><h4>5. Scalability Across Departments</h4><p>RAG-based systems can serve multiple departments with specialized knowledge — legal, HR, customer support, engineering, and more — by indexing their respective knowledge bases. This enables scalable, context-aware AI solutions across the enterprise.</p><h3>🧪 Personal Exploration: A Hands-On RAG Example</h3><p>In one of my recent AI experiments, I built a RAG-powered assistant that connected a language model to a curated set of my own research notes and technical documentation.</p><p>This setup enabled me to:<br> ⚡ <strong>Answer complex queries instantly</strong> — with responses grounded in my trusted sources<br> ✅ <strong>Receive source references</strong> for every response, enhancing transparency<br> 🔄 <strong>Update the knowledge base</strong> freely — no model retraining required</p><p>It was like creating a <strong>domain-specific expert assistant</strong> that truly “knew” my content — fast, reliable, and always up-to-date.</p><h3>Lessons Learned</h3><p>From practical experimentation, seeral important takeaways emerged:</p><p>Prompt design is crucial: Clear and well-structured prompts lead to more accurate and relevant responses.</p><p>Data quality matters: Clean, well-chunked documents significantly enhance both retrieval and generation performance.</p><p>Smaller models can excel: When paired with high-quality, domain-specific data, smaller models often outperform larger ones.</p><p>Chunking strategy impacts output: The size and overlap of text chunks can greatly influence the relevance and completeness of generated responses.</p><h3>🔮 What’s Next for RAG?</h3><p>Hybrid Retrieval: Combine keyword + semantic search</p><p>Feedback Loops: Let agents refine and rate answers</p><p>Knowledge Graphs + Embeddings: Enhance reasoning with structured relationships</p><h3>🧩 Conclusion</h3><p>RAG is more than a technical strategy — it’s a powerful approach for making AI work with your real, changing world.</p><p>It helps your models:</p><p>📚 Stay aware of specific knowledge</p><p>📌 Reference and justify their outputs</p><p>🔄 Stay up to date effortlessly</p><p>If you’re building with LLMs, exploring RAG will significantly boost their usefulness and trust.</p><p>👉 In the next article, I’ll walk you through building a simple RAG system from scratch — so you can bring this architecture to life in your own projects.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=603886d37d56" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Corporate Climb: Brutal, Beautiful, and Yours to Redefine]]></title>
            <link>https://medium.com/@rkanagasikamani/the-corporate-climb-brutal-beautiful-and-yours-to-redefine-de9215742d75?source=rss-4a9b0802f05c------2</link>
            <guid isPermaLink="false">https://medium.com/p/de9215742d75</guid>
            <category><![CDATA[self-awareness]]></category>
            <category><![CDATA[growth-mindset]]></category>
            <category><![CDATA[satisfaction]]></category>
            <dc:creator><![CDATA[Ravichandran K]]></dc:creator>
            <pubDate>Wed, 09 Apr 2025 19:16:21 GMT</pubDate>
            <atom:updated>2025-04-09T19:16:21.307Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ubO3Nmj-d6gomb4y" /><figcaption>Photo by <a href="https://unsplash.com/@markusspiske?utm_source=medium&amp;utm_medium=referral">Markus Spiske</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Climbing the corporate ladder? Oh, it looks like success — swanky titles, swollen pay-checks, maybe even your own parking spot (if you’re lucky). But behind those shiny LinkedIn promotions and smug coffee chats lies a truth no one warns you about: a soul-sucking mix of power plays, late-night Slack messages, and meetings that could’ve been emails — or better yet, nothing at all. Welcome to the real grind — where the higher you rise, the thinner the air… and the thicker the drama.</p><h3><strong>The Slow Burn That Becomes a Wildfire</strong></h3><p>It starts innocently — a couple of late nights, a quick email during dinner, maybe skipping one weekend plan “just this once.” Before you know it, work has unpacked its bags and moved into every corner of your life — your weekends, your holidays, even your shower thoughts.</p><p>You trade movie nights for dashboards, hobbies for KPIs, and family dinners for back-to-back “quick syncs.” All in the noble pursuit of “impact” — which somehow always translates to more work and less life.</p><h3>Great Work ≠ Great Promotion</h3><p>Here’s the plot twist they don’t tell you: crushing your goals, staying late, and being the office MVP doesn’t guarantee a seat at the big table. Promotions? They’ve got less to do with excellence and more to do with exposure, timing, and who’s whispering your name in the right rooms.</p><p>Meanwhile, that one guy who mastered the art of sounding smart in meetings is already two levels up — not because he’s brilliant, but because he’s mastered the corporate Game of Thrones. Spoiler alert: meritocracy is cute… until politics enters the chat.</p><h3>Loyalty? That’s Cute — Until It Isn’t</h3><p>You’re told to stick around, be loyal, “grow with the company.” So you do — you skip offers, stay through chaos, and wear your badge like a second skin. But here’s the harsh truth: your loyalty might be deep, but the company’s loyalty? Paper-thin.</p><p>All it takes is one spreadsheet in one boardroom and poof — your years of hustle are reduced to a bullet point in a restructuring deck.</p><p>Because in the end, loyalty is optional… and often, it’s a one-way street.</p><h3>Biased Bosses: The Unspoken Ceiling</h3><p>Here’s something you won’t find in your onboarding manual — not all managers play fair. Some have favourites. Some promote clones of themselves. And some treat feedback like it’s an optional side dish they can skip.</p><p>You could be crushing every metric, carrying the team on your back, and still get passed over because you’re not part of “the inner circle.” The Friday beers gang. The same-college-as-me club. Or worse — the “you just don’t fit the vibe” crowd. Spoiler: the vibe is usually code for bias.</p><p>Trying to change these managers? Good luck. You’re not just battling opinions — you’re up against decades of comfort, unchecked power, and the corporate immunity that comes with being “liked by leadership.”</p><p>It’s like showing up to a rigged poker game and expecting to win by playing fair. And while some of them may smile in town halls and parrot “diversity of thought,” behind closed doors they still hand out opportunities like party favours at a reunion they didn’t invite you to.</p><p>Moral of the story? Sometimes it’s not your lack of skills — it’s their lack of vision.</p><h3>The Top’s Got a View — But It’s Also Got Storm Clouds</h3><p>You made it! Welcome to the top — where the titles are fancy, the calendars are packed, and the smiles are… strategic. Sure, you’ve got authority, but guess what took the hit? Your freedom. Your peace. Sometimes even your sanity.</p><p>The higher you climb, the lonelier it gets. Conversations become calculated, friendships feel like networking events, and every win comes with a side of pressure. Turns out, the view is great — if you don’t mind the altitude sickness and emotional isolation.</p><h3>Burnout: The New Office Flex</h3><p>In some corners of the corporate jungle, burnout isn’t a red flag — it’s a badge of honour. People brag about their 14-hour days like it’s an Olympic sport. Skipped meals, late-night emails, zero boundaries? “Wow, such dedication.” But let’s be real — working yourself into the ground isn’t noble, it’s self-destruction in a tailored blazer. And yet, you might still feel guilty for logging off early… because apparently, real leaders never rest. (Plot twist: they should.)</p><h3>Who Even Are You Anymore?</h3><p>You start with purpose, passion, and maybe even a vision board. But slowly, the game gets to you. You adjust. You edit yourself. You trade authenticity for acceptability. Eventually, you’re not sure if you’re chasing goals or just running on autopilot — shaped more by performance reviews than personal values. The system doesn’t always reward you — it rewards who you become to survive it.</p><h3>Big Title, Big Pay-check… Big Void?</h3><p>You’ve made it. The title’s impressive, the bank account is smiling, and people respectfully CC you. But then comes that quiet, unnerving whisper: “Now what?” If you climbed the wrong ladder — or climbed it for the wrong reasons — the view can feel eerily empty. Turns out, success without ful-fillment is just… <em>a fancier kind of failure.</em></p><h3>The Real Truth</h3><p>Yes, success in the corporate world is real — and sometimes even deeply meaningful. But it doesn’t come free. It comes with trade-offs, compromises, and some scars no one sees.</p><p>So no, it’s not about burning the ladder down. It’s about climbing the ladder eyes wide open. Know your WHY. Protect your joy. Define your version of success — not the one HR put on a slide deck.</p><p>Because sometimes, the boldest move isn’t climbing higher…<br>It’s choosing a direction that actually feels like you.</p><h3>Growth Is Real — If You Play It Smart</h3><p>For all its mess, the corporate world isn’t all doom and drama. Growth is possible — not just up, but outward, inward, and in ways that align with who you really are. The key? Don’t just hustle blindly. Be intentional. Find mentors who lift, not just lead. Speak up, even when it’s uncomfortable. Learn the system — not to lose yourself in it, but to navigate it on your terms. And when the system won’t change for you? Change your seat at the table — or build your own damn table. Real success isn’t about surviving the climb — it’s about making sure it’s your mountain to begin with.</p><h3>One Last Thing</h3><p>The truth is, the corporate climb isn’t inherently bad — it’s just rarely honest. Yes, there’s chaos. Yes, there’s politics. But there’s also growth, grit, and the chance to evolve into someone sharper, wiser, and more self-aware. You don’t have to play the game exactly like everyone else. You just need to know the rules — and then decide which ones are worth following, and which ones you’re brave enough to break.</p><p>So rise if you want to rise — but rise with your values intact, your boundaries protected, and your eyes wide open.<br>Because when you define success on your terms, the view is not just better — it’s yours.</p><p>Do it not because you have to — but because you <em>want</em> to.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=de9215742d75" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Mastering the Art of Interviewing: A Guide to Creating Meaningful Connections and Uncovering…]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/@rkanagasikamani/mastering-the-art-of-interviewing-a-guide-to-creating-meaningful-connections-and-uncovering-acae1b0cef39?source=rss-4a9b0802f05c------2"><img src="https://cdn-images-1.medium.com/max/2600/0*OcLUFhGFOLIlUhM7" width="5766"></a></p><p class="medium-feed-snippet">Interviews are a pivotal part of professional life, and I&#x2019;ve had the privilege of experiencing both sides&#x200A;&#x2014;&#x200A;being both an interviewer and&#x2026;</p><p class="medium-feed-link"><a href="https://medium.com/@rkanagasikamani/mastering-the-art-of-interviewing-a-guide-to-creating-meaningful-connections-and-uncovering-acae1b0cef39?source=rss-4a9b0802f05c------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://medium.com/@rkanagasikamani/mastering-the-art-of-interviewing-a-guide-to-creating-meaningful-connections-and-uncovering-acae1b0cef39?source=rss-4a9b0802f05c------2</link>
            <guid isPermaLink="false">https://medium.com/p/acae1b0cef39</guid>
            <category><![CDATA[interviewer-training]]></category>
            <category><![CDATA[recruitement]]></category>
            <category><![CDATA[interviewer]]></category>
            <dc:creator><![CDATA[Ravichandran K]]></dc:creator>
            <pubDate>Sat, 01 Mar 2025 03:55:59 GMT</pubDate>
            <atom:updated>2025-03-01T03:55:59.862Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Vertex AI for Image Embedding : A Step-by-Step Guide]]></title>
            <link>https://medium.com/@rkanagasikamani/how-to-use-vertex-ai-for-image-embedding-python-a-step-by-step-guide-3f5be3042584?source=rss-4a9b0802f05c------2</link>
            <guid isPermaLink="false">https://medium.com/p/3f5be3042584</guid>
            <category><![CDATA[vertex-ai]]></category>
            <category><![CDATA[image-classification]]></category>
            <category><![CDATA[multimodel-ai]]></category>
            <dc:creator><![CDATA[Ravichandran K]]></dc:creator>
            <pubDate>Fri, 15 Nov 2024 18:50:58 GMT</pubDate>
            <atom:updated>2024-11-16T17:40:29.363Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/958/1*XetqgXf5pC4Q3lsQqG9lyw.jpeg" /></figure><h3>1. Introduction</h3><p>Vertex AI from Google Cloud offers powerful models for various machine learning tasks, including image analysis and embeddings. Image embeddings are a way to represent images as numerical vectors (arrays of numbers) that capture the essence or features of the images. These embeddings can then be used for tasks such as image search, image comparison, and recommendation systems.</p><p>In this guide, we’ll show you how to interact with the <strong>MultiModalEmbeddingModel</strong> from Vertex AI to generate image embeddings. We’ll walk through two variations of the API: one where the image URL is passed directly and another where the image is passed as raw byte data. This gives you flexibility depending on how you are sourcing your images.</p><h3>2. Setting Up the Environment</h3><p>To begin, you’ll need the following setup:</p><ul><li><strong>Google Cloud Project</strong>: Ensure you have access to a Google Cloud project with Vertex AI enabled.</li><li><strong>Vertex AI API</strong>: You’ll need to interact with the Vertex AI MultiModalEmbeddingModel, which provides the image embedding functionality.</li><li><strong>Credentials</strong>: Use the appropriate Google Cloud service credentials to authenticate the API requests.</li></ul><h3>3. Initializing Vertex AI</h3><p>The first step is to initialize Vertex AI. This process will authenticate the API client and prepare it for use. Below is the method to initialize Vertex AI with the necessary credentials.</p><pre>import google<br>import vertexai<br>from typing import Optional<br><br>def initialize_vertexai(<br>        project: Optional[str] = None,<br>        location: Optional[str] = None,<br>        credentials: Optional[google.auth.credentials.Credentials] = None<br>):<br>    vertexai.init(<br>        project=project,<br>        location=location,<br>        credentials=credentials<br>    )</pre><p><strong>Explanation</strong>:</p><ul><li><strong>project</strong>: Your Google Cloud project ID.</li><li><strong>location</strong>: The location of your Vertex AI service (e.g., &#39;us-west4&#39;).</li><li><strong>credentials</strong>: Authentication credentials used to connect to the API.</li></ul><p>You will call this method only once before processing the images.</p><h3>4. Fetching the Image from a URL</h3><p>The next step is to fetch the image from a URL, as this is a common way of accessing images. Below is a function that accepts the URL of an image, downloads it, and returns the raw image bytes.</p><pre>import requests<br><br>def get_image_bytes(url: str) -&gt; bytes:<br>    try:<br>        response = requests.get(url)<br>        response.raise_for_status()  # Raises HTTPError for bad responses (4xx and 5xx)<br>        return response.content  # Return raw image bytes<br>    except requests.RequestException as e:<br>        raise Exception(f&quot;Error accessing the URL: {e}&quot;)p</pre><p><strong>Explanation</strong>:</p><ul><li>This function fetches the image from the provided URL using the requests library.</li><li>If there is an error (such as the URL being unreachable), it raises an exception.</li></ul><h3>5. Making the Embedding Call</h3><p>There are two ways to interact with the image embedding model from Vertex AI. We can either pass the image URL (which will be downloaded) or directly provide the image as raw byte data. Let’s see both variations:</p><h4>Variation 1: Image URL as Input</h4><p>This version of the function will accept the URL of the image, download it, and pass it to the Vertex AI model for embedding generation.</p><pre>from vertexai.vision_models import Image, MultiModalEmbeddingModel<br><br>def process_image_embedding_from_url(/service/url: str, model: MultiModalEmbeddingModel):<br>    try:<br>        image_bytes = get_image_bytes(url)<br>        image = Image(image_bytes=image_bytes)<br>        <br>        embedding_dimension = 1408<br>        embeddings = model.get_embeddings(<br>            image=image,<br>            dimension=embedding_dimension,<br>        )<br><br>        print(f&quot;URL: {url}&quot;)<br>        print(f&quot;Image Embedding: {embeddings.image_embedding}&quot;)<br>        <br>    except Exception as e:<br>        print(f&quot;Error processing URL {url}: {e}&quot;)</pre><p><strong>Explanation</strong>:</p><ul><li><strong>Input</strong>: The function takes an image URL.</li><li><strong>Process</strong>: The image is fetched from the URL using the get_image_bytes() function.</li><li><strong>Embedding</strong>: The image is passed to the Vertex AI model for embedding generation.</li><li><strong>Output</strong>: The function prints the image embedding and, if available, the text embedding.</li></ul><h4>Variation 2: Raw Image Bytes as Input</h4><p>In this version, the image is passed as raw byte data, such as when the image is already loaded or fetched from another source.</p><pre>def process_image_embedding_from_bytes(image_bytes: bytes, model: MultiModalEmbeddingModel):<br>    try:<br>        image = Image(image_bytes=image_bytes)<br>        <br>        embedding_dimension = 1408<br>        embeddings = model.get_embeddings(<br>            image=image,<br>            dimension=embedding_dimension,<br>        )<br><br>        print(f&quot;Image Embedding: {embeddings.image_embedding}&quot;)<br>        print(f&quot;Text Embedding: {embeddings.text_embedding}&quot;)<br>    except Exception as e:<br>        print(f&quot;Error processing the image bytes: {e}&quot;)</pre><p><strong>Explanation</strong>:</p><ul><li><strong>Input</strong>: The function takes the image as raw byte data (such as from a local file or another API).</li><li><strong>Process</strong>: The image bytes are passed directly to the Image() object.</li><li><strong>Embedding</strong>: The raw bytes are sent to the Vertex AI model for embedding generation.</li><li><strong>Output</strong>: It prints out the image embedding and text embedding (if applicable).\</li></ul><h3>6. Calling the Methods for Multiple Images</h3><p>You can process multiple images by calling the process_image_embedding_from_url() or process_image_embedding_from_bytes() methods for each image in a list.</p><h3>7. Conclusion</h3><p>With these two variations, you can either fetch images directly from a URL or pass the image data as raw bytes. Both methods integrate seamlessly with the Vertex AI embedding model, allowing you to process multiple images efficiently. The flexibility to handle image URLs or byte data makes this approach versatile for a variety of use cases, such as image search, content-based retrieval, or face recognition.</p><p>By following this guide, you now have the tools to interact with Vertex AI and generate image embeddings to power your AI-driven applications.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3f5be3042584" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Mastering Angular: A Comprehensive Guide to Core Concepts and Advanced Techniques]]></title>
            <link>https://medium.com/@rkanagasikamani/mastering-angular-a-comprehensive-guide-to-core-concepts-and-advanced-techniques-7cd2c6118599?source=rss-4a9b0802f05c------2</link>
            <guid isPermaLink="false">https://medium.com/p/7cd2c6118599</guid>
            <category><![CDATA[developer-tools]]></category>
            <category><![CDATA[angular]]></category>
            <dc:creator><![CDATA[Ravichandran K]]></dc:creator>
            <pubDate>Thu, 04 Jul 2024 17:39:01 GMT</pubDate>
            <atom:updated>2024-07-04T17:39:01.711Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1St1_Z_lpHAlxs3B0ebxhg.jpeg" /><figcaption>&lt;app-root&gt;&lt;/app-root&gt;</figcaption></figure><p>Angular is a powerful framework for building dynamic web applications. This guide covers essential concepts and advanced techniques to help you become a proficient Angular developer.</p><h3>Core Angular Concepts</h3><h4>Fundamentals</h4><p>Angular’s core building blocks include:</p><ul><li>Components: Encapsulate template, data, and behavior for UI elements.</li><li>Directives: Extend HTML with custom attributes and elements.</li><li>Services: Provide shared functionality across components.</li><li>Dependency Injection (DI): A design pattern for managing dependencies.</li><li>Data Binding: Sync data between component and view.</li><li>NgModules: Organize and modularize application code.</li><li>Routing: Navigate between different views in a single-page application.</li><li>Signals: Wrapper around a values that notifies consumers</li></ul><h4>Change Detection</h4><p>Angular’s change detection mechanism updates the view when data changes. Two main strategies are:</p><p>1. Default: Checks the entire component tree for changes.<br>2. OnPush: Only checks components when inputs change, improving performance.</p><p>Optimize change detection by using immutable objects and pure pipes.</p><h4>TypeScript</h4><p>TypeScript enhances JavaScript with static typing, interfaces, and advanced OOP features. Benefits for Angular development include:</p><p>- Improved code quality and maintainability<br>- Better tooling and IDE support<br>- Early error detection</p><h4>Reactive Extensions (RxJS)</h4><p>RxJS is crucial for handling asynchronous operations in Angular:</p><p>- Observables: Represent streams of data over time.<br>- Operators: Manipulate and transform data streams.<br>- Subjects: Special types of Observables that can multicast to many Observers.</p><h4>Forms</h4><p>Angular provides two approaches to handling forms:</p><p>1. Template-driven forms: Simple forms with two-way data binding.<br>2. Reactive forms: More robust, scalable forms with a model-driven approach.</p><p>Implement form validation and error handling for a better user experience.</p><h4>Testing</h4><p>Ensure code quality with:</p><p>- Unit tests: Test individual components and services.<br>- End-to-end tests: Test the application as a whole.</p><p>Use tools like Jasmine and Protractor for comprehensive test coverage.</p><h3>Advanced Angular Techniques</h3><h4>AOT vs JIT Compilation</h4><p>- Ahead-of-Time (AOT) compilation: Compiles Angular templates during build time, resulting in faster rendering and smaller file size.<br>- Just-in-Time (JIT) compilation: Compiles templates at runtime, useful for development.</p><h4>Lazy Loading</h4><p>Implement lazy loading to load feature modules on demand, improving initial load time and performance.</p><h4>State Management</h4><p>For complex applications, consider state management solutions:</p><p>- NgRx: Redux-inspired state management library for Angular.<br>- NGXS: State management pattern + library for Angular.<br>- Akita: State management tailored for JS Applications.</p><h4>Server-Side Rendering (SSR)</h4><p>Implement Angular Universal for SSR to improve SEO and initial page load times.</p><h4>Custom Directives/Pipes</h4><p>Extend Angular’s functionality by creating:</p><p>- Custom directives: Add behavior to elements.<br>- Custom pipes: Transform data for display.</p><h4>Security</h4><p>Implement security best practices:</p><p>- Use Angular’s built-in sanitization.<br>- Implement Content Security Policy (CSP).<br>- Guard against Cross-Site Scripting (XSS) attacks.</p><h4>Signals</h4><p>A signal is a wrapper around a value that notifies interested consumers when that value changes. Signals can contain any value from primitives to complex data structures.</p><h3>Architecture and Scalability</h3><h4>Scalability Strategies</h4><p>- Optimize data fetching and caching.<br>- Implement efficient state management.<br>- Use web workers for CPU-intensive tasks.</p><h4>Module Organization</h4><p>Structure your application using feature modules and shared modules for better maintainability and scalability.</p><h4>Performance Optimization</h4><p>- Use Angular’s built-in profiling tools.<br>- Implement virtual scrolling for large lists.<br>- Optimize change detection and minimize DOM manipulation.</p><h3>Developer Tools</h3><p><strong>1. Angular CLI: Your One-Stop Shop for Angular Projects</strong></p><p>The Angular CLI (Command Line Interface) is an invaluable tool for scaffolding new Angular projects, and generating components, services, and other building blocks. It streamlines development by automating repetitive tasks and providing a consistent workflow. Here are some key functionalities of the CLI:</p><ul><li><strong>Project Creation:</strong> With a single command, you can set up a new Angular project with a pre-configured directory structure and essential files.</li><li><strong>Component, Service, and Pipe Generation:</strong> The CLI allows you to quickly generate components, services, pipes, and other Angular functionalities, saving you time and ensuring consistency.</li><li><strong>Development Server:</strong> The CLI can start a local development server, allowing you to test your application in a browser environment with features like hot reloading for instant feedback on code changes.</li><li><strong>Build and Serve:</strong> Easily build your application for production with optimized code and serve it for deployment.</li></ul><p><strong>2. Angular DevTools: Debugging and Profiling Made Easy</strong></p><p>The Angular DevTools browser extension unlocks a treasure trove of debugging and profiling capabilities. It integrates seamlessly with Chrome DevTools or Firefox Add-ons, providing an “Angular” tab specifically designed for your Angular application. Let’s explore some of its benefits:</p><ul><li><strong>Component Explorer:</strong> Visualize the component hierarchy of your application, allowing you to inspect individual components and their properties.</li><li><strong>State Inspection and Editing:</strong> Preview and modify component state in real-time, making debugging a breeze.</li><li><strong>Change Detection Profiling:</strong> Gain insights into your application’s performance by profiling change detection cycles. Identify bottlenecks and optimize your code for a smoother user experience.</li><li><strong>Dependency Injection Tree:</strong> Visualize the dependency injection tree, helping you understand how services are resolved throughout your application.</li></ul><p><strong>3. Language Services and Libraries: Enhance Your Development Workflow</strong></p><p>Beyond the CLI and DevTools, Angular offers a rich ecosystem of language services and libraries that empower developers:</p><ul><li><strong>TypeScript Language Service:</strong> TypeScript, a superset of JavaScript, provides excellent type checking and code completion within your IDE, leading to fewer errors and faster development.</li><li><strong>Angular Material:</strong> A comprehensive library of pre-built UI components that adhere to Google’s Material Design guidelines. This saves you time from scratch-building common UI elements like buttons, cards, and dialogs while maintaining a consistent look and feel.</li><li><strong>Third-Party Libraries:</strong> The vast Angular ecosystem offers numerous third-party libraries that address specific needs, ranging from state management with NgRx to HTTP client interaction with Angular HttpClient.</li></ul><h3>Non-Functional Requirements</h3><h4>Accessibility (a11y)</h4><p>Ensure your application is accessible:</p><p>- Use ARIA attributes.<br>- Implement keyboard navigation.<br>- Provide alternative text for images.</p><h4>Internationalization (i18n) and Localization (l10n)</h4><p>Prepare your application for a global audience:</p><p>- Use Angular’s i18n tools for translations.<br>- Implement locale-specific formatting for dates, numbers, and currencies.</p><h4>Logging and Error Handling</h4><p>Implement robust error handling:</p><p>- Use Angular’s error-handling mechanisms.<br>- Implement centralized logging services.<br>- Provide meaningful error messages to users.</p><p>By mastering these concepts and techniques, you’ll be well-equipped to build scalable, performant, and maintainable Angular applications.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7cd2c6118599" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>