<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Neeraj Kumar</title><description>Personal website for Neeraj Kumar. Product Builder, Engineer &amp; AI.</description><link>https://kneeraj.com/</link><item><title>Anatomy of an always-on agent</title><link>https://kneeraj.com/posts/2026/anatomy-of-an-always-on-agent/</link><guid isPermaLink="true">https://kneeraj.com/posts/2026/anatomy-of-an-always-on-agent/</guid><description>What changes when an AI agent stops waiting for your prompt: the eight building blocks of an always-on agent, and the metrics a PM should track.</description><pubDate>Fri, 27 Nov 2026 04:30:00 GMT</pubDate><content:encoded>&lt;p&gt;&lt;em&gt;An AI PM’s view of what changes when the agent stops waiting for you.&lt;/em&gt;&lt;/p&gt;
&lt;h2 id=&quot;table-of-contents&quot;&gt;Table of Contents&lt;/h2&gt;
&lt;p&gt;&lt;/p&gt;&lt;details&gt;&lt;summary&gt;Open Table of Contents&lt;/summary&gt;&lt;p&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;#what-always-on-means-to-the-user&quot;&gt;What “always-on” means to the user&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;#the-anatomy&quot;&gt;The anatomy&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;#1-triggers&quot;&gt;1. Triggers&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;#2-event-inbox&quot;&gt;2. Event inbox&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;#3-timers&quot;&gt;3. Timers&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;#4-worker&quot;&gt;4. Worker&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;#5-memory&quot;&gt;5. Memory&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;#6-dreaming&quot;&gt;6. Dreaming&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;#7-permissions&quot;&gt;7. Permissions&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;#8-outbox&quot;&gt;8. Outbox&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;#how-it-fits-together-one-run&quot;&gt;How it fits together: one run&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;#the-pm-view-what-changes&quot;&gt;The PM view: what changes&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;/p&gt;&lt;/details&gt;&lt;p&gt;&lt;/p&gt;
&lt;h2 id=&quot;what-always-on-means-to-the-user&quot;&gt;What “always-on” means to the user&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;It’s proactive.&lt;/strong&gt; You don’t open an app to ask it something. A flight confirmation lands in your inbox, and before you’ve even thought about where to stay, it has noticed that you haven’t booked a hotel yet.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;It’s persistent.&lt;/strong&gt; It remembers that you like the aisle seat, that your sister’s birthday is on Tuesday, and that you already turned down that conference, so it won’t ask again. It isn’t just keeping old chats around. It’s learning how you like things done, the way a good assistant does after a few months with you.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;It follows through.&lt;/strong&gt; When you say “remind me to book a hotel”, it doesn’t fire one alarm and forget about it. It checks back on Thursday, sees that you still haven’t booked, and nudges you once.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;You can trust it on its own.&lt;/strong&gt; You can switch off for the weekend without worrying that it will reply-all to your landlord or spend money you never approved.&lt;/p&gt;
&lt;p&gt;The first is what makes it proactive. The second and third are what make it persistent. The last is why you’d keep it switched on.&lt;/p&gt;
&lt;p&gt;Here’s the twist PMs should internalise: “always on” is the experience, not the runtime. Under the hood the agent is asleep almost all the time. It wakes for a short run, does one piece of work, saves what it learned, and goes back to sleep.&lt;/p&gt;
&lt;h2 id=&quot;the-anatomy&quot;&gt;The anatomy&lt;/h2&gt;
&lt;p&gt;Eight building blocks (a more product-shaped take on &lt;a href=&quot;https://kneeraj.com/posts/2025/ai-agent-primitives&quot;&gt;the agent primitives&lt;/a&gt;). Each one is simple. The product is in how they combine.&lt;/p&gt;
&lt;h3 id=&quot;1-triggers&quot;&gt;1. Triggers&lt;/h3&gt;
&lt;p&gt;Things that wake the agent: events (a new email lands), schedules (every Saturday morning), mentions (you tag it in a chat), and follow-ups it set for itself (“check on Thursday whether the hotel is booked”). Your prompt is just one trigger among many.&lt;/p&gt;
&lt;h3 id=&quot;2-event-inbox&quot;&gt;2. Event inbox&lt;/h3&gt;
&lt;p&gt;Every trigger writes to one durable inbox, and that inbox is the source of truth. If a run crashes, the event is still there to retry. Duplicates are dropped by their source ID, so one email never becomes two replies. Three quick messages from you can be batched into one run instead of three.&lt;/p&gt;
&lt;h3 id=&quot;3-timers&quot;&gt;3. Timers&lt;/h3&gt;
&lt;p&gt;Follow-ups and schedules live in their own store. A scheduler checks for anything due and drops it into the inbox. Timers never start runs directly. Everything goes through the inbox, and that one rule keeps the system predictable.&lt;/p&gt;
&lt;h3 id=&quot;4-worker&quot;&gt;4. Worker&lt;/h3&gt;
&lt;p&gt;The worker picks up an event and starts a run: an agent session with its own transcript of messages and tool calls. If the event continues earlier work (you answered its question), it resumes that session. If it’s new, it starts fresh. Either way, the run is short, and then it stops.&lt;/p&gt;
&lt;h3 id=&quot;5-memory&quot;&gt;5. Memory&lt;/h3&gt;
&lt;p&gt;A durable store for what the agent can’t look up anywhere else: your instructions, notes about you, what it already told you (so it doesn’t nag twice), and progress on open tasks. Only a small index loads at the start of each run. Detail is pulled in on demand. The rule of thumb: store judgment, not data. Your inbox is already searchable. The fact that you ignore promo mails from one airline is not.&lt;/p&gt;
&lt;h3 id=&quot;6-dreaming&quot;&gt;6. Dreaming&lt;/h3&gt;
&lt;p&gt;An offline pass that rereads past sessions against memory. It fixes wrong notes, merges duplicates, drops stale ones, and spots patterns no single run can see, like the fact that you always book a hotel within two days of booking a flight. This is where the agent actually learns. Without it, memory slowly rots.&lt;/p&gt;
&lt;h3 id=&quot;7-permissions&quot;&gt;7. Permissions&lt;/h3&gt;
&lt;p&gt;The agent acts with your access while you’re not watching, so this layer is the product’s trust contract. Credentials sit behind a proxy, so the agent never holds your tokens. Classifiers block risky actions. And anything that matters, like sending a reply or paying for a room, becomes a deferred call: the run pauses and asks you, and your answer arrives later as a new event in the inbox. Nobody sits waiting on a spinner.&lt;/p&gt;
&lt;h3 id=&quot;8-outbox&quot;&gt;8. Outbox&lt;/h3&gt;
&lt;p&gt;Every run ends in one of three ways: a message, an approval ask, or nothing at all. Silence is a valid output, and often the right one.&lt;/p&gt;
&lt;h2 id=&quot;how-it-fits-together-one-run&quot;&gt;How it fits together: one run&lt;/h2&gt;
&lt;pre class=&quot;astro-code astro-code-themes min-light night-owl&quot; style=&quot;background-color:#ffffff;--shiki-dark-bg:#011627;color:#24292eff;--shiki-dark:#d6deeb; overflow-x: auto; white-space: pre-wrap; word-wrap: break-word;&quot; tabindex=&quot;0&quot; data-language=&quot;text&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span&gt;[Triggers]  email · calendar · schedule · mention&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;     │&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;     ▼&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;[Event inbox] ◄── [Timers] ◄── follow-ups the agent sets ◄──┐&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;     │                                                       │&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;     ▼                                                       │&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;[Worker] ── loads ──► [Memory]  ◄── [Dreaming, offline]      │&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;     │   ── checks ─► [Permissions]                          │&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;     ▼                                                       │&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;[Outbox]  message · approval ask · nothing ──────────────────┘&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Say you book a flight to Goa for 12 December.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Trigger.&lt;/strong&gt; The confirmation email lands, and an event goes into the inbox.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Worker + memory.&lt;/strong&gt; The agent wakes and loads its memory index: you like staying near the beach, you have a nightly budget, and you asked it to shortlist hotels but never book without asking.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Work.&lt;/strong&gt; It checks your calendar and mail. No hotel yet. It shortlists three.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Permissions.&lt;/strong&gt; Booking spends money, so it’s a deferred call. Outbox: “Three options for Goa. Want me to book the first one?” The run ends.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Timer.&lt;/strong&gt; It sets a follow-up: if there’s no answer by Thursday, nudge once.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Resume.&lt;/strong&gt; Two hours later you reply “yes, the first one”. That’s a new event, so the same session resumes, books the room, confirms, and writes “Goa trip: hotel booked” to memory. The Thursday nudge never fires.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Dreaming.&lt;/strong&gt; That night, it notices this is your third trip this year where you picked the beachside option under budget, and sharpens its notes.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The same skeleton runs everything else. A &lt;strong&gt;Saturday newsletter digest&lt;/strong&gt; is a schedule trigger, a read, a summary and one message. &lt;strong&gt;Email triage&lt;/strong&gt; is an event trigger that drafts replies and asks before sending. An &lt;strong&gt;event reminder&lt;/strong&gt; is a calendar event plus a timer: a message the evening before with what you need to prepare, and silence if you’ve already done it.&lt;/p&gt;
&lt;h2 id=&quot;the-pm-view-what-changes&quot;&gt;The PM view: what changes&lt;/h2&gt;
&lt;p&gt;The product surface moves from the chat box to the moment of interruption. Quality is no longer about how good the answer to a prompt is. It’s whether the agent picks the right moment, says the right thing, and stays out of the way the rest of the time.&lt;/p&gt;
&lt;p&gt;What I’d measure:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Event to action time:&lt;/strong&gt; how fast the agent turns a signal into something useful.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Loops closed without the user:&lt;/strong&gt; outcomes finished end to end.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Interrupts per useful outcome:&lt;/strong&gt; lower is better.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Ping action rate:&lt;/strong&gt; how often a message leads you to do something.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Wrong-action rate:&lt;/strong&gt; anything sent, booked or said that you had to undo.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;A great always-on agent is mostly invisible. You notice it in two moments: when it saves you, and when it should have stayed quiet.&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;&lt;strong&gt;Sources&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Anthropic, “&lt;a href=&quot;https://claude.com/blog/building-always-on-agents&quot;&gt;Building always-on agents&lt;/a&gt;”&lt;/li&gt;
&lt;li&gt;Anthropic, “&lt;a href=&quot;https://anthropic.com/engineering/components-of-agent-memory&quot;&gt;Components of agent memory&lt;/a&gt;”&lt;/li&gt;
&lt;/ul&gt;</content:encoded><category>ai-agents</category><category>business-of-ai</category></item><item><title>AI PM Product Strategy Case Study: How Perplexity Grew to $1B in Annualised Revenue</title><link>https://kneeraj.com/posts/2026/perplexity-revenue-growth-case-study/</link><guid isPermaLink="true">https://kneeraj.com/posts/2026/perplexity-revenue-growth-case-study/</guid><description>How did Perplexity go from a commoditised answer engine to $1B in annualised revenue? A product manager&apos;s read on the shift to trusted workflows, the strategy takeaways, and my ideas to grow revenue further.</description><pubDate>Sun, 22 Nov 2026 04:30:00 GMT</pubDate><content:encoded>&lt;h2 id=&quot;table-of-contents&quot;&gt;Table of Contents&lt;/h2&gt;
&lt;p&gt;&lt;/p&gt;&lt;details&gt;&lt;summary&gt;Open Table of Contents&lt;/summary&gt;&lt;p&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;#introduction&quot;&gt;Introduction&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;#the-shift-from-answer-engine-to-trusted-workflows&quot;&gt;The shift: from answer engine to trusted workflows&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;#key-takeaways-for-product-strategy&quot;&gt;Key takeaways for product strategy&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;#my-ideas-to-grow-revenue-further&quot;&gt;My ideas to grow revenue further&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;/p&gt;&lt;/details&gt;&lt;p&gt;&lt;/p&gt;
&lt;h2 id=&quot;introduction&quot;&gt;Introduction&lt;/h2&gt;
&lt;p&gt;Perplexity recently announced &lt;strong&gt;$1B in annualised revenue&lt;/strong&gt;. I started digging in, because it is a fascinating journey: from an &lt;em&gt;answer engine over web data&lt;/em&gt;, a use case that is fast becoming a commodity, to a business at this scale. Press reports say it started 2026 below $250M and crossed $750M by August.&lt;/p&gt;
&lt;p&gt;So where is the money coming from, and what can a product person learn from it? This post is my attempt to answer that, followed by a few ideas of my own on how to grow revenue even further.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Two caveats. “Annualised” is a run rate (current revenue extrapolated over a year), not recognised revenue. And Perplexity has not published a breakdown by product, so this is my read of public information, not insider data.&lt;/em&gt;&lt;/p&gt;
&lt;h2 id=&quot;the-shift-from-answer-engine-to-trusted-workflows&quot;&gt;The shift: from answer engine to trusted workflows&lt;/h2&gt;
&lt;p&gt;Perplexity started as an answer engine: search infrastructure plus &lt;a href=&quot;https://kneeraj.com/posts/2025/mcp-and-llms-with-tools&quot;&gt;LLMs with tools&lt;/a&gt;, giving cited answers over web data. Good, but consumers can now get that almost anywhere. Here are the key steps I see in how it moved up:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Chose the right customer.&lt;/strong&gt; It focused on people who need &lt;em&gt;trustworthy, source-backed&lt;/em&gt; answers (finance, VC/PE, consulting, GTM teams), not on the casual consumer who just wants a quick answer.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Added trusted, proprietary data.&lt;/strong&gt; Partnerships with sources like Bloomberg, FactSet, PitchBook, Statista and Crunchbase. Anyone can search the open web, but not everyone can search licensed data.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Moved from answers to completed workflows.&lt;/strong&gt; With &lt;strong&gt;Computer&lt;/strong&gt;, the job is end-to-end research (analyse a company, produce the report), not a single answer. Finance shows this well: trusted data connectors, repeatable workflows like company tearsheets and sourcing screens, source traceability, and integration into Excel, Teams and the Agent API.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Used the API as distribution.&lt;/strong&gt; Instead of acquiring every customer itself, Perplexity lets companies with their own distribution build on its intelligence. Their usage becomes its revenue.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;The result is a portfolio that monetises in four ways:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Consumer subscriptions&lt;/strong&gt; (answer engine on web data)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Enterprise / team subscriptions&lt;/strong&gt; (answer engine on trusted data)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Computer&lt;/strong&gt;: usage-based credits for end-to-end workflows&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;API&lt;/strong&gt;: companies building intelligence products on top&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;key-takeaways-for-product-strategy&quot;&gt;Key takeaways for product strategy&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;1. Commodity use cases cap revenue.&lt;/strong&gt; When every competitor gives a decent cited answer for free, you cannot charge much for it. Growth came from moving to customers who pay for trust.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;2. Sell the job done, not the answer.&lt;/strong&gt; An answer is a feature. A finished tearsheet or investment memo is a completed job, and a completed job can be priced on usage and value. That is why Computer’s credit model works.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;3. Differentiation gets the sale, defensibility keeps the customer.&lt;/strong&gt; This is the lens I find most useful. My rating of Perplexity’s advantages:&lt;/p&gt;





























&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Advantage&lt;/th&gt;&lt;th&gt;Defensibility&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;Source-backed AI answers&lt;/td&gt;&lt;td&gt;Low&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Access to financial-data partners&lt;/td&gt;&lt;td&gt;Medium&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Proprietary search infrastructure&lt;/td&gt;&lt;td&gt;Medium&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Enterprise integrations and workflows&lt;/td&gt;&lt;td&gt;Medium to high&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;API integrations into customer products&lt;/td&gt;&lt;td&gt;Medium to high&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;
&lt;p&gt;Imagine a private equity firm using Computer every day to screen targets with licensed PitchBook data, apply its own investment criteria, generate standard investment committee memos, and store reusable workflows. After six months, switching to ChatGPT means recreating integrations, workflows, permissions, templates and accumulated memory. &lt;strong&gt;The more embedded the product, the harder it is to replace.&lt;/strong&gt; The levers that grow revenue here are the same ones that build the moat.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;4. Let partners carry distribution.&lt;/strong&gt; The API turns customers’ existing reach into Perplexity’s growth, with no acquisition cost.&lt;/p&gt;
&lt;h2 id=&quot;my-ideas-to-grow-revenue-further&quot;&gt;My ideas to grow revenue further&lt;/h2&gt;
&lt;p&gt;I start the way I always do, with the &lt;strong&gt;growth equation&lt;/strong&gt;, so every idea maps to a variable I can move:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Consumer = free users × conversion rate × ARPU&lt;/li&gt;
&lt;li&gt;Business = customers × avg. seats × ARPU + usage-based revenue&lt;/li&gt;
&lt;li&gt;API = customers × billable usage per customer&lt;/li&gt;
&lt;li&gt;…minus churn&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Revenue grows in three ways: acquire new customers, expand revenue from existing ones, or reduce churn. I prioritise on impact, margin, confidence, effort and speed. &lt;strong&gt;My bias: for a fast uptick, start with expansion revenue.&lt;/strong&gt; The customers and trust are already there, while new-customer acquisition is slower and costlier.&lt;/p&gt;
&lt;p&gt;Here are the top four opportunities I would explore:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;1. Free-to-paid conversion.&lt;/strong&gt; Give free users a small bucket of Computer credits so they feel an end-to-end workflow. Workflows burn credits fast, which creates a natural upgrade moment. Pair it with time-limited Pro/Max trials for high-intent users (people researching companies and financials), and contextual nudges such as “you analysed five companies, want this as a weekly report?”&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;2. Cross-sell.&lt;/strong&gt; Ask which unsolved problem an existing customer has that another product could solve. Intent signals point the way: enterprise search users running company research → Computer; enterprise accounts building internal tools → API. Size it as &lt;em&gt;eligible customers × attach rate × incremental ARR&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;3. Upsell.&lt;/strong&gt; Find power users and customers hitting limits, then offer higher tiers with better models, more quota, more trusted sources, more connectors and indexing of internal company knowledge. That last one raises switching costs too.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;4. Usage-based growth on Computer.&lt;/strong&gt; Get customers to run more workflows, more often, on bigger jobs: recurring workflow templates, templates a teammate can remix and the next team can adopt, and longer-running deep research. It compounds, because more usage means more embedded workflows, higher switching costs and lower churn.&lt;/p&gt;
&lt;p&gt;What would you prioritise differently? I would love to hear your take.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Sources:&lt;/strong&gt; the $1B run-rate comment was made by Perplexity’s CEO on November 16, 2026, as reported in press coverage (&lt;a href=&quot;https://fourweekmba.com/ai-perplexity-hits-1b-run-rate-with-5x-lower-burn-ceo-says/&quot;&gt;FourWeekMBA&lt;/a&gt;, &lt;a href=&quot;https://aimagazine.com/news/perplexity-ai-answer-engine-tops-us-750m-run-rate&quot;&gt;AI Magazine&lt;/a&gt;). The growth trajectory comes from reports by The Information and the Financial Times. These are company claims and press-reported figures, not audited results.&lt;/p&gt;</content:encoded><category>business-of-ai</category><category>product-management</category></item><item><title>Building a System of AI Agents with Grok Bot</title><link>https://kneeraj.com/posts/2026/system-of-ai-agents-grok-bot/</link><guid isPermaLink="true">https://kneeraj.com/posts/2026/system-of-ai-agents-grok-bot/</guid><description>How I set up Grok Bot as a system of agents: a chief of staff, shared computer, connectors, and routines that take a task from outline to review.</description><pubDate>Thu, 29 Oct 2026 04:30:00 GMT</pubDate><content:encoded>&lt;p&gt;Grok Bot is one of the best AI products I have used since Claude Code CLI first showed up and things just worked. This note is about the system of agents I run on it, not a single chatbot.&lt;/p&gt;
&lt;div style=&quot;margin: 1.5rem 0; max-width: 100%; overflow: hidden;&quot;&gt;
  &lt;div style=&quot;position: relative; width: 100%; max-width: 640px; margin: 0 auto; padding-bottom: 56.25%; height: 0;&quot;&gt;
    &lt;iframe style=&quot;position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 0;&quot; src=&quot;https://www.youtube.com/embed/PbdbxF_0ABY&quot; title=&quot;YouTube video player&quot; allow=&quot;accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture&quot; allowfullscreen&gt;
    &lt;/iframe&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&quot;what-grok-bot-is&quot;&gt;What Grok Bot is&lt;/h2&gt;
&lt;p&gt;Always-on agents are not a new idea. &lt;a href=&quot;https://kneeraj.com/posts/2026/setup-openclaw-personal-assistant-vps&quot;&gt;OpenClaw&lt;/a&gt; and Hermes already let you host a &lt;a href=&quot;https://kneeraj.com/posts/2026/harness-design-software-development&quot;&gt;harness&lt;/a&gt;, build agents on top, and talk to them from WhatsApp, Telegram, or another channel. Give a model a computer and the right infrastructure and it can do a lot. Those systems still feel built for a hacker. Grok Bot is the first one I have used that feels built for everyone.&lt;/p&gt;
&lt;p&gt;I use the Mac app (there is an iPhone app too). It is a simple chat surface. Under that, a bot is a special-purpose agent. Mine include:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;A &lt;strong&gt;chief of staff&lt;/strong&gt;, the only one I talk to most of the time. It delegates.&lt;/li&gt;
&lt;li&gt;A &lt;strong&gt;deep research&lt;/strong&gt; bot, for a topic I want turned into something I can actually read.&lt;/li&gt;
&lt;li&gt;An &lt;strong&gt;AI learner&lt;/strong&gt;, for the harness and product topics I am trying to understand.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The infrastructure is the part that matters. The bots share a computer that stays on. They can use a browser, run code, and create files, diagrams, and videos on that machine. I have connected the accounts I already live in: Gmail, GitHub, X, Vercel, and others. A routine is just a sentence. “Every Sunday, do this” becomes a scheduled task.&lt;/p&gt;
&lt;p&gt;The behavior that changed how I think about the product: I can tell the chief of staff to pass a message to deep research, and it actually sends that message. The bots work as a team. Risky actions stay behind an approval, and email is drafted rather than sent.&lt;/p&gt;
&lt;h2 id=&quot;a-system-not-a-pile-of-agents&quot;&gt;A system, not a pile of agents&lt;/h2&gt;
&lt;p&gt;A stack of agents does not make you faster if you are the one moving context between them and reviewing every output. That is the old productivity problem from &lt;em&gt;Getting Things Done&lt;/em&gt;: where a task gets filed, who picks it up, and what gets delegated.&lt;/p&gt;
&lt;p&gt;The unlock is a system that already holds the context and the orchestration. I hand over the task. I do not re-brief five tools.&lt;/p&gt;
&lt;p&gt;The same idea applies to the size of the work. Automating tiny chores is fine. The gains show up when an end-to-end job disappears. I have tried blog pipelines that made me hop from a draft, to Claude Code, to a Vercel deploy, to a review. With this setup I brainstorm the topic and the outline, and a pull request with a preview is waiting. I review the result and merge. The more of the day that works like that, the more the job becomes delegation and judgment.&lt;/p&gt;
&lt;p&gt;That is the same pattern as a good manager. You do not assign one task to ten people. You hand it to one person who already knows the specialists. People who are already good at managing will probably get more out of this, faster.&lt;/p&gt;
&lt;h2 id=&quot;what-i-actually-gave-it&quot;&gt;What I actually gave it&lt;/h2&gt;
&lt;p&gt;In the walkthrough I dropped a handful of tasks on the chief of staff and let it decide who should do what:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Deep research on AI eval platforms, with Raindrop as one of the examples I named&lt;/li&gt;
&lt;li&gt;A look at a newly launched competitor&lt;/li&gt;
&lt;li&gt;What people on X had been saying over the last 30 days&lt;/li&gt;
&lt;li&gt;A site audit of my own site&lt;/li&gt;
&lt;li&gt;Product-marketing ideas&lt;/li&gt;
&lt;li&gt;A learning brief from the AI learner&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Each one showed up as a task, with notes, and then a result. The learning brief came back as a doc I could read in place. My Drive and Notion are connected, so the output is not trapped in a chat transcript. I did not stop to check which model wrote it. The doc was good enough to read.&lt;/p&gt;
&lt;p&gt;I have not yet given it a task that failed on the first try. That is a very different experience from Claude chat, Claude Code, or Cowork, and from Hermes and OpenClaw, where I still spend a lot of effort assembling the system. The north star for any AI product is that it just works.&lt;/p&gt;</content:encoded><category>ai-agents</category><category>productivity</category><category>open-source</category></item><item><title>A local voice-to-text device on an ESP32</title><link>https://kneeraj.com/posts/2026/esp32-local-voice-to-text/</link><guid isPermaLink="true">https://kneeraj.com/posts/2026/esp32-local-voice-to-text/</guid><description>A small hardware experiment: an ESP32-C6 with a microphone sends audio to a Mac, and NVIDIA Parakeet transcribes it locally.</description><pubDate>Tue, 06 Oct 2026 04:30:00 GMT</pubDate><content:encoded>&lt;p&gt;A quick hardware experiment. I wanted speech transcription that never leaves my own machines: a small board captures audio, my Mac does the transcription.&lt;/p&gt;
&lt;div style=&quot;margin: 1.5rem 0; max-width: 100%; overflow: hidden;&quot;&gt;
  &lt;div style=&quot;position: relative; width: 100%; max-width: 640px; margin: 0 auto; padding-bottom: 56.25%; height: 0;&quot;&gt;
    &lt;iframe style=&quot;position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 0;&quot; src=&quot;https://www.youtube.com/embed/l9fsYQ34i-g&quot; title=&quot;YouTube video player&quot; allow=&quot;accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture&quot; allowfullscreen&gt;
    &lt;/iframe&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&quot;the-board&quot;&gt;The board&lt;/h2&gt;
&lt;p&gt;The device is an ESP32-C6 (a PCB Cupid GLYPH C6) with a microphone and a battery. I flashed firmware onto it. Click the BOOT button to start recording, click again to stop.&lt;/p&gt;
&lt;p&gt;Audio goes over Wi-Fi to my Mac. NVIDIA’s Parakeet speech model runs locally and turns it into text. Nothing is sent to a transcription API. In the demo I just talked at it (“hello”, “mic testing”) and the text showed up on the computer.&lt;/p&gt;
&lt;p&gt;The board is more capable than this one trick. I want to do more small hardware projects with it.&lt;/p&gt;
&lt;p&gt;This sits next to the Mac dictation setup I have been using with Muesli. Same idea, different box: keep the audio on hardware I control, and let a local model do the recognition.&lt;/p&gt;</content:encoded><category>speech-to-text</category></item><item><title>Speech to text on a Mac, with a model I choose</title><link>https://kneeraj.com/posts/2026/speech-to-text-mac-muesli/</link><guid isPermaLink="true">https://kneeraj.com/posts/2026/speech-to-text-mac-muesli/</guid><description>How I dictate on a Mac with the open source Muesli app: local models when they are good enough, and GPT-4o mini transcribe when I want fewer corrections.</description><pubDate>Tue, 29 Sep 2026 04:30:00 GMT</pubDate><content:encoded>&lt;p&gt;I dictate on my Mac almost for free. The app is &lt;a href=&quot;https://github.com/kn-neeraj/muesli-dictation-app&quot;&gt;Muesli&lt;/a&gt;, an open source dictation app, and the useful part is that I can pick the model.&lt;/p&gt;
&lt;div style=&quot;margin: 1.5rem 0; max-width: 100%; overflow: hidden;&quot;&gt;
  &lt;div style=&quot;position: relative; width: 100%; max-width: 640px; margin: 0 auto; padding-bottom: 56.25%; height: 0;&quot;&gt;
    &lt;iframe style=&quot;position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 0;&quot; src=&quot;https://www.youtube.com/embed/0TkN-Mw2FJU&quot; title=&quot;YouTube video player&quot; allow=&quot;accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture&quot; allowfullscreen&gt;
    &lt;/iframe&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&quot;local-first-then-a-cloud-model-when-local-is-not-enough&quot;&gt;Local first, then a cloud model when local is not enough&lt;/h2&gt;
&lt;p&gt;Muesli already exposes open source models that run on the machine. I used NVIDIA Parakeet for a while. It was not accurate enough for how I talk, especially once sentences get long.&lt;/p&gt;
&lt;p&gt;Muesli is open source, so I added a small change: choose OpenAI, paste an API key, and the OpenAI transcription models show up next to the local ones. I have been using GPT-4o mini transcribe. The full GPT-4o transcribe model is a bit more accurate and a bit slower. For dictation I care about both, and mini is the better balance. The same slot can also take a model through OpenRouter.&lt;/p&gt;
&lt;p&gt;The bill for about two months of this was around $0.30. Low to medium usage, but that is the point. Dictation only works if I actually leave it on.&lt;/p&gt;
&lt;p&gt;I first tried this as a fast-speech hack two months earlier, in the video about GPT-4o mini transcribe. This is the same setup after I had lived with it long enough to know the cost. There are plenty of polished dictation apps. This one lets me swap the model, including a local one, instead of locking me into a single vendor.&lt;/p&gt;</content:encoded><category>speech-to-text</category></item><item><title>Talking to a Mac with GPT-4o mini transcribe</title><link>https://kneeraj.com/posts/2026/mac-dictation-gpt-4o-mini-transcribe/</link><guid isPermaLink="true">https://kneeraj.com/posts/2026/mac-dictation-gpt-4o-mini-transcribe/</guid><description>A small change to the open source Muesli app so Mac dictation can use OpenAI&apos;s GPT-4o mini transcribe when a local model mangles fast speech.</description><pubDate>Mon, 03 Aug 2026 04:30:00 GMT</pubDate><content:encoded>&lt;p&gt;I talk to my Mac and want the text dropped into whatever editor is focused. The open source app I use for that is Muesli. It ships with local speech-to-text models. Parakeet was the one I reached for, and it fell apart when I spoke quickly. I was spending the time I had saved on corrections.&lt;/p&gt;
&lt;div style=&quot;margin: 1.5rem 0; max-width: 100%; overflow: hidden;&quot;&gt;
  &lt;div style=&quot;position: relative; width: 100%; max-width: 640px; margin: 0 auto; padding-bottom: 56.25%; height: 0;&quot;&gt;
    &lt;iframe style=&quot;position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 0;&quot; src=&quot;https://www.youtube.com/embed/Hca-FDXqmxg&quot; title=&quot;YouTube video player&quot; allow=&quot;accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture&quot; allowfullscreen&gt;
    &lt;/iframe&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&quot;the-change&quot;&gt;The change&lt;/h2&gt;
&lt;p&gt;Muesli is open source, so I changed it to call OpenAI’s GPT-4o mini transcribe. In the demo I talked fast, on purpose, and the transcript landed without a pile of edits. That is the bar. If I have to rewrite the sentence, I should have typed it.&lt;/p&gt;
&lt;p&gt;The usage meter in that session showed 7 requests and 693 tokens. Even a much heavier day, on the order of 20 to 30 thousand tokens, still looked like less than a dollar. I kept using it. A later video covers the two-month bill, about $0.30, and OpenRouter as another way to bring a model.&lt;/p&gt;
&lt;p&gt;The code I pointed at from the video is &lt;a href=&quot;https://github.com/kn-neeraj/muesli-dictation-app&quot;&gt;kn-neeraj/muesli-dictation-app&lt;/a&gt;.&lt;/p&gt;</content:encoded><category>speech-to-text</category></item><item><title>Learning harness engineering with LangChain Deep Agents (1/10)</title><link>https://kneeraj.com/posts/2026/learning-harness-engineering-langchain-deep-agents/</link><guid isPermaLink="true">https://kneeraj.com/posts/2026/learning-harness-engineering-langchain-deep-agents/</guid><description>Week one of a ten-week series: how the LangChain Deep Agents harness is assembled, and what a deep-research trace looks like in LangSmith.</description><pubDate>Sun, 02 Aug 2026 04:30:00 GMT</pubDate><content:encoded>&lt;p&gt;A friend asked how I would evaluate a long-running agent that burns thousands of turns and tool calls. I did not have a good answer. The agents I have shipped are mostly vertical B2B agents, not coding agents that run for a long time. This series is me learning that in public, on LangChain’s Deep Agents harness.&lt;/p&gt;
&lt;div style=&quot;margin: 1.5rem 0; max-width: 100%; overflow: hidden;&quot;&gt;
  &lt;div style=&quot;position: relative; width: 100%; max-width: 640px; margin: 0 auto; padding-bottom: 56.25%; height: 0;&quot;&gt;
    &lt;iframe style=&quot;position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 0;&quot; src=&quot;https://www.youtube.com/embed/KmAJmdvPGZY&quot; title=&quot;YouTube video player&quot; allow=&quot;accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture&quot; allowfullscreen&gt;
    &lt;/iframe&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&quot;what-i-want-out-of-the-ten-weeks&quot;&gt;What I want out of the ten weeks&lt;/h2&gt;
&lt;p&gt;Deep Agents is an open source harness. I am working from my own fork. By harness I mean the agent loop plus the primitives a modern coding agent needs: sub-agents, a filesystem, context management, a shell, skills.&lt;/p&gt;
&lt;p&gt;The plan for the series:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Read the Deep Agents harness until the pieces fit together.&lt;/li&gt;
&lt;li&gt;Get comfortable evaluating long-running agents, using LangSmith to read traces.&lt;/li&gt;
&lt;li&gt;Run it on a public benchmark. τ-bench is the one I have in mind. I have not picked yet.&lt;/li&gt;
&lt;li&gt;Change the harness and see if the score moves, ideally on a weaker model where the failure is easier to see.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Coding-agent harnesses (Claude Code, Codex, and the rest) are ahead of most other agents. They are a good place to study. I wrote a shorter version of the design principles, from a different talk, in &lt;a href=&quot;https://kneeraj.com/posts/2026/harness-design-software-development&quot;&gt;harness design for software development&lt;/a&gt;. This series is the code.&lt;/p&gt;
&lt;h2 id=&quot;three-layers&quot;&gt;Three layers&lt;/h2&gt;
&lt;p&gt;The core loop is still model, tools, and repeat. The scaffolding around that loop is what lets a stronger model finish a long task reliably. When a lab ships a more capable model, they also have to ship the primitives that show the model off: instructions, memory, skills, a filesystem, compaction.&lt;/p&gt;
&lt;p&gt;Deep Agents sits on three layers. From the bottom:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;LangGraph runtime.&lt;/strong&gt; This is the engine. It stores each step of the loop so a run can resume if something fails.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;LangChain framework.&lt;/strong&gt; The interfaces: a chat model (I can pass GPT-4.1 mini or something stronger), tools as functions, and external tools such as Tavily for web search.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Deep Agents harness.&lt;/strong&gt; Middleware and a backend on top of those two. It injects memory, skills, the filesystem, and sub-agents, and it handles summarization.&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&quot;a-deep-research-agent-as-the-example&quot;&gt;A deep-research agent, as the example&lt;/h2&gt;
&lt;p&gt;Week one uses the deep-research example in the Deep Agents repo. It is the same shape as a ChatGPT-style deep research run, simpler than the production version.&lt;/p&gt;
&lt;p&gt;The orchestrator is built from a model, tools, a system prompt, sub-agents, backends, and skills. The instructions tell it to plan, save that plan as a todo list, spawn dedicated research sub-agents, synthesize, and verify. A research sub-agent does not spawn further agents. It can search and it can think, and it can loop for a while. The parent can spawn as many as the task needs.&lt;/p&gt;
&lt;p&gt;Give it “quantum computing breakthroughs in 2024” and the model, not me, decides the split: history, current results, outlook. Each sub-agent searches and thinks until it is done. The parent writes the report. In &lt;code&gt;agent.py&lt;/code&gt; that is a small constructor. The research workflow lives in the system instructions the agent actually follows.&lt;/p&gt;
&lt;h2 id=&quot;what-the-langsmith-trace-showed&quot;&gt;What the LangSmith trace showed&lt;/h2&gt;
&lt;p&gt;I ran that prompt in LangSmith with GPT-4.1 mini. The waterfall was about 60 seconds.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;A few seconds of the main agent deciding what to do with the task.&lt;/li&gt;
&lt;li&gt;It spawned a research sub-agent with a query I had not written: a comprehensive pass on the latest advancements and key discoveries.&lt;/li&gt;
&lt;li&gt;That sub-agent ran for about 50 of the 60 seconds. Inside it: todos, Tavily search, a think tool, then search again.&lt;/li&gt;
&lt;li&gt;The orchestrator spent the remaining seconds synthesizing the final report.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The report itself was not the lesson. The lesson is that a short prompt becomes a long trajectory the model invents. Traces get huge, and the agent picks its own path. Evaluating that, with an LLM judge and with a human reading the trace, is the actual harness-engineering skill. You cannot babysit every step. You change the instructions and the tools so the next run is more reliable.&lt;/p&gt;
&lt;h2 id=&quot;what-week-two-is-for&quot;&gt;What week two is for&lt;/h2&gt;
&lt;p&gt;Next I want a verifier skill on this same research agent: an independent check of the report, then a look at the traces. I want to compare when GPT-4.1 mini invokes that skill with when a stronger model (I am planning to use GPT-5.5) does. As models get better they eat parts of the harness. The harness for a task you already understand should get thinner. The tasks you point the agent at should get more ambitious, because the model can finally hold them.&lt;/p&gt;</content:encoded><category>ai-agents</category><category>evals</category></item><item><title>Agentic Summit BLR: 4 Key Takeaways</title><link>https://kneeraj.com/posts/2026/agentic-summit-bangalore/</link><guid isPermaLink="true">https://kneeraj.com/posts/2026/agentic-summit-bangalore/</guid><description>Four insights from the Agentic Summit in Bangalore on building AI agents, from ambitious student projects to the evolving role of engineers as agent managers.</description><pubDate>Thu, 23 Jul 2026 04:30:00 GMT</pubDate><content:encoded>&lt;p&gt;Spent yesterday at the Agentic Summit in Bangalore. Here are four things that stood out:&lt;/p&gt;
&lt;h2 id=&quot;1-think-way-more-ambitious&quot;&gt;1. Think Way More Ambitious&lt;/h2&gt;
&lt;p&gt;Met 2 young kids from PES university coding research papers and building an RL platform from scratch. The lesson: &lt;strong&gt;models are already good — think way more ambitious.&lt;/strong&gt; If undergrads can tackle this, your scope might be too small.&lt;/p&gt;
&lt;img src=&quot;https://kneeraj.com/assets/img/2026/agentic-summit-blr/rl-sandbox.jpeg&quot; alt=&quot;RL sandbox task tracker built by PES students&quot; style=&quot;width: 100%; height: auto; border: 3px solid #ddd; box-shadow: 0 4px 8px rgba(0,0,0,0.1);&quot;&gt;
&lt;h2 id=&quot;2-everyone-is-becoming-a-manager&quot;&gt;2. Everyone is becoming a manager&lt;/h2&gt;
&lt;p&gt;A Google DeepMind engineer made a sharp point: &lt;strong&gt;everyone is now a manager of agents.&lt;/strong&gt; Your job isn’t just coding anymore — it’s verification, evals, and judgment calls on agent output.&lt;/p&gt;
&lt;img src=&quot;https://kneeraj.com/assets/img/2026/agentic-summit-blr/engineer-manager.jpeg&quot; alt=&quot;Slide showing &amp;#x27;Every Engineer is Becoming a Manager&amp;#x27;&quot; style=&quot;width: 100%; height: auto; border: 3px solid #ddd; box-shadow: 0 4px 8px rgba(0,0,0,0.1);&quot;&gt;
&lt;h2 id=&quot;3-observability-is-the-new-land-grab&quot;&gt;3. Observability Is the New Land Grab&lt;/h2&gt;
&lt;p&gt;Multiple talks emphasized that &lt;strong&gt;observability is the new competitive moat&lt;/strong&gt;, with traces becoming the critical data asset. If you’re building agents, instrument everything.&lt;/p&gt;
&lt;img src=&quot;https://kneeraj.com/assets/img/2026/agentic-summit-blr/traces_analysis.png&quot; alt=&quot;Agent traces analysis dashboard showing trace overview and metrics&quot; style=&quot;width: 100%; height: auto; border: 3px solid #ddd; box-shadow: 0 4px 8px rgba(0,0,0,0.1);&quot;&gt;
&lt;h2 id=&quot;4-resource-principles-of-building-ai-agents&quot;&gt;4. Resource: Principles of Building AI Agents&lt;/h2&gt;
&lt;p&gt;Picked a nice bedtime read as well.&lt;/p&gt;
&lt;img src=&quot;https://kneeraj.com/assets/img/2026/agentic-summit-blr/principles-building-ai-agents.jpeg&quot; alt=&quot;Principles of Building AI Agents book cover&quot; style=&quot;width: 100%; height: auto; border: 3px solid #ddd; box-shadow: 0 4px 8px rgba(0,0,0,0.1);&quot;&gt;</content:encoded><category>ai-agents</category><category>events</category><category>llm-engineering</category></item><item><title>Hermes hackathon: a YouTube growth agent called Tubesmith</title><link>https://kneeraj.com/posts/2026/hermes-hackathon-tubesmith/</link><guid isPermaLink="true">https://kneeraj.com/posts/2026/hermes-hackathon-tubesmith/</guid><description>A hackathon demo of Tubesmith, a YouTube growth agent on self-hosted Hermes that turns one video into Shorts with research, cutting, and SEO sub-agents.</description><pubDate>Sun, 12 Jul 2026 04:30:00 GMT</pubDate><content:encoded>&lt;p&gt;This is Tubesmith, a YouTube growth agent I ran for a Hermes hackathon. It lives on Hermes, on infrastructure I host myself. Give it a video id and it comes back with Shorts.&lt;/p&gt;
&lt;div style=&quot;margin: 1.5rem 0; max-width: 100%; overflow: hidden;&quot;&gt;
  &lt;div style=&quot;position: relative; width: 100%; max-width: 640px; margin: 0 auto; padding-bottom: 56.25%; height: 0;&quot;&gt;
    &lt;iframe style=&quot;position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 0;&quot; src=&quot;https://www.youtube.com/embed/ZCwbHGx5lPo&quot; title=&quot;YouTube video player&quot; allow=&quot;accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture&quot; allowfullscreen&gt;
    &lt;/iframe&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&quot;one-video-in-shorts-out&quot;&gt;One video in, Shorts out&lt;/h2&gt;
&lt;p&gt;Tubesmith orchestrates three sub-agents: Reels, SEO, and Research. In the demo I handed it a YouTube id. Hermes ran the orchestrator, which pulled in the reel agent and the SEO agent.&lt;/p&gt;
&lt;p&gt;The run downloaded the video, looked for the segments worth clipping, and used a model to decide where a Short should start and stop. It extracted two clips. SEO ran on them, then a polish pass finished each one. I copied the files to my Mac and played them.&lt;/p&gt;
&lt;p&gt;The first Short was about 28 seconds. It opens on a title card taken from the source video, with the channel name, then the clip, then a closing card. The second one follows the same shape.&lt;/p&gt;
&lt;p&gt;This is a different hackathon from the &lt;a href=&quot;https://kneeraj.com/posts/2026/hackathon-portkey-ai-builder-challenge&quot;&gt;Portkey AI Builder Challenge&lt;/a&gt;. That one was cost and quality on historical traffic. This one is a content agent: research the video, cut it, and package the cut so it can be published.&lt;/p&gt;</content:encoded><category>events</category><category>ai-agents</category></item><item><title>Inference Engineering 101 for Technical Product Builders</title><link>https://kneeraj.com/posts/2026/inference-engineering-101/</link><guid isPermaLink="true">https://kneeraj.com/posts/2026/inference-engineering-101/</guid><description>A practical introduction to inference engineering for product builders: why time to first token, VRAM, prompt length, and KV cache matter when shipping AI products.</description><pubDate>Wed, 01 Jul 2026 15:35:32 GMT</pubDate><content:encoded>&lt;h2 id=&quot;table-of-contents&quot;&gt;Table of Contents&lt;/h2&gt;
&lt;p&gt;&lt;/p&gt;&lt;details&gt;&lt;summary&gt;Open Table of Contents&lt;/summary&gt;&lt;p&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;#introduction&quot;&gt;Introduction&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;#youtube-walkthrough&quot;&gt;YouTube walkthrough&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;#what-is-inference-engineering&quot;&gt;What is inference engineering?&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;#why-technical-pms-should-care&quot;&gt;Why technical PMs should care&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;#what-happens-during-inference-101&quot;&gt;What happens during inference 101&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;#the-practical-experiment-gemma-3-12b-on-a-google-colab-t4-gpu&quot;&gt;The practical experiment: Gemma 3 12B on a Google Colab T4 GPU&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;#a-simple-checklist-for-technical-pms&quot;&gt;A simple checklist for technical PMs&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;/p&gt;&lt;/details&gt;&lt;p&gt;&lt;/p&gt;
&lt;h2 id=&quot;introduction&quot;&gt;Introduction&lt;/h2&gt;
&lt;p&gt;If you are building AI products, inference engineering becomes relevant much earlier than most people expect. At first, the focus is usually on model quality, prompts, and demos. But once something starts becoming a real product, a different set of questions starts showing up:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Why is the first token slow?&lt;/li&gt;
&lt;li&gt;Why does prompt length suddenly affect user experience?&lt;/li&gt;
&lt;li&gt;Why does one deployment option look cheap in a prototype and expensive in production?&lt;/li&gt;
&lt;li&gt;Why does a model work fine in one environment and fail in another?&lt;/li&gt;
&lt;li&gt;What should product and engineering teams actually measure?&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Those are inference engineering questions. This is a practical PM field note and the goal is to understand what happens behind the scenes when you call an LLM (i.e. inference) and how to make better product and platform decisions, backed by a simple Gemma 4 12B experiment on Google Colab T4 GPU instance.&lt;/p&gt;
&lt;h2 id=&quot;youtube-walkthrough&quot;&gt;YouTube walkthrough&lt;/h2&gt;
&lt;div style=&quot;margin: 1.5rem 0; max-width: 100%; overflow: hidden;&quot;&gt;
  &lt;div style=&quot;position: relative; width: 100%; max-width: 640px; margin: 0 auto; padding-bottom: 56.25%; height: 0;&quot;&gt;
    &lt;iframe style=&quot;position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 0;&quot; src=&quot;https://www.youtube.com/embed/uiMszor9SE0&quot; title=&quot;YouTube video player&quot; allow=&quot;accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture&quot; allowfullscreen&gt;
    &lt;/iframe&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&quot;what-is-inference-engineering&quot;&gt;What is inference engineering?&lt;/h2&gt;
&lt;p&gt;At a high level, inference engineering is the discipline of serving models well in real products.&lt;/p&gt;
&lt;p&gt;An LLM is not a normal web service. When a user sends a prompt, the system has to load model weights, process input tokens, build attention state, store KV cache, and generate output one token at a time. That is why inference is not just an infrastructure problem. It is also a product and business problem.&lt;/p&gt;
&lt;h2 id=&quot;why-technical-pms-should-care&quot;&gt;Why technical PMs should care&lt;/h2&gt;
&lt;p&gt;There are three practical reasons this matters.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;1. It directly affects product experience&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Users do not experience your model as a benchmark. They experience it as responsiveness, reliability, and quality under constraints.&lt;/p&gt;
&lt;p&gt;If the first token is slow, the product feels slow. If prompts are too large, cost rises and latency gets worse. If hardware is poorly matched to the workload, unit economics break. Inference engineering sits directly in that loop.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;2. It changes model and platform decisions&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Open models will likely play a role similar to open source software. They may not replace every closed model, but they will matter in the stack. That makes serving tradeoffs a product judgment problem, not just an engineering one.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;3. Most real products will end up multi-model&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;The right model depends on the task and the environment.&lt;/p&gt;
&lt;p&gt;A lightweight model on a phone, a stronger coding model on a laptop, a larger model in production, and another one on an edge device can all be part of the same architecture.&lt;/p&gt;
&lt;p&gt;That means teams need to understand how inference changes across hardware, memory budgets, context length, and latency requirements.&lt;/p&gt;
&lt;h2 id=&quot;what-happens-during-inference-101&quot;&gt;What happens during inference 101&lt;/h2&gt;
&lt;img src=&quot;https://kneeraj.com/assets/img/2026/inference-engg-101/inference-engg-behind-the-scenes.png&quot; alt=&quot;Solution Architecture&quot; style=&quot;width: 100%; height: auto; border: 3px solid #ddd; box-shadow: 0 4px 8px rgba(0,0,0,0.1);&quot;&gt;
&lt;p&gt;One clean way to think about inference is this:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;A client sends a prompt.&lt;/li&gt;
&lt;li&gt;The prompt is tokenized.&lt;/li&gt;
&lt;li&gt;The model weights are read from VRAM.&lt;/li&gt;
&lt;li&gt;The system runs a prefill pass on the input tokens.&lt;/li&gt;
&lt;li&gt;The decoder begins generating output tokens one by one.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;That sequence is simple, but it explains a lot of product behavior.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Model weights live in VRAM&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;A large fraction of GPU memory is consumed just by storing the model.&lt;/p&gt;
&lt;p&gt;In this experiment, I used Gemma 3 12B with 4-bit quantization. A rough estimate puts the model weights around 6 GB, with actual usage landing a bit higher once runtime overhead and quantization metadata are included.&lt;/p&gt;
&lt;p&gt;That estimate is useful even if you are not implementing the stack yourself. It helps you quickly judge whether a deployment path is plausible.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Prefill and decode are different phases&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;This is one of the most useful ideas in inference engineering.&lt;/p&gt;
&lt;p&gt;The prefill phase processes the input prompt. Each input token adds to attention computation and the key-value cache stored for later reuse.&lt;/p&gt;
&lt;p&gt;The decode phase is what most people experience as generation. It predicts one token at a time after prefill is done.&lt;/p&gt;
&lt;p&gt;These phases stress the system differently:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Prefill is heavily influenced by prompt length and compute.&lt;/li&gt;
&lt;li&gt;Decode speed is more tied to token-by-token generation dynamics and memory movement.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;This is why “the model feels fast” is not a single metric.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;The three practical resources to watch&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;If you want a compact operational view, I would watch these three:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;VRAM&lt;/code&gt;: Can the model and its runtime state fit?&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Compute&lt;/code&gt;: How quickly can the system process the prompt, especially during prefill?&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Memory bandwidth&lt;/code&gt;: How efficiently can the system move data during generation?&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;These are not just engineering metrics. They shape product feasibility.&lt;/p&gt;
&lt;p&gt;If VRAM is insufficient, the model does not fit cleanly. If compute is weak, prefill slows down and first-token latency rises. If bandwidth is constrained, generation throughput suffers.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;KV cache is not a side detail&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;KV cache is central to how inference works efficiently.&lt;/p&gt;
&lt;p&gt;When the model processes input tokens, it stores attention-related state in GPU memory. That cache grows with prompt length, which is one reason long-context workloads get expensive or slow.&lt;/p&gt;
&lt;p&gt;This also explains why prompt caching matters in production. If a shared prefix is reused across requests, the system can avoid recomputing the same work, improving both latency and cost.&lt;/p&gt;
&lt;h2 id=&quot;the-practical-experiment-gemma-3-12b-on-a-google-colab-t4-gpu&quot;&gt;The practical experiment: Gemma 3 12B on a Google Colab T4 GPU&lt;/h2&gt;
&lt;p&gt;The second half of the session moved from theory to a simple experiment. I used a free Tesla T4 GPU in Google Colab and loaded a 4-bit quantized Gemma 3 12B model through the Hugging Face stack.&lt;/p&gt;
&lt;img src=&quot;https://kneeraj.com/assets/img/2026/inference-engg-101/colab-experiment-setup.png&quot; alt=&quot;Colab Experiment setup&quot; style=&quot;width: 100%; height: auto; border: 3px solid #ddd; box-shadow: 0 4px 8px rgba(0,0,0,0.1);&quot;&gt;
&lt;p&gt;The setup helped answer a few grounded questions that PMs should care about:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;How much VRAM gets consumed before any real user traffic arrives?&lt;/li&gt;
&lt;li&gt;What does time to first token look like on a modest GPU?&lt;/li&gt;
&lt;li&gt;How many tokens per second do we get after generation starts?&lt;/li&gt;
&lt;li&gt;What changes when prompt length increases?&lt;/li&gt;
&lt;/ul&gt;
&lt;img src=&quot;https://kneeraj.com/assets/img/2026/inference-engg-101/colab-metrics-1.png&quot; alt=&quot;Colab Experiment setup&quot; style=&quot;width: 100%; height: auto; border: 3px solid #ddd; box-shadow: 0 4px 8px rgba(0,0,0,0.1);&quot;&gt;
&lt;p&gt;The numbers were directionally clear:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The model occupied roughly half of the T4’s available VRAM after load.&lt;/li&gt;
&lt;li&gt;Time to first token was noticeably sensitive to prompt length.&lt;/li&gt;
&lt;li&gt;Tokens per second stayed relatively stable compared to TTFT.&lt;/li&gt;
&lt;li&gt;KV cache grew as the prompt got longer.&lt;/li&gt;
&lt;/ul&gt;
&lt;img src=&quot;https://kneeraj.com/assets/img/2026/inference-engg-101/colab-experiment-results-2.png&quot; alt=&quot;Colab Experiment setup&quot; style=&quot;width: 100%; height: auto; border: 3px solid #ddd; box-shadow: 0 4px 8px rgba(0,0,0,0.1);&quot;&gt;
&lt;img src=&quot;https://kneeraj.com/assets/img/2026/inference-engg-101/colab-experiment-results-3.png&quot; alt=&quot;Colab Experiment setup&quot; style=&quot;width: 100%; height: auto; border: 3px solid #ddd; box-shadow: 0 4px 8px rgba(0,0,0,0.1);&quot;&gt;
&lt;p&gt;That is exactly the kind of pattern worth internalizing if you are making roadmap or platform decisions.&lt;/p&gt;
&lt;div style=&quot;margin: 1.25rem 0; padding: 1rem 1.25rem; border: 1px solid var(--border); border-radius: 12px; background: color-mix(in srgb, var(--muted) 35%, var(--background)); color: var(--foreground);&quot;&gt;
  &lt;div style=&quot;display: flex; align-items: center; gap: 0.6rem; font-weight: 700; color: var(--foreground); margin-bottom: 0.25rem;&quot;&gt;
    &lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;20&quot; height=&quot;20&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot; style=&quot;flex: 0 0 auto;&quot;&gt;
      &lt;path stroke=&quot;none&quot; d=&quot;M0 0h24v24H0z&quot; fill=&quot;none&quot;&gt;&lt;/path&gt;
      &lt;path d=&quot;M9 19c-4.3 1.4 -4.3 -2.5 -6 -3m12 5v-3.5c0 -1 .1 -1.4 -.5 -2c2.8 -.3 5.5 -1.4 5.5 -6a4.6 4.6 0 0 0 -1.3 -3.2a4.2 4.2 0 0 0 -.1 -3.2s-1.1 -.3 -3.5 1.3a12.3 12.3 0 0 0 -6.2 0c-2.4 -1.6 -3.5 -1.3 -3.5 -1.3a4.2 4.2 0 0 0 -.1 3.2a4.6 4.6 0 0 0 -1.3 3.2c0 4.6 2.7 5.7 5.5 6c-.6 .6 -.6 1.2 -.5 2v3.5&quot;&gt;&lt;/path&gt;
    &lt;/svg&gt;
    &lt;span&gt;Experiment assets&lt;/span&gt;
  &lt;/div&gt;
  &lt;div style=&quot;font-size: 0.95rem; color: var(--foreground); opacity: 0.8; margin-bottom: 0.9rem;&quot;&gt;
    Gemma 3 12B Colab notebook plus the broader inference learnings repo.
  &lt;/div&gt;
  &lt;div style=&quot;display: flex; gap: 0.75rem; flex-wrap: wrap;&quot;&gt;
    &lt;a href=&quot;https://github.com/kn-neeraj/inference-engg-learnings/blob/main/notebooks/Gemma4_12_inference.ipynb&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; style=&quot;display: inline-block; padding: 0.55rem 0.95rem; border-radius: 10px; border: 1px solid var(--accent); background: var(--accent); color: var(--background); text-decoration: none; font-weight: 700;&quot;&gt;
      View Notebook
    &lt;/a&gt;
    &lt;a href=&quot;https://github.com/kn-neeraj/inference-engg-learnings&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; style=&quot;display: inline-block; padding: 0.55rem 0.95rem; border-radius: 10px; border: 1px solid var(--border); background: transparent; color: var(--foreground); text-decoration: none; font-weight: 700;&quot;&gt;
      View Repo
    &lt;/a&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;strong&gt;Important takeaways&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;As prompt length increased, time to first token increased roughly linearly, while tokens per second stayed relatively flat.&lt;/p&gt;
&lt;p&gt;This is a useful PM anchor. It tells us:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Long prompts hurt responsiveness before generation starts.&lt;/li&gt;
&lt;li&gt;Prompt optimization is not just about saving tokens, it is about reducing prefill cost.&lt;/li&gt;
&lt;li&gt;User-perceived latency often comes from earlier in the pipeline than people assume.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;If you are building an LLM feature, this has immediate product implications. A system can feel slow even when decode speed is acceptable, simply because the prompt is doing too much work upfront.&lt;/p&gt;
&lt;h2 id=&quot;a-simple-checklist-for-technical-pms&quot;&gt;A simple checklist for technical PMs&lt;/h2&gt;
&lt;p&gt;When I look at an LLM workload now, I try to ask:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;What model are we serving?&lt;/li&gt;
&lt;li&gt;On what hardware?&lt;/li&gt;
&lt;li&gt;What precision are we using?&lt;/li&gt;
&lt;li&gt;How large are the prompts?&lt;/li&gt;
&lt;li&gt;How much KV cache growth should we expect?&lt;/li&gt;
&lt;li&gt;Is the bottleneck prefill, decode, or memory fit?&lt;/li&gt;
&lt;li&gt;Can prompt caching or architecture changes reduce waste?&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;That set of questions gets you much closer to real understanding than a generic “the model feels slow.”&lt;/p&gt;
&lt;p&gt;It also leads to better conversations with engineering teams. Instead of asking only for &lt;a href=&quot;https://kneeraj.com/posts/2025/framework-for-evaluating-ai-products&quot;&gt;eval scores&lt;/a&gt;, you start asking:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;What is our time to first token?&lt;/li&gt;
&lt;li&gt;How does it change with context length?&lt;/li&gt;
&lt;li&gt;What is our effective throughput?&lt;/li&gt;
&lt;li&gt;What is driving cost most right now?&lt;/li&gt;
&lt;li&gt;Which part of the stack is actually the bottleneck?&lt;/li&gt;
&lt;/ul&gt;</content:encoded><category>llm-engineering</category></item><item><title>A local hybrid-search memory for coding agents</title><link>https://kneeraj.com/posts/2026/local-hybrid-search-memory/</link><guid isPermaLink="true">https://kneeraj.com/posts/2026/local-hybrid-search-memory/</guid><description>Session summaries, a /summarize skill, and a local sift CLI: BM25 plus Gemma embeddings in SQLite, so an agent can search past work without rereading the repo.</description><pubDate>Sun, 14 Jun 2026 04:30:00 GMT</pubDate><content:encoded>&lt;p&gt;General-purpose coding agents are already good. Claude Code and Codex can grep, open files, and keep going. The part they do not have is my memory. This is a personal memory layer that works with whichever agent I point at a repo, and the index never leaves the machine.&lt;/p&gt;
&lt;p&gt;I wrote before about &lt;a href=&quot;https://kneeraj.com/posts/2025/ai-agent-memory-system&quot;&gt;the kinds of memory an agent needs&lt;/a&gt;, and about &lt;a href=&quot;https://kneeraj.com/posts/2026/openclaw-learnings-memory-1&quot;&gt;OpenClaw’s file-based memory&lt;/a&gt;. This is a different system: searchable session notes, built for the coding-agent loop.&lt;/p&gt;
&lt;div style=&quot;margin: 1.5rem 0; max-width: 100%; overflow: hidden;&quot;&gt;
  &lt;div style=&quot;position: relative; width: 100%; max-width: 640px; margin: 0 auto; padding-bottom: 56.25%; height: 0;&quot;&gt;
    &lt;iframe style=&quot;position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 0;&quot; src=&quot;https://www.youtube.com/embed/MB4Gu4E3fvc&quot; title=&quot;YouTube video player&quot; allow=&quot;accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture&quot; allowfullscreen&gt;
    &lt;/iframe&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&quot;why-bother&quot;&gt;Why bother&lt;/h2&gt;
&lt;p&gt;Two things kept showing up.&lt;/p&gt;
&lt;p&gt;The context graph of a project matters more than swapping the agent. As the work accumulates, accuracy depends on the agent being able to find what we already decided. Grep and “open the file” work, and they also burn tokens. A search tool over memory is cheaper than making the model reread the repo.&lt;/p&gt;
&lt;p&gt;The other lesson, which matches what Codex and the other coding agents already push: if the folder stays the source of truth, the agent gets better over time. Memory should be files in that folder, not a side database I cannot open.&lt;/p&gt;
&lt;h2 id=&quot;writing-the-memory&quot;&gt;Writing the memory&lt;/h2&gt;
&lt;p&gt;I use the compound-engineering plugin plus a bit of my own tooling. A project already has the code, and a &lt;code&gt;docs&lt;/code&gt; folder for brainstorms and plans. Next to that, a &lt;code&gt;sessions&lt;/code&gt; folder.&lt;/p&gt;
&lt;p&gt;At the end of a session I run a &lt;code&gt;/summarize&lt;/code&gt; skill. It writes a structured markdown file: date, title, a short summary, and a longer one. The short summary is what keyword search should hit. There is no hook that knows I am about to close the session, so this is still manual. I do it before I stop.&lt;/p&gt;
&lt;p&gt;When the file lands, the skill calls a CLI I named sift (&lt;code&gt;sift index&lt;/code&gt; and &lt;code&gt;sift embed&lt;/code&gt;). Agents are good at CLIs, so the search surface is a CLI rather than a library only I can call.&lt;/p&gt;
&lt;h2 id=&quot;how-sift-searches&quot;&gt;How sift searches&lt;/h2&gt;
&lt;p&gt;sift keeps a SQLite database on disk.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Keyword search is full-text, ranked with BM25 (TF-IDF style).&lt;/li&gt;
&lt;li&gt;Semantic search is a vector index, via the SQLite vector extension.&lt;/li&gt;
&lt;li&gt;Embeddings come from a local Gemma embedding model, about 300M parameters, through Ollama. It has seen both text and code. No embedding API.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;In the demo, &lt;code&gt;sift list&lt;/code&gt; showed the sessions already indexed. &lt;code&gt;sift index&lt;/code&gt; had nothing new. &lt;code&gt;sift embed&lt;/code&gt; reported 35 chunks across five sessions. &lt;code&gt;sift search&lt;/code&gt; for the local embedding model I had used returned those chunks. That query is for the agent, not for me. The agent gets a handful of passages and can open the file if it needs more. The search itself did not spend model tokens.&lt;/p&gt;
&lt;p&gt;On other projects I have had on the order of a hundred sessions. At that size, asking the agent to explore is how the context window disappears.&lt;/p&gt;
&lt;h2 id=&quot;how-the-agent-is-told-to-use-it&quot;&gt;How the agent is told to use it&lt;/h2&gt;
&lt;p&gt;I put the instructions in the Codex &lt;code&gt;AGENTS.md&lt;/code&gt; for the repo. The agent is told it can search session summaries, fetch one file, list recent sessions, and run &lt;code&gt;/summarize&lt;/code&gt; to write the current session. It should call &lt;code&gt;sift search&lt;/code&gt; when I ask what we already decided.&lt;/p&gt;
&lt;p&gt;I checked that on a fresh Codex session, one that had never seen the earlier conversation. I asked which embedding model we had picked. It called sift several times (search, then a more specific get, then a list) and answered with the local Gemma model on Ollama, including which session summary the decision lived in. A broader question, “what have we built here”, took more tool calls, and it still got there from the short summaries instead of reading every file.&lt;/p&gt;
&lt;p&gt;I plan to open source the &lt;code&gt;/summarize&lt;/code&gt; skill and the sift CLI, alongside the other skills I keep reusing. The index stays local. For embeddings, nothing is sent out.&lt;/p&gt;</content:encoded><category>ai-agents</category><category>coding-agents</category></item><item><title>Why AI agent development is nothing like software development</title><link>https://kneeraj.com/posts/2026/ai-agent-development-is-not-software-development/</link><guid isPermaLink="true">https://kneeraj.com/posts/2026/ai-agent-development-is-not-software-development/</guid><description>Use cases, architecture, UX, evals, and latency all change when the platform is a model with agency. Stuffing an LLM API into a web app does not make an agent.</description><pubDate>Sat, 11 Apr 2026 04:30:00 GMT</pubDate><content:encoded>&lt;p&gt;Most of the application-layer “agents” I see are an API call dropped into a normal web app. That happens because the team is still using a software-development checklist. After building agents at work and on my own projects, that checklist is the thing that fails first.&lt;/p&gt;
&lt;p&gt;The practical version of the scaffolding, from a different talk, is &lt;a href=&quot;https://kneeraj.com/posts/2026/harness-design-software-development&quot;&gt;harness design for software development&lt;/a&gt;. This one is the mindset underneath it.&lt;/p&gt;
&lt;div style=&quot;margin: 1.5rem 0; max-width: 100%; overflow: hidden;&quot;&gt;
  &lt;div style=&quot;position: relative; width: 100%; max-width: 640px; margin: 0 auto; padding-bottom: 56.25%; height: 0;&quot;&gt;
    &lt;iframe style=&quot;position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 0;&quot; src=&quot;https://www.youtube.com/embed/Sm3XLTj0-WE&quot; title=&quot;YouTube video player&quot; allow=&quot;accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture&quot; allowfullscreen&gt;
    &lt;/iframe&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&quot;three-platforms-same-questions&quot;&gt;Three platforms, same questions&lt;/h2&gt;
&lt;p&gt;Whenever I look at a software platform I ask the same questions. What use cases does it unlock? What is the architecture? Who is the user, and what does the workflow look like? What does stability mean? What does performance mean?&lt;/p&gt;
&lt;p&gt;The web was a browser anyone could open. Use cases such as e-commerce showed up because the distribution was a personal computer and a URL. The architecture was frontend, backend, and APIs. UX was navigation for humans. Stability meant the features worked and the site stayed up. Latency meant a person could finish the task without waiting on a spinner.&lt;/p&gt;
&lt;p&gt;Mobile was the same architecture and the same stability story, with a different workflow. Tabs, a thumb, a hamburger menu. New use cases (the usual example is Uber) existed because the computer was in your hand all day.&lt;/p&gt;
&lt;p&gt;The platform now is the model. I think of it as intelligence as a service. The web and the phone shipped whatever the developer had hardcoded. A model can take a task, break it down, and decide. The job left for us is the environment around that intelligence. That is also how people work. The brain is not the interesting variable. The room you put it in is.&lt;/p&gt;
&lt;h2 id=&quot;what-changes&quot;&gt;What changes&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;Use cases.&lt;/strong&gt; Software on top of a model is an agent because it has agency. Until now, only people did. Digitally, that is programming, shopping, research, the work that used to require a person to think. It will not stay digital. Anywhere a task needed someone to look and act, an agent is a candidate. Older apps only did what a developer had enumerated.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Who the software is for.&lt;/strong&gt; A lot of what we build next is for agents to operate. Humans stay on quality, supervision, and review. That is already how the digital tools feel, and it is the same shape I expect once this reaches the physical world.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Architecture.&lt;/strong&gt; I stopped calling it an architecture and started calling it a harness. The job is not a frontend and a backend. The job is a well-defined environment and a well-defined task, so the model can finish the work reliably. I went through the pieces I actually use in the harness post. The diagram at the end of the video is from HumanLayer’s &lt;a href=&quot;https://www.humanlayer.dev/blog/skill-issue-harness-engineering-for-coding-agents&quot;&gt;Skill Issue: harness engineering for coding agents&lt;/a&gt;. I did not draw it.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;UX.&lt;/strong&gt; Design systems were built for people. Agents do not want a careful UI. They want a CLI, an MCP server, tools, and markdown. That is why Claude Code is pleasant to extend: you hand it tools. Humans still review, so the human workflow becomes the review artifact. Cursor shipping a video of the task working is a better review surface than a dashboard full of steps.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Stability.&lt;/strong&gt; The first time the software can think, it is non-deterministic, and for plenty of tasks you cannot even write down “correct.” Coding is the exception that proves it. A test fails or it does not, which is why coding agents moved first. Everywhere else, stability work turns into evaluation. Do you have a dataset? Are the labels real? Does the set look like what the agent will see in production? People who have shipped ML already know this. Everyone else is walking into a different job.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Latency.&lt;/strong&gt; The old latency budget assumed a person clicking and a dumb program responding. If the agent is reliable and the task is auto-verifiable, I would rather fire it in the cloud and review the outcome. Most tasks are not there yet, so the UI is a chat: I steer, it misses, I steer again. The right amount of waiting also depends on the task. Something I do for an hour a week deserves a higher-quality, slower run than something I need in five minutes. Thinking budgets (a little, a lot, as much as you can afford) are that tradeoff made explicit. More time and more tokens, within guardrails, usually means a better result.&lt;/p&gt;
&lt;h2 id=&quot;work-backwards-from-the-model&quot;&gt;Work backwards from the model&lt;/h2&gt;
&lt;p&gt;The miss I keep seeing is a team that starts from a traditional workflow and asks where to put the API. The more useful question is what the model can already do, and what agent is worth building on top of it. Use cases, harness, review UX, evals, and latency are all different questions now. Treating them as the old questions is how you get a demo that is just a chat box on a CRUD app.&lt;/p&gt;</content:encoded><category>ai-agents</category><category>business-of-ai</category></item><item><title>Harness design for software development</title><link>https://kneeraj.com/posts/2026/harness-design-software-development/</link><guid isPermaLink="true">https://kneeraj.com/posts/2026/harness-design-software-development/</guid><description>Three principles for building a practical software development harness: repo as system of record, auto-evaluation loops, and a dedicated black-box evaluator agent.</description><pubDate>Sun, 05 Apr 2026 04:30:00 GMT</pubDate><content:encoded>&lt;img src=&quot;https://kneeraj.com/assets/img/2026/harness-design/harness-design.png&quot; alt=&quot;Designing harness for software development&quot; style=&quot;display: block; margin: 0 auto 1.5rem; max-width: 100%; height: auto; border-radius: 8px;&quot;&gt;
&lt;p&gt;AI Agent design is very different from traditional software development and &lt;strong&gt;Harness Engg.&lt;/strong&gt; is at the frontend and centre of it. Building intelligent systems (thianks to LLMs) require orchestrating powerful LLMs and new types of primitives tools, skills, MCPs in an env. that let LLMs flourish!&lt;/p&gt;
&lt;p&gt;No wonder, Both &lt;a href=&quot;https://openai.com/index/harness-engineering/&quot;&gt;Openai&lt;/a&gt; and &lt;a href=&quot;https://www.anthropic.com/engineering/harness-design-long-running-apps&quot;&gt;Anthropic&lt;/a&gt; has been very vocal about how to design harness for different use-cases esp. software development.&lt;/p&gt;
&lt;p&gt;I have been building some side projects such as Leaf (&lt;a href=&quot;https://github.com/kn-neeraj/leaf_app&quot;&gt;an open source markdown reader app&lt;/a&gt;) and trying to use some of these concepts to test them!&lt;/p&gt;
&lt;h2 id=&quot;youtube-walkthrough&quot;&gt;YouTube walkthrough&lt;/h2&gt;
&lt;div style=&quot;margin: 1.5rem 0; max-width: 100%; overflow: hidden;&quot;&gt;
  &lt;div style=&quot;position: relative; width: 100%; max-width: 640px; margin: 0 auto; padding-bottom: 56.25%; height: 0;&quot;&gt;
    &lt;iframe style=&quot;position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 0;&quot; src=&quot;https://www.youtube.com/embed/MVFBuKgF0vs&quot; title=&quot;YouTube video player&quot; allow=&quot;accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture&quot; allowfullscreen&gt;
    &lt;/iframe&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&quot;1-repo-as-a-system-of-record&quot;&gt;1. Repo as a system of record&lt;/h2&gt;
&lt;p&gt;The repo should not just store source files. It should act as the &lt;strong&gt;system of record&lt;/strong&gt; for the entire development loop.&lt;/p&gt;
&lt;p&gt;That means specs, tasks, implementation, tests, eval cases, and learnings should all sit close to the code. When the repo is the center of gravity, both humans and agents have a shared place to read from and write back to.&lt;/p&gt;
&lt;p&gt;This matters because software development quickly becomes chaotic when intent is scattered across chat threads, docs, local notes, and half-remembered decisions. The repo creates a durable memory. It tells you:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;what the system is supposed to do&lt;/li&gt;
&lt;li&gt;what changed&lt;/li&gt;
&lt;li&gt;how it is verified&lt;/li&gt;
&lt;li&gt;what was learned while building it&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Once you treat the repo as the record, you can build much stronger workflows on top of it.&lt;/p&gt;
&lt;h2 id=&quot;2-auto-evaluation-loop&quot;&gt;2. Auto-evaluation loop&lt;/h2&gt;
&lt;p&gt;A harness should not depend on someone manually inspecting every change.&lt;/p&gt;
&lt;p&gt;It should have an &lt;strong&gt;auto-evaluation loop&lt;/strong&gt; that continuously checks whether the output is getting better or worse. This can include tests, linting, screenshots, benchmark checks, task-level evals, or product-specific acceptance checks. (More on designing evals in &lt;a href=&quot;https://kneeraj.com/posts/2025/framework-for-evaluating-ai-products&quot;&gt;my framework for evaluating LLM-powered products&lt;/a&gt;.)&lt;/p&gt;
&lt;p&gt;The important bit is not any single eval. The important bit is the loop:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;make a change&lt;/li&gt;
&lt;li&gt;run evaluations automatically&lt;/li&gt;
&lt;li&gt;inspect failures&lt;/li&gt;
&lt;li&gt;refine the system&lt;/li&gt;
&lt;li&gt;repeat&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;This is what turns development from “generate code and hope” into an actual feedback system.&lt;/p&gt;
&lt;p&gt;In AI-assisted development, this becomes even more important. Agents can produce a lot of output quickly, but speed without evaluation just means you can be wrong faster. The harness has to close that loop automatically.&lt;/p&gt;
&lt;h2 id=&quot;3-dedicated-black-box-evaluator-agent&quot;&gt;3. Dedicated black-box evaluator agent&lt;/h2&gt;
&lt;p&gt;One of the most useful patterns is to have a dedicated &lt;strong&gt;black-box evaluator agent&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;Its job is not to implement. Its job is to judge outcomes from the outside.&lt;/p&gt;
&lt;p&gt;That separation matters. The builder agent is usually too close to the solution. It knows what it intended to do, which makes it easier to miss gaps. A black-box evaluator looks at the system the way a user, tester, or reviewer would:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;given this input, what actually happened?&lt;/li&gt;
&lt;li&gt;does the output match the spec?&lt;/li&gt;
&lt;li&gt;did quality regress?&lt;/li&gt;
&lt;li&gt;what failed, exactly?&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;This agent becomes even more useful when connected to the repo and the evaluation loop. It can read the spec, run the system, compare behavior against expectations, and write back structured findings. Over time, that creates a much more reliable development process.&lt;/p&gt;</content:encoded><category>ai-agents</category><category>productivity</category></item><item><title>My Executive Assistant built with OpenClaw &amp; Minimax 2.5</title><link>https://kneeraj.com/posts/2026/my-executive-assistant-openclaw-vps-minimax/</link><guid isPermaLink="true">https://kneeraj.com/posts/2026/my-executive-assistant-openclaw-vps-minimax/</guid><description>How I’m building a non-executive executive assistant with specialized AI agents for morning briefings, learning, tasks, blogging, and more.</description><pubDate>Sun, 01 Mar 2026 04:30:00 GMT</pubDate><content:encoded>&lt;p&gt;Everyone is becoming a one-person CEO. The game is leverage, and AI agents are becoming the new operating layer. &lt;b&gt;&lt;u&gt;OpenClaw&lt;/u&gt;&lt;/b&gt; felt exciting because it lets me run a 24x7 assistant on a VPS that keeps working in the background while I sleep!&lt;/p&gt;
&lt;p&gt;I am building this assistant to run my personal life and support a wide variety of tasks. Right now, I have an army of mini-assistants doing the following jobs:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Morning Digest&lt;/strong&gt;: Curated AI news and key articles, delivered at 8 AM with my coffee. It can also send a voice note when I want to listen on the go, and optionally generate an explainer image on request.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Learning Companion&lt;/strong&gt;: Keeps my learning from drifting. It tracks what I am studying, surfaces relevant notes, and keeps my deep-dives active.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Blog Assistant&lt;/strong&gt;: Helps me brainstorm and outline blog posts. I still finish the writing, add images/videos, and publish. I don’t want fully AI-written posts; I prefer keeping a human touch.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Task Assistant&lt;/strong&gt;: Connected to my Notion workspace to capture tasks and remind me about what matters for the week.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Knowledge Assistant&lt;/strong&gt;: Has read access to my Notion knowledge base so I can ask questions quickly. It is basic right now, but I plan to push it toward deeper research.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;buildathon-upgrades-i-added-recently&quot;&gt;Buildathon upgrades I added recently&lt;/h2&gt;
&lt;p&gt;In the recent buildathon, I added two useful upgrades to the assistant:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Audio generation for morning briefings, so updates are easier to consume while moving.&lt;/li&gt;
&lt;li&gt;Explainer image generation, so dense topics can be visualized quickly.&lt;/li&gt;
&lt;/ul&gt;
&lt;div style=&quot;width: 100%; max-width: 315px; margin: 2rem auto;&quot;&gt;
  &lt;div style=&quot;position: relative; width: 100%; aspect-ratio: 9 / 16; overflow: hidden;&quot;&gt;
    &lt;iframe src=&quot;https://www.youtube.com/embed/xwpB6FYB75k&quot; style=&quot;position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 0;&quot; allow=&quot;accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture&quot; allowfullscreen&gt;
    &lt;/iframe&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&quot;how-the-stack-looks-today&quot;&gt;How the stack looks today&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Infra&lt;/strong&gt;: 2GB RAM machine on DigitalOcean for &lt;strong&gt;$10/month&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Core model&lt;/strong&gt;: &lt;strong&gt;Minimax 2.5 via OpenRouter&lt;/strong&gt; for most knowledge-work tasks.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Usage and cost&lt;/strong&gt;: Burned through &lt;strong&gt;30M tokens in the last 2 weeks&lt;/strong&gt; for around &lt;strong&gt;$4&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Media capabilities&lt;/strong&gt;: OpenAI TTS for voice notes and Gemini 2.5 Flash (Nano Banana) for image creation.&lt;/li&gt;
&lt;/ul&gt;
&lt;img src=&quot;https://kneeraj.com/assets/img/2026/openclaw-executive-assistant/openclaw_token_consumption.png&quot; alt=&quot;performance screenshot 00&quot; style=&quot;display: block; margin: 0 auto 1.5rem; max-width: 100%; height: auto; border-radius: 8px;&quot;&gt;
&lt;h2 id=&quot;what-is-coming-next&quot;&gt;What is coming next!&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Deep research on any topic (leveraging OpenAI and Claude Deep Research APIs where useful)&lt;/li&gt;
&lt;li&gt;Reminders over phone call&lt;/li&gt;
&lt;li&gt;Video generation with voiceover from prompts and screenshots&lt;/li&gt;
&lt;li&gt;Idea Factory: research product ideas and store them&lt;/li&gt;
&lt;li&gt;App Development Robot: Pitck prioritized ideas from Idea Factory, build web or Android prototypes overnight (on Linux), and deliver morning updates with screenshots, videos, and APKs&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;core-capabilities-i-still-need-to-invest-in&quot;&gt;Core capabilities I still need to invest in&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Better video creation pipelines&lt;/li&gt;
&lt;li&gt;Voice-instruction interface&lt;/li&gt;
&lt;li&gt;Agent having its own GitHub and deploy environment access&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The future is really exciting. It is time to build!!&lt;/p&gt;</content:encoded><category>openclaw</category><category>ai-agents</category><category>productivity</category><category>open-source</category></item><item><title>OpenClaw Memory Setup &amp; Mini-Assistants</title><link>https://kneeraj.com/posts/2026/openclaw-learnings-memory-1/</link><guid isPermaLink="true">https://kneeraj.com/posts/2026/openclaw-learnings-memory-1/</guid><description>A look at the file-based memory system that gives my AI assistant continuity across conversations.</description><pubDate>Sun, 22 Feb 2026 04:30:00 GMT</pubDate><content:encoded>&lt;h2 id=&quot;table-of-contents&quot;&gt;Table of contents&lt;/h2&gt;
&lt;p&gt;&lt;/p&gt;&lt;details&gt;&lt;summary&gt;Open Table of contents&lt;/summary&gt;&lt;p&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;#the-core-files&quot;&gt;The Core Files&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;#the-daily-memory-folder&quot;&gt;The Daily Memory Folder&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;#mini-assistants&quot;&gt;Mini-Assistants&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;#why-files&quot;&gt;Why Files?&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;/p&gt;&lt;/details&gt;&lt;p&gt;&lt;/p&gt;
&lt;h2 id=&quot;the-core-files&quot;&gt;The Core Files&lt;/h2&gt;
&lt;p&gt;Think of these as the assistant’s “brain” — files that define who I am, who the assistant is, and what matters to us.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;SOUL.md&lt;/strong&gt; — This is the assistant’s personality. It defines how it should behave: be helpful without being performative, have opinions, be resourceful. It’s the “character sheet” that shapes every response.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;USER.md&lt;/strong&gt; — Everything about me. My name, timezone, preferences, what I care about. Before any response, the assistant reads this to know exactly who it’s helping.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;IDENTITY.md&lt;/strong&gt; — A quick summary card. Name (Anki), what I am (personal assistant), my vibe (calm). Like a name tag that says “here’s what I call you.”&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;AGENTS.md&lt;/strong&gt; — The operating instructions. How to handle group chats, when to speak vs stay quiet, how to use reactions. Basically, social rules for being a good participant.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;TOOLS.md&lt;/strong&gt; — The cheat sheet. API tokens, cron schedules, skill configurations. Everything the assistant needs to actually do its job.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;MEMORY.md&lt;/strong&gt; — Long-term memory. The distilled version of what matters: learned insights, mini-assistants overview, important reminders.&lt;/p&gt;
&lt;p&gt;Here’s how everything is organized:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://kneeraj.com/assets/img/2026/openclaw-memory-setup/file-structure.svg&quot; alt=&quot;OpenClaw File Structure&quot; loading=&quot;lazy&quot;&gt;&lt;/p&gt;
&lt;h2 id=&quot;the-daily-memory-folder&quot;&gt;The Daily Memory Folder&lt;/h2&gt;
&lt;p&gt;The &lt;code&gt;memory/&lt;/code&gt; folder holds daily notes. Each file is named with a date (like &lt;code&gt;2026-02-21.md&lt;/code&gt;) and captures what happened that day — conversations, decisions, things to remember.&lt;/p&gt;
&lt;p&gt;At the end of each day (or during periodic “heartbeats”), these daily notes get reviewed. Important stuff graduates to MEMORY.md. The rest stays as raw context if needed later.&lt;/p&gt;
&lt;h2 id=&quot;mini-assistants&quot;&gt;Mini-Assistants&lt;/h2&gt;
&lt;p&gt;The real magic is the mini-assistant system. Instead of one general-purpose AI, I have specialized helpers for specific tasks:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;BrainX&lt;/strong&gt; — My learning companion. Captures articles, manages deep-dive topics, tracks coding projects.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Task Assistant&lt;/strong&gt; — Syncs with Notion to manage my todo list.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Morning AI Digest&lt;/strong&gt; — Fetches AI news every morning.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Blog Assistant&lt;/strong&gt; — Handles writing and publishing blog posts.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Each mini-assistant lives in its own folder with its own skill file, keeping everything organized.&lt;/p&gt;
&lt;h2 id=&quot;why-files&quot;&gt;Why Files?&lt;/h2&gt;
&lt;p&gt;All of this is plain Markdown files in a folder. No database, no complex setup. Just files that the assistant reads when it wakes up. It’s simple, transparent, and I can edit anything directly if needed.&lt;/p&gt;
&lt;p&gt;The assistant wakes up each session fresh, reads these files, and suddenly knows who I am, what I care about, and what I’m working on. That’s the setup.&lt;/p&gt;</content:encoded><category>openclaw</category><category>productivity</category></item><item><title>How to Setup Your OpenClaw Personal Assistant on a VPS</title><link>https://kneeraj.com/posts/2026/setup-openclaw-personal-assistant-vps/</link><guid isPermaLink="true">https://kneeraj.com/posts/2026/setup-openclaw-personal-assistant-vps/</guid><description>A step-by-step guide to setting up OpenClaw, an open-source personal AI assistant on your own VPS with Telegram integration and practical automation examples.</description><pubDate>Sun, 15 Feb 2026 02:30:00 GMT</pubDate><content:encoded>&lt;p&gt;&lt;mark style=&quot;background-color: #e0f2fe; padding: 4px 8px; border-radius: 4px; font-weight: bold; font-style: italic;&quot;&gt; OpenClaw is an open-source personal AI assistant that runs on your own server, giving you complete control over your AI helper while keeping your data private. &lt;/mark&gt;&lt;/p&gt;
&lt;div style=&quot;width: 100%; max-width: 315px; margin: 2rem auto;&quot;&gt;
  &lt;div style=&quot;position: relative; width: 100%; aspect-ratio: 9 / 16; overflow: hidden;&quot;&gt;
    &lt;iframe src=&quot;https://www.youtube.com/embed/wWQdISF8xSY&quot; style=&quot;position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 0;&quot; allow=&quot;accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture&quot; allowfullscreen&gt;
    &lt;/iframe&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&quot;table-of-contents&quot;&gt;Table of Contents&lt;/h2&gt;
&lt;p&gt;&lt;/p&gt;&lt;details&gt;&lt;summary&gt;Open Table of Contents&lt;/summary&gt;&lt;p&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;#what-is-openclaw&quot;&gt;What is OpenClaw?&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;#why-run-on-a-vps&quot;&gt;Why Run on a VPS?&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;#setup-steps&quot;&gt;Setup Steps&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;#setup-key-features&quot;&gt;Setup key features&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;#setup-mini-assistants&quot;&gt;Setup mini assistants&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;/p&gt;&lt;/details&gt;&lt;p&gt;&lt;/p&gt;
&lt;h2 id=&quot;what-is-openclaw&quot;&gt;What is OpenClaw?&lt;/h2&gt;
&lt;p&gt;OpenClaw is an open-source personal AI assistant that runs locally on your server. Unlike cloud-based AI assistants, OpenClaw gives you:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Full control&lt;/strong&gt; — customize everything to your needs&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Automation superpowers&lt;/strong&gt; — automate repetitive tasks, schedule reports, manage tasks&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Multi-channel access&lt;/strong&gt; — interact via Telegram, WhatsApp, Discord, or web chat&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Think of it as having your own personal AI assistant that’s available 24/7, never forgets context, and gets things done.&lt;/p&gt;
&lt;h2 id=&quot;why-run-on-a-vps&quot;&gt;Why Run on a VPS?&lt;/h2&gt;
&lt;p&gt;While you can run OpenClaw on a local machine, a VPS (Virtual Private Server) offers significant advantages:&lt;/p&gt;

























&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Benefit&lt;/th&gt;&lt;th&gt;Description&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;strong&gt;Always Available&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;Your assistant is online 24/7, even when your computer is off&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;strong&gt;Public Access&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;Access from anywhere via Telegram or other channels&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;strong&gt;Better Reliability&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;Professional hosting with uptime guarantees&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;strong&gt;Continuous Automation&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;Run scheduled tasks (cron jobs) reliably&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;
&lt;p&gt;Popular VPS providers include DigitalOcean, AWS EC2, Linode, Hetzner, or Railway. For personal use, I use DigitalOcean.&lt;/p&gt;
&lt;h2 id=&quot;setup-steps&quot;&gt;Setup Steps&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;Step 1: Set Up Your VPS&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;You can chose DigitalOcean droplet, or Heztner, etc&lt;/li&gt;
&lt;li&gt;Ensure you can SSH into it. I use Termius.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Step 2 : Install Openclaw &amp;#x26; configure it&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;OpenClaw requires Node.js. Install it first&lt;/li&gt;
&lt;li&gt;Install OpenClaw using NPM and configure it&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;astro-code astro-code-themes min-light night-owl&quot; style=&quot;background-color:#ffffff;--shiki-dark-bg:#011627;color:#24292eff;--shiki-dark:#d6deeb; overflow-x: auto; white-space: pre-wrap; word-wrap: break-word;&quot; tabindex=&quot;0&quot; data-language=&quot;bash&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#C2C3C5;--shiki-light-font-style:inherit;--shiki-dark:#637777;--shiki-dark-font-style:italic&quot;&gt;# Install OpenClaw globally&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6F42C1;--shiki-light-font-style:inherit;--shiki-dark:#82AAFF;--shiki-dark-font-style:italic&quot;&gt;npm&lt;/span&gt;&lt;span style=&quot;color:#2B5581;--shiki-dark:#ECC48D&quot;&gt; install&lt;/span&gt;&lt;span style=&quot;color:#2B5581;--shiki-dark:#82AAFF&quot;&gt; -g&lt;/span&gt;&lt;span style=&quot;color:#2B5581;--shiki-dark:#ECC48D&quot;&gt; openclaw&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#C2C3C5;--shiki-light-font-style:inherit;--shiki-dark:#637777;--shiki-dark-font-style:italic&quot;&gt;# Initialize (follow the wizard)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6F42C1;--shiki-light-font-style:inherit;--shiki-dark:#82AAFF;--shiki-dark-font-style:italic&quot;&gt;openclaw&lt;/span&gt;&lt;span style=&quot;color:#2B5581;--shiki-dark:#ECC48D&quot;&gt; init&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#C2C3C5;--shiki-light-font-style:inherit;--shiki-dark:#637777;--shiki-dark-font-style:italic&quot;&gt;# Configure. The wizard guides through AI model, channels&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6F42C1;--shiki-light-font-style:inherit;--shiki-dark:#82AAFF;--shiki-dark-font-style:italic&quot;&gt;openclaw&lt;/span&gt;&lt;span style=&quot;color:#2B5581;--shiki-dark:#ECC48D&quot;&gt; configure&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Step 3 : Configure Telegram bot&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Open Telegram and search for @BotFather&lt;/li&gt;
&lt;li&gt;Send &lt;code&gt;/newbot&lt;/code&gt; to create a new bot&lt;/li&gt;
&lt;li&gt;Follow the prompts to name your bot&lt;/li&gt;
&lt;li&gt;Copy the bot token (you’ll need it)&lt;/li&gt;
&lt;/ol&gt;
&lt;pre class=&quot;astro-code astro-code-themes min-light night-owl&quot; style=&quot;background-color:#ffffff;--shiki-dark-bg:#011627;color:#24292eff;--shiki-dark:#d6deeb; overflow-x: auto; white-space: pre-wrap; word-wrap: break-word;&quot; tabindex=&quot;0&quot; data-language=&quot;bash&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6F42C1;--shiki-light-font-style:inherit;--shiki-dark:#82AAFF;--shiki-dark-font-style:italic&quot;&gt;openclaw&lt;/span&gt;&lt;span style=&quot;color:#2B5581;--shiki-dark:#ECC48D&quot;&gt; config&lt;/span&gt;&lt;span style=&quot;color:#2B5581;--shiki-dark:#ECC48D&quot;&gt; set&lt;/span&gt;&lt;span style=&quot;color:#2B5581;--shiki-dark:#ECC48D&quot;&gt; channels.telegram.enabled&lt;/span&gt;&lt;span style=&quot;color:#1976D2;--shiki-dark:#82AAFF&quot;&gt; true&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6F42C1;--shiki-light-font-style:inherit;--shiki-dark:#82AAFF;--shiki-dark-font-style:italic&quot;&gt;openclaw&lt;/span&gt;&lt;span style=&quot;color:#2B5581;--shiki-dark:#ECC48D&quot;&gt; config&lt;/span&gt;&lt;span style=&quot;color:#2B5581;--shiki-dark:#ECC48D&quot;&gt; set&lt;/span&gt;&lt;span style=&quot;color:#2B5581;--shiki-dark:#ECC48D&quot;&gt; channels.telegram.botToken&lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#D9F5DD&quot;&gt; &quot;&lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#ECC48D&quot;&gt;YOUR_BOT_TOKEN&lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#D9F5DD&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6F42C1;--shiki-light-font-style:inherit;--shiki-dark:#82AAFF;--shiki-dark-font-style:italic&quot;&gt;openclaw&lt;/span&gt;&lt;span style=&quot;color:#2B5581;--shiki-dark:#ECC48D&quot;&gt; config&lt;/span&gt;&lt;span style=&quot;color:#2B5581;--shiki-dark:#ECC48D&quot;&gt; set&lt;/span&gt;&lt;span style=&quot;color:#2B5581;--shiki-dark:#ECC48D&quot;&gt; channels.telegram.dmPolicy&lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#D9F5DD&quot;&gt; &quot;&lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#ECC48D&quot;&gt;open&lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#D9F5DD&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color:#24292EFF;--shiki-dark:#D6DEEB&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;OpenClaw will now be running on your VPS!&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Step 4 : Start openclaw in TUI&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Start openclaw in terminal with &lt;code&gt;openclaw tui&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;setup-key-features&quot;&gt;Setup key features&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;1. Memory System&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;OpenClaw can remember context across conversations (&lt;a href=&quot;https://kneeraj.com/posts/2026/openclaw-learnings-memory-1&quot;&gt;how its memory works&lt;/a&gt;, and &lt;a href=&quot;https://kneeraj.com/posts/2025/ai-agent-memory-system&quot;&gt;how to design memory for agents in general&lt;/a&gt;):&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes min-light night-owl&quot; style=&quot;background-color:#ffffff;--shiki-dark-bg:#011627;color:#24292eff;--shiki-dark:#d6deeb; overflow-x: auto; white-space: pre-wrap; word-wrap: break-word;&quot; tabindex=&quot;0&quot; data-language=&quot;bash&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#C2C3C5;--shiki-light-font-style:inherit;--shiki-dark:#637777;--shiki-dark-font-style:italic&quot;&gt;# Enable memory&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6F42C1;--shiki-light-font-style:inherit;--shiki-dark:#82AAFF;--shiki-dark-font-style:italic&quot;&gt;openclaw&lt;/span&gt;&lt;span style=&quot;color:#2B5581;--shiki-dark:#ECC48D&quot;&gt; config&lt;/span&gt;&lt;span style=&quot;color:#2B5581;--shiki-dark:#ECC48D&quot;&gt; set&lt;/span&gt;&lt;span style=&quot;color:#2B5581;--shiki-dark:#ECC48D&quot;&gt; agents.defaults.memorySearch.enabled&lt;/span&gt;&lt;span style=&quot;color:#1976D2;--shiki-dark:#82AAFF&quot;&gt; true&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This lets your assistant remember previous conversations, preferences, and important details.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;2. Web Search&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Enable web search for your assistant:&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes min-light night-owl&quot; style=&quot;background-color:#ffffff;--shiki-dark-bg:#011627;color:#24292eff;--shiki-dark:#d6deeb; overflow-x: auto; white-space: pre-wrap; word-wrap: break-word;&quot; tabindex=&quot;0&quot; data-language=&quot;bash&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6F42C1;--shiki-light-font-style:inherit;--shiki-dark:#82AAFF;--shiki-dark-font-style:italic&quot;&gt;openclaw&lt;/span&gt;&lt;span style=&quot;color:#2B5581;--shiki-dark:#ECC48D&quot;&gt; config&lt;/span&gt;&lt;span style=&quot;color:#2B5581;--shiki-dark:#ECC48D&quot;&gt; set&lt;/span&gt;&lt;span style=&quot;color:#2B5581;--shiki-dark:#ECC48D&quot;&gt; tools.web.search.enabled&lt;/span&gt;&lt;span style=&quot;color:#1976D2;--shiki-dark:#82AAFF&quot;&gt; true&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6F42C1;--shiki-light-font-style:inherit;--shiki-dark:#82AAFF;--shiki-dark-font-style:italic&quot;&gt;openclaw&lt;/span&gt;&lt;span style=&quot;color:#2B5581;--shiki-dark:#ECC48D&quot;&gt; config&lt;/span&gt;&lt;span style=&quot;color:#2B5581;--shiki-dark:#ECC48D&quot;&gt; set&lt;/span&gt;&lt;span style=&quot;color:#2B5581;--shiki-dark:#ECC48D&quot;&gt; tools.web.search.provider&lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#D9F5DD&quot;&gt; &quot;&lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#ECC48D&quot;&gt;brave&lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#D9F5DD&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#C2C3C5;--shiki-light-font-style:inherit;--shiki-dark:#637777;--shiki-dark-font-style:italic&quot;&gt;# Add your Brave API key&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6F42C1;--shiki-light-font-style:inherit;--shiki-dark:#82AAFF;--shiki-dark-font-style:italic&quot;&gt;openclaw&lt;/span&gt;&lt;span style=&quot;color:#2B5581;--shiki-dark:#ECC48D&quot;&gt; config&lt;/span&gt;&lt;span style=&quot;color:#2B5581;--shiki-dark:#ECC48D&quot;&gt; set&lt;/span&gt;&lt;span style=&quot;color:#2B5581;--shiki-dark:#ECC48D&quot;&gt; tools.web.search.apiKey&lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#D9F5DD&quot;&gt; &quot;&lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#ECC48D&quot;&gt;YOUR_BRAVE_API_KEY&lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#D9F5DD&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;3. Scheduled automated tasks&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Set up cron jobs for automation:&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes min-light night-owl&quot; style=&quot;background-color:#ffffff;--shiki-dark-bg:#011627;color:#24292eff;--shiki-dark:#d6deeb; overflow-x: auto; white-space: pre-wrap; word-wrap: break-word;&quot; tabindex=&quot;0&quot; data-language=&quot;bash&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#C2C3C5;--shiki-light-font-style:inherit;--shiki-dark:#637777;--shiki-dark-font-style:italic&quot;&gt;# Add a morning briefing cron job&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6F42C1;--shiki-light-font-style:inherit;--shiki-dark:#82AAFF;--shiki-dark-font-style:italic&quot;&gt;openclaw&lt;/span&gt;&lt;span style=&quot;color:#2B5581;--shiki-dark:#ECC48D&quot;&gt; cron&lt;/span&gt;&lt;span style=&quot;color:#2B5581;--shiki-dark:#ECC48D&quot;&gt; add&lt;/span&gt;&lt;span style=&quot;color:#2B5581;--shiki-dark:#82AAFF&quot;&gt; --schedule&lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#D9F5DD&quot;&gt; &quot;&lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#ECC48D&quot;&gt;cron 0 9 * * *&lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#D9F5DD&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color:#24292EFF;--shiki-dark:#F78C6C&quot;&gt; \&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#2B5581;--shiki-dark:#82AAFF&quot;&gt;  --sessionTarget&lt;/span&gt;&lt;span style=&quot;color:#2B5581;--shiki-dark:#ECC48D&quot;&gt; main&lt;/span&gt;&lt;span style=&quot;color:#24292EFF;--shiki-dark:#F78C6C&quot;&gt; \&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#2B5581;--shiki-dark:#82AAFF&quot;&gt;  --payload&lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#D9F5DD&quot;&gt; &apos;&lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#ECC48D&quot;&gt;{&quot;kind&quot;:&quot;systemEvent&quot;,&quot;text&quot;:&quot;Run morning brief&quot;}&lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#D9F5DD&quot;&gt;&apos;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;h2 id=&quot;setup-mini-assistants&quot;&gt;Setup mini assistants&lt;/h2&gt;
&lt;p&gt;Here are some real-world examples of what you can automate:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Morning AI Digest : Every morning at 8:30 AM, get an AI news digest:&lt;/li&gt;
&lt;li&gt;Task Assistant : Connect to Notion or task management tools to record/update tasks and set reminders&lt;/li&gt;
&lt;li&gt;Knowledge Assistant : Connected my notion for knowledge assistant&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Start small, set up the basics first, then explore advanced features as you get comfortable. The beauty of OpenClaw is that it grows with your needs.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Ready to try?&lt;/strong&gt; Spin up a VPS, install OpenClaw, and message your new personal assistant on Telegram!&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;&lt;em&gt;Have questions or run into issues? Check the &lt;a href=&quot;https://docs.openclaw.ai&quot;&gt;OpenClaw documentation&lt;/a&gt; or join the community on &lt;a href=&quot;https://discord.com/invite/clawd&quot;&gt;Discord&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;</content:encoded><category>openclaw</category><category>ai-agents</category><category>productivity</category></item><item><title>Building an open source native Markdown reader app</title><link>https://kneeraj.com/posts/2026/open-source-markdown-reader-leaf/</link><guid isPermaLink="true">https://kneeraj.com/posts/2026/open-source-markdown-reader-leaf/</guid><description>How I built Leaf, a native macOS Markdown reader, using a spec-driven, vibe-coding loop with Codex CLI.</description><pubDate>Mon, 02 Feb 2026 04:30:00 GMT</pubDate><content:encoded>&lt;p&gt;I wanted to try @OpenAICodexCli for building an end-to-end app. Since I have been reading a lot of Markdown files as I keep saving context while vibe-coding, I went ahead and built a Markdown reader app, Leaf.&lt;/p&gt;
&lt;p&gt;A native macOS Markdown reader, using a vibe-coding loop powered by Codex CLI: quick intent, and fast iteration.&lt;/p&gt;
&lt;div style=&quot;margin: 1.5rem 0; max-width: 100%; overflow: hidden;&quot;&gt;
  &lt;div style=&quot;position: relative; width: 100%; max-width: 640px; margin: 0 auto; padding-bottom: 56.25%; height: 0;&quot;&gt;
    &lt;iframe style=&quot;position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 0;&quot; src=&quot;https://www.youtube.com/embed/JduYTtYZQ68&quot; title=&quot;YouTube video player&quot; allow=&quot;accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture&quot; allowfullscreen&gt;
    &lt;/iframe&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&quot;spec-driven-first&quot;&gt;Spec-driven first&lt;/h2&gt;
&lt;p&gt;I started with a clear PRD highlighting the goals and non-goals, what the app is, what it is not, and how the core flows should feel. Codex CLI helped turn those specs into concrete tasks, and each change was measured against the spec to keep scope tight.&lt;/p&gt;
&lt;h2 id=&quot;the-vibe-loop&quot;&gt;The vibe loop&lt;/h2&gt;
&lt;p&gt;The “vibe” part came from short, focused cycles: sketch the intent, implement a slice, test it, and refine.&lt;/p&gt;
&lt;p&gt;Built key parts like:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Markdown rendering&lt;/li&gt;
&lt;li&gt;File navigation&lt;/li&gt;
&lt;li&gt;A distraction-free reading layout&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;beyond-vibe-code-solving-real-engineering-problems&quot;&gt;Beyond vibe code: Solving real engineering problems&lt;/h2&gt;
&lt;p&gt;This wasn’t just UI polish. I hit real Markdown rendering performance issues and went deep: profiled with Xcode Instruments, collected traces, and fed them to Codex to pinpoint the root cause and iterate fast. Seeing a coding agent reason through a gnarly performance bottleneck with the right context feels a bit magical.&lt;/p&gt;
&lt;img src=&quot;https://kneeraj.com/assets/img/2026/leaf-markdown-reader/performance_screenshot_00.png&quot; alt=&quot;performance screenshot 00&quot; style=&quot;display: block; margin: 0 auto 1.5rem; max-width: 100%; height: auto; border-radius: 8px;&quot;&gt;
&lt;img src=&quot;https://kneeraj.com/assets/img/2026/leaf-markdown-reader/performance_screenshot_01.png&quot; alt=&quot;performance screenshot 01&quot; style=&quot;display: block; margin: 0 auto 1.5rem; max-width: 100%; height: auto; border-radius: 8px;&quot;&gt;
&lt;h2 id=&quot;things-i-loved&quot;&gt;Things I loved&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Works for much longer independently&lt;/li&gt;
&lt;li&gt;I was even able to solve arcane performance issues by recording and sharing trace files. Very few engineers are able to go that deep&lt;/li&gt;
&lt;li&gt;Context limits are off the charts&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Don’t sleep on @OpenAICodexCli. @OpenAI you cooked with 5.2 thinking high with CLI harness!&lt;/p&gt;
&lt;h2 id=&quot;source-code&quot;&gt;Source code&lt;/h2&gt;
&lt;div class=&quot;github-card github-card--solo&quot;&gt;
  &lt;a href=&quot;https://github.com/kn-neeraj/leaf_app&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; class=&quot;github-card__btn&quot;&gt;
    View on GitHub
  &lt;/a&gt;
&lt;/div&gt;</content:encoded><category>open-source</category><category>speech-to-text</category><category>coding-agents</category></item><item><title>Hackathon (after a long time!): Portkey AI Builder Challenge</title><link>https://kneeraj.com/posts/2026/hackathon-portkey-ai-builder-challenge/</link><guid isPermaLink="true">https://kneeraj.com/posts/2026/hackathon-portkey-ai-builder-challenge/</guid><description>How we built a Cost-Quality Optimization system using Historical Replay and won the Portkey AI Builder Challenge hackathon.</description><pubDate>Sun, 18 Jan 2026 04:30:00 GMT</pubDate><content:encoded>&lt;img src=&quot;https://kneeraj.com/assets/img/2026/hackathon-portkey/header_image.png&quot; alt=&quot;Winning the Portkey AI Builder Challenge&quot; style=&quot;display: block; margin: 0 auto 1.5rem; max-width: 100%; height: auto; border-radius: 8px;&quot;&gt;
&lt;h2 id=&quot;table-of-contents&quot;&gt;Table of Contents&lt;/h2&gt;
&lt;p&gt;&lt;/p&gt;&lt;details&gt;&lt;summary&gt;Open Table of Contents&lt;/summary&gt;&lt;p&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;#hackathon-presentation&quot;&gt;Hackathon Presentation&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;#the-problem-statement&quot;&gt;The Problem Statement&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;#our-solution-cost-quality-optimization-via-historical-replay&quot;&gt;Our Solution: Cost-Quality Optimization via Historical Replay&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;#key-learnings&quot;&gt;Key Learnings&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;#results&quot;&gt;Results&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;/p&gt;&lt;/details&gt;&lt;p&gt;&lt;/p&gt;
&lt;h2 id=&quot;hackathon-presentation&quot;&gt;Hackathon Presentation&lt;/h2&gt;
&lt;div style=&quot;margin: 1.5rem auto; max-width: 1080px;&quot;&gt;
  &lt;iframe style=&quot;width: 100%; height: 600px; border: 1px solid #ddd; border-radius: 8px; box-shadow: 0 4px 8px rgba(0,0,0,0.1);&quot; src=&quot;https://team-23-portkey-hackatho-iomp3u0.gamma.site/&quot; title=&quot;Portkey AI Builder Challenge - Team 23 Presentation&quot; allow=&quot;fullscreen&quot; allowfullscreen&gt;
  &lt;/iframe&gt;
&lt;/div&gt;
&lt;h2 id=&quot;the-problem-statement&quot;&gt;The Problem Statement&lt;/h2&gt;
&lt;p&gt;There is huge value to be unlocked for enabling Enterprise agents for non-tech teams in a safe and optimal way.  Most Enterprise teams waste budget on frontier models for tasks that don’t need them—GPT-4 for copy, Claude Opus for FAQs. Many Non-technical teams default to expensive models without the expertise to optimize. They need a smarter solution.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;80% potential cost savings&lt;/strong&gt; by using right-sized models.&lt;/p&gt;
&lt;h2 id=&quot;our-solution-cost-quality-optimization-via-historical-replay&quot;&gt;Our Solution: Cost-Quality Optimization via Historical Replay&lt;/h2&gt;
&lt;p&gt;We built &lt;strong&gt;Intelligent Model Optimization Through Historical Analysis&lt;/strong&gt; — a system that helps teams find the right model for each task by auto-validating on their traces (available via products like Portkey).&lt;/p&gt;
&lt;img src=&quot;https://kneeraj.com/assets/img/2026/hackathon-portkey/solution-architecture.png&quot; alt=&quot;Solution Architecture&quot; style=&quot;width: 100%; height: auto; border: 3px solid #ddd; box-shadow: 0 4px 8px rgba(0,0,0,0.1);&quot;&gt;
&lt;p&gt;&lt;strong&gt;How it works:&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Auto-Capture AI Traces&lt;/strong&gt; — Integrate Portkey for prompt-completion logging&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Configure LLM Judge &amp;#x26; Guardrails&lt;/strong&gt; — Define quality metrics &amp;#x26; minimum thresholds&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Benchmark LLM Alternatives&lt;/strong&gt; — Test different models on your actual workload&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Generate Recommendations&lt;/strong&gt; — Receive data-driven guidance on optimal model selection&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;The system balances &lt;strong&gt;saving costs&lt;/strong&gt; while &lt;strong&gt;maintaining quality&lt;/strong&gt;. Imagine reports like these automatically generated for your agents :&lt;/p&gt;
&lt;!-- TODO: Add demo screenshot --&gt;
&lt;img src=&quot;https://kneeraj.com/assets/img/2026/hackathon-portkey/demo-screenshot.png&quot; alt=&quot;LLM Evaluation Report Demo&quot; style=&quot;width: 100%; height: auto; border: 3px solid #ddd; box-shadow: 0 4px 8px rgba(0,0,0,0.1);&quot;&gt;
&lt;h2 id=&quot;key-learnings&quot;&gt;Key Learnings&lt;/h2&gt;
&lt;p&gt;Enabling AI agents for non-tech teams is a massive opportunity. The key is balancing three parameters:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Accuracy&lt;/strong&gt; — Output must meet business standards&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Guardrails&lt;/strong&gt; : Ensure the agents can be enabeld in a safe &amp;#x26; secure way&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Cost&lt;/strong&gt; — Budget constraints are real&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;results&quot;&gt;Results&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;We won!&lt;/strong&gt;&lt;/p&gt;
&lt;!-- TODO: Add winning photos --&gt;
&lt;!-- &lt;img src=&quot;https://kneeraj.com/assets/img/2026/hackathon-portkey/team-photo.jpg&quot; alt=&quot;Team celebrating the win&quot; style=&quot;width: 100%; height: auto; border: 3px solid #ddd; box-shadow: 0 4px 8px rgba(0,0,0,0.1);&quot;&gt; --&gt;</content:encoded><category>events</category><category>llm-engineering</category></item><item><title>Customer Feedback Analysis: From Days to Minutes with AI</title><link>https://kneeraj.com/posts/2026/customer-feedback-analysis/</link><guid isPermaLink="true">https://kneeraj.com/posts/2026/customer-feedback-analysis/</guid><description>How I built a customer feedback analysis system that saves days of manual research and creates synthesized reports for different audiences.</description><pubDate>Wed, 14 Jan 2026 04:30:00 GMT</pubDate><content:encoded>&lt;h2 id=&quot;introduction&quot;&gt;Introduction&lt;/h2&gt;
&lt;p&gt;I recently conducted a brown bag session on “Building a Customer Feedback Analysis System,” and the feedback was overwhelmingly positive. This system has been a game-changer for me, saving hours—if not days—of manual work in synthesizing customer research. Instead of spending countless hours reading through feedback, manually categorizing insights, and crafting reports for different stakeholders, I now have an AI-powered workflow that does the heavy lifting in minutes.&lt;/p&gt;
&lt;h2 id=&quot;the-system-in-action&quot;&gt;The System in Action&lt;/h2&gt;
&lt;p&gt;Below are the slides from my session, where I walk through a real-world example using an ABC Ecommerce Company’s customer feedback. You’ll see the detailed prompts I use to synthesize feedback and generate reports tailored for various audiences—from product managers to executives to support teams.&lt;/p&gt;
&lt;div style=&quot;margin: 1.5rem auto; max-width: 900px;&quot;&gt;
  &lt;iframe style=&quot;width: 100%; height: 800px; border: 1px solid #ddd; border-radius: 8px; box-shadow: 0 4px 8px rgba(0,0,0,0.1);&quot; src=&quot;https://gamma.app/embed/rpokmfh7heglfst&quot; title=&quot;Customer Feedback Analysis System - Brown Bag Session&quot; allow=&quot;fullscreen&quot; allowfullscreen&gt;
  &lt;/iframe&gt;
&lt;/div&gt;</content:encoded><category>product-management</category></item><item><title>With AI, Aim 10X or Nothing</title><link>https://kneeraj.com/posts/2026/aim-10x-or-nothing/</link><guid isPermaLink="true">https://kneeraj.com/posts/2026/aim-10x-or-nothing/</guid><description>AI has exposed the reality of digital work - those who spent time on high-value deep thinking vs run-of-the-mill tasks. Time to aim 10X.</description><pubDate>Sat, 10 Jan 2026 04:30:00 GMT</pubDate><content:encoded>&lt;p&gt;I am writing this as a personal reflection, but I am sure it will resonate with a lot of folks. Don’t take it in a negative way, look at it as a moment of truth.&lt;/p&gt;
&lt;h2 id=&quot;digital-work-explosion--the-drugery-of-run-of-the-mill-work&quot;&gt;Digital Work Explosion &amp;#x26; the drugery of “run-of-the-mill” work&lt;/h2&gt;
&lt;p&gt;In the last decade, everything was digitized and most work happened digitally. Especially, software engineering and product development exploded. Consequently, organizations scaled with a lot of digital workers and hierarchies were built to manage it.&lt;/p&gt;
&lt;p&gt;In large organizations this led to a lot of glue work and run-of-the-mill ideas. Basically, &lt;strong&gt;80% of ideas and work we did was mostly remix of existing ideas adding very little real value.&lt;/strong&gt;  Most of us did that 80% of the run-of-the-mill average stuff and got by with good salaries and survived and thrived.&lt;/p&gt;
&lt;p&gt;There were obviously those &lt;strong&gt;10X folks&lt;/strong&gt; who spent a lot of their time on 20% high-value work (bringing judgement, taste, deeper thinking, going the extra mile, etc) that created 80% of the value!&lt;/p&gt;
&lt;h2 id=&quot;the-ai-shift&quot;&gt;The AI Shift&lt;/h2&gt;
&lt;p&gt;As AI democratizes run-of-the-mill work from digital tasks, &lt;u&gt;all that 80% of the low value work is suddenly gone. It should NOT take more than 20% of our time now &lt;/u&gt;. Suddenely, 1x looks really bad as these folks are still spending most of their time in the “run-of-the-mill” work.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;The 10X folks, on the other hand (look at the top programmers, top designers, or anyone top in their field), are beasts now. They look 100X or even 1000X.&lt;/strong&gt; They had the taste, the judgment, the depth, the second-order thinking, the business sense, and what not. But doing stuff and managing bureaucracy took the life out of them. &lt;strong&gt;All this goes out with AI.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;With AI, &lt;strong&gt;80% of drudgery work takes 20% of the time. 20% of the real value work should now take 80% of the time.&lt;/strong&gt;&lt;/p&gt;
&lt;h2 id=&quot;aim-10x-or-nothing&quot;&gt;Aim 10X or nothing&lt;/h2&gt;
&lt;p&gt;Aim to be 10X: think deeper, develop taste and judgment, be opinionated, second-order thinking, domain knowledge. Thats the only skill left in digital work!&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Spend 80% of your time on high-value work and 20% of time on drudgery work.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Thank you for your attention to this matter!&lt;/p&gt;</content:encoded><category>productivity</category><category>product-management</category><category>business-of-ai</category></item><item><title>Code From Phone: 5 Steps to build a AI Coding Server in 1 hour.</title><link>https://kneeraj.com/posts/2025/coding_from_mobile/</link><guid isPermaLink="true">https://kneeraj.com/posts/2025/coding_from_mobile/</guid><description>Build a complete AI coding environment accessible from your mobile phone in just 10 minutes for $6/month. Code anywhere, anytime using SSH, VPS, and AI coding agents.</description><pubDate>Thu, 08 Jan 2026 18:30:00 GMT</pubDate><content:encoded>&lt;h2 id=&quot;the-workflow&quot;&gt;The Workflow&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;Phone → SSH → VPS → AI agent builds code → Push to GitHub → Pull on laptop&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Cost&lt;/strong&gt;: $6/month&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Time to setup&lt;/strong&gt;: 10 minutes&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Use case&lt;/strong&gt;: Code anywhere, anytime&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;the-setup&quot;&gt;The Setup&lt;/h2&gt;
&lt;h3 id=&quot;1-rent-a-vps&quot;&gt;1. Rent a VPS&lt;/h3&gt;
&lt;p&gt;&lt;a href=&quot;https://www.digitalocean.com/&quot;&gt;Digital Ocean&lt;/a&gt; (I used Digital ocean) or &lt;a href=&quot;https://www.hetzner.com/&quot;&gt;Hetzner&lt;/a&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;$4-6/month, 1GB+ RAM&lt;/li&gt;
&lt;li&gt;Choose closest region&lt;/li&gt;
&lt;li&gt;Ubuntu 24.04, password auth&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&quot;2-install-termius&quot;&gt;2. Install Termius&lt;/h3&gt;
&lt;p&gt;&lt;a href=&quot;https://termius.com/&quot;&gt;Termius&lt;/a&gt; - iOS/Android app (free)&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Add host: VPS IP, username root, your password&lt;/li&gt;
&lt;li&gt;Connect via SSH&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&quot;3-install-your-favourite-ai-coding-agents&quot;&gt;3. Install your favourite AI Coding Agents&lt;/h3&gt;
&lt;pre class=&quot;astro-code astro-code-themes min-light night-owl&quot; style=&quot;background-color:#ffffff;--shiki-dark-bg:#011627;color:#24292eff;--shiki-dark:#d6deeb; overflow-x: auto; white-space: pre-wrap; word-wrap: break-word;&quot; tabindex=&quot;0&quot; data-language=&quot;bash&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6F42C1;--shiki-light-font-style:inherit;--shiki-dark:#82AAFF;--shiki-dark-font-style:italic&quot;&gt;apt&lt;/span&gt;&lt;span style=&quot;color:#2B5581;--shiki-dark:#ECC48D&quot;&gt; update&lt;/span&gt;&lt;span style=&quot;color:#212121;--shiki-dark:#D6DEEB&quot;&gt; &amp;#x26;&amp;#x26;&lt;/span&gt;&lt;span style=&quot;color:#6F42C1;--shiki-light-font-style:inherit;--shiki-dark:#82AAFF;--shiki-dark-font-style:italic&quot;&gt; apt&lt;/span&gt;&lt;span style=&quot;color:#2B5581;--shiki-dark:#ECC48D&quot;&gt; install&lt;/span&gt;&lt;span style=&quot;color:#2B5581;--shiki-dark:#ECC48D&quot;&gt; npm&lt;/span&gt;&lt;span style=&quot;color:#2B5581;--shiki-dark:#82AAFF&quot;&gt; -y&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6F42C1;--shiki-light-font-style:inherit;--shiki-dark:#82AAFF;--shiki-dark-font-style:italic&quot;&gt;npm&lt;/span&gt;&lt;span style=&quot;color:#2B5581;--shiki-dark:#ECC48D&quot;&gt; install&lt;/span&gt;&lt;span style=&quot;color:#2B5581;--shiki-dark:#82AAFF&quot;&gt; -g&lt;/span&gt;&lt;span style=&quot;color:#2B5581;--shiki-dark:#ECC48D&quot;&gt; @anthropic-ai/claude-code&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6F42C1;--shiki-light-font-style:inherit;--shiki-dark:#82AAFF;--shiki-dark-font-style:italic&quot;&gt;npm&lt;/span&gt;&lt;span style=&quot;color:#2B5581;--shiki-dark:#ECC48D&quot;&gt; install&lt;/span&gt;&lt;span style=&quot;color:#2B5581;--shiki-dark:#82AAFF&quot;&gt; -g&lt;/span&gt;&lt;span style=&quot;color:#2B5581;--shiki-dark:#ECC48D&quot;&gt; @openai/codex&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&quot;4-setup-github-sync&quot;&gt;4. Setup GitHub Sync&lt;/h3&gt;
&lt;pre class=&quot;astro-code astro-code-themes min-light night-owl&quot; style=&quot;background-color:#ffffff;--shiki-dark-bg:#011627;color:#24292eff;--shiki-dark:#d6deeb; overflow-x: auto; white-space: pre-wrap; word-wrap: break-word;&quot; tabindex=&quot;0&quot; data-language=&quot;bash&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6F42C1;--shiki-light-font-style:inherit;--shiki-dark:#82AAFF;--shiki-dark-font-style:italic&quot;&gt;git&lt;/span&gt;&lt;span style=&quot;color:#2B5581;--shiki-dark:#ECC48D&quot;&gt; config&lt;/span&gt;&lt;span style=&quot;color:#2B5581;--shiki-dark:#82AAFF&quot;&gt; --global&lt;/span&gt;&lt;span style=&quot;color:#2B5581;--shiki-dark:#ECC48D&quot;&gt; user.name&lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#D9F5DD&quot;&gt; &quot;&lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#ECC48D&quot;&gt;Your Name&lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#D9F5DD&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6F42C1;--shiki-light-font-style:inherit;--shiki-dark:#82AAFF;--shiki-dark-font-style:italic&quot;&gt;git&lt;/span&gt;&lt;span style=&quot;color:#2B5581;--shiki-dark:#ECC48D&quot;&gt; config&lt;/span&gt;&lt;span style=&quot;color:#2B5581;--shiki-dark:#82AAFF&quot;&gt; --global&lt;/span&gt;&lt;span style=&quot;color:#2B5581;--shiki-dark:#ECC48D&quot;&gt; user.email&lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#D9F5DD&quot;&gt; &quot;&lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#ECC48D&quot;&gt;your@email.com&lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#D9F5DD&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6F42C1;--shiki-light-font-style:inherit;--shiki-dark:#82AAFF;--shiki-dark-font-style:italic&quot;&gt;ssh-keygen&lt;/span&gt;&lt;span style=&quot;color:#2B5581;--shiki-dark:#82AAFF&quot;&gt; -t&lt;/span&gt;&lt;span style=&quot;color:#2B5581;--shiki-dark:#ECC48D&quot;&gt; ed25519&lt;/span&gt;&lt;span style=&quot;color:#2B5581;--shiki-dark:#82AAFF&quot;&gt; -C&lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#D9F5DD&quot;&gt; &quot;&lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#ECC48D&quot;&gt;your@email.com&lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#D9F5DD&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6F42C1;--shiki-light-font-style:inherit;--shiki-dark:#82AAFF;--shiki-dark-font-style:italic&quot;&gt;cat&lt;/span&gt;&lt;span style=&quot;color:#2B5581;--shiki-dark:#ECC48D&quot;&gt; ~/.ssh/id_ed25519.pub&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Add the SSH key to your GitHub account.&lt;/p&gt;
&lt;h3 id=&quot;5-start-coding&quot;&gt;5. Start Coding&lt;/h3&gt;
&lt;pre class=&quot;astro-code astro-code-themes min-light night-owl&quot; style=&quot;background-color:#ffffff;--shiki-dark-bg:#011627;color:#24292eff;--shiki-dark:#d6deeb; overflow-x: auto; white-space: pre-wrap; word-wrap: break-word;&quot; tabindex=&quot;0&quot; data-language=&quot;bash&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6F42C1;--shiki-light-font-style:inherit;--shiki-dark:#82AAFF;--shiki-dark-font-style:italic&quot;&gt;mkdir&lt;/span&gt;&lt;span style=&quot;color:#2B5581;--shiki-dark:#ECC48D&quot;&gt; ~/projects&lt;/span&gt;&lt;span style=&quot;color:#212121;--shiki-dark:#D6DEEB&quot;&gt; &amp;#x26;&amp;#x26;&lt;/span&gt;&lt;span style=&quot;color:#6F42C1;--shiki-light-font-style:inherit;--shiki-dark:#C5E478;--shiki-dark-font-style:italic&quot;&gt; cd&lt;/span&gt;&lt;span style=&quot;color:#2B5581;--shiki-dark:#ECC48D&quot;&gt; ~/projects&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6F42C1;--shiki-light-font-style:inherit;--shiki-dark:#82AAFF;--shiki-dark-font-style:italic&quot;&gt;codex&lt;/span&gt;&lt;span style=&quot;color:#C2C3C5;--shiki-light-font-style:inherit;--shiki-dark:#637777;--shiki-dark-font-style:italic&quot;&gt;  # or claude&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#C2C3C5;--shiki-light-font-style:inherit;--shiki-dark:#637777;--shiki-dark-font-style:italic&quot;&gt;# Build something&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6F42C1;--shiki-light-font-style:inherit;--shiki-dark:#82AAFF;--shiki-dark-font-style:italic&quot;&gt;git&lt;/span&gt;&lt;span style=&quot;color:#2B5581;--shiki-dark:#ECC48D&quot;&gt; init&lt;/span&gt;&lt;span style=&quot;color:#212121;--shiki-dark:#D6DEEB&quot;&gt; &amp;#x26;&amp;#x26;&lt;/span&gt;&lt;span style=&quot;color:#6F42C1;--shiki-light-font-style:inherit;--shiki-dark:#82AAFF;--shiki-dark-font-style:italic&quot;&gt; git&lt;/span&gt;&lt;span style=&quot;color:#2B5581;--shiki-dark:#ECC48D&quot;&gt; add&lt;/span&gt;&lt;span style=&quot;color:#2B5581;--shiki-dark:#ECC48D&quot;&gt; .&lt;/span&gt;&lt;span style=&quot;color:#212121;--shiki-dark:#D6DEEB&quot;&gt; &amp;#x26;&amp;#x26;&lt;/span&gt;&lt;span style=&quot;color:#6F42C1;--shiki-light-font-style:inherit;--shiki-dark:#82AAFF;--shiki-dark-font-style:italic&quot;&gt; git&lt;/span&gt;&lt;span style=&quot;color:#2B5581;--shiki-dark:#ECC48D&quot;&gt; commit&lt;/span&gt;&lt;span style=&quot;color:#2B5581;--shiki-dark:#82AAFF&quot;&gt; -m&lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#D9F5DD&quot;&gt; &quot;&lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#ECC48D&quot;&gt;built from phone&lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#D9F5DD&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6F42C1;--shiki-light-font-style:inherit;--shiki-dark:#82AAFF;--shiki-dark-font-style:italic&quot;&gt;git&lt;/span&gt;&lt;span style=&quot;color:#2B5581;--shiki-dark:#ECC48D&quot;&gt; remote&lt;/span&gt;&lt;span style=&quot;color:#2B5581;--shiki-dark:#ECC48D&quot;&gt; add&lt;/span&gt;&lt;span style=&quot;color:#2B5581;--shiki-dark:#ECC48D&quot;&gt; origin&lt;/span&gt;&lt;span style=&quot;color:#2B5581;--shiki-dark:#ECC48D&quot;&gt; git@github.com:you/repo.git&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6F42C1;--shiki-light-font-style:inherit;--shiki-dark:#82AAFF;--shiki-dark-font-style:italic&quot;&gt;git&lt;/span&gt;&lt;span style=&quot;color:#2B5581;--shiki-dark:#ECC48D&quot;&gt; push&lt;/span&gt;&lt;span style=&quot;color:#2B5581;--shiki-dark:#82AAFF&quot;&gt; -u&lt;/span&gt;&lt;span style=&quot;color:#2B5581;--shiki-dark:#ECC48D&quot;&gt; origin&lt;/span&gt;&lt;span style=&quot;color:#2B5581;--shiki-dark:#ECC48D&quot;&gt; main&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;h2 id=&quot;result&quot;&gt;Result&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;Coding from mobile anywhere anytime…&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://kneeraj.com/assets/img/2025/coding-from-mobile/code_from_phone_3.png&quot; alt=&quot;Screenshot showing code development interface on mobile phone via Termius&quot; style=&quot;width: 100%; height: auto; border: 3px solid #ddd; box-shadow: 0 4px 8px rgba(0,0,0,0.1);&quot;&gt;&lt;/p&gt;</content:encoded><category>coding-agents</category><category>openclaw</category></item><item><title>Fine-tuning 101: Qwen3 0.6B on CodeForces Data</title><link>https://kneeraj.com/posts/2025/llm-finetuning-101/</link><guid isPermaLink="true">https://kneeraj.com/posts/2025/llm-finetuning-101/</guid><description>Hands-on journey on fine-tuning Qwen3-0.6B on competitive programming problems using HuggingFace infrastructure and Claude Code.</description><pubDate>Tue, 30 Dec 2025 18:30:00 GMT</pubDate><content:encoded>&lt;p&gt;&lt;img src=&quot;https://kneeraj.com/assets/img/2025/fine-tuning-101/header_image.jpg&quot; alt=&quot;image.png&quot; loading=&quot;lazy&quot;&gt;&lt;/p&gt;
&lt;h2 id=&quot;table-of-contents&quot;&gt;Table of Contents&lt;/h2&gt;
&lt;p&gt;&lt;/p&gt;&lt;details&gt;&lt;summary&gt;Open Table of Contents&lt;/summary&gt;&lt;p&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;#introduction&quot;&gt;Introduction&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;#what-were-doing&quot;&gt;What We’re Doing&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;#keywords&quot;&gt;Keywords&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;#key-hyper-parameters&quot;&gt;Key Hyper-parameters&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;#model-evaluation-parameters&quot;&gt;Model Evaluation Parameters&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;#fine-tuning-implementation&quot;&gt;Fine-tuning Implementation&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;#finally-ran-on-1000-examples-with-train-eval-split&quot;&gt;Finally, ran on 1000 examples with train-eval split&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;#key-learnings--what-next&quot;&gt;Key Learnings &amp;#x26; What Next!&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;#key-references&quot;&gt;Key References&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;/p&gt;&lt;/details&gt;&lt;p&gt;&lt;/p&gt;
&lt;h2 id=&quot;introduction&quot;&gt;Introduction&lt;/h2&gt;
&lt;p&gt;Powerful AI models are heavily post-trained for reasoning, coding tasks, agentic capabilities like instruction-following and tool calling. In fact, one of the hypotheses of why Claude Code (CLI) is better is that the model is post-trained on tools that the harness(Claude Code) uses making the full stack (harness + model) even better. It’s the result of deliberate post-training using techniques like &lt;strong&gt;Supervised Fine-Tuning (SFT)&lt;/strong&gt;, &lt;strong&gt;Reinforcement Learning from Human Feedback (RLHF)&lt;/strong&gt;, and &lt;strong&gt;Direct Preference Optimization (DPO)&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;&lt;mark style=&quot;background-color: #fff3cd; padding: 4px 8px; border-radius: 4px; font-weight: bold; font-style: italic;&quot;&gt;*I wanted to understand this process hands-on. In this blog, I’ll walk you through my journey fine-tuning &lt;strong&gt;Qwen3-0.6B&lt;/strong&gt; on HuggingFace CodeForces using its cloud infrastructure and HF &lt;code&gt;model-trainer&lt;/code&gt; claude skill and Claude Code. &lt;/mark&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;We will try Supervised Fine-Tuning (SFT) today.&lt;/strong&gt;&lt;/p&gt;
&lt;h2 id=&quot;what-were-doing&quot;&gt;What We’re Doing&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Base Model:&lt;/strong&gt;  &lt;a href=&quot;https://huggingface.co/Qwen/Qwen3-0.6B&quot;&gt;Qwen3-0.6B&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;CodeForces Competition Problems Dataset:&lt;/strong&gt; The &lt;a href=&quot;https://huggingface.co/datasets/open-r1/codeforces-cots&quot;&gt;open-r1/codeforces-cots&lt;/a&gt; dataset contains &lt;strong&gt;47,000 competitive programming problems&lt;/strong&gt; with solutions and chain-of-thought reasoning traces. Each example has: &lt;strong&gt;Problem description&lt;/strong&gt;: A competitive programming challenge, &lt;strong&gt;Messages format&lt;/strong&gt;: Conversational format with the problem as a user message and the solution with reasoning as an assistant message. Example:&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Problem&lt;/strong&gt; :&lt;/p&gt;
&lt;p&gt;You are given an array &lt;code&gt;a&lt;/code&gt; of &lt;code&gt;n&lt;/code&gt; integers, where &lt;code&gt;n&lt;/code&gt; is odd. In one operation, you will remove two adjacent elements from the array &lt;code&gt;a&lt;/code&gt;, and then concatenate the remaining parts. For example, given the array &lt;code&gt;[4,7,4,2,9]&lt;/code&gt;, we can obtain &lt;code&gt;[4,2,9]&lt;/code&gt; by removing &lt;code&gt;[4,7]&lt;/code&gt;.You will repeatedly perform this operation until exactly one element remains in &lt;code&gt;a&lt;/code&gt;. Find the maximum possible value of the remaining element.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Messages&lt;/strong&gt;:&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes min-light night-owl&quot; style=&quot;background-color:#ffffff;--shiki-dark-bg:#011627;color:#24292eff;--shiki-dark:#d6deeb; overflow-x: auto; white-space: pre-wrap; word-wrap: break-word;&quot; tabindex=&quot;0&quot; data-language=&quot;json&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292EFF;--shiki-dark:#D6DEEB&quot;&gt;{&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#D32F2F;--shiki-dark:#7FDBCA&quot;&gt;  &quot;messages&quot;&lt;/span&gt;&lt;span style=&quot;color:#212121;--shiki-dark:#D6DEEB&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#24292EFF;--shiki-dark:#D6DEEB&quot;&gt; [&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292EFF;--shiki-dark:#D6DEEB&quot;&gt;    {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#D32F2F;--shiki-dark:#7FDBCA&quot;&gt;      &quot;role&quot;&lt;/span&gt;&lt;span style=&quot;color:#212121;--shiki-dark:#D6DEEB&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#D9F5DD&quot;&gt; &quot;&lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#C789D6&quot;&gt;user&lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#D9F5DD&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color:#212121;--shiki-dark:#D6DEEB&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#D32F2F;--shiki-dark:#7FDBCA&quot;&gt;      &quot;content&quot;&lt;/span&gt;&lt;span style=&quot;color:#212121;--shiki-dark:#D6DEEB&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#D9F5DD&quot;&gt; &quot;&lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#C789D6&quot;&gt;You will be given a competitive programming problem. Please reason step by step about the solution, then provide a complete implementation in C++17...&lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#D9F5DD&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292EFF;--shiki-dark:#D6DEEB&quot;&gt;    }&lt;/span&gt;&lt;span style=&quot;color:#212121;--shiki-dark:#D6DEEB&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292EFF;--shiki-dark:#D6DEEB&quot;&gt;    {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#D32F2F;--shiki-dark:#7FDBCA&quot;&gt;      &quot;role&quot;&lt;/span&gt;&lt;span style=&quot;color:#212121;--shiki-dark:#D6DEEB&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#D9F5DD&quot;&gt; &quot;&lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#C789D6&quot;&gt;assistant&lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#D9F5DD&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color:#212121;--shiki-dark:#D6DEEB&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#D32F2F;--shiki-dark:#7FDBCA&quot;&gt;      &quot;content&quot;&lt;/span&gt;&lt;span style=&quot;color:#212121;--shiki-dark:#D6DEEB&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#D9F5DD&quot;&gt; &quot;&lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#C789D6&quot;&gt;Let&apos;s think through this step by step...&lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#F78C6C&quot;&gt;\n\n&lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#C789D6&quot;&gt;```cpp&lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#F78C6C&quot;&gt;\n\n&lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#C789D6&quot;&gt;```&lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#D9F5DD&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292EFF;--shiki-dark:#D6DEEB&quot;&gt;    }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292EFF;--shiki-dark:#D6DEEB&quot;&gt;  ]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292EFF;--shiki-dark:#D6DEEB&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Using HuggingFace Infrastructure &amp;#x26; Tools (model-trainer skill and HF MCP)&lt;/strong&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Hugging Face Jobs&lt;/strong&gt;: Cloud GPU infrastructure (requires HF Pro account)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;TRL (Transformer Reinforcement Learning)&lt;/strong&gt;: The library that actually handles the training loop, LoRA integration, and optimization&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;HF Model-Trainer Skill&lt;/strong&gt; : &lt;a href=&quot;https://github.com/huggingface/skills/tree/main/hf-llm-trainer/skills/model-trainer&quot;&gt;https://github.com/huggingface/skills/tree/main/hf-llm-trainer/skills/model-trainer&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;mark style=&quot;background-color: #fff3cd; padding: 4px 8px; border-radius: 4px; font-weight: bold; font-style: italic;&quot;&gt;Claude Code + HF MCP helps in coding the fine-tuning script, monitoring and pushing metrics, runs jobs in the HF GPU infra.&lt;/mark&gt;&lt;/p&gt;
&lt;h2 id=&quot;keywords&quot;&gt;Keywords&lt;/h2&gt;

















&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;&lt;strong&gt;Terms&lt;/strong&gt;&lt;/th&gt;&lt;th&gt;&lt;strong&gt;Definitions&lt;/strong&gt;&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;strong&gt;Supervised Fine-Tuning (SFT)&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;The pre-trained model (like Qwen3) has broad knowledge from internet text. SFT teaches it task-specific skills by showing it &lt;strong&gt;examples of correct behavior&lt;/strong&gt;. : Understand competitive programming problems, Reason through solution approaches, Generate correct C++ code, Explain the solution clearly&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;strong&gt;LoRA: Efficient Fine-Tuning&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;Qwen3-0.6B has 600 million parameters. LoRA (Low rank adaptation) doesn’t modify the original model weights. Instead, it add a small “adapter” layer that learns tasks-specific transformations. &lt;strong&gt;Finally, we only train about 1% of the total parameters, but still achieve effective learning. The adapters captures the task-specific patterns while the frozen base model retains general knowledge.&lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;
&lt;h3 id=&quot;key-hyper-parameters&quot;&gt;Key Hyper-parameters&lt;/h3&gt;























&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Parameter&lt;/th&gt;&lt;th&gt;Value&lt;/th&gt;&lt;th&gt;What It Does&lt;/th&gt;&lt;th&gt;Why This Value?&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;strong&gt;Batch Size&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;&lt;code&gt;2&lt;/code&gt; (per GPU)&lt;/td&gt;&lt;td&gt;Examples processed simultaneously&lt;/td&gt;&lt;td&gt;Memory-efficient for 24GB GPU&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;strong&gt;Epochs&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;&lt;code&gt;3&lt;/code&gt;&lt;/td&gt;&lt;td&gt;Full passes through the training data to optimise the evaluation&lt;/td&gt;&lt;td&gt;Multiple passes help with 1,000&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;
&lt;h3 id=&quot;model-evaluation-parameters&quot;&gt;Model Evaluation Parameters&lt;/h3&gt;
&lt;p&gt;How do we evaluate the fine-tuned model.&lt;/p&gt;





















&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;&lt;strong&gt;Metric&lt;/strong&gt;&lt;/th&gt;&lt;th&gt;&lt;strong&gt;Definition&lt;/strong&gt;&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;strong&gt;Training loss&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;Measures how well the model predicts tokens on the training data&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;strong&gt;Validation loss&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;Measures how well the model predicts tokens on unseen evaluation data to check generalization&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;strong&gt;Token Accuracy on eval set&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;Model predicts next tokens and we compare with the ground truth&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;
&lt;h2 id=&quot;fine-tuning-implementation&quot;&gt;Fine-tuning Implementation&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;First run, a sample fine-tuning run on 500 examples with 1 epoch&lt;/li&gt;
&lt;li&gt;Second run, fine-tuning run with 1000 examples and 3 epochs&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;First goal was seeing a training job complete successfully. I started with just &lt;strong&gt;500 examples&lt;/strong&gt; for rapid iteration.&lt;/p&gt;
&lt;p&gt;Early attempts had lot of failures:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;❌ Missing dependencies (&lt;code&gt;trl&lt;/code&gt;, &lt;code&gt;peft&lt;/code&gt;, &lt;code&gt;bitsandbytes&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;❌ Format detection errors&lt;/li&gt;
&lt;li&gt;❌ Job timeouts from underestimating training time&lt;/li&gt;
&lt;li&gt;❌ Errors with &lt;code&gt;KeyError: &apos;completion&apos;&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;https://kneeraj.com/assets/img/2025/fine-tuning-101/error_screenshot.png&quot; alt=&quot;image.png&quot; loading=&quot;lazy&quot;&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Key learnings:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Dataset format:&lt;/strong&gt; The TRL library was getting confused with &lt;code&gt;messages&lt;/code&gt; and &lt;code&gt;prompt&lt;/code&gt; columns in the dataset. SFTTrainer saw &lt;code&gt;&apos;prompt&apos;&lt;/code&gt; in the first example and assumed prompt-completion format. Then it looked for &lt;code&gt;&apos;completion&apos;&lt;/code&gt;—which didn’t exist—and crashed.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Use Python UV script format:&lt;/strong&gt;: Inline dependencies in script comments. Jobs can’t access local files&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&quot;finally-ran-on-1000-examples-with-train-eval-split&quot;&gt;Finally, ran on 1000 examples with train-eval split&lt;/h3&gt;
&lt;p&gt;&lt;mark style=&quot;background-color: #fff3cd; padding: 4px 8px; border-radius: 4px; font-weight: bold; font-style: italic;&quot;&gt;&lt;strong&gt;Here is the code :&lt;/strong&gt;  &lt;a href=&quot;https://gist.github.com/kn-neeraj/140c2184233d922be0c2cb92d21dfa00&quot;&gt;https://gist.github.com/kn-neeraj/140c2184233d922be0c2cb92d21dfa00&lt;/a&gt; &lt;/mark&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Results &amp;#x26; Interpretation&lt;/strong&gt;&lt;/p&gt;





























&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Metric&lt;/th&gt;&lt;th&gt;500 Examples (1 epoch)&lt;/th&gt;&lt;th&gt;1000 Examples (3 epochs) train-eval&lt;/th&gt;&lt;th&gt;Improvement&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;strong&gt;Final Loss&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;training loss:  1.1328&lt;/td&gt;&lt;td&gt;training loss : 0.85&lt;br&gt;evaluation loss : &lt;strong&gt;0.35&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;&lt;strong&gt;65% better&lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;strong&gt;Token Accuracy&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;training: 75%&lt;/td&gt;&lt;td&gt;&lt;strong&gt;training : 78%&lt;br&gt;evaluation : 89%&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;&lt;strong&gt;+14%&lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;strong&gt;Training Time&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;~7 min&lt;/td&gt;&lt;td&gt;~18 min&lt;/td&gt;&lt;td&gt;2.6x longer&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;
&lt;p&gt;&lt;strong&gt;Loss Function Graphs from the run&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://kneeraj.com/assets/img/2025/fine-tuning-101/loss_graphs.png&quot; alt=&quot;image.png&quot; loading=&quot;lazy&quot;&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Observations&lt;/strong&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Both train and eval loss decreased together, good for generalization&lt;/li&gt;
&lt;li&gt;Eval metrics were slightly worse than train (expected), but the gap was small&lt;/li&gt;
&lt;li&gt;No signs of severe overfitting even after 3 epochs. Need more epochs&lt;/li&gt;
&lt;li&gt;GPU memory: Still only ~10-12% utilized&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The model was genuinely learning to solve new problems, not just memorizing the training set.&lt;/p&gt;
&lt;h2 id=&quot;key-learnings--what-next&quot;&gt;Key Learnings &amp;#x26; What Next!&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;Learning 1&lt;/strong&gt; -&gt; Claude Code with HF MCP &amp;#x26; model-trainer skill works but with a lot of context. HF MCP gives claude tools like below to help in full cycle of fine-tuning:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;code&gt;mcp__hf-skills__hf_jobs&lt;/code&gt; - Submit training jobs to cloud GPUs&lt;/li&gt;
&lt;li&gt;&lt;code&gt;mcp__hf-skills__model_search&lt;/code&gt; - Find models on the Hub&lt;/li&gt;
&lt;li&gt;&lt;code&gt;mcp__hf-skills__dataset_search&lt;/code&gt; - Discover datasets&lt;/li&gt;
&lt;li&gt;&lt;code&gt;mcp__hf-skills__hub_repo_details&lt;/code&gt; - Get model/dataset info&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;em&gt;&lt;strong&gt;Claude Code helped write training script and use HF MCP to submit the training jobs.&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;What’s Next&lt;/strong&gt; -&gt; Doing fine-tuning run on full dataset (47000 examples) and doing evaluation on benchmark dataset using &lt;a href=&quot;https://kneeraj.com/posts/2025/coding-agent-learnings-2&quot;&gt;LLM-as-a-judge&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Visualising the Full Stack&lt;/strong&gt;&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes min-light night-owl&quot; style=&quot;background-color:#ffffff;--shiki-dark-bg:#011627;color:#24292eff;--shiki-dark:#d6deeb; overflow-x: auto; white-space: pre-wrap; word-wrap: break-word;&quot; tabindex=&quot;0&quot; data-language=&quot;plaintext&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span&gt;┌─────────────────────────────────────────┐&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;│  Claude Code + HF MCP                   │&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;│  (Orchestration &amp;#x26; Debugging)            │&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;└───────────────┬─────────────────────────┘&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;                │&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;┌───────────────▼─────────────────────────┐&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;│  Hugging Face Jobs                      │&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;│  (Cloud GPU Infrastructure)             │&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;└───────────────┬─────────────────────────┘&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;                │&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;┌───────────────▼─────────────────────────┐&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;│  TRL (Transformer RL Library)           │&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;│  (SFTTrainer, LoRA, Training Loop)      │&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;└───────────────┬─────────────────────────┘&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;                │&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;┌───────────────▼─────────────────────────┐&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;│  Trackio                                │&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;│  (Metrics &amp;#x26; Monitoring)                 │&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;└─────────────────────────────────────────┘&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&quot;key-references&quot;&gt;Key References&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://huggingface.co/docs/trl/en/index&quot;&gt;Hugging Face TRL Docs&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Claude model-trainer skill so we can guide claude code to do most of the heavy lifting &lt;a href=&quot;https://github.com/huggingface/skills/tree/main/hf-llm-trainer/skills/model-trainer&quot;&gt;https://github.com/huggingface/skills/tree/main/hf-llm-trainer/skills/model-trainer&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</content:encoded><category>llm-engineering</category><category>coding-agents</category></item><item><title>Designing Memory System for AI Agents</title><link>https://kneeraj.com/posts/2025/ai-agent-memory-system/</link><guid isPermaLink="true">https://kneeraj.com/posts/2025/ai-agent-memory-system/</guid><description>To design memory systems for AI agents with a practical implementation of personalized quizzing app.</description><pubDate>Sat, 22 Nov 2025 18:30:00 GMT</pubDate><content:encoded>&lt;p&gt;&lt;mark style=&quot;background-color: #fff3cd; padding: 4px 8px; border-radius: 4px; font-weight: bold; font-style: italic;&quot;&gt; Agent Memory is hard to build, but it’s the key to creating a personalized, accurate agents with real high switching costs through accumulated context and difficult to replace. &lt;/mark&gt;&lt;/p&gt;
&lt;h2 id=&quot;table-of-contents&quot;&gt;Table of Contents&lt;/h2&gt;
&lt;p&gt;&lt;/p&gt;&lt;details&gt;&lt;summary&gt;Open Table of Contents&lt;/summary&gt;&lt;p&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;#llms-vs-agents&quot;&gt;LLMs vs Agents&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;#why-memory-is-critical-for-agents&quot;&gt;Why Memory is Critical for Agents&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;#memory-system-design-for-ai-agents&quot;&gt;Memory System Design for AI Agents&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;#what-is-a-memory-system&quot;&gt;What is a Memory System?&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;#system-design&quot;&gt;System Design&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;#example-designing-agentic-memory-system-for-personalised-quizzing-app&quot;&gt;Example: Designing Agentic Memory System for “Personalised Quizzing App”&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;#problem&quot;&gt;Problem:&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;#challenges&quot;&gt;Challenges:&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;#memory-system-design&quot;&gt;Memory System Design:&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;#references&quot;&gt;References&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;/p&gt;&lt;/details&gt;&lt;p&gt;&lt;/p&gt;
&lt;h2 id=&quot;llms-vs-agents&quot;&gt;LLMs vs Agents&lt;/h2&gt;
&lt;p&gt;Most product builders confuse b/w LLMs and AI Agents. LLMs are&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Stateless text/image/video predictor&lt;/li&gt;
&lt;li&gt;Single-turn responder - no memory between requests&lt;/li&gt;
&lt;li&gt;No actions - only produces output&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Whereas Agents are intelligent software that accomplishes higher-order human level tasks and needs a series of components such as:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Workflow&lt;/strong&gt; - orchestrates multi-step tasks with user control and transparency&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;LLM (Brain)&lt;/strong&gt; - reasoning and decision-making engine&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Actions via Tools&lt;/strong&gt; - capabilities to interact with external world (APIs, databases, file systems)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Memory&lt;/strong&gt; - Stores context across interactions (short-term session state + long-term knowledge)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Orchestration&lt;/strong&gt; - manages loops, error handling, state transitions&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;h2 id=&quot;why-memory-is-critical-for-agents&quot;&gt;Why Memory is Critical for Agents&lt;/h2&gt;
&lt;p&gt;Memory is critical to humans as they accomplish any tasks to note down learnings, remember instructions, learn from mistakes, etc&lt;/p&gt;
&lt;p&gt;In the same way, memory matters for AI agents:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Personalisation&lt;/strong&gt; (to each customer…)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Boosts accuracy&lt;/strong&gt; in accomplishing tasks to not make same mistakes…&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Being able to perform long horizon tasks&lt;/strong&gt; (working long term requires iterations, learnings, un-learnings)&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;h2 id=&quot;memory-system-design-for-ai-agents&quot;&gt;Memory System Design for AI Agents&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;https://kneeraj.com/assets/img/2025/memory-system-design/ai-agents-memory-system.jpg&quot; alt=&quot;AI Agents memory design system&quot; style=&quot;width: 100%; height: auto; border: 3px solid #ddd; box-shadow: 0 4px 8px rgba(0,0,0,0.1);&quot;&gt;&lt;/p&gt;
&lt;h3 id=&quot;what-is-a-memory-system&quot;&gt;What is a Memory System?&lt;/h3&gt;
&lt;p&gt;A memory system for agent creates, stores, and utilises “memories” that helps agents achieve tasks with &lt;strong&gt;better accuracy&lt;/strong&gt; and &lt;strong&gt;in a more personalised manner&lt;/strong&gt;. Where memories are “&lt;strong&gt;valuable (important) &amp;#x26; Relevant (recent &amp;#x26; not outdated)&lt;/strong&gt;” to the &lt;strong&gt;task&lt;/strong&gt; and the &lt;strong&gt;human&lt;/strong&gt; accomplishing the task.&lt;/p&gt;
&lt;h3 id=&quot;system-design&quot;&gt;System Design&lt;/h3&gt;
&lt;p&gt;To design a memory system for your AI Agent, you need to carefully define the following :&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Entities&lt;/strong&gt; you require information for: Human, company, places, etc. For example, conversation agents require information about their users, but maybe info companies they work for, etc&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Types of information&lt;/strong&gt; that you require:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Working memory (or short-term memory)&lt;/strong&gt;: short-term session memory in the context window&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Semantic or Factual memory&lt;/strong&gt;: remember facts about “entities” (“Neeraj is a AI product builder”)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Episodic Memory&lt;/strong&gt;: “Experiences” or “actions &amp;#x26; results” (“Went to Six Flags on 10th birthday”, “created this code and faced bug last time..”)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Procedural Memory&lt;/strong&gt;: Explicit Instructions to follow for agents (“Always provide concise answers)&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Memory Lifecycle&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;When memories are generated&lt;/strong&gt;:
&lt;ul&gt;
&lt;li&gt;In the hot path: Agent decides what to remember during conversation&lt;/li&gt;
&lt;li&gt;In the background: Async processing after turns/sessions&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;When &amp;#x26; how it is utilised:&lt;/strong&gt; deciding whether to use memory requires nontrivial reasoning over your request and the system rules&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Memory should be Inspectable:&lt;/strong&gt; Can go back to any “memory snippet” used to understand “why”&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;User Control:&lt;/strong&gt; when memory gets used and how users control it&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Memory Store:&lt;/strong&gt; Database for efficient upsert &amp;#x26; retrieval&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;hr&gt;
&lt;h2 id=&quot;example-designing-agentic-memory-system-for-personalised-quizzing-app&quot;&gt;Example: Designing Agentic Memory System for “Personalised Quizzing App”&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;https://kneeraj.com/assets/img/2025/memory-system-design/personalised_quizzing_app.jpg&quot; alt=&quot;AI Agents memory system for personalised quizzing app&quot; style=&quot;width: 100%; height: auto; border: 3px solid #ddd; box-shadow: 0 4px 8px rgba(0,0,0,0.1);&quot;&gt;&lt;/p&gt;
&lt;h3 id=&quot;problem&quot;&gt;Problem:&lt;/h3&gt;
&lt;p&gt;Build a adaptive learning agent that quizzes users on topics they’ve studied, adapting difficulty based on performance and remembering learning patterns across sessions.&lt;/p&gt;
&lt;h3 id=&quot;challenges&quot;&gt;Challenges:&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Track what topics user has learned and their proficiency levels&lt;/li&gt;
&lt;li&gt;Remember past quiz performance&lt;/li&gt;
&lt;li&gt;Adapt difficulty based on learning progress on topics&lt;/li&gt;
&lt;li&gt;Maintain context within a study session while building long-term knowledge&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&quot;memory-system-design&quot;&gt;Memory System Design:&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;Entities&lt;/strong&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;User : Individual learner (proficiency, preferences, learning patterns)&lt;/li&gt;
&lt;li&gt;Topics : Subjects being studied (coverage, difficulty levels)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Types of memories required&lt;/strong&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Working Memory (Short-term/Session-level)&lt;/strong&gt; : Current quiz topic and difficult level, Questions asked in this session, Real-time performance score&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Semantic Memory (Facts)&lt;/strong&gt; : User’s proficiency per topic, Topics mastered vs. struggling with, Study schedule preferences&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Episodic Memory (Events happened…)&lt;/strong&gt; : Past quiz attempts with results (Topic: Calculus, Date: Nov 20, Score: 7/10), Learning breakthroughs, Common mistake patterns, Questions answered incorrectly multiple times&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Procedural Memory (Instructions to follow)&lt;/strong&gt; : - When to Increase difficulty (3 consecutive correct answers), How to space repetition,  Escalation rules (suggest human tutor after 3 failed attempts&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;User Control&lt;/strong&gt;: Opt-in memory with “remember by learning patterns”, granular control with reset proficiency per topic, mark quizzes practice only (no memory updates), See and edit what agent remembers, etc&lt;/p&gt;
&lt;h2 id=&quot;references&quot;&gt;References&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Paper on Cognitive Architectures for Language Agents : &lt;a href=&quot;https://arxiv.org/pdf/2309.02427&quot;&gt;https://arxiv.org/pdf/2309.02427&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://www.leoniemonigatti.com/blog/memory-in-ai-agents.html&quot;&gt;https://www.leoniemonigatti.com/blog/memory-in-ai-agents.html&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</content:encoded><category>ai-agents</category><category>llm-engineering</category></item><item><title>Demystifying AI Agents (1/X): Agent Primitives</title><link>https://kneeraj.com/posts/2025/ai-agent-primitives/</link><guid isPermaLink="true">https://kneeraj.com/posts/2025/ai-agent-primitives/</guid><description>The no buzz-word primer on AI Agents you were looking for! Understanding agent primitives and build a GitHub PR Orchestrator Agent.</description><pubDate>Sun, 21 Sep 2025 10:49:00 GMT</pubDate><content:encoded>&lt;p&gt;&lt;mark style=&quot;background-color: #fff3cd; padding: 4px 8px; border-radius: 4px; font-weight: bold; font-style: italic;&quot;&gt;This is the “no buzz-word primer” on AI Agents you were looking for, I promise!&lt;/mark&gt;&lt;/p&gt;
&lt;h2 id=&quot;table-of-contents&quot;&gt;Table of Contents&lt;/h2&gt;
&lt;p&gt;&lt;/p&gt;&lt;details&gt;&lt;summary&gt;Open Table of Contents&lt;/summary&gt;&lt;p&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;#what-are-ai-agents&quot;&gt;What are AI Agents?&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;#agent-primitives&quot;&gt;Agent Primitives&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;#lets-build-a-github-pr-orchestrator-agent&quot;&gt;Let’s build a Github PR Orchestrator Agent!&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;#step-1-create-agent-with-instructions&quot;&gt;Step 1: Create Agent with instructions&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;#step-2-provide-tool-definitions&quot;&gt;Step 2: Provide Tool Definitions&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;#step-3-review-incoming-pr-with-the-agent&quot;&gt;Step 3: Review incoming PR with the Agent&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;#conclusion&quot;&gt;Conclusion&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;/p&gt;&lt;/details&gt;&lt;p&gt;&lt;/p&gt;
&lt;h2 id=&quot;what-are-ai-agents&quot;&gt;What are AI Agents?&lt;/h2&gt;
&lt;p&gt;In Tech World, “AI Agents” are everywhere. Let’s demystify them by going first principles! Since the field is very evolving, do yourself a favour, instead of sticking to some definition by “influencers” define your own “playbook”.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Having read a lot about AI agents, I really like the Anthropic Team’s definition so let’s borrow from them&lt;/strong&gt; 🙂.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Lets Define Human Agents&lt;/strong&gt; : Humans have brains to think &amp;#x26; break-down problems, memory to recall context while solving problems, and certain “agency or dexterity” to do stuff (hands, legs, etc) using tools like “laptop/mouse,etc” in digital world and “machines” in physical world. Essentially, take a problem, break it down, do something, take feedback and repeat!&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;AI Agents&lt;/strong&gt; : Because LLMs are incredibly smart in “thinking and breaking down problems”, with little help from Human Masters (pun intended!) they can mimick “Human Agents”. That is, LLM based Agents, can also use LLM (their brain) to breakdown problems, use “tools provided” to do stuff in the digital/physical world, receive feedback and keep iterating till the task is complete! &lt;strong&gt;This paradigm of new “intelligent human like AI applications” that is evolving is called “AI Agents”.&lt;/strong&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;https://kneeraj.com/assets/img/2025/ai-agents/agent_types.png&quot; alt=&quot;Comparison of different types of AI agents&quot; style=&quot;width: 100%; height: auto; border: 3px solid #ddd; box-shadow: 0 4px 8px rgba(0,0,0,0.1);&quot;&gt;&lt;/p&gt;
&lt;p&gt;But just like humans not all AI agents are the same! Agents evolve from simple ones with limited autonomy to highly autonomous agents that accomplish a much harder human level of task!&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Single LLM Features&lt;/strong&gt;: Simple app features enhanced with LLM calls. Example: LLM summarizing yesterday’s WhatsApp messages instead of reading them manually. Easy to build but limited in complexity - just fire &amp;#x26; forget with no memory.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Workflow based Agents&lt;/strong&gt;: AI that handles complete digital workflows with predefined steps. Example: Given a presentation topic, the agent researches → creates outline → generates content → adds visuals → provides speaker notes. Each step uses multiple LLM calls in a clear sequence. Gamma.app is a great example.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Highly Autonomous Agents&lt;/strong&gt;: Most people believe these are the true agents! They need only a high-level task and available tools. They break down problems, work iteratively, and adapt their approach autonomously. Magical when they work, but come with higher costs, latency, and unpredictability. Examples: Claude Code, Deep Research agents that handle complex tasks without predefined workflows or orchestration.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;agent-primitives&quot;&gt;Agent Primitives&lt;/h2&gt;
&lt;p&gt;Just like traditional software is composed of frontend, backend, APIs, etc, Agents are composed of the following building blocks:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;LLMs with reasoning &amp;#x26; tool calling&lt;/strong&gt;: LLMs which can reason (to breakdown tasks), can follow instructions, and have tool calling capability (i.e. can call tools available to them at will !!). Most state-of-the-art LLMs have these capabilities!&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Tool System&lt;/strong&gt;: This is where application developers come into picture! Look at the your agent think of the “capabilities” you want to provide the LLM (“your brain”) to accomplish any kind of tasks they may receive!&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Memory &amp;#x26; State Management&lt;/strong&gt;: Just like humans! To work on long horizon tasks one needs to use their past learnings, constantly update their memory and utilise it when needed!&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Control &amp;#x26; Reliability&lt;/strong&gt;: These are the guardrails, constraints, exit conditions you as an app developer have to set, so that Agents don’t go into a zone and just burn time and tokens! With autonomous agents it becomes a very important task!&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Evals&lt;/strong&gt;: Agents are magic when work! But bringing reliability is hard in such autonomous tasks as they can take any path in production! Hence, evals to bring reliability is really important! (Here is &lt;a href=&quot;https://kneeraj.com/posts/2025/framework-for-evaluating-ai-products&quot;&gt;my framework for evaluating LLM-powered products&lt;/a&gt;, and &lt;a href=&quot;https://kneeraj.com/posts/2025/coding-agent-learnings-2&quot;&gt;how I built an evals system for a coding agent&lt;/a&gt;.)&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;img src=&quot;https://kneeraj.com/assets/img/2025/ai-agents/autonomous_agents.png&quot; alt=&quot;Agent primitives architecture diagram&quot; style=&quot;width: 100%; height: auto; border: 3px solid #ddd; box-shadow: 0 4px 8px rgba(0,0,0,0.1);&quot;&gt;&lt;/p&gt;
&lt;h2 id=&quot;lets-build-a-github-pr-orchestrator-agent&quot;&gt;Let’s build a Github PR Orchestrator Agent!&lt;/h2&gt;
&lt;div style=&quot;margin: 1.5rem 0; max-width: 100%; overflow: hidden;&quot;&gt;
  &lt;div style=&quot;position: relative; width: 100%; max-width: 640px; margin: 0 auto; padding-bottom: 56.25%; height: 0;&quot;&gt;
    &lt;iframe style=&quot;position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 0;&quot; src=&quot;https://www.youtube.com/embed/Q1lpF2gxeag&quot; title=&quot;GitHub PR Orchestrator Agent Demo&quot; allow=&quot;accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture&quot; allowfullscreen&gt;
    &lt;/iframe&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;As a PM, I brainstorm with ChatGPT/Claude for PRDs, then build with &lt;code&gt;Claude Code&lt;/code&gt;. For this project, I explored &lt;code&gt;OpenAI Agents SDK&lt;/code&gt; : it provides core agent primitives (instructions, tool definitions, session management) with customization flexibility. Most major LLM providers now offer similar SDKs: Anthropic’s &lt;code&gt;Claude Code SDK&lt;/code&gt;, Google’s &lt;code&gt;Agent Development Kit&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Following was the scope of this agent and &lt;code&gt;prd.md&lt;/code&gt; file:&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes min-light night-owl&quot; style=&quot;background-color:#ffffff;--shiki-dark-bg:#011627;color:#24292eff;--shiki-dark:#d6deeb; overflow-x: auto; white-space: pre-wrap; word-wrap: break-word;&quot; tabindex=&quot;0&quot; data-language=&quot;markdown&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6F42C1;--shiki-light-font-weight:bold;--shiki-dark:#82B1FF;--shiki-dark-font-weight:inherit&quot;&gt;# Github PR Orchestrator Agent - PRD&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6F42C1;--shiki-light-font-weight:bold;--shiki-dark:#82B1FF;--shiki-dark-font-weight:inherit&quot;&gt;## Introduction &lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292EFF;--shiki-dark:#D6DEEB&quot;&gt;I am building a github PR Orchestrator AI Agent. Even-driven agent that reviews PRs in a fixed workflow: summarise, assess risks, and annotate. &lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6F42C1;--shiki-light-font-weight:bold;--shiki-dark:#C5E478;--shiki-dark-font-weight:inherit&quot;&gt;**&lt;/span&gt;&lt;span style=&quot;color:#6F42C1;--shiki-light-font-weight:bold;--shiki-dark:#C5E478;--shiki-dark-font-weight:bold&quot;&gt;Features&lt;/span&gt;&lt;span style=&quot;color:#6F42C1;--shiki-light-font-weight:bold;--shiki-dark:#C5E478;--shiki-dark-font-weight:inherit&quot;&gt;**&lt;/span&gt;&lt;span style=&quot;color:#24292EFF;--shiki-dark:#D6DEEB&quot;&gt;: &lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292EFF;--shiki-dark:#D9F5DD&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;color:#24292EFF;--shiki-dark:#D6DEEB&quot;&gt; Concise PR summary with impacted files.&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292EFF;--shiki-dark:#D9F5DD&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;color:#24292EFF;--shiki-dark:#D6DEEB&quot;&gt; Risk detection + reviewer checklist.&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292EFF;--shiki-dark:#D9F5DD&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;color:#24292EFF;--shiki-dark:#D6DEEB&quot;&gt; Inline annotations (≤50 per batch) posted to GitHub Checks.&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6F42C1;--shiki-light-font-weight:bold;--shiki-dark:#82B1FF;--shiki-dark-font-weight:inherit&quot;&gt;## High Level Implementation Plan&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292EFF;--shiki-dark:#D9F5DD&quot;&gt;1.&lt;/span&gt;&lt;span style=&quot;color:#6F42C1;--shiki-light-font-weight:bold;--shiki-dark:#C5E478;--shiki-dark-font-weight:inherit&quot;&gt; **&lt;/span&gt;&lt;span style=&quot;color:#6F42C1;--shiki-light-font-weight:bold;--shiki-dark:#C5E478;--shiki-dark-font-weight:bold&quot;&gt;Trigger&lt;/span&gt;&lt;span style=&quot;color:#6F42C1;--shiki-light-font-weight:bold;--shiki-dark:#C5E478;--shiki-dark-font-weight:inherit&quot;&gt;**&lt;/span&gt;&lt;span style=&quot;color:#24292EFF;--shiki-dark:#D6DEEB&quot;&gt;: Create a &lt;/span&gt;&lt;span style=&quot;color:#6F42C1;--shiki-light-font-weight:bold;--shiki-dark:#C5E478;--shiki-dark-font-weight:inherit&quot;&gt;**&lt;/span&gt;&lt;span style=&quot;color:#6F42C1;--shiki-light-font-weight:bold;--shiki-dark:#C5E478;--shiki-dark-font-weight:bold&quot;&gt;GitHub Actions&lt;/span&gt;&lt;span style=&quot;color:#6F42C1;--shiki-light-font-weight:bold;--shiki-dark:#C5E478;--shiki-dark-font-weight:inherit&quot;&gt;**&lt;/span&gt;&lt;span style=&quot;color:#24292EFF;--shiki-dark:#D6DEEB&quot;&gt; workflow on &lt;/span&gt;&lt;span style=&quot;color:#2B5581;--shiki-dark:#C5E478&quot;&gt;`pull_request`&lt;/span&gt;&lt;span style=&quot;color:#24292EFF;--shiki-dark:#D6DEEB&quot;&gt; (&lt;/span&gt;&lt;span style=&quot;color:#2B5581;--shiki-dark:#C5E478&quot;&gt;`opened|synchronize|reopened`&lt;/span&gt;&lt;span style=&quot;color:#24292EFF;--shiki-dark:#D6DEEB&quot;&gt;).&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292EFF;--shiki-dark:#D9F5DD&quot;&gt;2.&lt;/span&gt;&lt;span style=&quot;color:#24292EFF;--shiki-dark:#D6DEEB&quot;&gt; Add &lt;/span&gt;&lt;span style=&quot;color:#2B5581;--shiki-dark:#C5E478&quot;&gt;`OPENAI_API_KEY`&lt;/span&gt;&lt;span style=&quot;color:#24292EFF;--shiki-dark:#D6DEEB&quot;&gt; to secrets&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292EFF;--shiki-dark:#D9F5DD&quot;&gt;3.&lt;/span&gt;&lt;span style=&quot;color:#6F42C1;--shiki-light-font-weight:bold;--shiki-dark:#C5E478;--shiki-dark-font-weight:inherit&quot;&gt; **&lt;/span&gt;&lt;span style=&quot;color:#6F42C1;--shiki-light-font-weight:bold;--shiki-dark:#C5E478;--shiki-dark-font-weight:bold&quot;&gt;Fetch context&lt;/span&gt;&lt;span style=&quot;color:#6F42C1;--shiki-light-font-weight:bold;--shiki-dark:#C5E478;--shiki-dark-font-weight:inherit&quot;&gt;**&lt;/span&gt;&lt;span style=&quot;color:#24292EFF;--shiki-dark:#D6DEEB&quot;&gt;: In the job, call GitHub REST to &lt;/span&gt;&lt;span style=&quot;color:#6F42C1;--shiki-light-font-weight:bold;--shiki-dark:#C5E478;--shiki-dark-font-weight:inherit&quot;&gt;**&lt;/span&gt;&lt;span style=&quot;color:#6F42C1;--shiki-light-font-weight:bold;--shiki-dark:#C5E478;--shiki-dark-font-weight:bold&quot;&gt;get PR details + list changed files&lt;/span&gt;&lt;span style=&quot;color:#6F42C1;--shiki-light-font-weight:bold;--shiki-dark:#C5E478;--shiki-dark-font-weight:inherit&quot;&gt;**&lt;/span&gt;&lt;span style=&quot;color:#24292EFF;--shiki-dark:#D6DEEB&quot;&gt; (and/or fetch the diff).&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292EFF;--shiki-dark:#D9F5DD&quot;&gt;4.&lt;/span&gt;&lt;span style=&quot;color:#6F42C1;--shiki-light-font-weight:bold;--shiki-dark:#C5E478;--shiki-dark-font-weight:inherit&quot;&gt; **&lt;/span&gt;&lt;span style=&quot;color:#6F42C1;--shiki-light-font-weight:bold;--shiki-dark:#C5E478;--shiki-dark-font-weight:bold&quot;&gt;Install SDK&lt;/span&gt;&lt;span style=&quot;color:#6F42C1;--shiki-light-font-weight:bold;--shiki-dark:#C5E478;--shiki-dark-font-weight:inherit&quot;&gt;**&lt;/span&gt;&lt;span style=&quot;color:#24292EFF;--shiki-dark:#D6DEEB&quot;&gt;: Install the &lt;/span&gt;&lt;span style=&quot;color:#6F42C1;--shiki-light-font-weight:bold;--shiki-dark:#C5E478;--shiki-dark-font-weight:inherit&quot;&gt;**&lt;/span&gt;&lt;span style=&quot;color:#6F42C1;--shiki-light-font-weight:bold;--shiki-dark:#C5E478;--shiki-dark-font-weight:bold&quot;&gt;OpenAI Agents SDK&lt;/span&gt;&lt;span style=&quot;color:#6F42C1;--shiki-light-font-weight:bold;--shiki-dark:#C5E478;--shiki-dark-font-weight:inherit&quot;&gt;**&lt;/span&gt;&lt;span style=&quot;color:#24292EFF;--shiki-dark:#D6DEEB&quot;&gt; in the job. (We&apos;ll use &lt;/span&gt;&lt;span style=&quot;color:#6F42C1;--shiki-light-font-weight:bold;--shiki-dark:#C5E478;--shiki-dark-font-weight:inherit&quot;&gt;**&lt;/span&gt;&lt;span style=&quot;color:#6F42C1;--shiki-light-font-weight:bold;--shiki-dark:#C5E478;--shiki-dark-font-weight:bold&quot;&gt;Agents&lt;/span&gt;&lt;span style=&quot;color:#6F42C1;--shiki-light-font-weight:bold;--shiki-dark:#C5E478;--shiki-dark-font-weight:inherit&quot;&gt;**&lt;/span&gt;&lt;span style=&quot;color:#24292EFF;--shiki-dark:#D6DEEB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#6F42C1;--shiki-light-font-weight:bold;--shiki-dark:#C5E478;--shiki-dark-font-weight:inherit&quot;&gt;**&lt;/span&gt;&lt;span style=&quot;color:#6F42C1;--shiki-light-font-weight:bold;--shiki-dark:#C5E478;--shiki-dark-font-weight:bold&quot;&gt;Sessions&lt;/span&gt;&lt;span style=&quot;color:#6F42C1;--shiki-light-font-weight:bold;--shiki-dark:#C5E478;--shiki-dark-font-weight:inherit&quot;&gt;**&lt;/span&gt;&lt;span style=&quot;color:#24292EFF;--shiki-dark:#D6DEEB&quot;&gt; for per-PR state, and &lt;/span&gt;&lt;span style=&quot;color:#6F42C1;--shiki-light-font-weight:bold;--shiki-dark:#C5E478;--shiki-dark-font-weight:inherit&quot;&gt;**&lt;/span&gt;&lt;span style=&quot;color:#6F42C1;--shiki-light-font-weight:bold;--shiki-dark:#C5E478;--shiki-dark-font-weight:bold&quot;&gt;Guardrails&lt;/span&gt;&lt;span style=&quot;color:#6F42C1;--shiki-light-font-weight:bold;--shiki-dark:#C5E478;--shiki-dark-font-weight:inherit&quot;&gt;**&lt;/span&gt;&lt;span style=&quot;color:#24292EFF;--shiki-dark:#D6DEEB&quot;&gt; for output validation.) &lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292EFF;--shiki-dark:#D9F5DD&quot;&gt;5.&lt;/span&gt;&lt;span style=&quot;color:#6F42C1;--shiki-light-font-weight:bold;--shiki-dark:#C5E478;--shiki-dark-font-weight:inherit&quot;&gt; **&lt;/span&gt;&lt;span style=&quot;color:#6F42C1;--shiki-light-font-weight:bold;--shiki-dark:#C5E478;--shiki-dark-font-weight:bold&quot;&gt;Define agent&lt;/span&gt;&lt;span style=&quot;color:#6F42C1;--shiki-light-font-weight:bold;--shiki-dark:#C5E478;--shiki-dark-font-weight:inherit&quot;&gt;**&lt;/span&gt;&lt;span style=&quot;color:#24292EFF;--shiki-dark:#D6DEEB&quot;&gt;: &quot;Reviewer&quot; agent with tools: &lt;/span&gt;&lt;span style=&quot;color:#2B5581;--shiki-dark:#C5E478&quot;&gt;`gh_get_pr`&lt;/span&gt;&lt;span style=&quot;color:#24292EFF;--shiki-dark:#D6DEEB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#2B5581;--shiki-dark:#C5E478&quot;&gt;`gh_list_files`&lt;/span&gt;&lt;span style=&quot;color:#24292EFF;--shiki-dark:#D6DEEB&quot;&gt;, optional &lt;/span&gt;&lt;span style=&quot;color:#2B5581;--shiki-dark:#C5E478&quot;&gt;`gh_get_diff`&lt;/span&gt;&lt;span style=&quot;color:#24292EFF;--shiki-dark:#D6DEEB&quot;&gt;. Output schema: &lt;/span&gt;&lt;span style=&quot;color:#2B5581;--shiki-dark:#C5E478&quot;&gt;`{summary, checklist[], annotations[]}`&lt;/span&gt;&lt;span style=&quot;color:#24292EFF;--shiki-dark:#D6DEEB&quot;&gt;.&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292EFF;--shiki-dark:#D9F5DD&quot;&gt;6.&lt;/span&gt;&lt;span style=&quot;color:#6F42C1;--shiki-light-font-weight:bold;--shiki-dark:#C5E478;--shiki-dark-font-weight:inherit&quot;&gt; **&lt;/span&gt;&lt;span style=&quot;color:#6F42C1;--shiki-light-font-weight:bold;--shiki-dark:#C5E478;--shiki-dark-font-weight:bold&quot;&gt;Run&lt;/span&gt;&lt;span style=&quot;color:#6F42C1;--shiki-light-font-weight:bold;--shiki-dark:#C5E478;--shiki-dark-font-weight:inherit&quot;&gt;**&lt;/span&gt;&lt;span style=&quot;color:#24292EFF;--shiki-dark:#D6DEEB&quot;&gt;: Pass files/diff to the agent; produce summary, risk checklist, and normalized annotations (&lt;/span&gt;&lt;span style=&quot;color:#2B5581;--shiki-dark:#C5E478&quot;&gt;`path`&lt;/span&gt;&lt;span style=&quot;color:#24292EFF;--shiki-dark:#D6DEEB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#2B5581;--shiki-dark:#C5E478&quot;&gt;`start_line`&lt;/span&gt;&lt;span style=&quot;color:#24292EFF;--shiki-dark:#D6DEEB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#2B5581;--shiki-dark:#C5E478&quot;&gt;`end_line`&lt;/span&gt;&lt;span style=&quot;color:#24292EFF;--shiki-dark:#D6DEEB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#2B5581;--shiki-dark:#C5E478&quot;&gt;`level`&lt;/span&gt;&lt;span style=&quot;color:#24292EFF;--shiki-dark:#D6DEEB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#2B5581;--shiki-dark:#C5E478&quot;&gt;`message`&lt;/span&gt;&lt;span style=&quot;color:#24292EFF;--shiki-dark:#D6DEEB&quot;&gt;).&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292EFF;--shiki-dark:#D9F5DD&quot;&gt;7.&lt;/span&gt;&lt;span style=&quot;color:#24292EFF;--shiki-dark:#D6DEEB&quot;&gt; Post results:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292EFF;--shiki-dark:#D9F5DD&quot;&gt;    -&lt;/span&gt;&lt;span style=&quot;color:#6F42C1;--shiki-light-font-weight:bold;--shiki-dark:#C5E478;--shiki-dark-font-weight:inherit&quot;&gt; **&lt;/span&gt;&lt;span style=&quot;color:#6F42C1;--shiki-light-font-weight:bold;--shiki-dark:#C5E478;--shiki-dark-font-weight:bold&quot;&gt;No-server path (easiest):&lt;/span&gt;&lt;span style=&quot;color:#6F42C1;--shiki-light-font-weight:bold;--shiki-dark:#C5E478;--shiki-dark-font-weight:inherit&quot;&gt;**&lt;/span&gt;&lt;span style=&quot;color:#24292EFF;--shiki-dark:#D6DEEB&quot;&gt; Emit &lt;/span&gt;&lt;span style=&quot;color:#6F42C1;--shiki-light-font-weight:bold;--shiki-dark:#C5E478;--shiki-dark-font-weight:inherit&quot;&gt;**&lt;/span&gt;&lt;span style=&quot;color:#6F42C1;--shiki-light-font-weight:bold;--shiki-dark:#C5E478;--shiki-dark-font-weight:bold&quot;&gt;workflow annotations&lt;/span&gt;&lt;span style=&quot;color:#6F42C1;--shiki-light-font-weight:bold;--shiki-dark:#C5E478;--shiki-dark-font-weight:inherit&quot;&gt;**&lt;/span&gt;&lt;span style=&quot;color:#24292EFF;--shiki-dark:#D6DEEB&quot;&gt; via Actions &lt;/span&gt;&lt;span style=&quot;color:#6F42C1;--shiki-light-font-weight:bold;--shiki-dark:#C5E478;--shiki-dark-font-weight:inherit&quot;&gt;**&lt;/span&gt;&lt;span style=&quot;color:#6F42C1;--shiki-light-font-weight:bold;--shiki-dark:#C5E478;--shiki-dark-font-weight:bold&quot;&gt;workflow commands&lt;/span&gt;&lt;span style=&quot;color:#6F42C1;--shiki-light-font-weight:bold;--shiki-dark:#C5E478;--shiki-dark-font-weight:inherit&quot;&gt;**&lt;/span&gt;&lt;span style=&quot;color:#24292EFF;--shiki-dark:#D6DEEB&quot;&gt; (&lt;/span&gt;&lt;span style=&quot;color:#2B5581;--shiki-dark:#C5E478&quot;&gt;`::notice|::warning|::error file=...,line=...::message`&lt;/span&gt;&lt;span style=&quot;color:#24292EFF;--shiki-dark:#D6DEEB&quot;&gt;) so they show inline on the PR. Also write the summary to the job summary.&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292EFF;--shiki-dark:#D9F5DD&quot;&gt;8.&lt;/span&gt;&lt;span style=&quot;color:#6F42C1;--shiki-light-font-weight:bold;--shiki-dark:#C5E478;--shiki-dark-font-weight:inherit&quot;&gt; **&lt;/span&gt;&lt;span style=&quot;color:#6F42C1;--shiki-light-font-weight:bold;--shiki-dark:#C5E478;--shiki-dark-font-weight:bold&quot;&gt;Guard &amp;#x26; limits&lt;/span&gt;&lt;span style=&quot;color:#6F42C1;--shiki-light-font-weight:bold;--shiki-dark:#C5E478;--shiki-dark-font-weight:inherit&quot;&gt;**&lt;/span&gt;&lt;span style=&quot;color:#24292EFF;--shiki-dark:#D6DEEB&quot;&gt;: Enforce max annotations per run, validate JSON before posting, and retry on API 429/5xx.&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Let’s follow these simple steps to create the Agent:&lt;/strong&gt;&lt;/p&gt;
&lt;h3 id=&quot;step-1-create-agent-with-instructions&quot;&gt;Step 1: Create Agent with instructions&lt;/h3&gt;
&lt;pre class=&quot;astro-code astro-code-themes min-light night-owl&quot; style=&quot;background-color:#ffffff;--shiki-dark-bg:#011627;color:#24292eff;--shiki-dark:#d6deeb; overflow-x: auto; white-space: pre-wrap; word-wrap: break-word;&quot; tabindex=&quot;0&quot; data-language=&quot;python&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#C2C3C5;--shiki-light-font-style:inherit;--shiki-dark:#637777;--shiki-dark-font-style:italic&quot;&gt;# Agent instructions&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292EFF;--shiki-dark:#D6DEEB&quot;&gt;instructions &lt;/span&gt;&lt;span style=&quot;color:#D32F2F;--shiki-dark:#C792EA&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#D9F5DD&quot;&gt; &quot;&quot;&quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#ECC48D&quot;&gt;You are a senior code reviewer AI agent specializing in pull request analysis.&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#ECC48D&quot;&gt;Your responsibilities:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#ECC48D&quot;&gt;1. Use get_pr_details() to understand the PR context&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#ECC48D&quot;&gt;2. Use analyze_file_changes() to examine what files were modified&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#ECC48D&quot;&gt;3. Use security_scan() to check for security risks&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#ECC48D&quot;&gt;4. Use performance_check() to identify performance concerns&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#ECC48D&quot;&gt;5. Generate a structured review with summary, checklist, and annotations&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#ECC48D&quot;&gt;Always be constructive, specific, and helpful in your feedback.&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#ECC48D&quot;&gt;Focus on code quality, security, performance, and maintainability.&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#ECC48D&quot;&gt;Provide your final review in this exact format:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#ECC48D&quot;&gt;SUMMARY: [2-3 sentence summary of the PR]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#ECC48D&quot;&gt;RISK_SCORE: [number 1-10]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#ECC48D&quot;&gt;CHECKLIST:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#ECC48D&quot;&gt;- [item 1 with priority: high/medium/low]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#ECC48D&quot;&gt;- [item 2 with priority: high/medium/low]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#ECC48D&quot;&gt;ANNOTATIONS:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#ECC48D&quot;&gt;- [filename]:[line]: [level]: [message]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#ECC48D&quot;&gt;- [filename]:[line]: [level]: [message]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#D9F5DD&quot;&gt;&quot;&quot;&quot;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&quot;step-2-provide-tool-definitions&quot;&gt;Step 2: Provide Tool Definitions&lt;/h3&gt;
&lt;p&gt;Define tool definitions for analyzing file changes, security scan, performance scan, getting PR metadata, etc. These tool definitions are provided LLMs so that as per the task, based on their instructions they can call these tools autonomously and act on their output!&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes min-light night-owl&quot; style=&quot;background-color:#ffffff;--shiki-dark-bg:#011627;color:#24292eff;--shiki-dark:#d6deeb; overflow-x: auto; white-space: pre-wrap; word-wrap: break-word;&quot; tabindex=&quot;0&quot; data-language=&quot;python&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6F42C1;--shiki-dark:#C5E478&quot;&gt;@&lt;/span&gt;&lt;span style=&quot;color:#6F42C1;--shiki-light-font-style:inherit;--shiki-dark:#C5E478;--shiki-dark-font-style:italic&quot;&gt;function_tool&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#D32F2F;--shiki-dark:#C792EA&quot;&gt;def&lt;/span&gt;&lt;span style=&quot;color:#6F42C1;--shiki-light-font-style:inherit;--shiki-dark:#82AAFF;--shiki-dark-font-style:italic&quot;&gt; analyze_file_changes&lt;/span&gt;&lt;span style=&quot;color:#24292EFF;--shiki-dark:#D9F5DD&quot;&gt;()&lt;/span&gt;&lt;span style=&quot;color:#212121;--shiki-dark:#D6DEEB&quot;&gt; -&gt;&lt;/span&gt;&lt;span style=&quot;color:#24292EFF;--shiki-dark:#D6DEEB&quot;&gt; List&lt;/span&gt;&lt;span style=&quot;color:#212121;--shiki-dark:#D6DEEB&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color:#24292EFF;--shiki-dark:#D6DEEB&quot;&gt;Dict&lt;/span&gt;&lt;span style=&quot;color:#212121;--shiki-dark:#D6DEEB&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color:#1976D2;--shiki-dark:#C5E478&quot;&gt;str&lt;/span&gt;&lt;span style=&quot;color:#212121;--shiki-dark:#D6DEEB&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color:#24292EFF;--shiki-dark:#D6DEEB&quot;&gt; Any&lt;/span&gt;&lt;span style=&quot;color:#212121;--shiki-dark:#D6DEEB&quot;&gt;]]&lt;/span&gt;&lt;span style=&quot;color:#24292EFF;--shiki-dark:#D6DEEB&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#C2C3C5;--shiki-dark:#D9F5DD&quot;&gt;    &quot;&quot;&quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#C2C3C5;--shiki-dark:#ECC48D&quot;&gt;    Tool: Analyze individual file changes&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#C2C3C5;--shiki-dark:#D9F5DD&quot;&gt;    &quot;&quot;&quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#D32F2F;--shiki-light-font-style:inherit;--shiki-dark:#C792EA;--shiki-dark-font-style:italic&quot;&gt;    global&lt;/span&gt;&lt;span style=&quot;color:#24292EFF;--shiki-dark:#82AAFF&quot;&gt; FILES_DATA&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292EFF;--shiki-dark:#D6DEEB&quot;&gt;    analyzed_files &lt;/span&gt;&lt;span style=&quot;color:#D32F2F;--shiki-dark:#C792EA&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#24292EFF;--shiki-dark:#D9F5DD&quot;&gt; []&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#D32F2F;--shiki-light-font-style:inherit;--shiki-dark:#C792EA;--shiki-dark-font-style:italic&quot;&gt;    for&lt;/span&gt;&lt;span style=&quot;color:#24292EFF;--shiki-dark:#D6DEEB&quot;&gt; file_data &lt;/span&gt;&lt;span style=&quot;color:#D32F2F;--shiki-light-font-style:inherit;--shiki-dark:#C792EA;--shiki-dark-font-style:italic&quot;&gt;in&lt;/span&gt;&lt;span style=&quot;color:#24292EFF;--shiki-dark:#82AAFF&quot;&gt; FILES_DATA&lt;/span&gt;&lt;span style=&quot;color:#212121;--shiki-dark:#D6DEEB&quot;&gt;[:&lt;/span&gt;&lt;span style=&quot;color:#1976D2;--shiki-dark:#F78C6C&quot;&gt;20&lt;/span&gt;&lt;span style=&quot;color:#212121;--shiki-dark:#D6DEEB&quot;&gt;]:&lt;/span&gt;&lt;span style=&quot;color:#C2C3C5;--shiki-light-font-style:inherit;--shiki-dark:#637777;--shiki-dark-font-style:italic&quot;&gt;  # Limit to 20 files max&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292EFF;--shiki-dark:#D6DEEB&quot;&gt;        file_info &lt;/span&gt;&lt;span style=&quot;color:#D32F2F;--shiki-dark:#C792EA&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#212121;--shiki-dark:#D6DEEB&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#D9F5DD&quot;&gt;            &quot;&lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#ECC48D&quot;&gt;filename&lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#D9F5DD&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color:#212121;--shiki-dark:#D6DEEB&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#24292EFF;--shiki-dark:#D6DEEB&quot;&gt; file_data&lt;/span&gt;&lt;span style=&quot;color:#212121;--shiki-dark:#D6DEEB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#6F42C1;--shiki-dark:#B2CCD6&quot;&gt;get&lt;/span&gt;&lt;span style=&quot;color:#212121;--shiki-dark:#D6DEEB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#D9F5DD&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#ECC48D&quot;&gt;filename&lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#D9F5DD&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color:#212121;--shiki-dark:#D9F5DD&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#D9F5DD&quot;&gt; &quot;&quot;&lt;/span&gt;&lt;span style=&quot;color:#212121;--shiki-dark:#D6DEEB&quot;&gt;),&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#D9F5DD&quot;&gt;            &quot;&lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#ECC48D&quot;&gt;status&lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#D9F5DD&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color:#212121;--shiki-dark:#D6DEEB&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#24292EFF;--shiki-dark:#D6DEEB&quot;&gt; file_data&lt;/span&gt;&lt;span style=&quot;color:#212121;--shiki-dark:#D6DEEB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#6F42C1;--shiki-dark:#B2CCD6&quot;&gt;get&lt;/span&gt;&lt;span style=&quot;color:#212121;--shiki-dark:#D6DEEB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#D9F5DD&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#ECC48D&quot;&gt;status&lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#D9F5DD&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color:#212121;--shiki-dark:#D9F5DD&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#D9F5DD&quot;&gt; &quot;&quot;&lt;/span&gt;&lt;span style=&quot;color:#212121;--shiki-dark:#D6DEEB&quot;&gt;),&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#D9F5DD&quot;&gt;            &quot;&lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#ECC48D&quot;&gt;additions&lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#D9F5DD&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color:#212121;--shiki-dark:#D6DEEB&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#24292EFF;--shiki-dark:#D6DEEB&quot;&gt; file_data&lt;/span&gt;&lt;span style=&quot;color:#212121;--shiki-dark:#D6DEEB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#6F42C1;--shiki-dark:#B2CCD6&quot;&gt;get&lt;/span&gt;&lt;span style=&quot;color:#212121;--shiki-dark:#D6DEEB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#D9F5DD&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#ECC48D&quot;&gt;additions&lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#D9F5DD&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color:#212121;--shiki-dark:#D9F5DD&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color:#1976D2;--shiki-dark:#F78C6C&quot;&gt; 0&lt;/span&gt;&lt;span style=&quot;color:#212121;--shiki-dark:#D6DEEB&quot;&gt;),&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#D9F5DD&quot;&gt;            &quot;&lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#ECC48D&quot;&gt;deletions&lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#D9F5DD&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color:#212121;--shiki-dark:#D6DEEB&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#24292EFF;--shiki-dark:#D6DEEB&quot;&gt; file_data&lt;/span&gt;&lt;span style=&quot;color:#212121;--shiki-dark:#D6DEEB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#6F42C1;--shiki-dark:#B2CCD6&quot;&gt;get&lt;/span&gt;&lt;span style=&quot;color:#212121;--shiki-dark:#D6DEEB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#D9F5DD&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#ECC48D&quot;&gt;deletions&lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#D9F5DD&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color:#212121;--shiki-dark:#D9F5DD&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color:#1976D2;--shiki-dark:#F78C6C&quot;&gt; 0&lt;/span&gt;&lt;span style=&quot;color:#212121;--shiki-dark:#D6DEEB&quot;&gt;),&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#D9F5DD&quot;&gt;            &quot;&lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#ECC48D&quot;&gt;extension&lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#D9F5DD&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color:#212121;--shiki-dark:#D6DEEB&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#6F42C1;--shiki-dark:#B2CCD6&quot;&gt; get_file_extension&lt;/span&gt;&lt;span style=&quot;color:#212121;--shiki-dark:#D6DEEB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#212121;--shiki-dark:#82AAFF&quot;&gt;file_data.&lt;/span&gt;&lt;span style=&quot;color:#6F42C1;--shiki-dark:#B2CCD6&quot;&gt;get&lt;/span&gt;&lt;span style=&quot;color:#212121;--shiki-dark:#D6DEEB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#D9F5DD&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#ECC48D&quot;&gt;filename&lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#D9F5DD&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color:#212121;--shiki-dark:#D9F5DD&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#D9F5DD&quot;&gt; &quot;&quot;&lt;/span&gt;&lt;span style=&quot;color:#212121;--shiki-dark:#D6DEEB&quot;&gt;)),&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#D9F5DD&quot;&gt;            &quot;&lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#ECC48D&quot;&gt;has_tests&lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#D9F5DD&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color:#212121;--shiki-dark:#D6DEEB&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#D9F5DD&quot;&gt; &quot;&lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#ECC48D&quot;&gt;test&lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#D9F5DD&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color:#D32F2F;--shiki-dark:#C792EA&quot;&gt; in&lt;/span&gt;&lt;span style=&quot;color:#24292EFF;--shiki-dark:#D6DEEB&quot;&gt; file_data&lt;/span&gt;&lt;span style=&quot;color:#212121;--shiki-dark:#D6DEEB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#6F42C1;--shiki-dark:#B2CCD6&quot;&gt;get&lt;/span&gt;&lt;span style=&quot;color:#212121;--shiki-dark:#D6DEEB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#D9F5DD&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#ECC48D&quot;&gt;filename&lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#D9F5DD&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color:#212121;--shiki-dark:#D9F5DD&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#D9F5DD&quot;&gt; &quot;&quot;&lt;/span&gt;&lt;span style=&quot;color:#212121;--shiki-dark:#D6DEEB&quot;&gt;).&lt;/span&gt;&lt;span style=&quot;color:#6F42C1;--shiki-dark:#B2CCD6&quot;&gt;lower&lt;/span&gt;&lt;span style=&quot;color:#212121;--shiki-dark:#D6DEEB&quot;&gt;(),&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#D9F5DD&quot;&gt;            &quot;&lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#ECC48D&quot;&gt;patch_preview&lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#D9F5DD&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color:#212121;--shiki-dark:#D6DEEB&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#24292EFF;--shiki-dark:#D6DEEB&quot;&gt; file_data&lt;/span&gt;&lt;span style=&quot;color:#212121;--shiki-dark:#D6DEEB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#6F42C1;--shiki-dark:#B2CCD6&quot;&gt;get&lt;/span&gt;&lt;span style=&quot;color:#212121;--shiki-dark:#D6DEEB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#D9F5DD&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#ECC48D&quot;&gt;patch&lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#D9F5DD&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color:#212121;--shiki-dark:#D9F5DD&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#D9F5DD&quot;&gt; &quot;&quot;&lt;/span&gt;&lt;span style=&quot;color:#212121;--shiki-dark:#D6DEEB&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color:#24292EFF;--shiki-dark:#D9F5DD&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color:#212121;--shiki-dark:#D6DEEB&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#1976D2;--shiki-dark:#F78C6C&quot;&gt;800&lt;/span&gt;&lt;span style=&quot;color:#24292EFF;--shiki-dark:#D9F5DD&quot;&gt;]&lt;/span&gt;&lt;span style=&quot;color:#C2C3C5;--shiki-light-font-style:inherit;--shiki-dark:#637777;--shiki-dark-font-style:italic&quot;&gt;  # First 800 chars of diff&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#212121;--shiki-dark:#D6DEEB&quot;&gt;        }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292EFF;--shiki-dark:#D6DEEB&quot;&gt;        analyzed_files&lt;/span&gt;&lt;span style=&quot;color:#212121;--shiki-dark:#D6DEEB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#6F42C1;--shiki-dark:#B2CCD6&quot;&gt;append&lt;/span&gt;&lt;span style=&quot;color:#212121;--shiki-dark:#D6DEEB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#212121;--shiki-dark:#82AAFF&quot;&gt;file_info&lt;/span&gt;&lt;span style=&quot;color:#212121;--shiki-dark:#D6DEEB&quot;&gt;)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#D32F2F;--shiki-light-font-style:inherit;--shiki-dark:#C792EA;--shiki-dark-font-style:italic&quot;&gt;    return&lt;/span&gt;&lt;span style=&quot;color:#24292EFF;--shiki-dark:#D6DEEB&quot;&gt; analyzed_files&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6F42C1;--shiki-dark:#C5E478&quot;&gt;@&lt;/span&gt;&lt;span style=&quot;color:#6F42C1;--shiki-light-font-style:inherit;--shiki-dark:#C5E478;--shiki-dark-font-style:italic&quot;&gt;function_tool&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#D32F2F;--shiki-dark:#C792EA&quot;&gt;def&lt;/span&gt;&lt;span style=&quot;color:#6F42C1;--shiki-light-font-style:inherit;--shiki-dark:#82AAFF;--shiki-dark-font-style:italic&quot;&gt; security_scan&lt;/span&gt;&lt;span style=&quot;color:#24292EFF;--shiki-dark:#D9F5DD&quot;&gt;()&lt;/span&gt;&lt;span style=&quot;color:#212121;--shiki-dark:#D6DEEB&quot;&gt; -&gt;&lt;/span&gt;&lt;span style=&quot;color:#24292EFF;--shiki-dark:#D6DEEB&quot;&gt; Dict&lt;/span&gt;&lt;span style=&quot;color:#212121;--shiki-dark:#D6DEEB&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color:#1976D2;--shiki-dark:#C5E478&quot;&gt;str&lt;/span&gt;&lt;span style=&quot;color:#212121;--shiki-dark:#D6DEEB&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color:#24292EFF;--shiki-dark:#D6DEEB&quot;&gt; Any&lt;/span&gt;&lt;span style=&quot;color:#212121;--shiki-dark:#D6DEEB&quot;&gt;]&lt;/span&gt;&lt;span style=&quot;color:#24292EFF;--shiki-dark:#D6DEEB&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#C2C3C5;--shiki-dark:#D9F5DD&quot;&gt;    &quot;&quot;&quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#C2C3C5;--shiki-dark:#ECC48D&quot;&gt;    Tool: Basic security analysis of changes&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#C2C3C5;--shiki-dark:#D9F5DD&quot;&gt;    &quot;&quot;&quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#D32F2F;--shiki-light-font-style:inherit;--shiki-dark:#C792EA;--shiki-dark-font-style:italic&quot;&gt;    global&lt;/span&gt;&lt;span style=&quot;color:#24292EFF;--shiki-dark:#82AAFF&quot;&gt; FILES_DATA&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292EFF;--shiki-dark:#D6DEEB&quot;&gt;    security_issues &lt;/span&gt;&lt;span style=&quot;color:#D32F2F;--shiki-dark:#C792EA&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#24292EFF;--shiki-dark:#D9F5DD&quot;&gt; []&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292EFF;--shiki-dark:#D6DEEB&quot;&gt;    risk_indicators &lt;/span&gt;&lt;span style=&quot;color:#D32F2F;--shiki-dark:#C792EA&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#24292EFF;--shiki-dark:#D9F5DD&quot;&gt; []&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#D32F2F;--shiki-light-font-style:inherit;--shiki-dark:#C792EA;--shiki-dark-font-style:italic&quot;&gt;    for&lt;/span&gt;&lt;span style=&quot;color:#24292EFF;--shiki-dark:#D6DEEB&quot;&gt; file_data &lt;/span&gt;&lt;span style=&quot;color:#D32F2F;--shiki-light-font-style:inherit;--shiki-dark:#C792EA;--shiki-dark-font-style:italic&quot;&gt;in&lt;/span&gt;&lt;span style=&quot;color:#24292EFF;--shiki-dark:#82AAFF&quot;&gt; FILES_DATA&lt;/span&gt;&lt;span style=&quot;color:#212121;--shiki-dark:#D6DEEB&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292EFF;--shiki-dark:#D6DEEB&quot;&gt;        filename &lt;/span&gt;&lt;span style=&quot;color:#D32F2F;--shiki-dark:#C792EA&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#24292EFF;--shiki-dark:#D6DEEB&quot;&gt; file_data&lt;/span&gt;&lt;span style=&quot;color:#212121;--shiki-dark:#D6DEEB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#6F42C1;--shiki-dark:#B2CCD6&quot;&gt;get&lt;/span&gt;&lt;span style=&quot;color:#212121;--shiki-dark:#D6DEEB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#D9F5DD&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#ECC48D&quot;&gt;filename&lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#D9F5DD&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color:#212121;--shiki-dark:#D9F5DD&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#D9F5DD&quot;&gt; &quot;&quot;&lt;/span&gt;&lt;span style=&quot;color:#212121;--shiki-dark:#D6DEEB&quot;&gt;)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292EFF;--shiki-dark:#D6DEEB&quot;&gt;        patch &lt;/span&gt;&lt;span style=&quot;color:#D32F2F;--shiki-dark:#C792EA&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#24292EFF;--shiki-dark:#D6DEEB&quot;&gt; file_data&lt;/span&gt;&lt;span style=&quot;color:#212121;--shiki-dark:#D6DEEB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#6F42C1;--shiki-dark:#B2CCD6&quot;&gt;get&lt;/span&gt;&lt;span style=&quot;color:#212121;--shiki-dark:#D6DEEB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#D9F5DD&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#ECC48D&quot;&gt;patch&lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#D9F5DD&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color:#212121;--shiki-dark:#D9F5DD&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#D9F5DD&quot;&gt; &quot;&quot;&lt;/span&gt;&lt;span style=&quot;color:#212121;--shiki-dark:#D6DEEB&quot;&gt;)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#C2C3C5;--shiki-light-font-style:inherit;--shiki-dark:#637777;--shiki-dark-font-style:italic&quot;&gt;        # Check for common security patterns&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#D32F2F;--shiki-light-font-style:inherit;--shiki-dark:#C792EA;--shiki-dark-font-style:italic&quot;&gt;        if&lt;/span&gt;&lt;span style=&quot;color:#6F42C1;--shiki-dark:#C5E478&quot;&gt; any&lt;/span&gt;&lt;span style=&quot;color:#212121;--shiki-dark:#D6DEEB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#212121;--shiki-dark:#82AAFF&quot;&gt;pattern &lt;/span&gt;&lt;span style=&quot;color:#D32F2F;--shiki-light-font-style:inherit;--shiki-dark:#C792EA;--shiki-dark-font-style:italic&quot;&gt;in&lt;/span&gt;&lt;span style=&quot;color:#212121;--shiki-dark:#82AAFF&quot;&gt; patch.&lt;/span&gt;&lt;span style=&quot;color:#6F42C1;--shiki-dark:#B2CCD6&quot;&gt;lower&lt;/span&gt;&lt;span style=&quot;color:#212121;--shiki-dark:#D6DEEB&quot;&gt;()&lt;/span&gt;&lt;span style=&quot;color:#D32F2F;--shiki-light-font-style:inherit;--shiki-dark:#C792EA;--shiki-dark-font-style:italic&quot;&gt; for&lt;/span&gt;&lt;span style=&quot;color:#212121;--shiki-dark:#82AAFF&quot;&gt; pattern &lt;/span&gt;&lt;span style=&quot;color:#D32F2F;--shiki-light-font-style:inherit;--shiki-dark:#C792EA;--shiki-dark-font-style:italic&quot;&gt;in&lt;/span&gt;&lt;span style=&quot;color:#212121;--shiki-dark:#D9F5DD&quot;&gt; [&lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#D9F5DD&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#ECC48D&quot;&gt;password&lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#D9F5DD&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color:#212121;--shiki-dark:#82AAFF&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#D9F5DD&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#ECC48D&quot;&gt;secret&lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#D9F5DD&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color:#212121;--shiki-dark:#82AAFF&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#D9F5DD&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#ECC48D&quot;&gt;api_key&lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#D9F5DD&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color:#212121;--shiki-dark:#82AAFF&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#D9F5DD&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#ECC48D&quot;&gt;token&lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#D9F5DD&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color:#212121;--shiki-dark:#D9F5DD&quot;&gt;]&lt;/span&gt;&lt;span style=&quot;color:#212121;--shiki-dark:#D6DEEB&quot;&gt;):&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292EFF;--shiki-dark:#D6DEEB&quot;&gt;            security_issues&lt;/span&gt;&lt;span style=&quot;color:#212121;--shiki-dark:#D6DEEB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#6F42C1;--shiki-dark:#B2CCD6&quot;&gt;append&lt;/span&gt;&lt;span style=&quot;color:#212121;--shiki-dark:#D6DEEB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#D32F2F;--shiki-dark:#C792EA&quot;&gt;f&lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#ECC48D&quot;&gt;&quot;Potential sensitive data in &lt;/span&gt;&lt;span style=&quot;color:#1976D2;--shiki-dark:#82AAFF&quot;&gt;{&lt;/span&gt;&lt;span style=&quot;color:#212121;--shiki-dark:#82AAFF&quot;&gt;filename&lt;/span&gt;&lt;span style=&quot;color:#1976D2;--shiki-dark:#82AAFF&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#ECC48D&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color:#212121;--shiki-dark:#D6DEEB&quot;&gt;)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#D32F2F;--shiki-light-font-style:inherit;--shiki-dark:#C792EA;--shiki-dark-font-style:italic&quot;&gt;        if&lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#D9F5DD&quot;&gt; &quot;&lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#ECC48D&quot;&gt;.env&lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#D9F5DD&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color:#D32F2F;--shiki-dark:#C792EA&quot;&gt; in&lt;/span&gt;&lt;span style=&quot;color:#24292EFF;--shiki-dark:#D6DEEB&quot;&gt; filename &lt;/span&gt;&lt;span style=&quot;color:#D32F2F;--shiki-dark:#C792EA&quot;&gt;or&lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#D9F5DD&quot;&gt; &quot;&lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#ECC48D&quot;&gt;config&lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#D9F5DD&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color:#D32F2F;--shiki-dark:#C792EA&quot;&gt; in&lt;/span&gt;&lt;span style=&quot;color:#24292EFF;--shiki-dark:#D6DEEB&quot;&gt; filename&lt;/span&gt;&lt;span style=&quot;color:#212121;--shiki-dark:#D6DEEB&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292EFF;--shiki-dark:#D6DEEB&quot;&gt;            risk_indicators&lt;/span&gt;&lt;span style=&quot;color:#212121;--shiki-dark:#D6DEEB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#6F42C1;--shiki-dark:#B2CCD6&quot;&gt;append&lt;/span&gt;&lt;span style=&quot;color:#212121;--shiki-dark:#D6DEEB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#D32F2F;--shiki-dark:#C792EA&quot;&gt;f&lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#ECC48D&quot;&gt;&quot;Configuration file modified: &lt;/span&gt;&lt;span style=&quot;color:#1976D2;--shiki-dark:#82AAFF&quot;&gt;{&lt;/span&gt;&lt;span style=&quot;color:#212121;--shiki-dark:#82AAFF&quot;&gt;filename&lt;/span&gt;&lt;span style=&quot;color:#1976D2;--shiki-dark:#82AAFF&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#ECC48D&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color:#212121;--shiki-dark:#D6DEEB&quot;&gt;)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#D32F2F;--shiki-light-font-style:inherit;--shiki-dark:#C792EA;--shiki-dark-font-style:italic&quot;&gt;        if&lt;/span&gt;&lt;span style=&quot;color:#6F42C1;--shiki-dark:#C5E478&quot;&gt; any&lt;/span&gt;&lt;span style=&quot;color:#212121;--shiki-dark:#D6DEEB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#212121;--shiki-dark:#82AAFF&quot;&gt;pattern &lt;/span&gt;&lt;span style=&quot;color:#D32F2F;--shiki-light-font-style:inherit;--shiki-dark:#C792EA;--shiki-dark-font-style:italic&quot;&gt;in&lt;/span&gt;&lt;span style=&quot;color:#212121;--shiki-dark:#82AAFF&quot;&gt; patch &lt;/span&gt;&lt;span style=&quot;color:#D32F2F;--shiki-light-font-style:inherit;--shiki-dark:#C792EA;--shiki-dark-font-style:italic&quot;&gt;for&lt;/span&gt;&lt;span style=&quot;color:#212121;--shiki-dark:#82AAFF&quot;&gt; pattern &lt;/span&gt;&lt;span style=&quot;color:#D32F2F;--shiki-light-font-style:inherit;--shiki-dark:#C792EA;--shiki-dark-font-style:italic&quot;&gt;in&lt;/span&gt;&lt;span style=&quot;color:#212121;--shiki-dark:#D9F5DD&quot;&gt; [&lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#D9F5DD&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#ECC48D&quot;&gt;eval(&lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#D9F5DD&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color:#212121;--shiki-dark:#82AAFF&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#D9F5DD&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#ECC48D&quot;&gt;exec(&lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#D9F5DD&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color:#212121;--shiki-dark:#82AAFF&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#D9F5DD&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#ECC48D&quot;&gt;subprocess&lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#D9F5DD&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color:#212121;--shiki-dark:#82AAFF&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#D9F5DD&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#ECC48D&quot;&gt;os.system&lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#D9F5DD&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color:#212121;--shiki-dark:#D9F5DD&quot;&gt;]&lt;/span&gt;&lt;span style=&quot;color:#212121;--shiki-dark:#D6DEEB&quot;&gt;):&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292EFF;--shiki-dark:#D6DEEB&quot;&gt;            security_issues&lt;/span&gt;&lt;span style=&quot;color:#212121;--shiki-dark:#D6DEEB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#6F42C1;--shiki-dark:#B2CCD6&quot;&gt;append&lt;/span&gt;&lt;span style=&quot;color:#212121;--shiki-dark:#D6DEEB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#D32F2F;--shiki-dark:#C792EA&quot;&gt;f&lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#ECC48D&quot;&gt;&quot;Potentially dangerous code execution in &lt;/span&gt;&lt;span style=&quot;color:#1976D2;--shiki-dark:#82AAFF&quot;&gt;{&lt;/span&gt;&lt;span style=&quot;color:#212121;--shiki-dark:#82AAFF&quot;&gt;filename&lt;/span&gt;&lt;span style=&quot;color:#1976D2;--shiki-dark:#82AAFF&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#ECC48D&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color:#212121;--shiki-dark:#D6DEEB&quot;&gt;)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#D32F2F;--shiki-light-font-style:inherit;--shiki-dark:#C792EA;--shiki-dark-font-style:italic&quot;&gt;    return&lt;/span&gt;&lt;span style=&quot;color:#212121;--shiki-dark:#D6DEEB&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#D9F5DD&quot;&gt;        &quot;&lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#ECC48D&quot;&gt;security_issues&lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#D9F5DD&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color:#212121;--shiki-dark:#D6DEEB&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#24292EFF;--shiki-dark:#D6DEEB&quot;&gt; security_issues&lt;/span&gt;&lt;span style=&quot;color:#212121;--shiki-dark:#D6DEEB&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#D9F5DD&quot;&gt;        &quot;&lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#ECC48D&quot;&gt;risk_indicators&lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#D9F5DD&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color:#212121;--shiki-dark:#D6DEEB&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#24292EFF;--shiki-dark:#D6DEEB&quot;&gt; risk_indicators&lt;/span&gt;&lt;span style=&quot;color:#212121;--shiki-dark:#D6DEEB&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#D9F5DD&quot;&gt;        &quot;&lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#ECC48D&quot;&gt;risk_level&lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#D9F5DD&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color:#212121;--shiki-dark:#D6DEEB&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#D9F5DD&quot;&gt; &quot;&lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#ECC48D&quot;&gt;high&lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#D9F5DD&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color:#D32F2F;--shiki-light-font-style:inherit;--shiki-dark:#C792EA;--shiki-dark-font-style:italic&quot;&gt; if&lt;/span&gt;&lt;span style=&quot;color:#24292EFF;--shiki-dark:#D6DEEB&quot;&gt; security_issues &lt;/span&gt;&lt;span style=&quot;color:#D32F2F;--shiki-light-font-style:inherit;--shiki-dark:#C792EA;--shiki-dark-font-style:italic&quot;&gt;else&lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#D9F5DD&quot;&gt; &quot;&lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#ECC48D&quot;&gt;medium&lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#D9F5DD&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color:#D32F2F;--shiki-light-font-style:inherit;--shiki-dark:#C792EA;--shiki-dark-font-style:italic&quot;&gt; if&lt;/span&gt;&lt;span style=&quot;color:#24292EFF;--shiki-dark:#D6DEEB&quot;&gt; risk_indicators &lt;/span&gt;&lt;span style=&quot;color:#D32F2F;--shiki-light-font-style:inherit;--shiki-dark:#C792EA;--shiki-dark-font-style:italic&quot;&gt;else&lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#D9F5DD&quot;&gt; &quot;&lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#ECC48D&quot;&gt;low&lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#D9F5DD&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#212121;--shiki-dark:#D6DEEB&quot;&gt;    }&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&quot;step-3-review-incoming-pr-with-the-agent&quot;&gt;Step 3: Review incoming PR with the Agent&lt;/h3&gt;
&lt;pre class=&quot;astro-code astro-code-themes min-light night-owl&quot; style=&quot;background-color:#ffffff;--shiki-dark-bg:#011627;color:#24292eff;--shiki-dark:#d6deeb; overflow-x: auto; white-space: pre-wrap; word-wrap: break-word;&quot; tabindex=&quot;0&quot; data-language=&quot;python&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#C2C3C5;--shiki-light-font-style:inherit;--shiki-dark:#637777;--shiki-dark-font-style:italic&quot;&gt;# Create the agent with tools&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292EFF;--shiki-dark:#8EACE3&quot;&gt;self&lt;/span&gt;&lt;span style=&quot;color:#212121;--shiki-dark:#D6DEEB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#24292EFF;--shiki-dark:#D6DEEB&quot;&gt;agent &lt;/span&gt;&lt;span style=&quot;color:#D32F2F;--shiki-dark:#C792EA&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#6F42C1;--shiki-dark:#B2CCD6&quot;&gt; Agent&lt;/span&gt;&lt;span style=&quot;color:#212121;--shiki-dark:#D6DEEB&quot;&gt;(&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#212121;--shiki-dark:#D7DBE0&quot;&gt;    name&lt;/span&gt;&lt;span style=&quot;color:#D32F2F;--shiki-dark:#C792EA&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#D9F5DD&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#ECC48D&quot;&gt;PR-Reviewer&lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#D9F5DD&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color:#212121;--shiki-dark:#D9F5DD&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#212121;--shiki-dark:#D7DBE0&quot;&gt;    instructions&lt;/span&gt;&lt;span style=&quot;color:#D32F2F;--shiki-dark:#C792EA&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#212121;--shiki-dark:#82AAFF&quot;&gt;instructions&lt;/span&gt;&lt;span style=&quot;color:#212121;--shiki-dark:#D9F5DD&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#212121;--shiki-dark:#D7DBE0&quot;&gt;    tools&lt;/span&gt;&lt;span style=&quot;color:#D32F2F;--shiki-dark:#C792EA&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#212121;--shiki-dark:#D9F5DD&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color:#212121;--shiki-dark:#82AAFF&quot;&gt;get_pr_details, analyze_file_changes, security_scan, performance_check&lt;/span&gt;&lt;span style=&quot;color:#212121;--shiki-dark:#D9F5DD&quot;&gt;]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#212121;--shiki-dark:#D6DEEB&quot;&gt;)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#C2C3C5;--shiki-light-font-style:inherit;--shiki-dark:#637777;--shiki-dark-font-style:italic&quot;&gt;# Lastly, Review the incoming PR with Github Orchestrator Agent&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#D32F2F;--shiki-dark:#C792EA&quot;&gt;def&lt;/span&gt;&lt;span style=&quot;color:#6F42C1;--shiki-light-font-style:inherit;--shiki-dark:#82AAFF;--shiki-dark-font-style:italic&quot;&gt; review_pr&lt;/span&gt;&lt;span style=&quot;color:#24292EFF;--shiki-dark:#D9F5DD&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF9800;--shiki-dark:#7FDBCA&quot;&gt;self&lt;/span&gt;&lt;span style=&quot;color:#212121;--shiki-dark:#D6DEEB&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color:#FF9800;--shiki-dark:#7FDBCA&quot;&gt; pr_data&lt;/span&gt;&lt;span style=&quot;color:#212121;--shiki-dark:#D6DEEB&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#24292EFF;--shiki-dark:#D6DEEB&quot;&gt; Dict&lt;/span&gt;&lt;span style=&quot;color:#212121;--shiki-dark:#D6DEEB&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color:#1976D2;--shiki-dark:#C5E478&quot;&gt;str&lt;/span&gt;&lt;span style=&quot;color:#212121;--shiki-dark:#D6DEEB&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color:#24292EFF;--shiki-dark:#D6DEEB&quot;&gt; Any&lt;/span&gt;&lt;span style=&quot;color:#212121;--shiki-dark:#D6DEEB&quot;&gt;],&lt;/span&gt;&lt;span style=&quot;color:#FF9800;--shiki-dark:#7FDBCA&quot;&gt; files_data&lt;/span&gt;&lt;span style=&quot;color:#212121;--shiki-dark:#D6DEEB&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#24292EFF;--shiki-dark:#D6DEEB&quot;&gt; List&lt;/span&gt;&lt;span style=&quot;color:#212121;--shiki-dark:#D6DEEB&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color:#24292EFF;--shiki-dark:#D6DEEB&quot;&gt;Dict&lt;/span&gt;&lt;span style=&quot;color:#212121;--shiki-dark:#D6DEEB&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color:#1976D2;--shiki-dark:#C5E478&quot;&gt;str&lt;/span&gt;&lt;span style=&quot;color:#212121;--shiki-dark:#D6DEEB&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color:#24292EFF;--shiki-dark:#D6DEEB&quot;&gt; Any&lt;/span&gt;&lt;span style=&quot;color:#212121;--shiki-dark:#D6DEEB&quot;&gt;]]&lt;/span&gt;&lt;span style=&quot;color:#24292EFF;--shiki-dark:#D9F5DD&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color:#212121;--shiki-dark:#D6DEEB&quot;&gt; -&gt;&lt;/span&gt;&lt;span style=&quot;color:#24292EFF;--shiki-dark:#D6DEEB&quot;&gt; PRReviewOutput:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#C2C3C5;--shiki-dark:#D9F5DD&quot;&gt;    &quot;&quot;&quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#C2C3C5;--shiki-dark:#ECC48D&quot;&gt;    Main method: Review the PR using the agent&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#C2C3C5;--shiki-dark:#D9F5DD&quot;&gt;    &quot;&quot;&quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#D32F2F;--shiki-light-font-style:inherit;--shiki-dark:#C792EA;--shiki-dark-font-style:italic&quot;&gt;    global&lt;/span&gt;&lt;span style=&quot;color:#24292EFF;--shiki-dark:#82AAFF&quot;&gt; PR_DATA&lt;/span&gt;&lt;span style=&quot;color:#212121;--shiki-dark:#D6DEEB&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color:#24292EFF;--shiki-dark:#82AAFF&quot;&gt; FILES_DATA&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292EFF;--shiki-dark:#82AAFF&quot;&gt;    PR_DATA&lt;/span&gt;&lt;span style=&quot;color:#D32F2F;--shiki-dark:#C792EA&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#24292EFF;--shiki-dark:#D6DEEB&quot;&gt; pr_data&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292EFF;--shiki-dark:#82AAFF&quot;&gt;    FILES_DATA&lt;/span&gt;&lt;span style=&quot;color:#D32F2F;--shiki-dark:#C792EA&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#24292EFF;--shiki-dark:#D6DEEB&quot;&gt; files_data&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#D32F2F;--shiki-light-font-style:inherit;--shiki-dark:#C792EA;--shiki-dark-font-style:italic&quot;&gt;    try&lt;/span&gt;&lt;span style=&quot;color:#212121;--shiki-dark:#D6DEEB&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#C2C3C5;--shiki-light-font-style:inherit;--shiki-dark:#637777;--shiki-dark-font-style:italic&quot;&gt;        # Create the review prompt&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292EFF;--shiki-dark:#D6DEEB&quot;&gt;        review_prompt &lt;/span&gt;&lt;span style=&quot;color:#D32F2F;--shiki-dark:#C792EA&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#D32F2F;--shiki-dark:#C792EA&quot;&gt; f&lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#ECC48D&quot;&gt;&quot;&quot;&quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#ECC48D&quot;&gt;        Please review this Pull Request thoroughly:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#ECC48D&quot;&gt;        The PR is titled: &quot;&lt;/span&gt;&lt;span style=&quot;color:#1976D2;--shiki-dark:#82AAFF&quot;&gt;{&lt;/span&gt;&lt;span style=&quot;color:#24292EFF;--shiki-dark:#D6DEEB&quot;&gt;pr_data&lt;/span&gt;&lt;span style=&quot;color:#212121;--shiki-dark:#D6DEEB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#6F42C1;--shiki-dark:#B2CCD6&quot;&gt;get&lt;/span&gt;&lt;span style=&quot;color:#212121;--shiki-dark:#D6DEEB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#D9F5DD&quot;&gt;&apos;&lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#ECC48D&quot;&gt;title&lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#D9F5DD&quot;&gt;&apos;&lt;/span&gt;&lt;span style=&quot;color:#212121;--shiki-dark:#D9F5DD&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#D9F5DD&quot;&gt; &apos;&lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#ECC48D&quot;&gt;Unknown&lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#D9F5DD&quot;&gt;&apos;&lt;/span&gt;&lt;span style=&quot;color:#212121;--shiki-dark:#D6DEEB&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color:#1976D2;--shiki-dark:#82AAFF&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#ECC48D&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#ECC48D&quot;&gt;        Author: &lt;/span&gt;&lt;span style=&quot;color:#1976D2;--shiki-dark:#82AAFF&quot;&gt;{&lt;/span&gt;&lt;span style=&quot;color:#24292EFF;--shiki-dark:#D6DEEB&quot;&gt;pr_data&lt;/span&gt;&lt;span style=&quot;color:#212121;--shiki-dark:#D6DEEB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#6F42C1;--shiki-dark:#B2CCD6&quot;&gt;get&lt;/span&gt;&lt;span style=&quot;color:#212121;--shiki-dark:#D6DEEB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#D9F5DD&quot;&gt;&apos;&lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#ECC48D&quot;&gt;user&lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#D9F5DD&quot;&gt;&apos;&lt;/span&gt;&lt;span style=&quot;color:#212121;--shiki-dark:#D9F5DD&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color:#212121;--shiki-dark:#82AAFF&quot;&gt; {}&lt;/span&gt;&lt;span style=&quot;color:#212121;--shiki-dark:#D6DEEB&quot;&gt;).&lt;/span&gt;&lt;span style=&quot;color:#6F42C1;--shiki-dark:#B2CCD6&quot;&gt;get&lt;/span&gt;&lt;span style=&quot;color:#212121;--shiki-dark:#D6DEEB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#D9F5DD&quot;&gt;&apos;&lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#ECC48D&quot;&gt;login&lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#D9F5DD&quot;&gt;&apos;&lt;/span&gt;&lt;span style=&quot;color:#212121;--shiki-dark:#D9F5DD&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#D9F5DD&quot;&gt; &apos;&lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#ECC48D&quot;&gt;unknown&lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#D9F5DD&quot;&gt;&apos;&lt;/span&gt;&lt;span style=&quot;color:#212121;--shiki-dark:#D6DEEB&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color:#1976D2;--shiki-dark:#82AAFF&quot;&gt;}&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#ECC48D&quot;&gt;        Files changed: &lt;/span&gt;&lt;span style=&quot;color:#1976D2;--shiki-dark:#82AAFF&quot;&gt;{&lt;/span&gt;&lt;span style=&quot;color:#6F42C1;--shiki-dark:#C5E478&quot;&gt;len&lt;/span&gt;&lt;span style=&quot;color:#212121;--shiki-dark:#D6DEEB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#212121;--shiki-dark:#82AAFF&quot;&gt;files_data&lt;/span&gt;&lt;span style=&quot;color:#212121;--shiki-dark:#D6DEEB&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color:#1976D2;--shiki-dark:#82AAFF&quot;&gt;}&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#ECC48D&quot;&gt;        Use your available tools to:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#ECC48D&quot;&gt;        1. Get detailed PR information&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#ECC48D&quot;&gt;        2. Analyze the file changes&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#ECC48D&quot;&gt;        3. Run security scan&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#ECC48D&quot;&gt;        4. Check performance implications&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#ECC48D&quot;&gt;        Then provide a comprehensive review following the exact format specified in your instructions.&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#ECC48D&quot;&gt;        &quot;&quot;&quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#C2C3C5;--shiki-light-font-style:inherit;--shiki-dark:#637777;--shiki-dark-font-style:italic&quot;&gt;        # Agent processes the request using its tools&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6F42C1;--shiki-dark:#C5E478&quot;&gt;        print&lt;/span&gt;&lt;span style=&quot;color:#212121;--shiki-dark:#D6DEEB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#D9F5DD&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#ECC48D&quot;&gt;🤖 Agent analyzing PR with tools...&lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#D9F5DD&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color:#212121;--shiki-dark:#D6DEEB&quot;&gt;)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292EFF;--shiki-dark:#D6DEEB&quot;&gt;        result &lt;/span&gt;&lt;span style=&quot;color:#D32F2F;--shiki-dark:#C792EA&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#24292EFF;--shiki-dark:#D6DEEB&quot;&gt; Runner&lt;/span&gt;&lt;span style=&quot;color:#212121;--shiki-dark:#D6DEEB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#6F42C1;--shiki-dark:#B2CCD6&quot;&gt;run_sync&lt;/span&gt;&lt;span style=&quot;color:#212121;--shiki-dark:#D6DEEB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#212121;--shiki-dark:#8EACE3&quot;&gt;self&lt;/span&gt;&lt;span style=&quot;color:#212121;--shiki-dark:#82AAFF&quot;&gt;.agent&lt;/span&gt;&lt;span style=&quot;color:#212121;--shiki-dark:#D9F5DD&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color:#212121;--shiki-dark:#82AAFF&quot;&gt; review_prompt&lt;/span&gt;&lt;span style=&quot;color:#212121;--shiki-dark:#D6DEEB&quot;&gt;)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6F42C1;--shiki-dark:#C5E478&quot;&gt;        print&lt;/span&gt;&lt;span style=&quot;color:#212121;--shiki-dark:#D6DEEB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#D9F5DD&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#ECC48D&quot;&gt;✅ Agent completed analysis&lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#D9F5DD&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color:#212121;--shiki-dark:#D6DEEB&quot;&gt;)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292EFF;--shiki-dark:#D6DEEB&quot;&gt;        response_text &lt;/span&gt;&lt;span style=&quot;color:#D32F2F;--shiki-dark:#C792EA&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#24292EFF;--shiki-dark:#D6DEEB&quot;&gt; result&lt;/span&gt;&lt;span style=&quot;color:#212121;--shiki-dark:#D6DEEB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#24292EFF;--shiki-dark:#D6DEEB&quot;&gt;final_output&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#C2C3C5;--shiki-light-font-style:inherit;--shiki-dark:#637777;--shiki-dark-font-style:italic&quot;&gt;        # Parse and validate the response&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#D32F2F;--shiki-light-font-style:inherit;--shiki-dark:#C792EA;--shiki-dark-font-style:italic&quot;&gt;        return&lt;/span&gt;&lt;span style=&quot;color:#24292EFF;--shiki-dark:#8EACE3&quot;&gt; self&lt;/span&gt;&lt;span style=&quot;color:#212121;--shiki-dark:#D6DEEB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#6F42C1;--shiki-dark:#B2CCD6&quot;&gt;_parse_agent_response&lt;/span&gt;&lt;span style=&quot;color:#212121;--shiki-dark:#D6DEEB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#212121;--shiki-dark:#82AAFF&quot;&gt;response_text&lt;/span&gt;&lt;span style=&quot;color:#212121;--shiki-dark:#D9F5DD&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color:#212121;--shiki-dark:#82AAFF&quot;&gt; files_data&lt;/span&gt;&lt;span style=&quot;color:#212121;--shiki-dark:#D6DEEB&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The rest is just glue code i.e. parsing, debugging, etc. That’s it! Yes, the LLM does most of the magic. But here’s the catch: building a demo is 10X easier than building a reliable production agent that works ≥80% of the time. Users want magic that works consistently, not one time demos. That’s where real value is created.&lt;/p&gt;
&lt;h2 id=&quot;conclusion&quot;&gt;Conclusion&lt;/h2&gt;
&lt;p&gt;In this post, I just wanted to dip my toe into building an agent whether “workflow based agent” or “autonomous agent” albeit something very simple! Also, wanted to explore OpenAI Agent SDK! (Confession) Claude Code wrote most of the implementation. For straightforward agents like this PR reviewer, today’s coding agents are remarkably capable.&lt;/p&gt;</content:encoded><category>business-of-ai</category><category>ai-agents</category><category>llm-engineering</category></item><item><title>Learnings from building an AI coding agent:  Trustworthy AI Workflows - (3/3)</title><link>https://kneeraj.com/posts/2025/coding-agent-learnings-3/</link><guid isPermaLink="true">https://kneeraj.com/posts/2025/coding-agent-learnings-3/</guid><description>Building trustworthy AI workflows of your features.</description><pubDate>Tue, 02 Sep 2025 20:30:00 GMT</pubDate><content:encoded>&lt;p&gt;&lt;strong&gt;This is the last part in my series of “learnings from building an AI coding agent”. Here are the previous two posts&lt;/strong&gt; (in case you have read them yet) &lt;strong&gt;:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Part 1&lt;/strong&gt; : &lt;a href=&quot;https://kneeraj.com/posts/2025/coding-agent-learnings-1&quot;&gt;Building LLM Powered Coding Agent as a PM : Key Learnings (1/3)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Part 2&lt;/strong&gt; : &lt;a href=&quot;https://kneeraj.com/posts/2025/coding-agent-learnings-2&quot;&gt;How I built an “AI Evals” system for my product (a Coding Agent) - (2/3)&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;table-of-contents&quot;&gt;Table of Contents&lt;/h2&gt;
&lt;p&gt;&lt;/p&gt;&lt;details&gt;&lt;summary&gt;Open Table of Contents&lt;/summary&gt;&lt;p&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;#building-ai-assisted-app-migration-feature-workflow-with-ai-first-principles&quot;&gt;Building “AI-Assisted App Migration” feature workflow with AI-First principles&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;#what-is-ai-assisted-app-migration-feature&quot;&gt;What is “AI-Assisted App Migration” feature&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;#how-i-baked-trust-in-the-workflow-and-built-some-principles-along-the-way&quot;&gt;How I baked trust in the workflow and built some principles along the way..&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;#principle-1--radical-transparency--communication&quot;&gt;Principle 1 : Radical Transparency &amp;#x26; Communication&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;#principle-2--human-always-in-control&quot;&gt;Principle 2 : Human always in control&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;#principle-3--design-for-high-latency-if-you-have-to&quot;&gt;Principle 3 : Design for high latency if you have to…&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;#impact---developer-love-%EF%B8%8F%EF%B8%8F&quot;&gt;Impact - Developer Love ❤️❤️&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;/p&gt;&lt;/details&gt;&lt;p&gt;&lt;/p&gt;
&lt;h2 id=&quot;building-ai-assisted-app-migration-feature-workflow-with-ai-first-principles&quot;&gt;Building “AI-Assisted App Migration” feature workflow with AI-First principles&lt;/h2&gt;
&lt;h3 id=&quot;what-is-ai-assisted-app-migration-feature&quot;&gt;What is “AI-Assisted App Migration” feature&lt;/h3&gt;
&lt;p&gt;It was a feature we built in the AI coding agent at Freshworks that would take the outdated code of an app code base and migrate it “magically” to the latest supported developer platform version. It was important for our marketplace customers and business to ensure developers adopt latest platform versions which was not only more secure, making the apps secure, but also was feature rich in building diverse types of apps use-cases.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Here is how the feature worked&lt;/strong&gt;&lt;/p&gt;
&lt;div style=&quot;margin: 1.5rem 0; max-width: 100%; overflow: hidden;&quot;&gt;
  &lt;div style=&quot;position: relative; width: 100%; max-width: 640px; margin: 0 auto; padding-bottom: 56.25%; height: 0;&quot;&gt;
    &lt;iframe style=&quot;position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 0;&quot; src=&quot;https://www.youtube.com/embed/fCjdLPdzEnw&quot; title=&quot;YouTube video player&quot; allow=&quot;accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture&quot; allowfullscreen&gt;
    &lt;/iframe&gt;
  &lt;/div&gt;
&lt;/div&gt; 
&lt;p&gt;&lt;strong&gt;Of-course the risk was high!&lt;/strong&gt; We were changing 10s of files in an existing working app codebase which developers had written and understood very well! As a developer myself, I would hardly trust an AI (which is non-deterministic duh!) to make changes to my codebase since I am responsible for the code and a working app!&lt;/p&gt;
&lt;h2 id=&quot;how-i-baked-trust-in-the-workflow-and-built-some-principles-along-the-way&quot;&gt;How I baked trust in the workflow and built some principles along the way..&lt;/h2&gt;
&lt;aside&gt;
💡
&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt; : The below workflow far from perfect! I would say it was not even 50% done to the level I would want my users to trust the feature. But we do what we do with limited bandwidth and time 🙂&lt;/p&gt;
&lt;/aside&gt;
&lt;h3 id=&quot;principle-1--radical-transparency--communication&quot;&gt;Principle 1 : Radical Transparency &amp;#x26; Communication&lt;/h3&gt;
&lt;p&gt;&lt;em&gt;Does the user know what’s happening at all times? Do they understand what the AI is doing and how it’s arriving at its response?&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;We see this principle everywhere, driverless cars showing the how the car is navigating the environment with rich designed interface, or LLMs showing their reasoning traces on what they are doing, how they are planning and arriving at the answer!&lt;/p&gt;
&lt;p&gt;When users understand what’s happening, why it’s happening, and how the AI system is achieving their goals, you build extraordinary trust. This transparency acts as a trust safety net :  even when AI doesn’t deliver the expected output, users are willing to iterate and try again, adjusting what’s within their control (prompts, seeking help, contacting support, etc.).&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Real-World Example: AI-Assisted App Migration&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Few steps we took to bake trust into the feature workflow :&lt;/em&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Pushing real-time status messages in the chat vs generic loading spinner&lt;/strong&gt; on what is happening to ensure developer is always aware of what is happening”. Migration starting… analyzing files… migration in progress… migration completed.” This isn’t just status updates, it’s transparency in action.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Explicit permission for every change&lt;/strong&gt; : Ensuring “no change” gets committed without developer reviews them. Our messaging actively nudged users with “Let’s review the changes,” providing clear assurance that no code would be modified without explicit permission&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Honest communication about AI limitations&lt;/strong&gt; We encouraged users to thoroughly test their apps after accepting changes, explicitly reminding them that AI can make mistakes and that they must verify everything works before submitting to app marketplaces.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://kneeraj.com/assets/img/2025/coding-agent-learnings/migration-feature-ux-1.png&quot; alt=&quot;migration feature ux sample&quot; style=&quot;width: 100%; height: auto; border: 3px solid #ddd; box-shadow: 0 4px 8px rgba(0,0,0,0.1);&quot;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://kneeraj.com/assets/img/2025/coding-agent-learnings/migration-feature-ux-2.png&quot; alt=&quot;migration feature ux sample&quot; style=&quot;width: 100%; height: auto; border: 3px solid #ddd; box-shadow: 0 4px 8px rgba(0,0,0,0.1);&quot;&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;hr&gt;
&lt;h3 id=&quot;principle-2--human-always-in-control&quot;&gt;Principle 2 : Human always in control&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;Human always in control :&lt;/strong&gt; They can start, stop, undo,  and do anything to shape the AI behaviour at run time. Basically fully in control at all times.&lt;/p&gt;
&lt;p&gt;Users trust “systems” when they feel safe in applying AI and feel in control that they can apply, revert go back or go forward as they like.&lt;/p&gt;
&lt;aside&gt;
💡
&lt;p&gt;&lt;strong&gt;Read about the Volkswagen’s research on “3+1” design philosophy&lt;/strong&gt;: users need to know what mode the system is in, what it’s going to do before it does it, what the system is seeing, and have perfectly clear transitions when taking control. &lt;a href=&quot;https://www.fastcompany.com/3054330/the-secret-ux-issues-that-will-make-or-break-autonomous-cars&quot;&gt;The Secret UX Issues That Will Make (Or Break) Self-Driving Cars&lt;/a&gt; .
&lt;a href=&quot;https://medium.com/design-bootcamp/the-future-of-ux-in-autonomous-vehicles-87254f1fcf42&quot;&gt;The Future of UX in Autonomous Vehicles | by Robert “Joey” Werkmeister | Bootcamp | Apr, 2025 | Medium&lt;/a&gt;&lt;/p&gt;
&lt;/aside&gt;
&lt;p&gt;&lt;strong&gt;One of my first interactions with an early user was a wake-up call. She said, &lt;em&gt;“I’m not sure if I want to apply these code changes, what if they’re wrong and you replace my old working code!”&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;That was a light bulb moment for me on how much risk I am putting the user into! Basically taking away their working  code and replacing it with the non-deterministic AI generated code!&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Few steps we took to make user feel in control :&lt;/em&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Comprehensive review system :&lt;/strong&gt; Presenting changes as a change-log or Git PR,  giving users complete control to review and modify generated code before accepting any changes&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Granular selection control :&lt;/strong&gt; They can select all files, or any number of files they want to merge! Basically, whatever felt right for their situation&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Migration report :&lt;/strong&gt;  Most importantly, every migration generated a  “&lt;em&gt;migration-report.html&lt;/em&gt;” showing all the file changes in the diff format. That meant the changelog (their old code and proposed changes) were always available on demand in case anything goes wrong!&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt; : A revert and checkpoint system would have been perfect but that takes time to build and hence we chose the shortest path!&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://kneeraj.com/assets/img/2025/coding-agent-learnings/migration-feature-ux-2.png&quot; alt=&quot;migration feature ux sample&quot; style=&quot;width: 100%; height: auto; border: 3px solid #ddd; box-shadow: 0 4px 8px rgba(0,0,0,0.1);&quot;&gt;&lt;/p&gt;
&lt;aside&gt;
💡
&lt;p&gt;&lt;strong&gt;The Results&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;These workflow changes, combined with ongoing improvements to AI accuracy, led to nearly 100% solution acceptance rate. Users consistently chose to merge the suggested code because they felt completely in control!&lt;/p&gt;
&lt;/aside&gt;
&lt;hr&gt;
&lt;hr&gt;
&lt;h3 id=&quot;principle-3--design-for-high-latency-if-you-have-to&quot;&gt;Principle 3 : Design for high latency if you have to…&lt;/h3&gt;
&lt;p&gt;From the beginning, we faced an important decision: should we build synchronous or asynchronous workflows? Based on evals, Large apps could take 10-15 minutes for migration, with an average processing time of 5 minutes. Rather than forcing users to sit and wait, we chose asynchronous workflows from day one.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Our Approach:&lt;/strong&gt; Start the migration, then go do your work. We’ll notify you when the migration is complete so you can return and resume where you left off.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://kneeraj.com/assets/img/2025/coding-agent-learnings/migration-feature-ux-2.png&quot; alt=&quot;migration feature ux sample&quot; style=&quot;width: 100%; height: auto; border: 3px solid #ddd; box-shadow: 0 4px 8px rgba(0,0,0,0.1)&quot;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://kneeraj.com/assets/img/2025/coding-agent-learnings/migration-feature-ux-4.png&quot; alt=&quot;migration feature ux sample&quot; style=&quot;width: 100%; height: auto; border: 3px solid #ddd; box-shadow: 0 4px 8px rgba(0,0,0,0.1)&quot;&gt;&lt;/p&gt;
&lt;hr&gt;
&lt;hr&gt;
&lt;h2 id=&quot;impact---developer-love-️️&quot;&gt;Impact - Developer Love ❤️❤️&lt;/h2&gt;
&lt;blockquote&gt;
&lt;ul&gt;
&lt;li&gt;Developers were praising productivity gains in development and the ability to migrate apps to new platform versions seamlessly with AI assistance&lt;/li&gt;
&lt;li&gt;“Positive feedback rate” almost doubled from 30% to 54% even while feedback volume jumped 87% &gt; - indicating both higher satisfaction and broader adoption&lt;/li&gt;
&lt;li&gt;Continually improve “Response acceptance rate” - a critical milestone showing developers trust and actively adopt AI-generated suggestions&lt;/li&gt;
&lt;li&gt;Developer engagement accelerated 32.8% QoQ - reflecting sustained and growing usage patterns&lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;img src=&quot;https://kneeraj.com/assets/img/2025/coding-agent-learnings/impact.png&quot; alt=&quot;AI product impact metrics&quot; style=&quot;width: 100%; height: auto; border: 3px solid #ddd; box-shadow: 0 4px 8px rgba(0,0,0,0.1)&quot;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://kneeraj.com/assets/img/2025/coding-agent-learnings/neeraj-dev-feedback-email.png&quot; alt=&quot;AI product feedback over email&quot; style=&quot;width: 100%; height: auto; border: 3px solid #ddd; box-shadow: 0 4px 8px rgba(0,0,0,0.1)&quot;&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&lt;strong&gt;Again, this was far from perfect and what I was satisfied with as a good experience for my users! But was a great learning process (rather intro) for building AI-first workflows!&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;</content:encoded><category>business-of-ai</category><category>evals</category><category>coding-agents</category></item><item><title>Learnings from building an AI coding agent: How I build &apos;AI Evals&apos; system for my product (2/3)</title><link>https://kneeraj.com/posts/2025/coding-agent-learnings-2/</link><guid isPermaLink="true">https://kneeraj.com/posts/2025/coding-agent-learnings-2/</guid><description>Defining evaluation methodology, metrics &amp; evals, and using LLM-as-a-judge for my product, a coding agent.</description><pubDate>Sat, 30 Aug 2025 20:30:00 GMT</pubDate><content:encoded>&lt;p&gt;&lt;strong&gt;This is second in the series of articles I plan to write about my learnings of Building an AI product, defining evals, iterating through solutions and finally demonstrating impact on the customer &amp;#x26; business.  If you have not read the first article, &lt;a href=&quot;https://kneeraj.com/posts/2025/coding-agent-learnings-1&quot;&gt;start here&lt;/a&gt;.&lt;/strong&gt;&lt;/p&gt;
&lt;h2 id=&quot;table-of-contents&quot;&gt;Table of Contents&lt;/h2&gt;
&lt;p&gt;&lt;/p&gt;&lt;details&gt;&lt;summary&gt;Open Table of Contents&lt;/summary&gt;&lt;p&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;#first-why-evals&quot;&gt;First, why evals?&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;#how-to-do-evals&quot;&gt;How to do Evals&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;#example--how-i-did-evals-for-developer-copilot-a-coding-agent&quot;&gt;Example : How I did Evals for Developer Copilot, a coding agent&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;#feature--conversational-developer-assistant&quot;&gt;Feature : Conversational Developer Assistant&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;#how-we-did-evals&quot;&gt;How we did Evals&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;#impact---developer-love-%EF%B8%8F%EF%B8%8F&quot;&gt;Impact - Developer Love ❤️❤️&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;/p&gt;&lt;/details&gt;&lt;p&gt;&lt;/p&gt;
&lt;h2 id=&quot;first-why-evals&quot;&gt;First, why evals?&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;AI is non-deterministic but your product and customers who are using it need “reliability” in doing their tasks!  Evals&lt;/strong&gt; are a critical part of AI product development and Product Managers should be the internal champions of rigorous evals!&lt;/p&gt;
&lt;p&gt;It is a systematic way to measure and communicate AI product quality to your customers and teams.&lt;/p&gt;
&lt;h2 id=&quot;how-to-do-evals&quot;&gt;How to do Evals&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;https://kneeraj.com/assets/img/2025/coding-agent-learnings/evals-metrics-system.png&quot; alt=&quot;Evals &amp;#x26; Metric System for an AI product&quot; style=&quot;width: 100%; height: auto; border: 3px solid #ddd; box-shadow: 0 4px 8px rgba(0,0,0,0.1);&quot;&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Step 1&lt;/strong&gt; : Curate your Datasets (Test cases, Expected output)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Step 2&lt;/strong&gt; : Define your Evaluation Methodology &amp;#x26; parameters :
&lt;ul&gt;
&lt;li&gt;Define how will anyone compare (Ideal output vs AI output)&lt;/li&gt;
&lt;li&gt;Define Evaluation parameters&lt;/li&gt;
&lt;li&gt;What aggregated metrics you will convey from evaluation?&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Step 3&lt;/strong&gt; : Perform Evaluation
&lt;ul&gt;
&lt;li&gt;Manual (human judge) - (start here!)&lt;/li&gt;
&lt;li&gt;Automated  (LLM-as-a-judge) - (More on this topic later!)&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Step 4&lt;/strong&gt; : Analyse Error Patterns  :
&lt;ul&gt;
&lt;li&gt;Error Patterns : why test-cases failed and tag them
&lt;ul&gt;
&lt;li&gt;LLM not getting all the context?&lt;/li&gt;
&lt;li&gt;Context not in right format?&lt;/li&gt;
&lt;li&gt;Customer inputs are not good!&lt;/li&gt;
&lt;li&gt;more…&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Step 6&lt;/strong&gt; : Report Evaluation Metrics&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;example--how-i-did-evals-for-developer-copilot-a-coding-agent&quot;&gt;Example : How I did Evals for Developer Copilot, a coding agent&lt;/h2&gt;
&lt;h3 id=&quot;feature--conversational-developer-assistant&quot;&gt;Feature : Conversational Developer Assistant&lt;/h3&gt;
&lt;p&gt;&lt;em&gt;&lt;strong&gt;Feature description &amp;#x26; how it works&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Chat with Freddy AI developer assistant to generate code, fix errors, and get answers to your Freshworks app development questions. It uses typical RAG pipeline (Retrieval Augmented Features) on internally maintained knowledge base around developer platform.&lt;/p&gt;
&lt;div style=&quot;margin: 1.5rem 0; max-width: 100%; overflow: hidden;&quot;&gt;
  &lt;div style=&quot;position: relative; width: 100%; max-width: 640px; margin: 0 auto; padding-bottom: 56.25%; height: 0;&quot;&gt;
    &lt;iframe style=&quot;position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 0;&quot; src=&quot;https://www.youtube.com/embed/C1dipY9dqMI&quot; title=&quot;YouTube video player&quot; allow=&quot;accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture&quot; allowfullscreen&gt;
    &lt;/iframe&gt;
  &lt;/div&gt;
&lt;/div&gt; 
&lt;h3 id=&quot;how-we-did-evals&quot;&gt;How we did Evals&lt;/h3&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Step 1 : We created benchmark datasets&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;I analysed 1000 prompts from production manually and created a dataset with :
&lt;ul&gt;
&lt;li&gt;Identified Intent (debugging, generating feature code, generating frontend code, etc)&lt;/li&gt;
&lt;li&gt;Expected Output&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Step 2 :  Defined evaluation methodology &amp;#x26; parameters&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Methodology : Answer should contain “certain things” to be called a “accurate” answer. Each AI response will be scored “yes/no” on the list of criteria defined&lt;/li&gt;
&lt;li&gt;For each test-case in the dataset we defined multiple
&lt;ul&gt;
&lt;li&gt;&lt;em&gt;“Answer should include….”&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;&lt;em&gt;“Answer should include…”&lt;/em&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;For example for a debugging intent to “fix an error: &lt;error&gt;”, Answer should include…
&lt;ul&gt;
&lt;li&gt;&lt;em&gt;Root cause of the error : &lt;describe root=&quot;&quot; cause=&quot;&quot; for=&quot;&quot; the=&quot;&quot; error=&quot;&quot; test=&quot;&quot; case=&quot;&quot;&gt;&lt;/describe&gt;&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;&lt;em&gt;Code with Error Fixed : &amp;#x3C;this is how the fixed code template would look like…&gt;&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;&lt;em&gt;Code should be syntactically correct javascript&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;&lt;em&gt;….. (whatever you as a SME can define)&lt;/em&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/error&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Step 3 : Define evaluation metrics&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Accuracy Baseline Measure :&lt;/strong&gt;
&lt;ul&gt;
&lt;li&gt;% of test-cases with &gt;= 0.5 score i.e. This is a good response if you pass at-least half of the &lt;em&gt;“answer should have criteria”&lt;/em&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Avg Accuracy Score :&lt;/strong&gt;
&lt;ul&gt;
&lt;li&gt;Overall avg accuracy score across the dataset&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;These are just our defined metrics purely based on our evaluation methodology. Good product teams &amp;#x26; companies are defining their Dataset &amp;#x26; Evals. This allows them to iterate faster and replace LLMs, etc at will.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Step 4 : Analyse Error Patterns&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Feature uses a typical RAG (Retrieval Augmented Generation pipeline), after analysis, we realised the biggest issues were in searching &amp;#x26; fetching the “right context”.&lt;/li&gt;
&lt;li&gt;We had tonnes of experiments in tokenisation, query chunking, hybrid retrieval algorithms to improve context fetching which led to improves on the evals &amp;#x26; eventually product metrics&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Report the metrics&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Here are some recorded improvements we did by going from naive to advanced RAG pipeline.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;https://kneeraj.com/assets/img/2025/coding-agent-learnings/avg_accuracy_score.png&quot; alt=&quot;Metric graphs showing avg accuracy score&quot; style=&quot;width: 100%; height: auto; border: 3px solid #ddd; box-shadow: 0 4px 8px rgba(0,0,0,0.1);&quot;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://kneeraj.com/assets/img/2025/coding-agent-learnings/accuracy_baseline_graphs.png&quot; alt=&quot;Metric graphs showing accuracy baseline graphs&quot; style=&quot;width: 100%; height: auto; border: 3px solid #ddd; box-shadow: 0 4px 8px rgba(0,0,0,0.1);&quot;&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&quot;impact---developer-love-️️&quot;&gt;Impact - Developer Love ❤️❤️&lt;/h2&gt;
&lt;blockquote&gt;
&lt;ul&gt;
&lt;li&gt;Developers were praising productivity gains in development and the ability to migrate apps to new platform versions seamlessly with AI assistance&lt;/li&gt;
&lt;li&gt;“Positive feedback rate” almost doubled from 30% to 54% even while feedback volume jumped 87% &gt; - indicating both higher satisfaction and broader adoption&lt;/li&gt;
&lt;li&gt;Continually improve “Response acceptance rate” - a critical milestone showing developers trust and actively adopt AI-generated suggestions&lt;/li&gt;
&lt;li&gt;Developer engagement accelerated 32.8% QoQ - reflecting sustained and growing usage patterns&lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;img src=&quot;https://kneeraj.com/assets/img/2025/coding-agent-learnings/impact.png&quot; alt=&quot;Impact Image&quot; style=&quot;width: 100%; height: auto; border: 3px solid #ddd; box-shadow: 0 4px 8px rgba(0,0,0,0.1);&quot;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://kneeraj.com/assets/img/2025/coding-agent-learnings/neeraj-dev-feedback-email.png&quot; alt=&quot;developer email image&quot; style=&quot;width: 100%; height: auto; border: 3px solid #ddd; box-shadow: 0 4px 8px rgba(0,0,0,0.1);&quot;&gt;&lt;/p&gt;</content:encoded><category>business-of-ai</category><category>evals</category><category>coding-agents</category></item><item><title>Learnings from building an AI coding agent: Key Learnings (1/3)</title><link>https://kneeraj.com/posts/2025/coding-agent-learnings-1/</link><guid isPermaLink="true">https://kneeraj.com/posts/2025/coding-agent-learnings-1/</guid><description>Learnings from building AI/LLM coding agents highlighting value of AI evals, trustworthy workflows and the impact created.</description><pubDate>Fri, 29 Aug 2025 20:30:00 GMT</pubDate><content:encoded>&lt;p&gt;I spent last building a coding agent as a Product Manager and there were tonnes of learnings! LLMs have made the future of software incredibly exciting! While the internet democratised knowledge, AI is democratising “expertise, knowledge and skills”! It’s incredibly empowering to brainstorm to your intellectually smart partner (LLM) and bring ideas to life just through conversations!&lt;/p&gt;
&lt;p&gt;Starting with where this journey began! Throwback to my ReactNexus 2024 conference where I presented early learnings from building a coding agent, an advanced RAG pipeline, AI based code migrator, and other AI capabilities such as mockups to code, idea to app. Over the year we put a lot of emphasis on Evals and trustworthy workflows to improve reliability of coding agent, and UX. It reflected in developer feedback and numbers!&lt;/p&gt;
&lt;div style=&quot;margin: 1.5rem 0; max-width: 100%; overflow: hidden;&quot;&gt;
  &lt;div style=&quot;position: relative; width: 100%; max-width: 640px; margin: 0 auto; padding-bottom: 56.25%; height: 0;&quot;&gt;
    &lt;iframe style=&quot;position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 0;&quot; src=&quot;https://www.youtube.com/embed/gWzDYetc7Mw?start=1&quot; title=&quot;YouTube video player&quot; allow=&quot;accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture&quot; allowfullscreen&gt;
    &lt;/iframe&gt;
  &lt;/div&gt;
&lt;/div&gt; 
&lt;h2 id=&quot;developer-love-️️and-the-ensuing-impact&quot;&gt;Developer Love ❤️❤️ and the ensuing impact&lt;/h2&gt;
&lt;blockquote&gt;
&lt;ul&gt;
&lt;li&gt;Developers praising productivity gains in development and the ability to migrate apps to new platform versions seamlessly with AI assistance&lt;/li&gt;
&lt;li&gt;“Positive feedback rate” almost doubled from 30% to 54% even while feedback volume jumped 87% &gt; - indicating both higher satisfaction and broader adoption&lt;/li&gt;
&lt;li&gt;Continually improve “Response acceptance rate” - a critical milestone showing developers trust and actively adopt AI-generated suggestions&lt;/li&gt;
&lt;li&gt;Developer engagement accelerated 32.8% QoQ - reflecting sustained and growing usage patterns&lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;
&lt;!-- ![impact image](/assets/img/2025/coding-agent-learnings/impact.png) --&gt;
&lt;p&gt;&lt;img src=&quot;https://kneeraj.com/assets/img/2025/coding-agent-learnings/impact.png&quot; alt=&quot;Impact Image&quot; style=&quot;width: 100%; height: auto; border: 3px solid #ddd; box-shadow: 0 4px 8px rgba(0,0,0,0.1);&quot;&gt;&lt;/p&gt;
&lt;!-- ![developer email image](/assets/img/2025/coding-agent-learnings/neeraj-dev-feedback-email.png) --&gt;
&lt;p&gt;&lt;img src=&quot;https://kneeraj.com/assets/img/2025/coding-agent-learnings/neeraj-dev-feedback-email.png&quot; alt=&quot;developer email image&quot; style=&quot;width: 100%; height: auto; border: 3px solid #ddd; box-shadow: 0 4px 8px rgba(0,0,0,0.1);&quot;&gt;&lt;/p&gt;
&lt;h2 id=&quot;key-learnings-from-building-a-reliable-ai-product&quot;&gt;Key Learnings from building a “reliable AI product”&lt;/h2&gt;
&lt;p&gt;&lt;em&gt;&lt;strong&gt;I wanted to share the learnings and un-learnings of building an AI-powered product as a Product Manager! LLMs are all the rage right now and incredibly powerful, but the “rigour” required to build a reliable AI product was an important learning for me!&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Building “magical AI prototypes” is 10X easier, while building reliable products for customers has gotten “10X harder”!&lt;/strong&gt; There is “rigour” required in building AI products (Ask your ML counterparts!). What looks like a working demo often breaks when exposed to real users! One needs robust evals, continuous LLM traces evaluation for error analysis, and trustworthy workflows!&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Trust in AI products is really low thanks to overhyped claims&lt;/strong&gt;! Bake trust into your AI workflows from Day 1. As a PM, ask your self what can I add into my workflow (such as transparency and control) that makes my customer trust the AI system (aka your product).&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Robust Evals for accuracy, safety, and reliance! AI is non-deterministic but your product and customers who are using it need “reliability” with some scientific evidence! Evals&lt;/strong&gt; are a critical part of AI product development and Product Managers should be the internal champions of rigorous evals! You need systematic ways to measure and communicate quality to your teams and your customers.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;strong&gt;In the subsequent posts I will be talking about 2 things:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://kneeraj.com/posts/2025/coding-agent-learnings-2&quot;&gt;How we built an “AI evals” system&lt;/a&gt; (offline evals on test bed, evals on production data)&lt;/li&gt;
&lt;li&gt;How we built “trust” into all the AI feature workflows!!&lt;/li&gt;
&lt;/ul&gt;</content:encoded><category>business-of-ai</category><category>coding-agents</category><category>evals</category><category>productivity</category></item><item><title>Claude Mobile App Improvements PRD</title><link>https://kneeraj.com/posts/2025/claude-mobile-app-improvements/</link><guid isPermaLink="true">https://kneeraj.com/posts/2025/claude-mobile-app-improvements/</guid><description>Drive more usage in Claude mobile app by improving critical user workflows</description><pubDate>Thu, 07 Aug 2025 10:49:00 GMT</pubDate><content:encoded>&lt;p&gt;&lt;mark class=&quot;note&quot;&gt;A comprehensive PRD for improving Claude mobile app experience for casual users seeking quick conversations and accurate responses.&lt;/mark&gt;&lt;/p&gt;
&lt;h2 id=&quot;table-of-contents&quot;&gt;Table of Contents&lt;/h2&gt;
&lt;p&gt;&lt;/p&gt;&lt;details&gt;&lt;summary&gt;Open Table of Contents&lt;/summary&gt;&lt;p&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;#objective&quot;&gt;Objective&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;#user-personas&quot;&gt;User Personas&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;#suggested-claude-mobile-app-improvements-for-casual-users&quot;&gt;Suggested Claude Mobile App Improvements for Casual Users&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;#1-faster-ways-to-kickstart-conversations-with-claude-mobile-app&quot;&gt;1. Faster ways to kickstart conversations with Claude mobile app&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;#2-enabling-seamless-conversations&quot;&gt;2. Enabling Seamless Conversations&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;#3-information-hierarchy--workflow-improvements&quot;&gt;3. Information Hierarchy &amp;#x26; Workflow Improvements&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;/p&gt;&lt;/details&gt;&lt;p&gt;&lt;/p&gt;
&lt;h2 id=&quot;objective&quot;&gt;Objective&lt;/h2&gt;
&lt;p&gt;Drive more usage in Claude mobile app by improving critical user workflows.&lt;/p&gt;
&lt;h2 id=&quot;user-personas&quot;&gt;User Personas&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;Casual users interested in conversations &amp;#x26; getting responses&lt;/li&gt;
&lt;/ol&gt;
&lt;ul&gt;
&lt;li&gt;Optimising for productivity and efficiency and quickly getting responses!&lt;/li&gt;
&lt;li&gt;Want to converse and get reliable answers, mostly want accurate answers embedded in latest data (web search is important tool, connecting with system of records (Google workspace, Email, Calendar, etc)&lt;/li&gt;
&lt;li&gt;Just want to use best &amp;#x26; latest model and does not want cognitive load of choosing a model or structuring things by creating projects and ensuring relevant chats go into relevant projects! Mostly unstructured conversations with quick responses to get job done!&lt;/li&gt;
&lt;li&gt;Want to quickly start conversations with 1 click and get right to the answers wanted! Shortcuts for getting into conversations will be really helpful!&lt;/li&gt;
&lt;li&gt;Does not bother with long prompts but the expectations are high from the response&lt;/li&gt;
&lt;li&gt;Voice is a great way to quickly converse or communicate context or construct prompts&lt;/li&gt;
&lt;li&gt;Wants conversations and context to be seamless. For instance, if quota exhausted, wants to switch to the next best model!&lt;/li&gt;
&lt;/ul&gt;
&lt;ol start=&quot;2&quot;&gt;
&lt;li&gt;Specifically using for Coding &amp;#x26; Prototyping (PMs, designers, Analysts, etc)&lt;/li&gt;
&lt;/ol&gt;
&lt;ul&gt;
&lt;li&gt;Specially coming to make brainstorm &amp;#x26; make prototypes (artifacts). Want artifacts to be first class citizen of Claude Chat&lt;/li&gt;
&lt;li&gt;Making modifications to artifacts would be amazing!&lt;/li&gt;
&lt;li&gt;Generate and share artifacts efficiently! Enabled to gather feedback &amp;#x26; comments would be amazing!&lt;/li&gt;
&lt;li&gt;Easy ways to review artifacts with comments received and make modifications to artifacts simple&lt;/li&gt;
&lt;/ul&gt;
&lt;ol start=&quot;3&quot;&gt;
&lt;li&gt;Power users who specifically use Claude for all knowledge work and more aware of prompt engineering, tools, and tricks for best response&lt;/li&gt;
&lt;/ol&gt;
&lt;ul&gt;
&lt;li&gt;Ensures to start projects and group conversations into relevant projects for shared context&lt;/li&gt;
&lt;li&gt;Have multiple projects created and ensures to continue conversations there hoping claude has context of the project&lt;/li&gt;
&lt;li&gt;Carefully selects model, prompt, tools, whether “extended thinking” is required or not, deep research reports, etc for the best response&lt;/li&gt;
&lt;li&gt;Writes long prompts with all the prompt engineering techniques known! and the context given&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;h2 id=&quot;suggested-claude-mobile-app-improvements-for-casual-users&quot;&gt;Suggested Claude Mobile App Improvements for Casual Users&lt;/h2&gt;
&lt;p&gt;&lt;mark class=&quot;note note-info&quot;&gt;This user persona isn’t too “AI savvy” with prompts, tools, but instead looking for quick conversations and responses. The goal should be to reduce friction and enable as much seamless conversations as possible!&lt;/mark&gt;&lt;/p&gt;
&lt;h3 id=&quot;1-faster-ways-to-kickstart-conversations-with-claude-mobile-app&quot;&gt;1. Faster ways to kickstart conversations with Claude mobile app&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Home screen quick action with 3D touch:&lt;/strong&gt; “start a new chat”, “voice mode”&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Spotlight search shortcuts&lt;/strong&gt; to quickly start conversations&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Interactive widgets&lt;/strong&gt; (Home &amp;#x26; Lock screen, Control Centre shortcuts)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;1.1 &lt;strong&gt;Home Screen Quick Action&lt;/strong&gt;
&lt;strong&gt;Current Implementation&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://kneeraj.com/assets/img/2025/claude-mobile-improvements/current-3d-touch.png&quot; alt=&quot;Current 3D Touch menu showing limited options&quot; style=&quot;width: 25%; height: auto; border: 3px solid #ddd; box-shadow: 0 4px 8px rgba(0,0,0,0.1); display: block; margin: 20px auto;&quot;&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Improvement&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;mark class=&quot;note note-success&quot;&gt;Including “Start New Chat”, “Voice Mode”, “Continue in Recent project” options to quickly start conversations&lt;/mark&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://kneeraj.com/assets/img/2025/claude-mobile-improvements/3d_action.gif&quot; alt=&quot;Improved 3D Touch menu with Start New Chat, Voice Mode, and Continue in Recent Project options&quot; style=&quot;width: 25%; height: auto; border: 3px solid #ddd; box-shadow: 0 4px 8px rgba(0,0,0,0.1);&quot;&gt;&lt;/p&gt;
&lt;p&gt;1.2 &lt;strong&gt;Spotlight Search Shortcuts&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Current:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://kneeraj.com/assets/img/2025/claude-mobile-improvements/current-spotlight.png&quot; alt=&quot;Current Spotlight search showing basic search functionality&quot; style=&quot;width: 25%; height: auto; border: 3px solid #ddd; box-shadow: 0 4px 8px rgba(0,0,0,0.1);&quot;&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Improvement:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;mark class=&quot;note note-success&quot;&gt;Spotlight search shortcuts for Ask Claude, Start a New Chat, etc&lt;/mark&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://kneeraj.com/assets/img/2025/claude-mobile-improvements/improved-spotlight.png&quot; alt=&quot;Improved Spotlight search with shortcuts for Ask Claude and Start New Chat&quot; style=&quot;width: 25%; height: auto; border: 3px solid #ddd; box-shadow: 0 4px 8px rgba(0,0,0,0.1);&quot;&gt;&lt;/p&gt;
&lt;h3 id=&quot;2-enabling-seamless-conversations&quot;&gt;2. Enabling Seamless Conversations&lt;/h3&gt;
&lt;p&gt;2.1 &lt;strong&gt;Auto-Switching Models &amp;#x26; Chats After Hitting Limits&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Allow users to have longer conversations without hitting limits by auto-switching to new model or a new chat but “carrying the current context”&lt;/li&gt;
&lt;li&gt;Users can manually switch to other models by clicking on the title bar&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;mark class=&quot;note note-warning&quot;&gt;Currently, the title bar in Claude mobile app is broken completely. Clicking on it gives “Rename” vs all options with model switcher. Claude should fix title menu in iOS app: allow users to switch models with a tap, rename, etc&lt;/mark&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://kneeraj.com/assets/img/2025/claude-mobile-improvements/switching_models.gif&quot; alt=&quot;Model switching feature showing seamless transition between different Claude models&quot; style=&quot;width: 25%; height: auto; border: 3px solid #ddd; box-shadow: 0 4px 8px rgba(0,0,0,0.1);&quot;&gt;&lt;/p&gt;
&lt;p&gt;2.2 &lt;strong&gt;Prompt Enhancer&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Most users don’t write detailed prompts out of lack of knowledge on why prompts differ from “typical search queries” or lack of awareness around techniques to write better prompts or just too much typing &amp;#x26; cognitive load. For them there should be a prompt enhancer: User writes → Claude understands intent → Enhances prompt&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://kneeraj.com/assets/img/2025/claude-mobile-improvements/prompt_enhancer.gif&quot; alt=&quot;Prompt enhancer feature showing how user input is enhanced for better results&quot; style=&quot;width: 25%; height: auto; border: 3px solid #ddd; box-shadow: 0 4px 8px rgba(0,0,0,0.1);&quot;&gt;&lt;/p&gt;
&lt;p&gt;2.3 &lt;strong&gt;Add an Existing Conversation to Project&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Allow users to map existing conversations to a project. That way they don’t take the cognitive load upfront but later on if they realize it belongs to project let it be. Once added, index the current chat, add any files referred to project store.&lt;/p&gt;
&lt;p&gt;&lt;mark class=&quot;note note-warning&quot;&gt;For some reason Claude allows new conversation to add to a project but not an existing conversation.&lt;/mark&gt;&lt;/p&gt;
&lt;h3 id=&quot;3-information-hierarchy--workflow-improvements&quot;&gt;3. Information Hierarchy &amp;#x26; Workflow Improvements&lt;/h3&gt;
&lt;p&gt;3.1 &lt;strong&gt;Home Page Improvements&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Home page should not just show “Projects” as Casual users typically have chats/conversations. Rather, taking cues from web app, show “Recent Chats” and sections for “Chats”, and “projects” (if any).&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Current:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://kneeraj.com/assets/img/2025/claude-mobile-improvements/current-home.png&quot; alt=&quot;Current home page showing only Projects section&quot; style=&quot;width: 25%; height: auto; border: 3px solid #ddd; box-shadow: 0 4px 8px rgba(0,0,0,0.1);&quot;&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Improvement:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;mark class=&quot;note note-success&quot;&gt;Show search to filter to right conversation, recent chats to continue conversations and Chats, Projects section to go through list in case user needs.&lt;/mark&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://kneeraj.com/assets/img/2025/claude-mobile-improvements/improved-home.png&quot; alt=&quot;Improved home page with search, recent chats, and organized sections for Chats and Projects&quot; style=&quot;width: 25%; height: auto; border: 3px solid #ddd; box-shadow: 0 4px 8px rgba(0,0,0,0.1);&quot;&gt;&lt;/p&gt;
&lt;hr&gt;</content:encoded><category>business-of-ai</category><category>product-management</category></item><item><title>AI assistants vs agents: a mental model</title><link>https://kneeraj.com/posts/2025/ai-assistants-vs-agents/</link><guid isPermaLink="true">https://kneeraj.com/posts/2025/ai-assistants-vs-agents/</guid><description>Skip the slogan. An agent finishes a higher-order task with little help. An assistant helps you do a step. The difference shows up in autonomy, tokens, and whether the task is worth the cost.</description><pubDate>Sun, 13 Jul 2025 04:30:00 GMT</pubDate><content:encoded>&lt;p&gt;A lot of products are being called agents because the word tests well. I do not think a hard definition will survive the year, so I use a test I can apply to a product in front of me.&lt;/p&gt;
&lt;p&gt;The building blocks that show up once something passes this test are in &lt;a href=&quot;https://kneeraj.com/posts/2025/ai-agent-primitives&quot;&gt;Demystifying AI agents: agent primitives&lt;/a&gt;.&lt;/p&gt;
&lt;div style=&quot;margin: 1.5rem 0; max-width: 100%; overflow: hidden;&quot;&gt;
  &lt;div style=&quot;position: relative; width: 100%; max-width: 640px; margin: 0 auto; padding-bottom: 56.25%; height: 0;&quot;&gt;
    &lt;iframe style=&quot;position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 0;&quot; src=&quot;https://www.youtube.com/embed/NahVEZ6azZo&quot; title=&quot;YouTube video player&quot; allow=&quot;accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture&quot; allowfullscreen&gt;
    &lt;/iframe&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&quot;start-from-the-task-a-person-already-does&quot;&gt;Start from the task a person already does&lt;/h2&gt;
&lt;p&gt;Pick the domain first. Coding, video, music, whatever the human job actually is. Then split that job into the higher-order task and the unit tasks inside it.&lt;/p&gt;
&lt;p&gt;In coding, the higher-order task is: an issue exists, and a pull request that fixes it is open and green. Along the way someone reads the issue, plans, edits, runs the code, pushes, and fixes whatever CI rejected. Each of those is a unit task.&lt;/p&gt;
&lt;p&gt;An &lt;strong&gt;agent&lt;/strong&gt; is the software that can finish the higher-order task mostly on its own. Issue to pull request. Or a new feature, end to end, in the codebase.&lt;/p&gt;
&lt;p&gt;An &lt;strong&gt;assistant&lt;/strong&gt; helps with a unit task. It can explain the issue, or draft a plan, if it can see the code. You still do the job. It makes a step faster or cleaner.&lt;/p&gt;
&lt;h2 id=&quot;cost-has-to-be-worth-the-task&quot;&gt;Cost has to be worth the task&lt;/h2&gt;
&lt;p&gt;Agents eat tokens and they want a strong model. Assistants can live on a smaller one. That only makes sense when the higher-order task is expensive enough to pay for.&lt;/p&gt;
&lt;p&gt;Coding is. People pay $100 or $200 a month for Claude Code because a working change is worth more than the tokens. Deep research is the other one I trust. A real research agent does not run one query and summarize three links. It plans, searches, notices the result is thin, searches again, and writes the report. That is the multi-day version of the same work, compressed into 15 or 20 minutes. Most of us, outside of coding, spend our days researching and synthesizing. That is why the spend is rational.&lt;/p&gt;
&lt;p&gt;The things that fail the test are the cheap helpers: copilot chat, the first generation of chat products, conversational search that rewrites your question, opens a couple of links, and summarizes them. Useful. Not an agent. There is no real planning, no recovery when the first pass is bad, and no pile of subtasks.&lt;/p&gt;
&lt;p&gt;If someone asks me whether a product is an agent, I ask three things. Is this a higher-order task a person used to own? Can the software finish it without being walked through the steps? Does it do that reliably? If the answer is that it helps me do a step better, it is an assistant.&lt;/p&gt;
&lt;h2 id=&quot;what-pms-have-to-design-for&quot;&gt;What PMs have to design for&lt;/h2&gt;
&lt;p&gt;Once you claim the higher-order task, the product problems are human problems:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Can a person delegate the task, including with a prompt that is good enough?&lt;/li&gt;
&lt;li&gt;Can they see what the agent is doing while it runs?&lt;/li&gt;
&lt;li&gt;Can they check the work when it comes back?&lt;/li&gt;
&lt;li&gt;Is there an audit trail for a 15-minute or hour-long run, so “what did it do?” has an answer?&lt;/li&gt;
&lt;li&gt;Do they trust it? Trust is low precisely because you claimed a big task. The product has to spend extra effort earning it.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Autonomy without a way to verify is just a demo.&lt;/p&gt;</content:encoded><category>ai-agents</category><category>business-of-ai</category></item><item><title>Talk to Notion notes with Claude Desktop</title><link>https://kneeraj.com/posts/2025/talk-to-notion-with-claude-desktop/</link><guid isPermaLink="true">https://kneeraj.com/posts/2025/talk-to-notion-with-claude-desktop/</guid><description>A short setup: Notion&apos;s MCP server, a read-only integration, and Claude Desktop, so I can ask questions against my own notes instead of the public web.</description><pubDate>Mon, 14 Apr 2025 04:30:00 GMT</pubDate><content:encoded>&lt;p&gt;I wanted to ask questions against notes I had already written, not against the internet. Notion shipped an MCP server in front of their API. Claude Desktop is the client. The whole thing is a config file and a permissions screen.&lt;/p&gt;
&lt;p&gt;For the longer introduction to how a model with tools differs from a model on its own, and what MCP standardizes, see &lt;a href=&quot;https://kneeraj.com/posts/2025/mcp-and-llms-with-tools&quot;&gt;MCP and LLMs with tools&lt;/a&gt;.&lt;/p&gt;
&lt;div style=&quot;margin: 1.5rem 0; max-width: 100%; overflow: hidden;&quot;&gt;
  &lt;div style=&quot;position: relative; width: 100%; max-width: 640px; margin: 0 auto; padding-bottom: 56.25%; height: 0;&quot;&gt;
    &lt;iframe style=&quot;position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 0;&quot; src=&quot;https://www.youtube.com/embed/p8QPYn4NnJE&quot; title=&quot;YouTube video player&quot; allow=&quot;accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture&quot; allowfullscreen&gt;
    &lt;/iframe&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&quot;the-connection&quot;&gt;The connection&lt;/h2&gt;
&lt;p&gt;In Notion I created an integration and kept the permission tight. I kept it to reading content and comments, with no editing. Notion’s model is also per page: the integration does not see a page until that page is shared with it. I shared my AI space, which is where I keep notes on this stuff.&lt;/p&gt;
&lt;p&gt;In Claude Desktop the Notion MCP server goes into the config JSON, with the integration secret filled in. Restart Claude after that.&lt;/p&gt;
&lt;p&gt;The connection I ended up looking at could read content, read comments, and comment. It could not insert or update page content. That is the right default for a notes assistant. I can loosen it later if I want Claude writing back.&lt;/p&gt;
&lt;h2 id=&quot;asking-the-notes-not-the-web&quot;&gt;Asking the notes, not the web&lt;/h2&gt;
&lt;p&gt;The first check was mechanical. I asked for the subpages in that space. Claude called Notion search and listed the same pages I see in the sidebar.&lt;/p&gt;
&lt;p&gt;Then I asked for the top ten suggestions sitting inside my prompt-engineering notes. The list came back from those notes. It was not a generic essay from the model’s training data, and it was not a web search. That is the only reason to connect a notebook. The model should be reading what I wrote.&lt;/p&gt;</content:encoded><category>mcp</category></item><item><title>Winning in AI coding agents space</title><link>https://kneeraj.com/posts/2025/winning-coding-agents-space/</link><guid isPermaLink="true">https://kneeraj.com/posts/2025/winning-coding-agents-space/</guid><description>Strategy for winning in AI coding agents market</description><pubDate>Thu, 27 Mar 2025 13:46:00 GMT</pubDate><content:encoded>&lt;p&gt;&lt;img src=&quot;https://kneeraj.com/assets/img/2025/winning-ai-agents/winning-ai-agents-hero-image.png&quot; alt=&quot;AI coding agents strategy&quot; style=&quot;width: 100%; height: auto; border: 3px solid #ddd; box-shadow: 0 4px 8px rgba(0,0,0,0.1); display: block; margin: 20px auto;&quot;&gt;&lt;/p&gt;
&lt;h3 id=&quot;table-of-contents&quot;&gt;Table of Contents&lt;/h3&gt;
&lt;p&gt;&lt;/p&gt;&lt;details&gt;&lt;summary&gt;Open Table of Contents&lt;/summary&gt;&lt;p&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;#problem--if-you-are-pm-for-an-ai-coding-agent-what-strategy-you-will-use-to-win&quot;&gt;&lt;strong&gt;Problem : If you are PM for an AI coding agent what strategy you will use to win?&lt;/strong&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;#approach&quot;&gt;&lt;strong&gt;Approach&lt;/strong&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;#context&quot;&gt;&lt;strong&gt;Context&lt;/strong&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;#user-segments&quot;&gt;&lt;strong&gt;User Segments&lt;/strong&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;#how-do-you-build-a-differentiated-product-experience&quot;&gt;&lt;strong&gt;How do you build a differentiated product experience?&lt;/strong&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;#leverage-or-build-competitive-advantage&quot;&gt;&lt;strong&gt;Leverage or build competitive advantage&lt;/strong&gt;&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;/p&gt;&lt;/details&gt;&lt;p&gt;&lt;/p&gt;
&lt;h3 id=&quot;problem--if-you-are-pm-for-an-ai-coding-agent-what-strategy-you-will-use-to-win&quot;&gt;&lt;strong&gt;Problem : If you are PM for an AI coding agent what strategy you will use to win?&lt;/strong&gt;&lt;/h3&gt;
&lt;h3 id=&quot;approach&quot;&gt;&lt;strong&gt;Approach&lt;/strong&gt;&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;In any domain if you are building a product, few things are important :&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Which customer segment are you targeting?&lt;/li&gt;
&lt;li&gt;How do you build a differentiated product experience for them?&lt;/li&gt;
&lt;li&gt;Do you have any (durable) competitive advantages?&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&quot;context&quot;&gt;&lt;strong&gt;Context&lt;/strong&gt;&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;Broader trends in AI coding agent domain&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;LLMs are good at code related tasks : generating code, debugging code (context), writing tests, etc.&lt;/li&gt;
&lt;li&gt;Building low-mid difficult software products is becoming more accessible to low-no coders. A lot of boilerplate development tasks are becoming conversational&lt;/li&gt;
&lt;li&gt;Evolution from copilot (ask me anything about software development) to agents (do software development work for me…)&lt;/li&gt;
&lt;li&gt;Low-mid complexity software can go creator economy way (publish videos, podcasts, etc → publish mini software)&lt;/li&gt;
&lt;li&gt;Overall Software Product Development is becoming more &amp;#x26; more efficient!&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;What does these trends lead to :&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;More non-tech people will hear “hat” of software builder and would bring ideas to life!&lt;/li&gt;
&lt;li&gt;More software will be built →
&lt;ul&gt;
&lt;li&gt;long tail → apps-for-1 or personalised apps, software for niche audience (earlier economically not viable but now is!), software for specific industry verticals&lt;/li&gt;
&lt;li&gt;More efficiency means companies can use existing resources to build more…&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Professional Software Product Development teams will be smaller (Engg, PM, design) with big goals!&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Domain - Software domain with coding look like…&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Coding agents are an interesting space because LLMs are inherently good at coding and Software Engineering as an industry will disrupt for sure!&lt;/p&gt;
&lt;p&gt;AI will seep into Software Product development at all stages….&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Scoping&lt;/li&gt;
&lt;li&gt;Product Development (PM, Engg, UX)&lt;/li&gt;
&lt;li&gt;Testing&lt;/li&gt;
&lt;li&gt;Managing Infrastructure&lt;/li&gt;
&lt;li&gt;Ops (delivery, efficiency, collaboration etc) : CI/CD, Program management, etc&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;h3 id=&quot;user-segments&quot;&gt;&lt;strong&gt;User Segments&lt;/strong&gt;&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;Criteria for creating segments&lt;/strong&gt; : goal of building, type of software (web apps, mobile apps, marketplace apps, industry vertical specific apps)&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;**Vibe coder building personal software (**Analysts &lt;strong&gt;,&lt;/strong&gt; PMs, business folks,) : Minimal understanding of code but wants to build software for personal projects, showcasing ideas at office or to the world,  efficiency apps for their productivity, etc. Want fast, cheap way to get ideas to life!&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Indie hackers building small-mid scale software products&lt;/strong&gt;: Software engineers as they understand code but building interesting projects for themselves or even paid software professionally! Have to build sustainable income with software so need to acquire, retain customers in a profitable manner! have limited budget to spend!&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Professional software engineers&lt;/strong&gt; working in companies building software products. Need agents for productivity and moving faster!
&lt;ul&gt;
&lt;li&gt;Size of company : SME, Mid-market, Enterprise&lt;/li&gt;
&lt;li&gt;Industry vertical : More &amp;#x26; more software should be built for non-digital niche spaces : Real estate, telecom, operations, manufacturing, tourism, etc&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;mark class=&quot;note note-info&quot;&gt;Picking a segment depends on a lot of factors, growth, your core competency (product vs sales, etc). Lets pick “vibe coders” which is growing fast and cheaper to build (less complex software)..Challenge is highly competitive!&lt;/mark&gt;&lt;/p&gt;
&lt;hr&gt;
&lt;h3 id=&quot;how-do-you-build-a-differentiated-product-experience&quot;&gt;&lt;strong&gt;How do you build a differentiated product experience?&lt;/strong&gt;&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Dig deeper into their goals and segments and fulfil them better&lt;/li&gt;
&lt;li&gt;Leverage or build core competencies you have to gain an edge!&lt;/li&gt;
&lt;li&gt;Reliability (hard to build in AI products)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Vibe coders :&lt;/strong&gt; Analysts, PMs, Business folks, etc&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Goals&lt;/strong&gt; :&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Bring their ideas to life! These folks have a lot of real world context and hence have so many ideas but were restricted by what was possible to build!&lt;/li&gt;
&lt;li&gt;What is possible? To what level they can go (Can the product match their high ceiling of imagination) (Games, mobiles, web apps, internal apps that can connect to various systems, etc)&lt;/li&gt;
&lt;li&gt;They want to showcase their ideas to the world as easily as possible!&lt;/li&gt;
&lt;li&gt;Code, testing, security, infrastructure,observability etc doesn’t matter and would rather be oblivious to it! Only outcome matters!&lt;/li&gt;
&lt;li&gt;Being able to manage change lifecycle : allowing to make changes, commit changes, rollback&lt;/li&gt;
&lt;li&gt;Cost conscious as these projects may not fetch any money to them!&lt;/li&gt;
&lt;li&gt;Finicky! Keeps moving from idea to idea (build fast/kill fast)&lt;/li&gt;
&lt;li&gt;Guide them towards building better - Help them assume the role of UX, PMs, marketer, sales, etc&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Emotions :&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Empowerment &amp;#x26; pride!! Products need to tap into emotions of empowerment (see what you can do now something like canva did for bad designers like me)&lt;/li&gt;
&lt;li&gt;The output needs to be good! Showcasing stuff with pride!&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Key barriers in achieving above goals :&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Current coding agents don’t match their level of imagination (fall short!)&lt;/li&gt;
&lt;li&gt;Stability of current tools : The LLMs are prone to screw projects leading to people getting dejected&lt;/li&gt;
&lt;li&gt;Tools not handling : “Code, testing, security, infrastructure, observability and maintenance” -&gt; make them redundant! Completely hide them!&lt;/li&gt;
&lt;li&gt;Tools can be costly sometimes!&lt;/li&gt;
&lt;li&gt;Keep collaboration like git etc are just added overhead!&lt;/li&gt;
&lt;li&gt;Focused only on building but what about allied functions -&gt; how do I design better, how do understand &amp;#x26; write requirements better, how do I market or sell my stuff better (AI powered marketing ,selling, videos, etc)&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;h3 id=&quot;leverage-or-build-competitive-advantage&quot;&gt;&lt;strong&gt;Leverage or build competitive advantage&lt;/strong&gt;&lt;/h3&gt;
&lt;p&gt;&lt;mark class=&quot;note note-success&quot;&gt;- LLMs are commodity tools available to everyone!&lt;/mark&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Can you do a “task” for your user segment “better” at cheaper “cost”&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;AI competency stack for companies&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;(Table-stakes) Application layer optimisation : Can use existing LLMs to the best to solve customer needs (prompt engg., context management system, &lt;a href=&quot;https://kneeraj.com/posts/2025/mcp-and-llms-with-tools&quot;&gt;LLM + Tools&lt;/a&gt;, &lt;a href=&quot;https://kneeraj.com/posts/2025/framework-for-evaluating-ai-products&quot;&gt;Evals&lt;/a&gt;, etc&lt;/li&gt;
&lt;li&gt;Finetune for specific tasks : Can you take pre-trained LLMs and tune to your advantage for your tasks &amp;#x26; data (fine-tuning, Reinforcement learning)&lt;/li&gt;
&lt;li&gt;Model Inference Infrastructure : Can you host your own LLMs for cheaper (cost per inference token; see &lt;a href=&quot;https://kneeraj.com/posts/2026/inference-engineering-101&quot;&gt;Inference Engineering 101&lt;/a&gt;) &amp;#x26; (faster → reduced latency) or partner with someone. Innovations like using more thinking tokens for complex tasks. Since this variable cost with AI coding agents companies which keep this in control grow much faster!&lt;/li&gt;
&lt;li&gt;Pre-training special purpose small LLMs from scratch for your tasks!&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;https://kneeraj.com/assets/img/2025/winning-ai-agents/ai-competency-stack.png&quot; alt=&quot;AI competency stack&quot; style=&quot;width: 100%; height: auto; border: 3px solid #ddd; box-shadow: 0 4px 8px rgba(0,0,0,0.1); display: block; margin: 20px auto;&quot;&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Examples&lt;/strong&gt; :&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Windsurf has built technology competency across all 4 &lt;a href=&quot;https://codeium.com/blog/our-model-strategy&quot;&gt;https://codeium.com/blog/our-model-strategy&lt;/a&gt;. They have also built expertise in model inference infrastructure&lt;/li&gt;
&lt;li&gt;Bolt (stackblitz) built expertise in web containers (essentially web based developer infra) in a much more efficient manner! This helped them build “bolt.new” coding agent and keep it low latency to build web based AI coding agents and much efficient to scale (vs those are serving from cloud VMs)&lt;/li&gt;
&lt;li&gt;Replit was already building web based developer tools to democratise coding!&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Existing Competitive advantages (7 powers)&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Previous knowledge or work can be leveraged (Replit, etc)&lt;/li&gt;
&lt;li&gt;Network effects, regulatory, ….scale, patent, distribution advantage…proprietary data!&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;</content:encoded><category>business-of-ai</category><category>coding-agents</category><category>product-management</category></item><item><title>MCP and LLMs with tools</title><link>https://kneeraj.com/posts/2025/mcp-and-llms-with-tools/</link><guid isPermaLink="true">https://kneeraj.com/posts/2025/mcp-and-llms-with-tools/</guid><description>Augmented models are models with tools. MCP is the protocol that lets a client such as Claude Desktop call those tools, with Brave Search and a filesystem as the examples.</description><pubDate>Sun, 16 Mar 2025 04:30:00 GMT</pubDate><content:encoded>&lt;p&gt;A model that only knows what it was trained on is a weak product. Most of the context for real work lives somewhere else: a search index, a folder, a wiki, a database. This is the short version of how I think about tools, and about the Model Context Protocol Anthropic introduced so those tools can be plugged in the same way.&lt;/p&gt;
&lt;p&gt;I used the same pattern later to &lt;a href=&quot;https://kneeraj.com/posts/2025/talk-to-notion-with-claude-desktop&quot;&gt;talk to a Notion workspace from Claude Desktop&lt;/a&gt;.&lt;/p&gt;
&lt;div style=&quot;margin: 1.5rem 0; max-width: 100%; overflow: hidden;&quot;&gt;
  &lt;div style=&quot;position: relative; width: 100%; max-width: 640px; margin: 0 auto; padding-bottom: 56.25%; height: 0;&quot;&gt;
    &lt;iframe style=&quot;position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 0;&quot; src=&quot;https://www.youtube.com/embed/pYdGMU50ipc&quot; title=&quot;YouTube video player&quot; allow=&quot;accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture&quot; allowfullscreen&gt;
    &lt;/iframe&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&quot;standalone-models-and-augmented-ones&quot;&gt;Standalone models and augmented ones&lt;/h2&gt;
&lt;p&gt;The first useful LLMs took a prompt and produced text from what they had been trained on. That is a standalone model. It is a bad fit for work, because the context is scattered. Search is a tool. Files on a computer are a tool. The company wiki is a tool.&lt;/p&gt;
&lt;p&gt;An augmented model is one that can call those tools when the task needs them. A few patterns, all the same idea:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Retrieval.&lt;/strong&gt; RAG is a model with access to the right documents for this task. The application still has to fetch them and put them in the prompt. The model is no longer stuck with pretraining.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Web search.&lt;/strong&gt; Perplexity is the obvious product (&lt;a href=&quot;https://kneeraj.com/posts/2026/perplexity-revenue-growth-case-study&quot;&gt;how it grew to $1B in annualised revenue&lt;/a&gt;). ChatGPT grew a search tool for the same reason: the answer should include what is true this week.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A code interpreter.&lt;/strong&gt; The model writes Python, runs it, and reads the error or the chart. Data analysis in ChatGPT is this. The same move works for JavaScript run in the browser.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Computer use.&lt;/strong&gt; Give the model a computer and a task, and the tool is the machine.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The product work is deciding which tools exist, and whether the model is allowed to call them itself.&lt;/p&gt;
&lt;h2 id=&quot;mcp-is-a-set-of-rules&quot;&gt;MCP is a set of rules&lt;/h2&gt;
&lt;p&gt;JSON is a set of rules for sending structured data. MCP is a set of rules for exposing context, data, and functions to a model. Without that, every app invents its own tool format.&lt;/p&gt;
&lt;p&gt;The pieces:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;An &lt;strong&gt;MCP host&lt;/strong&gt; is the application the person is using. Claude Desktop is the one in the demo. Editors were starting to do this too. Cursor was already one of them.&lt;/li&gt;
&lt;li&gt;The host includes an &lt;strong&gt;MCP client&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;An &lt;strong&gt;MCP server&lt;/strong&gt; is the other side: a database, an API, a filesystem. It advertises tools. The host’s model can call them.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;That is an augmented model, reached through a protocol instead of a one-off integration.&lt;/p&gt;
&lt;h2 id=&quot;two-servers-in-claude-desktop&quot;&gt;Two servers in Claude Desktop&lt;/h2&gt;
&lt;p&gt;I could not get this working in the web app. Claude Desktop was the host. Under Developer settings, the config JSON listed two servers I had added: filesystem, and Brave Search. Brave’s API key has a free tier that was enough for the demo. After a restart, the tool list showed Brave web search, Brave local search, and the filesystem tools: create a directory, list a tree, edit a file, and the rest.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Search.&lt;/strong&gt; I asked for the weather in London in April, minimum and maximum, and whether it would rain, and I told it to search. Claude requested permission to run Brave web search, I allowed it for the chat, and it came back with temperature, rain, and a general forecast. The permission prompt every time is annoying. The interesting part is that the model decided the tool was how to answer.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Files.&lt;/strong&gt; I keep random screenshots of other products. I pointed at one and asked Claude to move it into a screenshots folder under a name I gave it. It used several filesystem tools: find the file, list the directory, confirm the folder, move the file. I checked Finder. The file was there.&lt;/p&gt;
&lt;p&gt;Both examples are small. Together they are the product shift I care about. If services expose themselves as tools, the interface is an instruction in English, and the model figures out which call to make.&lt;/p&gt;</content:encoded><category>mcp</category><category>llm-engineering</category></item><item><title>Prototyping with Claude</title><link>https://kneeraj.com/posts/2025/prototyping-with-claude/</link><guid isPermaLink="true">https://kneeraj.com/posts/2025/prototyping-with-claude/</guid><description>A mock in TLDraw, a prompt, and a screenshot. Claude turned a copilot idea into a React prototype I could drop into a PRD the same afternoon.</description><pubDate>Tue, 18 Feb 2025 04:30:00 GMT</pubDate><content:encoded>&lt;p&gt;Prototypes are how I get a feature discussed. Claude made the loop short enough that I will do it for ideas I would previously have left as a paragraph in a doc.&lt;/p&gt;
&lt;div style=&quot;margin: 1.5rem 0; max-width: 100%; overflow: hidden;&quot;&gt;
  &lt;div style=&quot;position: relative; width: 100%; max-width: 640px; margin: 0 auto; padding-bottom: 56.25%; height: 0;&quot;&gt;
    &lt;iframe style=&quot;position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 0;&quot; src=&quot;https://www.youtube.com/embed/RIVmsaJTwuc&quot; title=&quot;YouTube video player&quot; allow=&quot;accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture&quot; allowfullscreen&gt;
    &lt;/iframe&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&quot;the-idea&quot;&gt;The idea&lt;/h2&gt;
&lt;p&gt;The product context is a copilot inside an IDE. A developer hits an error. The copilot should offer a contextual prompt, right there, to fix it with the AI. Those prompts are a feature-discovery tool. As a PM I want people to find the feature at the moment they need it. Developers like it for the same reason: the help shows up when they are stuck, not in a tour they dismissed last week.&lt;/p&gt;
&lt;p&gt;I sketched it in &lt;a href=&quot;https://tldraw.com&quot;&gt;TLDraw&lt;/a&gt;, which is the mocking tool I actually use. Around the same time the VS Code extensions team had shipped a terminal shell integration API. An extension can read the commands a terminal ran, and it can run commands. That made the idea feel buildable, not just a picture. The copilot can see the failing command instead of asking the developer to paste it.&lt;/p&gt;
&lt;h2 id=&quot;prompt-plus-a-screenshot&quot;&gt;Prompt plus a screenshot&lt;/h2&gt;
&lt;p&gt;I wrote the behavior down, iterated on the prompt a bit, and sent Claude two things: the prompt, and a screenshot of the TLDraw mock. I did not start from a blank “make me a copilot.”&lt;/p&gt;
&lt;p&gt;Claude generated a React component. The result had the layout I had drawn. A copilot on the left, a prompt box, an editor with a small Fibonacci snippet, and a terminal. Click the terminal, it throws, and a notification appears. “Fix now” copies the code together with an instruction: diagnose the root cause and suggest a fix.&lt;/p&gt;
&lt;p&gt;That is enough to show the interaction. I published it and pasted the link into the PRD, which is where these prototypes usually end up. A screenshot of a mock starts a debate about the picture. A link people can click starts a debate about the behavior.&lt;/p&gt;</content:encoded><category>product-management</category></item><item><title>AI-assisted app migration with Freddy Developer Copilot</title><link>https://kneeraj.com/posts/2025/ai-assisted-app-migration-freddy/</link><guid isPermaLink="true">https://kneeraj.com/posts/2025/ai-assisted-app-migration-freddy/</guid><description>A one-click migration in Freddy Developer Copilot: detect an app on platform 2.2, review each file, and land it on 2.3 with request templates in place.</description><pubDate>Tue, 04 Feb 2025 04:30:00 GMT</pubDate><content:encoded>&lt;p&gt;Moving an app to a new platform version is real cost for the developer who has to do it, and for the customer waiting on them. In Freddy Developer Copilot we treated that as a single action: detect the old version, offer the upgrade, and review the diff with the developer.&lt;/p&gt;
&lt;p&gt;The later write-up of what we learned building this coding agent, including evals and the migration impact, is in &lt;a href=&quot;https://kneeraj.com/posts/2025/coding-agent-learnings-3&quot;&gt;key learnings (3/3)&lt;/a&gt;. This post is the migration itself.&lt;/p&gt;
&lt;div style=&quot;margin: 1.5rem 0; max-width: 100%; overflow: hidden;&quot;&gt;
  &lt;div style=&quot;position: relative; width: 100%; max-width: 640px; margin: 0 auto; padding-bottom: 56.25%; height: 0;&quot;&gt;
    &lt;iframe style=&quot;position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 0;&quot; src=&quot;https://www.youtube.com/embed/oMOhblU4V9Q&quot; title=&quot;YouTube video player&quot; allow=&quot;accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture&quot; allowfullscreen&gt;
    &lt;/iframe&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&quot;detect-then-migrate-file-by-file&quot;&gt;Detect, then migrate file by file&lt;/h2&gt;
&lt;p&gt;The demo app was still on platform version 2.2. Opening the copilot was enough for it to notice. It offered a one-click upgrade to 2.3. Saying yes starts a pass over the project. The assistant reads each file and proposes how that file should look on the new version. That pass is the slow part, and it should be. A migration that rewrites the project without showing its work is not something I would accept either.&lt;/p&gt;
&lt;h2 id=&quot;what-actually-changed&quot;&gt;What actually changed&lt;/h2&gt;
&lt;p&gt;When the pass finished, the review was a normal diff.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;manifest.json&lt;/code&gt; moved from platform 2.2 to 2.3.&lt;/li&gt;
&lt;li&gt;The old entries in &lt;code&gt;requests.json&lt;/code&gt; were removed.&lt;/li&gt;
&lt;li&gt;Deprecated domains that had been sitting on an allowlist were removed.&lt;/li&gt;
&lt;li&gt;In &lt;code&gt;server.js&lt;/code&gt;, a request (a POST in the demo) was rewritten into a request template, which is a 2.3 feature. The template was registered in &lt;code&gt;requests.json&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I accepted the changes. The app reported itself as 2.3, and it ran without errors. Cleanup was part of the same change, not a follow-up the developer was left to remember.&lt;/p&gt;
&lt;p&gt;The product claim is narrow on purpose. Third-party apps stall on platform upgrades because the work is boring and easy to get slightly wrong. A copilot that knows the version, knows the breaking changes, and leaves a reviewable diff is the feature. The developer still accepts it.&lt;/p&gt;</content:encoded><category>coding-agents</category></item><item><title>Framework for evaluating LLM powered products</title><link>https://kneeraj.com/posts/2025/framework-for-evaluating-ai-products/</link><guid isPermaLink="true">https://kneeraj.com/posts/2025/framework-for-evaluating-ai-products/</guid><description>A framework for effective evaluation of AI powered products</description><pubDate>Tue, 21 Jan 2025 04:30:00 GMT</pubDate><content:encoded>&lt;h3 id=&quot;table-of-contents&quot;&gt;Table of Contents&lt;/h3&gt;
&lt;p&gt;&lt;/p&gt;&lt;details&gt;&lt;summary&gt;Open Table of Contents&lt;/summary&gt;&lt;p&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;#introduction&quot;&gt;Introduction&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;#framework-for-effective-evaluation-of-ai-powered-products&quot;&gt;Framework for effective evaluation of AI powered products&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;#step-1--define-your-task&quot;&gt;Step 1 : Define your task&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;#step-2--define--quantitative-metrics-to-evaluate-response&quot;&gt;Step 2 : Define  quantitative metrics to evaluate response&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;#step-3--define-an-evaluation-dataset&quot;&gt;Step 3 : Define an evaluation dataset&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;#step-4--define-automated-grading-approach&quot;&gt;Step 4 : Define automated grading approach&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;#step-5--report-scores--compare-against-baseline-scores&quot;&gt;Step 5 : Report scores &amp;#x26; compare against baseline scores&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;/p&gt;&lt;/details&gt;&lt;p&gt;&lt;/p&gt;
&lt;h3 id=&quot;introduction&quot;&gt;Introduction&lt;/h3&gt;
&lt;p&gt;In recent years, the landscape of AI has undergone dramatic transformation. While ML or AI-powered products were once the domain of a select few companies and teams, the advent of Large Language Models (LLMs) has democratized intelligence, enabling everyone to build AI powered products.&lt;/p&gt;
&lt;p&gt;However, AI responses or products are not deterministic and measuring efficacy of these products on various tasks could be a new &amp;#x26; challenging territory to navigate.&lt;/p&gt;
&lt;p&gt;As someone building LLM-powered products, I am developing  mental models and frameworks to help in development and evaluation of AI-powered products&lt;/p&gt;
&lt;h3 id=&quot;framework-for-effective-evaluation-of-ai-powered-products&quot;&gt;Framework for effective evaluation of AI powered products&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;https://kneeraj.com/assets/img/2025/llm-evals-blogs/framework_for_evaluating_llm_products.png&quot; alt=&quot;Framework for evaluating LLM powered products&quot; style=&quot;width: 100%; height: auto; border: 3px solid #ddd; box-shadow: 0 4px 8px rgba(0,0,0,0.1); display: block; margin: 20px auto;&quot;&gt;&lt;/p&gt;
&lt;h3 id=&quot;step-1--define-your-task&quot;&gt;Step 1 : Define your task&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Clearly articulate the specific task your LLM-powered product is designed to perform.&lt;/li&gt;
&lt;li&gt;Task : “Generate code snippets as per context, Generate text, classification, sentiment analysis, QnA, conversations bot, etc”&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&quot;step-2--define--quantitative-metrics-to-evaluate-response&quot;&gt;Step 2 : Define  quantitative metrics to evaluate response&lt;/h3&gt;
&lt;p&gt;These aspects of LLM responses can be measured :&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Task Fidelity&lt;/strong&gt; : How well the model is performing the task :
&lt;ul&gt;
&lt;li&gt;F1 score, Precision, Recall, (Typically classification tasks, etc)&lt;/li&gt;
&lt;li&gt;BLEU Score : To evaluate quality of translated text against human reference&lt;/li&gt;
&lt;li&gt;Perplexity : How well a model predicts a sample&lt;/li&gt;
&lt;li&gt;Custom metrics like “responses contain so and so keywords”&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Task Consistency&lt;/strong&gt; : Models responses are consistent across similar inputs :
&lt;ul&gt;
&lt;li&gt;Cosine similarity of responses&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Context Utilisation&lt;/strong&gt; : Provide the conversations context and define a likert scale (1-5)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Latency&lt;/strong&gt; : Prompt response&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Cost&lt;/strong&gt; : Cost per LLM call based on request &amp;#x26; response tokens utilised and your production volume!&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&quot;step-3--define-an-evaluation-dataset&quot;&gt;Step 3 : Define an evaluation dataset&lt;/h3&gt;
&lt;p&gt;Design principles :&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Good indicator of real-world task distribution! Add edge cases as well&lt;/li&gt;
&lt;li&gt;Have good volume of test prompts&lt;/li&gt;
&lt;li&gt;For each prompt their is golden answer or golden keywords/claims&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&quot;step-4--define-automated-grading-approach&quot;&gt;Step 4 : Define automated grading approach&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Code based for simple metrics that can be calculated like for classifier F1 score, accuracy, precision, BLEU score for translation tasks, etc&lt;/li&gt;
&lt;li&gt;LLM based : Custom metrics like “responses contain so and so keywords or claims”, Ensure to structure your output to make it easier to calculate scores! (like a series of true/false on claims)&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&quot;step-5--report-scores--compare-against-baseline-scores&quot;&gt;Step 5 : Report scores &amp;#x26; compare against baseline scores&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Have baseline scores to check the efficacy of your solution pipeline (LLM + your custom components)&lt;/li&gt;
&lt;/ul&gt;</content:encoded><category>business-of-ai</category><category>llm-engineering</category><category>evals</category></item></channel></rss>