[{"content":"The first write that reaches only the new store changes your rollback procedure. Reverting the application might still work at the deployment layer. If the old code reads the old store, the user can get an answer with yesterday&rsquo;s state.\nThat is an easy trap to miss in a migration plan that says \u201ccompare, switch, roll back if needed.\u201d Put an expiration condition on the rollback. You want to know which write ends it, who can stop that write path, and what recovery looks like after it happens.\nRehearse a rollback after the write Stripe&rsquo;s online migration write-up describes moving subscription data for a system with hundreds of millions of subscription objects. The sequence backs up the engineering logic. Start writing to both representations and backfill, compare reads before switching them, change the write path, and then clean up the old representation. Moving reads and moving writes deserve separate decisions. Stripe Engineering, Online migrations at scale\nHere is a small example. A subscription starts at revision 1. By the time the copy finishes, both stores hold revision 2. A shadow comparison agrees, so the new read path takes over. The next write changes the new store to revision 3 only. Switch reads back and the user gets revision 2. Both stores can be perfectly healthy throughout.\nIllustrative record history. Parity at the read cutover expires when the old store stops receiving writes.\nA useful rollback rehearsal writes a new value after the cutover, restores the old read path, and verifies that the latest acknowledged value is still visible. Include deletion, retry and delayed update cases as well. A revision check matters when a backfill and a live write race. If the copy can overwrite a newer value, agreement measured before that interleaving says little about the eventual result.\nAmazon&rsquo;s rollback guide makes the same transition problem concrete for mixed versions. Deploy code that can read both forms before enabling writes in the new form. Test forward and backward transitions under mixed versions. After new-format state exists, recovery must land on a version that can read it or explicitly repair the data. AWS Builders&rsquo; Library, Ensuring rollback safety\nPausing the copy is a different control An online migration can fail before there is anything to roll back. GitHub reported a routine migration that ran for hours before rising customer demand and migration load saturated database connections on May 4, 2026. GitHub paused the migration. At peak, about 1.3% of requests returned 5xx responses, with an average of about 0.46% during the incident. That is an availability problem during the copy. It tells you little about whether the eventual data cutover is safe. GitHub&rsquo;s May 2026 availability report\nI&rsquo;d put two decisions in the runbook. The first is a pause decision for background work, based on production latency, connections and replication lag. The second is the cutover decision, based on read comparisons and a rollback test that includes post-cutover writes. Keep the old representation current through the rollback window with a replication mechanism whose lag and failures you can see. Give the overlap an end condition, since it carries extra work and creates its own failure modes.\nOnce writes stop reaching the old representation, change the runbook from \u201cswitch reads back\u201d to a recovery procedure you have actually rehearsed. That line belongs next to the write flag.\nDownload the version-history example and figure script.\n","permalink":"https:\/\/archit15singh.github.io\/posts\/2026-11-20-online-migration-rollback-expires\/","summary":"<p>The first write that reaches only the new store changes your rollback procedure. Reverting the application might still work at the deployment layer. If the old code reads the old store, the user can get an answer with yesterday&rsquo;s state.<\/p>\n<p>That is an easy trap to miss in a migration plan that says \u201ccompare, switch, roll back if needed.\u201d Put an expiration condition on the rollback. You want to know which write ends it, who can stop that write path, and what recovery looks like after it happens.<\/p>","title":"An online migration can quietly lose its rollback"},{"content":"If 1,000 canary requests pass, I&rsquo;d still ask what failure the test had a realistic chance of seeing. If the defect hits one in 10,000 requests, a clean run of that size is the likely outcome even with the defect present.\nA rollout plan usually starts with an exposure limit. I want a second number on it, the minimum amount of relevant traffic I need to see before the next decision. The two numbers move against each other when the canary is small.\nSmall enough to contain, large enough to observe Google&rsquo;s SRE Workbook uses a simple example. A candidate fails 20% of its requests and receives 5% of traffic. With a clean control, the fleet-wide error rate is 1%. Segmenting by version reveals the failure much more clearly. Those are teaching inputs. They show how a small rollout can limit damage and how a fleet average can obscure what&rsquo;s happening to the canary. Google SRE Workbook, Canarying Releases\nCloudflare&rsquo;s November 18, 2025 outage shows how this reasoning extends to generated configuration. The company regenerated a Bot Management feature file every five minutes. A bad file crossed a runtime limit and was distributed across its network. Cloudflare reported mitigating the main impact at 14:30 UTC and restoring all operations at 17:06 UTC. Its subsequent account describes moving to progressive configuration deployment with health checks and using a last-known-good configuration where possible. A staged rollout still needs a way for consumers to keep serving after rejecting a bad candidate. Cloudflare&rsquo;s incident report \u00b7 Cloudflare&rsquo;s rollout follow-up\nThe sample size has a cost Suppose every request independently has probability p of hitting a defect and detection is perfect whenever that happens. The probability of seeing at least one failure in n requests is 1 - (1 - p)^n. At one failure per 10,000 requests, 1,000 canary requests give you a 9.52% chance of seeing one. It takes 29,956 requests to raise that chance to at least 95%. At one failure per 1,000 requests, the corresponding requirement is 2,995. These are scenario results. A noisy metric that needs multiple events to move demands more evidence.\nIllustrative detection probabilities for independent requests. The dotted line marks a 95% chance of seeing at least one failure.\nAt 100 requests per second across the service, a 1% canary gets about one request per second. The 29,956-request case would take a little over eight hours at that rate. If the defect only hits a path the cohort barely exercises, the relevant clock runs slower. And if requests come in correlated bursts from a single customer, raw request count can make coverage look better than it is.\nI would set a minimum sample for the critical paths, keep a concurrent control, and give the release a hold state when it lacks evidence. If a particular account type carries the risk, use a representative cohort or run an explicit test for that path. Waiting longer on the wrong population just collects more of the wrong data. If the failure comes from a shared dependency, stage by a boundary that contains the effect before relying on percentages at all.\nA deadline can tell you when to stop waiting. The decision to expand needs to say what the canary actually saw.\nDownload the probability model and figure script.\n","permalink":"https:\/\/archit15singh.github.io\/posts\/2026-11-20-canaries-need-a-sample-budget\/","summary":"<p>If 1,000 canary requests pass, I&rsquo;d still ask what failure the test had a realistic chance of seeing. If the defect hits one in 10,000 requests, a clean run of that size is the likely outcome even with the defect present.<\/p>\n<p>A rollout plan usually starts with an exposure limit. I want a second number on it, the minimum amount of relevant traffic I need to see before the next decision. The two numbers move against each other when the canary is small.<\/p>","title":"A canary needs enough traffic to fail"},{"content":"A six-point lead on a coding benchmark would get my attention. So would learning that the same agent gained six points when its test environment stopped killing processes at a strict resource limit.\nAnthropic reported that gap between its tightest and uncapped Terminal-Bench 2.0 configurations. The model comparison people want to make is harder than it looks. The agent is writing files, running tests and pulling dependencies inside a real environment. A change to the worker can change the work it manages to finish. Anthropic&rsquo;s infrastructure experiment \u00b7 Terminal-Bench 2.0 release\nThe container has a vote Under Anthropic&rsquo;s strict per-task ceilings, 5.8% of runs hit infrastructure errors. Giving tasks three times the recommended resources as a ceiling brought that figure to 2.1%. With the caps removed it fell to 0.5%. The change from strict to three times headroom reduced infrastructure errors by 3.7 percentage points. Anthropic did not see a statistically significant difference in task success over that range in its experiment. Anthropic&rsquo;s resource sweep\nInfrastructure error rate across three configurations in Anthropic&rsquo;s Terminal-Bench 2.0 experiment.\nThe next step is the interesting one. From three times headroom to uncapped, infrastructure errors fell by another 1.6 points, while task success rose by almost four points. The extra room also let agents pursue approaches that took more resources. You cannot subtract the infrastructure error rate from the success rate to convert one score into another. Some crashed runs would have failed anyway. Some agents change what they can accomplish when the room gets bigger. Anthropic&rsquo;s breakdown of the uncapped runs\nDecide what the score is for For a model selection decision, I&rsquo;d rerun both candidates on the same tasks and harness revision, with the same tools, time and resource policy. Keep the result for each task and trial, including whether its counterpart solved the same job. A two-point aggregate lead tells me very little if the supposed winner is just passing the tasks its competitor kept timing out on. The failure logs tell me where to rerun, including in cases where the timeout is part of the product constraint.\nFor a deployment decision, I&rsquo;d run a second comparison under the actual production resource envelope. The question then is which complete system solves more jobs within the budget I can give it. A model that wins in a roomy container can be a poor fit for a service with a tight deadline. I&rsquo;d show solved jobs out of all attempts, alongside a breakdown of infrastructure errors, exhausted budgets and graded failures. Hiding failed starts behind an exclusion rule can hide the cost the operator will pay.\nThe harness and task version belong in the same row as the score. So do the guaranteed resources, hard ceilings, wall-clock limit and what happened to failed trials. Record the model revision and concurrency too. If these differ, a comparison can still tell you which complete setup worked better under its own conditions. It takes another run to make a claim about the model.\nAnthropic&rsquo;s six-point number came from one experiment on Terminal-Bench 2.0. I&rsquo;d use it to justify a resource sensitivity check, then measure the size of the effect on the tasks I actually care about.\nDownload the figure script and its source values.\n","permalink":"https:\/\/archit15singh.github.io\/posts\/2026-11-20-agent-benchmarks-need-resource-budgets\/","summary":"<p>A six-point lead on a coding benchmark would get my attention. So would learning that the same agent gained six points when its test environment stopped killing processes at a strict resource limit.<\/p>\n<p>Anthropic reported that gap between its tightest and uncapped Terminal-Bench 2.0 configurations. The model comparison people want to make is harder than it looks. The agent is writing files, running tests and pulling dependencies inside a real environment. A change to the worker can change the work it manages to finish. <a href=\"https:\/\/www.anthropic.com\/research\/infrastructure-noise\">Anthropic&rsquo;s infrastructure experiment<\/a> \u00b7 <a href=\"https:\/\/www.tbench.ai\/news\/announcement-2-0\">Terminal-Bench 2.0 release<\/a><\/p>","title":"An agent benchmark needs a resource budget"},{"content":"Part of The AI Infrastructure Reality Check.\nOn November 20, Corsair wanted $643.99 for a 32 GB kit it couldn&rsquo;t ship. Two months earlier, a snapshot showed the same kit in stock at $559.99. The $84 difference is easy to calculate. What a buyer actually paid is still an open question.\nThe trail gets clearer at the factory. Micron says it moved some DRAM supply to data-center and cloud customers in response to AI demand, with an emphasis on high-bandwidth memory. In November 2026, TrendForce reported slow PC sales and rising inventories of finished PCs. It still expected PC DRAM contract prices to rise 13\u201318% quarter over quarter in Q4. PC makers can sell fewer computers and pay more for memory if suppliers cut allocations faster than orders fall. Micron FY2025 Form 10-K \u00b7 TrendForce November PC procurement report\nTwo orders arrive at the fab An accelerator order calls for high-bandwidth memory, or HBM. The manufacturer stacks several DRAM dies on a base die and links them vertically through the silicon. An interposer connects the stack to the accelerator within the package. A desktop DDR5 chip goes onto a module that plugs into the CPU&rsquo;s memory channels. The competition happens earlier, when the supplier allocates wafer starts and cleanroom space. By the time you can hold a DDR5 module, the wafer decision has already been made. SK hynix and TSMC on HBM packaging \u00b7 Micron FY2026 Q2 Form 10-Q\nMicron says HBM takes more wafers and cleanroom space to produce the same number of bits at the same node. TrendForce projected that HBM would take 22% of DRAM wafer input and account for 9% of bit supply among the top three suppliers at the end of 2026. Divide the bit share by the wafer share for HBM and again for conventional DRAM. On that mix, HBM would produce about 35% as many bits per wafer. Those are rounded projections across several products and processes. Use a fab&rsquo;s own yield and product mix to make the calculation for that fab. Micron FY2026 Q2 Form 10-Q \u00b7 TrendForce June HBM supply outlook\nTrendForce\u2019s June 2026 projection compares shares of wafer input and bit supply across the top three DRAM suppliers.\nThe second order is for the server itself. The host CPU needs memory for the software that feeds the accelerator. Depending on the system, that can mean registered DDR5 DIMMs or LPDDR5X modules. SK hynix attributed its September-quarter DRAM results in part to a jump in server DDR5 sales, alongside its first HBM4 shipments at scale. Both orders draw on the supplier&rsquo;s DRAM output. SK hynix Q3 2026 results \u00b7 NVIDIA Vera Rubin tuning guide\nStarting change Where it reaches PC memory What can weaken the effect More HBM wafer starts Less of the shared capacity available for conventional DRAM, all else equal More wafer starts or more bits per wafer More server DDR5 orders Suppliers can direct more output to server customers Lower server orders or added conventional capacity Higher PC DRAM contract quotes A PC maker or module vendor faces higher replacement costs Older inventory, weaker sell-through, or a promotion A packaging upgrade can let a supplier ship more HBM from the same wafer allocation. PC memory supply can still stay tight if server DDR5 orders absorb the extra bits.\nWhat a sold-out HBM order book buys On November 4, 2026, TrendForce reported that Samsung had sold out its planned 2027 HBM supply. It said SK hynix had already agreed on 2027 HBM4 volumes and prices. To find out when each supplier gets paid, you need the contract. TrendForce November 4 DRAM bulletin\nMicron&rsquo;s filings show how big the gap between promises and payments can get. At May 28, 2026, it reported about $5 billion allocated to remaining performance obligations, with $422 million recorded as contract liabilities. By September 3 those figures were about $134 billion and $13 billion. Most of the contract liabilities were customer deposits, and Micron expected to repay nearly all of those deposits between 2029 and 2031. It expected to recognize about a quarter of the September obligations as revenue over the following twelve months. The reported balance covers several products and delivery dates. It uses committed volumes and minimum prices and omits agreements without a fixed price or price band. Micron FY2026 Q3 Form 10-Q \u00b7 Micron FY2026 Form 10-K, revenue recognition\nThe customer who puts money down has a claim on future supply. Before that memory is useful to a paying AI customer, someone still has to ship it, assemble a working rack and get the rack on a site that can run it.\nFour listings for one desktop kit In December 2025, Micron announced it was leaving the Crucial consumer business to supply faster-growing data-center customers. It planned to ship Crucial products through its fiscal second quarter, which ended in February 2026. Here the link to PC builders is concrete. One retail brand was leaving the market for reasons its owner put in writing. Micron&rsquo;s Crucial exit announcement\nThe sample below tracks one part number, CMK32GX5M2B6000C30. It&rsquo;s a black Corsair Vengeance DDR5-6000 CL30 kit with two 16 GB modules. Prices are in US dollars before tax. I dated the two indexed snapshots by their delivery estimates, September 23\u201325 for Corsair and November 7 in Sacramento for the Walmart marketplace listing. The last two pages were retrieved on November 20, 2026.\nListing Snapshot Posted price What the page showed Corsair direct, earlier snapshot September 2026 $559.99 In stock, free shipping advertised Walmart marketplace Early November 2026 $589.99 Add to cart, sold by Newegg Inc., shipping to Sacramento advertised Newegg direct November 20, 2026 $539.99 Out of stock Corsair direct November 20, 2026 $643.99 Out of stock Corsair and Newegg both showed the kit out of stock on November 20. The two earlier snapshots had different sellers or sales terms.\nCorsair&rsquo;s posted price rose $84, or 15.0%, between the two snapshots. The September listing was a promotion. In November the kit was out of stock. Newegg also appeared twice, as the seller on Walmart and on its own site. Those were different sales channels. Four listings for one kit give us a record of offers and stock status. Measuring what shoppers paid across the US would take a different dataset. Download the four observations\nFor someone building a local inference box, the RAM budget matters most when a model spills beyond the GPU. A dense 32-billion-parameter model at four bits per weight takes 16 billion bytes, about 14.9 GiB, for the weights alone. That leaves a 16 GiB card about 1.1 GiB for everything else, including quantization metadata and the context cache. Offloading some of the model to the CPU uses system RAM and can slow decoding. Compare builds on the model and context they can actually run at a speed you&rsquo;d use. llama.cpp memory and offload guide\nGPU rentals have a different price clock In June 2025, AWS cut the on-demand rate for its H100-based P5 instances by 44% from its May 31 baseline. The H200-based P5en rate fell 25%. AWS credited economies of scale and offered other billing terms on newer B200 capacity. TrendForce&rsquo;s June survey, meanwhile, showed PC DRAM contract prices rising that quarter, with DDR4 leading DDR5. That pairs a change in one provider&rsquo;s list price with a survey of OEM contracts. AWS June 2025 price announcement \u00b7 TrendForce June 2025 DRAM contract survey\nA cloud provider has already paid for, or is financing, the machine. Every idle hour expires. If more capacity comes online or customers move to newer GPUs, a discount can be cheaper than leaving an older rack empty. The memory supplier still has to decide which chips to make on its next wafers.\nA price comparison over time needs the same cloud provider, region, GPU model and billing terms on each date. For retail RAM, match the seller, country and kit, and put stock status next to the quote. To test the factory story itself, track PC allocations, total bit output and inventory. I&rsquo;d revise my view if suppliers kept shifting wafer capacity toward HBM and server memory while PC DRAM supply grew comfortably and PC contract prices fell for several quarters. In that case, weak PC demand or a larger supply of bits would be doing more of the work.\n","permalink":"https:\/\/archit15singh.github.io\/posts\/2026-11-20-how-ai-demand-raises-ddr5-prices\/","summary":"<p><em>Part of <a href=\"\/ai-infrastructure-reality-check\/\">The AI Infrastructure Reality Check<\/a>.<\/em><\/p>\n<p>On November 20, Corsair wanted $643.99 for a 32 GB kit it couldn&rsquo;t ship. Two months earlier, a snapshot showed the same kit in stock at $559.99. The $84 difference is easy to calculate. What a buyer actually paid is still an open question.<\/p>\n<p>The trail gets clearer at the factory. Micron says it moved some DRAM supply to data-center and cloud customers in response to AI demand, with an emphasis on high-bandwidth memory. In November 2026, TrendForce reported slow PC sales and rising inventories of finished PCs. It still expected PC DRAM contract prices to rise 13\u201318% quarter over quarter in Q4. PC makers can sell fewer computers and pay more for memory if suppliers cut allocations faster than orders fall. <a href=\"https:\/\/www.sec.gov\/Archives\/edgar\/data\/723125\/000072312525000028\/mu-20250828.htm\">Micron FY2025 Form 10-K<\/a> \u00b7 <a href=\"https:\/\/www.trendforce.com\/presscenter\/news\/20261111-13303.html\">TrendForce November PC procurement report<\/a><\/p>","title":"How the AI buildout reaches your DDR5 bill"},{"content":"Part of The AI Infrastructure Reality Check.\nNVIDIA reported $107.6 billion in Data Center revenue for the quarter ended October 25, 2026. For the quarter ended September 30, CoreWeave reported $3.66 billion in revenue and a $709 million net loss. Those totals cover different periods and different businesses. The chip supplier gets paid for hardware. The cloud operator needs to rent out capacity long enough to cover what it cost to put into service. NVIDIA Q3 FY2027 results \u00b7 CoreWeave Q3 2026 results\nStart with the invoice. If racks sit idle, does the chip supplier already have its money? Is the cloud operator still paying the data-center lease? Did the customer reserve the capacity in advance? Calling the whole thing an AI bubble skips the terms that tell you who loses money when demand comes in short.\nSix invoices, six ways to get paid Business Who pays for what Where the risk sits Accelerator and network silicon Cloud and system buyers pay for accelerators, switches and other equipment. The supplier has to plan production before demand settles. The buyer takes on the useful life and resale risk after accepting the equipment. Memory Accelerator makers and system vendors pay for HBM or conventional DRAM. Memory producers allocate wafer capacity and invest ahead of demand. Buyers may commit to supply before the downstream machine earns anything. Data-center development Tenants pay for commissioned capacity, space and connectivity. The party funding construction carries the delivery risk. Lease commencement, guarantees and remedies determine who pays for the delay. Power Facilities or their suppliers pay for energy, capacity and grid or on-site infrastructure. The contract and local tariff determine who carries demand shortfalls and who funds upgrades. A power reservation is one milestone on the way to energization. Compute Labs and enterprises pay for reserved capacity or metered usage. The operator has equipment, financing and delivery exposure. A take-or-pay contract can transfer some occupancy risk to the customer once the service is available. Applications and models People and businesses pay for API usage, subscriptions or software that performs a task. The seller has to retain customers and cover serving and development costs. Renewal is where the original usage claim meets a budget decision. One hyperscaler can fill several rows. Its cloud division can charge an internal transfer price, but that revenue drops out when the company consolidates its accounts. Between companies, both a GPU sale and a cloud booking count as transactions. Add those numbers together to track activity across suppliers. To measure final demand, count what customers pay for AI products.\nThe strongest evidence of real demand Anthropic&rsquo;s final prospectus shows what paid adoption looks like in one company&rsquo;s accounts. For the nine months ended September 30, 2026, it reported $33.242 billion in revenue, up from $2.545 billion in the same period a year earlier. Anthropic attributed $24.2 billion of that increase to consumption-based revenue and $6.5 billion to subscriptions. Most of the increase came from usage. Anthropic final prospectus, MD&amp;A\nBy September 30, 2026, Anthropic counted more than 11,900 customers generating at least $100,000 each over the previous twelve months, up from more than 950 a year earlier. That group accounted for about 74% of revenue in the first nine months of 2026. Those thresholds use Anthropic&rsquo;s definition of a customer. A handful of customers within the group could still account for a large share of sales. Anthropic final prospectus, revenue comparison\nThe U.S. Census Bureau&rsquo;s Business Trends and Outlook Survey asked a nationally representative sample of firms whether they used AI in a business function. Researchers found that 18% did during the November 2025 to January 2026 reference period. Weight the firms by employment and the share rises to 32%, because larger businesses reported using AI more often. That 32% is the share of employees who work for firms that reported using AI. U.S. Census Bureau working paper, The Microstructure of AI Diffusion\nThe employment-weighted measure counts workers at firms that report AI use in a business function.\nA company can report using AI in a workflow without knowing what the workflow saves. The survey measures how widely firms say they&rsquo;ve put AI to work. The prospectus puts a dollar figure on one vendor&rsquo;s sales.\nThe International Energy Agency estimates that global electricity demand from data centers rose 17% in 2025. At sites the IEA classifies as AI-focused, it rose 50%. Electricity demand covers everything the facility powers, including the overhead for keeping equipment running. The meter gives a separate way to track the buildout. To measure the return, you need figures on the revenue those sites help earn and what it costs to run them. IEA, Key Questions on Energy and AI\nFive tests to score by December 31, 2027 I expect paid use to grow even as some operators wait to commission new sites or struggle to earn back what they spent. These five thresholds date to November 20, 2026. Each one calls for a figure from a public disclosure.\nThe scorecard CSV has a row for each threshold, with space to fill in results as the filings come out.\nThe 2026 disclosures establish the baselines. The deadline for scoring the five predictions is December 31, 2027.\n1. A model company will turn usage growth into a lower compute ratio For the nine months ending September 30, 2027, I expect Anthropic&rsquo;s compute and infrastructure operating expense to come in below 50% of revenue. Its final prospectus puts the figure at 56.6% for the same period in 2026, or $18.808 billion in expenses on $33.242 billion in revenue. The expense line covers research and development compute as well as production infrastructure. A drop below 50% would show sales growing faster than the combined bill. Anthropic final prospectus, MD&amp;A\nAt 50% or above, I&rsquo;d temper the claim that Anthropic is outrunning its compute costs. A lower ratio could also reflect a change in what customers buy, new contract terms or the timing of a bill. Scoring this test takes comparable nine-month totals on the same reporting basis, including any restatement. Estimating gross margin per million tokens would take data specific to inference.\n2. CoreWeave will bring a larger fraction of its contracted power online I expect CoreWeave&rsquo;s active power to reach at least 45% of its contracted power in Q3 2027. Its Q3 2026 figures give a rough starting point of 37%, based on over 1.7 GW active and over 4.6 GW contracted. CoreWeave Q3 2026 results\nA surge in new power agreements could bring the ratio down even as more sites come online. Write down the active gigawatts alongside the ratio and check whether CoreWeave changed its definition. Power capacity speaks to site readiness. Customer usage comes from the work those sites actually run.\n3. An operator&rsquo;s operating income will still trail its net interest bill I expect CoreWeave&rsquo;s GAAP operating income to fall short of its net interest bill in Q3 2027. A year earlier, the company reported $207 million in operating income and $846 million in net interest expense. Compare the same quarterly income-statement lines when the 2027 figures arrive. The threshold uses the interest expense as a positive amount. CoreWeave Q3 2026 results\nIf operating income covers that interest bill, CoreWeave will have eased the financing squeeze sooner than I expect. GAAP operating income is the measure for this test. Principal repayments, capital expenditure and taxes remain separate cash commitments.\n4. New leases will still carry a double-digit wait to commencement I expect Digital Realty&rsquo;s weighted-average lag from signing a new lease to its contractual start date to come in at 12 months or longer in Q3 2027. The lag for leases signed in Q3 2026 was 17 months. Digital Realty Q3 2026 results\nA shorter wait would weaken the case for long delays before rental revenue starts for that quarter&rsquo;s leases. Look for the share of large-capacity deals in the release. A run of small deals in ready-to-use buildings can pull the average down while large projects still wait for switchgear.\n5. Chip sales will grow through the conversion delays I expect NVIDIA&rsquo;s Data Center segment to report at least $120 billion in Q3 FY2028 revenue on a comparable basis. That&rsquo;s roughly 11.5% above the $107.6 billion it reported in Q3 FY2027. NVIDIA Q3 FY2027 results\nIf NVIDIA falls short, I&rsquo;ll revisit my expectation that chip sales can keep growing while operators struggle to turn installed capacity into profitable work. I&rsquo;d check first for a product launch delay, a customer inventory drawdown or a change in segment reporting.\nBy December 31, 2027, score the original thresholds against the first comparable filings or earnings releases available by then. Mark a result unscorable if the company drops the disclosure, changes the definition or reports a rounded number that could fall on either side of the threshold.\nCoreWeave appears twice, so those two outcomes may move together. If all five predictions land, the data will support a picture of growing sales with uneven returns across the businesses. If Anthropic&rsquo;s compute bill stays above half of revenue and CoreWeave covers its interest, I&rsquo;ll have to ask why the cloud operator got relief before one of its customers did.\n","permalink":"https:\/\/archit15singh.github.io\/posts\/2026-11-20-six-different-businesses\/","summary":"<p><em>Part of <a href=\"\/ai-infrastructure-reality-check\/\">The AI Infrastructure Reality Check<\/a>.<\/em><\/p>\n<p>NVIDIA reported $107.6 billion in Data Center revenue for the quarter ended October 25, 2026. For the quarter ended September 30, CoreWeave reported $3.66 billion in revenue and a $709 million net loss. Those totals cover different periods and different businesses. The chip supplier gets paid for hardware. The cloud operator needs to rent out capacity long enough to cover what it cost to put into service. <a href=\"https:\/\/investor.nvidia.com\/news\/press-release-details\/2026\/NVIDIA-Announces-Financial-Results-for-Third-Quarter-Fiscal-2027\/default.aspx\">NVIDIA Q3 FY2027 results<\/a> \u00b7 <a href=\"https:\/\/www.sec.gov\/Archives\/edgar\/data\/1769628\/000176962826000461\/coreweave3q26earningspress.htm\">CoreWeave Q3 2026 results<\/a><\/p>","title":"Six AI businesses and five tests of the boom"},{"content":"Part of The AI Infrastructure Reality Check.\nIn the model below, a GPU earns $2 an hour for 90% of the year and still finishes $1,212 short. The operator bought a share of the server and network along with the GPU and needs to recover that investment over four years. At $2.50 an hour, the same installation breaks even at about 77% billable time. The GPU break-even calculator lets you price your own assumptions.\nPrice the billable hour Suppose a customer reserves eight GPUs and runs jobs on six. The invoice covers eight. The provider could keep all eight busy for a week testing its own software and bill nothing for that time. Start with the 8,760 calendar hours each GPU provides per year. Count the hours customers actually pay for, leaving outages, maintenance and idle periods in the denominator.\nEach GPU has to pay for part of the host and network fabric as well as the accelerator itself. The capital charge converts that bill into a yearly cost at the return the operator requires. Fixed operations and idle electricity also accrue all year. The rest of the electricity bill follows the hours the equipment spends under load.\ncapital charge = installed cost \u00d7 r \/ (1 \u2212 (1 + r)^(\u2212life)) baseline power cost = idle IT kW \u00d7 PUE \u00d7 $\/kWh \u00d7 calendar hours variable cost per billable hour = (load IT kW \u2212 idle IT kW) \u00d7 PUE \u00d7 $\/kWh annual fixed cost = capital charge + fixed operations + baseline power cost break-even rate = annual fixed cost \/ (8,760 \u00d7 billable fraction) + variable cost per billable hour break-even billable fraction = annual fixed cost \/ (8,760 \u00d7 (realized rate \u2212 variable cost)) Here r is the annual cost of capital. With a zero discount rate, divide the installed cost by the years of service. The example assigns zero resale value. Fixed operations cover each GPU&rsquo;s share of staffing, maintenance, floor space and recurring network costs. Include power demand charges and fees for reserved utility capacity in fixed operations if the site pays them. Power usage effectiveness (PUE) is total facility electricity divided by IT electricity for the same period. Multiplying IT consumption by PUE adds the facility&rsquo;s share of cooling and other overhead.\nBase case assumption Amount per GPU Installed cost, including allocated host and fabric $36,000 Economic life and annual cost of capital 4 years, 10% Annual fixed operations $4,800 Allocated idle \/ loaded IT draw 0.25 \/ 0.90 kW PUE and energy tariff 1.25, $0.09\/kWh Realized rate and billable fraction $2.00\/h, 90% NVIDIA specifies up to 700 W of configurable thermal design power (TDP) for the H100 SXM. The loaded draw in the model, 0.90 kW, is an assumption for the GPU and its share of the other IT equipment. The equation applies loaded power to billable hours and idle power to the rest. If the provider runs internal jobs, add their electricity separately. NVIDIA H100 specifications\nRecovering the $36,000 investment at the required return costs about $11,357 a year. Add operations and idle electricity and the annual fixed bill comes to $16,403, even with an empty booking calendar. Each loaded hour adds about 7.3 cents. At 90% billable, the provider earns $15,768 over 7,884 hours and incurs about $16,980 in annual costs including the capital charge. That&rsquo;s the economic result before tax. The cash account follows the actual payment dates.\nRealized rate Share of calendar hours needed $1.50 131.2%, infeasible $2.00 97.2% $2.50 77.2% $3.00 64.0% $4.00 47.7% Each point uses the same base-case GPU, electricity and operating costs. The shaded region would require more hours than a year contains.\nCut the electricity tariff from 9 to 7 cents per kWh and the provider saves about $183 a year at 90% billable. Losing ten points of billable time, from 90% to 80%, costs about $1,688 a year at $2\/h even after the electricity savings. At this site and with this equipment, finding paying workloads does more for the budget than negotiating those two cents.\nPut a price on years four and five A functioning server can have years of work left when demand for its GPU generation falls. A depreciation schedule gives another answer to how long the equipment will last. CoreWeave&rsquo;s 2025 annual report lists six years for technology equipment. In January 2025 Meta extended the estimated useful life of most servers and network assets to 5.5 years. These policies apply to asset classes that include several GPU generations and, at Meta, network equipment. CoreWeave 2025 Form 10-K \u00b7 Meta 2025 Form 10-K\nThe first model charges for four years of equipment and assumes a steady rental rate. Suppose customers start paying less after a new GPU generation ships. The buyer needs to know how much years four and five are worth at the price customers would actually pay.\nIn this second scenario, one GPU&rsquo;s share of the installation costs $35,000. It earns $3.20 per billable GPU-hour in year one. At 72% of 8,760 calendar hours, it sells 6,307.2 hours each year. Power, hosting, maintenance and labor cost $4,200 in cash each year. All inputs are assumptions. The model discounts year-end cash flows at 10%, assumes zero salvage value, and excludes taxes, working-capital changes and financing cash flows. Subtracting the investment from the discounted cash gives net present value (NPV).\nrate in year t = $3.20 \u00d7 (1 \u2212 annual rate decline)^(t \u2212 1) year t cash = 6,307.2 \u00d7 rate in year t \u2212 $4,200 NPV through year T = \u2212$35,000 + sum of year t cash \/ 1.10^t Annual decline in realized rate Year 5 cash 3-year NPV 5-year NPV 0% $15,983 +$4,747 +$25,588 15% $6,336 \u2212$1,963 +$7,569 30% $646 \u2212$7,990 \u2212$5,729 Every row starts with the same year-one cash flow. With an annual price drop of 15%, years four and five take net present value above zero. With a 30% annual drop, the machine still generates $646 of cash in year five. The project has a $5,729 shortfall in present-value terms. At that rate of decline, the operator needs about $3.61 per billable hour in year one to make a five-year project break even.\nEvery scenario sells the same number of hours. A departing customer could cut both occupancy and the achievable price. The reverse can happen when a lower rate brings in work for otherwise idle GPUs. You can set the billable share and price decline in the model to see how much each assumption costs. Run the Python model \u00b7 Download the default results\nConvert rack-hours to useful tokens In the published DeepSeek-R1 runs, one GB200 rack produced 523,790 output tokens per second in Offline and 240,274 in Interactive. If the hourly rack cost stays fixed, the cost of producing a million output tokens at the interactive throughput is 2.18 times the offline cost. Quiet periods, retries and spare capacity for traffic spikes would raise the cost further. MLPerf Inference v6.1, NVIDIA DeepSeek-R1 submission\nMLCommons marks all three runs as valid. They come from one submitter using the same system and model. Offline measures bulk processing. Server and Interactive send requests online and impose latency limits, with a tighter time-per-output-token limit for Interactive. The submissions can use different serving settings, so the numbers describe each run&rsquo;s complete configuration.\nScenario Output tokens\/s, rack-wide p99 time to first token p99 time per output token Offline 523,790 N\/A N\/A Server 395,940 869 ms 65.8 ms Interactive 240,274 527 ms 14.6 ms Throughput comes from the published MLPerf runs. The costs assume $216 per rack-hour, full benchmark throughput and 100% usable output.\nA rack can generate hundreds of thousands of tokens per second because it serves requests in parallel. At the other end of one request, a user waits for the first token and then reads the rest as they arrive. The published interactive run gives that user a faster stream while the rack generates fewer tokens overall.\nThe server reads the prompt during prefill and saves the attention keys and values in a KV cache. Decode uses that cache to produce each successive output token. Continuous batching lets the GPU do work for several requests in one step. A long prefill can delay requests already decoding, and larger batches can also affect their latency. The DistServe researchers measured the interference and separated prefill and decode onto different GPU pools. That puts the KV cache on the network between the pools, so the link now has to carry it. DistServe, OSDI 2024\nPrice the 72 GPUs at an assumed $3 each and the pool costs $216 for every hour you provision it. For rented GPUs, start with the invoice and add services billed separately. For an owned rack, allocate equipment, facilities, power, networking and operations by the hour. Divide that hourly cost by the usable output from the same hour.\nUSD per million usable output tokens = hourly pool cost * 1,000,000 \/ (3,600 * reference output tokens\/second * realized throughput share * usable-token share) At full benchmark throughput and 100% usable output, the cost per million is $0.115 for Offline, $0.152 for Server and $0.250 for Interactive. Now suppose the provisioned rack averages 55% of that Interactive throughput and 90% of the output tokens come from requests that met the service target. The result is $0.504 per million usable output tokens. The 55% measures throughput across the hour. GPU activity would measure something else. The 90% counts tokens in qualifying requests, so a long request carries more weight than a short one.\nThe benchmark&rsquo;s workload already incorporates the cost of processing its prompts. These calculations exclude API prices. A live workload can have longer prompts, different prefix reuse, extra reasoning output or more cancellations. Charge retries to the pool and count accepted output once.\nRun python3 physical-infrastructure-models.py tokens to reproduce the calculation. The --hourly-cost, --fill and --usable options let you substitute your own inputs. For a deployment decision, replay real prompts and output lengths against the latency target. Divide the pool&rsquo;s cost by the output from requests that met the target. Download the model\n","permalink":"https:\/\/archit15singh.github.io\/posts\/2026-11-20-gpu-break-even\/","summary":"<p><em>Part of <a href=\"\/ai-infrastructure-reality-check\/\">The AI Infrastructure Reality Check<\/a>.<\/em><\/p>\n<p>In the model below, a GPU earns $2 an hour for 90% of the year and still finishes $1,212 short. The operator bought a share of the server and network along with the GPU and needs to recover that investment over four years. At $2.50 an hour, the same installation breaks even at about 77% billable time. The <a href=\"\/downloads\/ai-infrastructure-reality-check\/gpu-break-even.html\">GPU break-even calculator<\/a> lets you price your own assumptions.<\/p>","title":"GPU economics from break-even to cost per token"},{"content":"Part of The AI Infrastructure Reality Check.\nIn the model below, the GPUs arrive in month 12. The operator can send its first bill in month 25. Move the delivery up four months and the invoice date stays put. Finish the grid work four months early and billing moves up one month. The delivery date on a purchase order tells you when the equipment gets to the site. Billing depends on when the operator has a working cluster the customer can accept.\nCoreWeave reported over 4.6 GW of contracted power and over 1.7 GW of active power at the end of September 2026. Look at one lease in its quarterly filing. The company was still waiting for 453 MW and expected that power to arrive in phases. At campus scale, a signature can precede delivery by years. CoreWeave Q3 2026 results \u00b7 CoreWeave Form 10-Q, Note 8\nWork backward from the first customer handoff The model covers one cluster at one site. The operator can bill once the customer accepts the system under the contract. Before that, the operator has to commission it, which means installing the equipment and checking it under load. The accelerators and network fabric have to be in place, the building needs working cooling and the utility needs to connect the power. The customer must be ready to integrate the cluster by the time acceptance starts.\nBranch Predecessor Ready in month Financing Project start 2 Accelerator delivery Financing 12 Network fabric delivery Financing 16 Building and cooling Financing, then permits 19 Energization Grid connection and switchgear 20 Customer readiness Financing 18 Commissioning Energization, cooling, GPUs, and fabric 23 Contractual acceptance Commissioning and customer readiness 25 Teal marks the baseline critical path. The chart shows selected tasks, with switchgear and permitting dependencies retained in the model.\nEach task waits for its last prerequisite. The switchgear is ready in month 14 and the grid connection in month 20, so the crew can energize the site in month 20. Commissioning takes three months. Acceptance takes two. The grid connection is on the critical path, the chain of work that determines the earliest possible finish. Cooling has one month to slip before it pushes back commissioning. The fabric has four.\nAn accelerator delivery in month 8 leaves the operator carrying the equipment four months longer, with billing still fixed at month 25. Paying for an earlier shipment may be worth it if it buys protection against a later shortage. Before signing, check whether the supplier can hold the shipment and who pays for storage and financing.\nWhich deadline moves the billing date? Change to the baseline First billable month Branch holding up commissioning None 25 Grid Accelerators arrive four months earlier 25 Grid Grid work finishes four months earlier 24 Building and cooling Grid work and cooling finish four months earlier 21 Grid and fabric, tied Fabric arrives five months later 26 Fabric If the grid work finishes early, the commissioning crew waits for the building and cooling instead. Shorten both schedules and the grid connection and fabric delivery land in month 16. With those dates tied, billing moves up again only if both jobs finish earlier.\nTo build this schedule for a specific site, you need dates for the milestones in the table. A connection request gives you an earlier point in the process. In its preliminary November 2026 update, ERCOT counted responses from 433 loads that together requested about 177 GW of interconnection capacity. Some applicants were still deciding what cooling equipment to use. Track how many megawatts make it from request to agreement to energization before putting them in a construction schedule. ERCOT preliminary data center impact survey, November 5, 2026\nMove a date in the interactive critical-path simulator, or download the Python model to calculate finish dates and critical paths. Run python3 physical-infrastructure-models.py deployment for the cases above. Add --task grid --months 14 to set the duration of the grid task to 14 months, counted from the end of its prerequisite. The simulator uses fixed dependencies and durations. For a construction budget, allow a range of finish dates. If several jobs share a crew or vendor, account for the chance that they&rsquo;ll all slip together.\nAfter commissioning, measure every constraint in one unit Once a new campus has secured its racks, I&rsquo;d check when it can draw firm power. At a site already serving customers, pick one workload and measure what each part of the system can sustain. Count the requests that finish within its service-level objective (SLO), such as a latency target. Otherwise a change that leaves customers waiting longer can look like a throughput gain. IEA on grids\nSuppose the GPUs can handle 72,000 qualifying requests an hour. The site has enough power for 80,000, enough cooling for 100,000 and enough network capacity for 90,000. Customers are asking for 92,000. This exercise gives each resource an independent ceiling for the same workload at a fixed operating point.\nCumulative change Accelerator limit Power Cooling Fabric Demand Served Active limit Baseline 72 80 100 90 92 72 Accelerators More accelerators 120 80 100 90 92 80 Power More firm power 120 110 100 90 92 90 Fabric Fabric upgrade 120 110 100 115 92 92 Demand Demand grows 120 110 100 115 105 100 Cooling The table gives hypothetical rates in thousands of requests an hour. Add room for 48,000 more requests at the accelerators and the site serves only 8,000 more. Power runs out first. Upgrade power and the fabric, and the site can serve everyone who shows up. More demand brings cooling into play. If demand drops to 70,000, that same site serves 70,000.\nRun the measurement again after a change. Adding racks can mean more communication between racks, especially if the team changes how it splits the workload across GPUs. Draw more power and the cooling headroom can shrink as the equipment gets hotter. The model holds those interactions fixed. A purchasing decision needs measurements from the proposed layout.\nRun python3 physical-infrastructure-models.py bottlenecks with the downloadable scenario model to reproduce the table. Replace the limits with measurements from your workload before testing an upgrade. When a 50% increase in one resource buys 5% more useful throughput, check which resource tops out next.\nDuring a power cap, the queue can become the limit The allocation problem looks different when a utility asks a running site to cut its load. In March 2026, Google reported signing 1 GW of demand-response capacity across its U.S. data-center agreements and said it can move some machine-learning work. The Zeus authors tested power caps and batch sizes on several deep-learning training workloads and measured energy-efficiency gains of 15.3% to 75.8%. An inference scheduler still needs to know how a power cap will change latency for the requests it serves. Google demand-response announcement \u00b7 Zeus, NSDI 2023\nIn the Python model, twelve rack groups can reserve up to 10 MW. Facility loads and shared services take a fixed 1.6 MW. A rack group at full power reserves 700 kW and serves ten requests a minute. The first capped configuration reserves 450 kW and serves eight requests a minute per group. At 7.2 MW, the scheduler checks every allocation that fits and can pick the one with the highest modeled service rate. It handles requests in arrival order.\nEvery run gets the same 30 minutes of traffic. The queue receives 75 requests a minute, rising to 100 a minute for a ten-minute burst. A request counts as on time if it finishes within two one-minute slots of arrival, including service. After the 30 minutes, the scheduler keeps running until the queue empties. The power column records the capacity each policy reserves.\nPolicy Reserved MW Completed\/min during arrivals Service-slot utilization p95 latency On time Peak backlog 12 full-power groups 10.0 83.3 69.4% 1 min 100% 0 8 full-power groups 7.2 78.3 97.9% 4 min 54.2% 200 12 capped groups 7.0 83.3 86.8% 2 min 100% 40 The same arrival trace and power limit apply to all three cases. The last two rows change how much throughput a capped group retains.\nAt 7.2 MW, eight groups at full power leave 200 requests in the queue at the peak. Twelve groups at reduced power bring the peak to 40. At 450 kW, each capped group in that run keeps 80% of its capacity on about 64% of its full power reservation.\nTake the same workload and assume each capped group keeps just 60% of its capacity. The twelve groups then offer 72 slots a minute. The 95th-percentile (p95) latency rises to six minutes and only 41.0% of requests finish on time. Eight full-power groups still deliver a p95 of four minutes and 54.2% on time. The search picks capped groups when they keep more of their capacity and full-power groups when capping costs more throughput. That search maximizes capacity for identical jobs. A scheduler for a mixed fleet has to account for which traffic classes can move.\nRun python3 physical-infrastructure-models.py power with the downloadable scheduler, then add --capped-rate 6 to give each capped group six slots per minute. The model treats all requests alike, holds service capacity constant within each slot and fixes the site overhead. For a curtailment drill, replay a burst at each power setting and measure throughput, tail latency and queue drain time. The last delayed request can still be waiting after the site has met its power target.\n","permalink":"https:\/\/archit15singh.github.io\/posts\/2026-11-20-ai-buildout-critical-path\/","summary":"<p><em>Part of <a href=\"\/ai-infrastructure-reality-check\/\">The AI Infrastructure Reality Check<\/a>.<\/em><\/p>\n<p>In the model below, the GPUs arrive in month 12. The operator can send its first bill in month 25. Move the delivery up four months and the invoice date stays put. Finish the grid work four months early and billing moves up one month. The delivery date on a purchase order tells you when the equipment gets to the site. Billing depends on when the operator has a working cluster the customer can accept.<\/p>","title":"What limits an AI cluster from delivery to peak load"},{"content":"Part of The AI Infrastructure Reality Check.\nFrom the September 2025 quarter to the same quarter in 2026, Microsoft, Alphabet and Meta brought in $9.6 billion more operating cash. They spent $62.5 billion more on property and equipment. After those purchases, the three companies had $8.41 billion left between them, down from $61.29 billion a year earlier. Microsoft Form 10-Q \u00b7 Alphabet results \u00b7 Meta results\nThe bridge compares the same September quarter in each year. It uses consolidated cash flows and excludes the separate finance-lease adjustment.\nThe same subtraction across three statements Each column compares the three months through September 30. Microsoft calls the 2026 period its fiscal first quarter. I take cash purchases or additions to property and equipment from the investing section, show the spend as a positive amount, and subtract it from operating cash flow. The filings report consolidated figures for all of each company&rsquo;s businesses.\nCompany Operating cash, 2025 \u2192 2026 Cash property and equipment, 2025 \u2192 2026 Cash after equipment, 2025 \u2192 2026 Microsoft $45.06bn \u2192 $58.00bn $19.39bn \u2192 $39.37bn $25.66bn \u2192 $18.63bn Alphabet $48.41bn \u2192 $42.29bn $23.95bn \u2192 $51.36bn $24.46bn \u2192 \u2212$9.07bn Meta $30.00bn \u2192 $32.79bn $18.83bn \u2192 $33.94bn $11.17bn \u2192 \u2212$1.16bn Three-company sum $123.47bn \u2192 $133.08bn $62.18bn \u2192 $124.66bn $61.29bn \u2192 $8.41bn Equipment purchases absorbed 50.4% of the three companies&rsquo; operating cash in the September 2025 quarter and 93.7% a year later. Microsoft brought in nearly $13 billion more operating cash and finished with about $7 billion less after purchases. Alphabet spent more on equipment as its operating cash fell, taking its quarterly balance below zero. Over the twelve months through September 2026, Alphabet still had $19.7 billion left after those purchases. Alphabet&rsquo;s quarterly and trailing cash-flow reconciliation\nThe lease payment is on another line Meta reported negative $2.12 billion of free cash flow for the 2026 quarter. Subtract its $964 million finance lease principal payment from the negative $1.16 billion in the equipment-only table and you get Meta&rsquo;s figure. Make the same principal-payment adjustment for all three firms and their combined balance drops from $8.41 billion to $5.34 billion. Alphabet also paid $159 million in advance on leases it expects to classify as finance leases. The $5.34 billion applies the narrower adjustment for separately reported financing cash paid on existing leases. Meta reconciliation \u00b7 Alphabet lease note \u00b7 Microsoft lease note\nLook at Microsoft&rsquo;s lease note for the timing difference. It acquired $5.19 billion of finance-lease right-of-use assets by taking on lease obligations in the quarter. It also paid $1.00 billion in financing cash on leases. The first number measures the assets it obtained through financing that quarter. The second records cash payments on leases signed at different times. Microsoft Form 10-Q, Note 12\nThe cash flow and lease notes together show how much the business funds now and some of what comes due later. Estimating how much of that spending went to AI would require a way to split shared equipment and space across workloads. Alphabet identifies technical infrastructure as a driver. The table uses each company&rsquo;s consolidated totals. Alphabet Form 10-Q\nDownload the filing figures, calculations and source links as a CSV.\nHow a supplier can also finance a customer AMD and Anthropic put a $5 billion ceiling on stock purchases tied to hardware delivery and deployment milestones. The IPO prospectus also lists $2.5 billion of AMD equity in the private placement that Anthropic confirmed closed on November 20. Each dollar from that purchase counts toward the $5 billion cap. Adding the announcements would give $7.5 billion on paper. The agreement leaves room for another $2.5 billion as GPU deployment hits the remaining milestones. Anthropic final prospectus, &ldquo;AMD Agreement&rdquo; \u00b7 Anthropic closing announcement\nAMD also helps supply the compute. Anthropic agreed to obtain an initial group of AMD-based racks subject to deployment conditions, potentially through approved system manufacturers or third-party providers. If Anthropic obtains the full initial capacity, it estimates spending more than $20 billion. The hardware framework leaves the dollar commitment open. That estimate tracks what Anthropic might spend on compute. The stock agreements track who supplies capital. Anthropic final prospectus, &ldquo;Contractual Obligations&rdquo;\nFollow the arrows by what changes hands. A hardware supplier bills the buyer when the terms call for payment. An investor pays for a stake. With a reservation, the operator has a claim on future cash if it satisfies the contract.\nRelationship Direction of value Disclosure AMD equity AMD \u2192 Anthropic, equity cash when issued Up to $5bn, inclusive of the $2.5bn private placement purchase AMD-based compute Approved system supplier or service provider \u2192 Anthropic, hardware or access Initial deployment subject to terms, with hardware or service spending following the applicable contract NVIDIA hardware NVIDIA \u2192 CoreWeave, GPUs CoreWeave identifies NVIDIA as a GPU supplier NVIDIA equity NVIDIA \u2192 CoreWeave, equity cash CoreWeave disclosed closing a $2bn investment in January 2026 NVIDIA reservation NVIDIA \u2192 CoreWeave, contingent service payments A September 2025 order form has a $6.3bn initial value and covers residual unsold capacity through April 13, 2032, subject to service availability, delivery and contract terms Anthropic prospectus \u00b7 CoreWeave September 2025 Form 8-K \u00b7 CoreWeave January 2026 Form 8-K\nCoreWeave has to deliver eligible capacity. If its other customers leave any of that capacity unsold, NVIDIA must buy the remainder under the terms of the order. That gives CoreWeave a buyer for eligible slots that would otherwise go empty, and it gives NVIDIA access to compute. The terms show who bears that risk. What NVIDIA runs, what it winds up paying and how much independent customers spend remain open questions. CoreWeave September 2025 Form 8-K\nThe ECB&rsquo;s November Financial Stability Review describes what happens if demand slows. Customer commitments and the credit or equity value of the firms that financed them can both weaken. A strong end market can still make it a sound deal. For a credit analysis, count actual customer invoices separately from equity funding and contingent reservations, especially when the same company supplies more than one. ECB Financial Stability Review, November 2026\nFollow commitments through to profit At the end of September 2026, CoreWeave reported $132.5 billion of revenue backlog. For the quarter it reported $3.66 billion of revenue, $207 million of operating income and a $709 million net loss. Between the backlog and the income statement sit the machines it can deliver, the hours it can bill and its financing costs. CoreWeave Q3 2026 results\nStage Count or calculate CoreWeave disclosure or data needed Commercial demand Committed future service by delivery or start date $132.5bn backlog at quarter end, including $132.3bn of remaining performance obligations Deliverable capacity Ready-to-serve GPU-hours, by region and machine type Over 1.7 GW active power and over 4.6 GW contracted power. Host inventory and readiness telemetry are needed to compute GPU-hours Billable service and actual usage Paid reserved hours, metered on-demand hours and GPU active time as separate measures Committed contracts accounted for 98% of quarterly revenue. Measuring actual GPU activity requires telemetry Operating and financing results Realized revenue, operating costs including depreciation, and financing costs $3.66bn revenue, $207m operating income, $846m net interest expense and $709m net loss CoreWeave Q3 2026 results \u00b7 CoreWeave Form 10-Q, revenue recognition and risk factors\nCoreWeave&rsquo;s $132.3 billion of remaining performance obligations counts billed and unbilled commitments after estimated reductions. It expects to recognize 36% in the next 24 months and another 38% in months 25 through 48 as it delivers and makes services available. Dividing a quarter of revenue by that balance throws away the delivery schedule. CoreWeave Form 10-Q, Note 2\nA power contract describes capacity the operator expects to have. Before a GPU can take a job, it needs an installation, commissioning and customer access. To count capacity in GPU-hours, use the inventory of working devices and the hours each one can serve the workload in question.\nTrack paid reservations, metered hours and active GPU time separately. A customer can leave a prepaid GPU idle and still pay for the hour. At renewal, that unused capacity gives the customer a reason to reconsider the contract.\nCoreWeave reported a 62% adjusted EBITDA margin for the quarter. The largest adjustments in its reconciliation were $1.89 billion of depreciation and amortization and $846 million of net interest. Start with the $207 million of operating income, subtract the $846 million in interest, add $13 million in other income and deduct $83 million for taxes. That&rsquo;s how a profitable operating quarter becomes a $709 million net loss. CoreWeave Q3 2026 results and non-GAAP reconciliation\nThe bridge starts at CoreWeave\u2019s reported operating income and ends at its GAAP net loss. Amounts are rounded to millions of dollars.\n","permalink":"https:\/\/archit15singh.github.io\/posts\/2026-11-20-ai-capex-cash-flow\/","summary":"<p><em>Part of <a href=\"\/ai-infrastructure-reality-check\/\">The AI Infrastructure Reality Check<\/a>.<\/em><\/p>\n<p>From the September 2025 quarter to the same quarter in 2026, Microsoft, Alphabet and Meta brought in $9.6 billion more operating cash. They spent $62.5 billion more on property and equipment. After those purchases, the three companies had $8.41 billion left between them, down from $61.29 billion a year earlier. <a href=\"https:\/\/www.sec.gov\/Archives\/edgar\/data\/789019\/000119312526436133\/msft-20260930.htm\">Microsoft Form 10-Q<\/a> \u00b7 <a href=\"https:\/\/www.sec.gov\/Archives\/edgar\/data\/1652044\/000165204426000080\/googexhibit991q32026.htm\">Alphabet results<\/a> \u00b7 <a href=\"https:\/\/www.sec.gov\/Archives\/edgar\/data\/1326801\/000162828026066700\/meta-09302026xexhibit991.htm\">Meta results<\/a><\/p>\n<figure class=\"series-figure\"><a href=\"\/downloads\/ai-infrastructure-reality-check\/hyperscaler-cash-spend-bridge.webp\">\n    <img loading=\"lazy\" src=\"\/downloads\/ai-infrastructure-reality-check\/hyperscaler-cash-spend-bridge.webp\"\n         alt=\"Combined cash remaining after equipment fell from $61.3B to $8.4B. Operating cash rose $9.6B while equipment cash spending rose $62.5B.\" width=\"1184\" height=\"696\"\/> <\/a><figcaption>\n            <p>The bridge compares the same September quarter in each year. It uses consolidated cash flows and excludes the separate finance-lease adjustment.<\/p>\n        <\/figcaption>\n<\/figure>","title":"AI infrastructure cash flow and who finances the buildout"},{"content":"A memory supplier sells a wafer\u2019s worth of chips. A cloud operator sells GPU hours. An application has to earn back what it spends on those hours. These five articles follow the money and equipment through the buildout, using public filings, price quotes, benchmarks and models you can rerun.\nRead the series How the AI buildout reaches your DDR5 bill What a memory supplier sees in its order book and what a PC builder sees at checkout. GPU economics from break-even to cost per token How much a GPU has to earn per hour, and how three MLPerf runs change the estimated cost per token. What limits an AI cluster from delivery to peak load Why getting the GPUs early can leave the billing date untouched, and what happens to inference queues when power drops. AI infrastructure cash flow and who finances the buildout What three hyperscalers spent on equipment and how suppliers help finance the customers buying it. Six AI businesses and five tests of the boom Where each business earns its money, what customers are already paying, and which numbers to revisit in 2027. Calculators and data GPU break-even calculator and its MIT license Critical-path simulator and the Python scenarios GPU economic-life model and its scenario results Capex and cash flow and DDR5 retail observations Prediction scorecard Python source for the ten article figures ","permalink":"https:\/\/archit15singh.github.io\/ai-infrastructure-reality-check\/","summary":"<p>A memory supplier sells a wafer\u2019s worth of chips. A cloud operator sells GPU hours. An application has to earn back what it spends on those hours. These five articles follow the money and equipment through the buildout, using public filings, price quotes, benchmarks and models you can rerun.<\/p>\n<h2 id=\"read-the-series\">Read the series<\/h2>\n<ol>\n<li><a href=\"\/posts\/2026-11-20-how-ai-demand-raises-ddr5-prices\/\">How the AI buildout reaches your DDR5 bill<\/a> What a memory supplier sees in its order book and what a PC builder sees at checkout.<\/li>\n<li><a href=\"\/posts\/2026-11-20-gpu-break-even\/\">GPU economics from break-even to cost per token<\/a> How much a GPU has to earn per hour, and how three MLPerf runs change the estimated cost per token.<\/li>\n<li><a href=\"\/posts\/2026-11-20-ai-buildout-critical-path\/\">What limits an AI cluster from delivery to peak load<\/a> Why getting the GPUs early can leave the billing date untouched, and what happens to inference queues when power drops.<\/li>\n<li><a href=\"\/posts\/2026-11-20-ai-capex-cash-flow\/\">AI infrastructure cash flow and who finances the buildout<\/a> What three hyperscalers spent on equipment and how suppliers help finance the customers buying it.<\/li>\n<li><a href=\"\/posts\/2026-11-20-six-different-businesses\/\">Six AI businesses and five tests of the boom<\/a> Where each business earns its money, what customers are already paying, and which numbers to revisit in 2027.<\/li>\n<\/ol>\n<h2 id=\"calculators-and-data\">Calculators and data<\/h2>\n<ul>\n<li><a href=\"\/downloads\/ai-infrastructure-reality-check\/gpu-break-even.html\">GPU break-even calculator<\/a> and its <a href=\"\/downloads\/ai-infrastructure-reality-check\/gpu-break-even-license.txt\">MIT license<\/a><\/li>\n<li><a href=\"\/downloads\/ai-infrastructure-reality-check\/critical-path.html\">Critical-path simulator<\/a> and the <a href=\"\/downloads\/ai-infrastructure-reality-check\/physical-infrastructure-models.py\">Python scenarios<\/a><\/li>\n<li><a href=\"\/downloads\/ai-infrastructure-reality-check\/gpu-economic-life.py\">GPU economic-life model<\/a> and its <a href=\"\/downloads\/ai-infrastructure-reality-check\/gpu-economic-life.csv\">scenario results<\/a><\/li>\n<li><a href=\"\/downloads\/ai-infrastructure-reality-check\/capex-cash-flow.csv\">Capex and cash flow<\/a> and <a href=\"\/downloads\/ai-infrastructure-reality-check\/retail-ddr5-observations.csv\">DDR5 retail observations<\/a><\/li>\n<li><a href=\"\/downloads\/ai-infrastructure-reality-check\/prediction-scorecard.csv\">Prediction scorecard<\/a><\/li>\n<li><a href=\"\/downloads\/ai-infrastructure-reality-check\/series-figures.py\">Python source for the ten article figures<\/a><\/li>\n<\/ul>","title":"The AI Infrastructure Reality Check"},{"content":"I wanted to check whether a skill actually did its job. The skill ran a goal prompt through OpenCode, called a handful of tools, and left a session behind. Then I read the final message, and the final message told me exactly what I wanted to hear.\nThat is the problem with grading an agent from its output alone. The reply is the last thing that happened, not the thing you were measuring.\nOpenCode ships two ways to run. opencode run prints the assistant&rsquo;s text to stdout and exits. The TUI is a full-screen program. Between them sits a gap: everything the interface does. How tool calls got grouped, whether a thinking block stayed collapsed, whether a permission prompt fired, what a keybind did, whether the transcript stayed readable or turned into a wall of noise. None of that appears in headless output, and all of it is behaviour.\nThe same run, two transcripts The setting I care about is session.verbosity in ~\/.config\/opencode\/cli.json. OpenCode&rsquo;s prose documentation does not mention it. The published JSON schema at https:\/\/opencode.ai\/v2\/cli.json does, and so does the binary, which implements three levels: low, medium, high. Upstream it arrived in PR #51131.\nlow collapses each run of tools and thinking into one summary row. medium groups reads and searches but still prints shell output. Here is the same prompt against the same two files, captured from the real TUI, once at low and once at medium.\nsession.verbosity: &quot;low&quot;. Three tool calls and two thinking blocks become one row: + 2 commands, 2 thoughts, 1 read. The answer is unchanged.\nsession.verbosity: &quot;medium&quot;. The read collapses into \u2192 Explored: 1 read, but the command runs in the open, output and all.\nSame model, same prompt, same files. The answer is byte-identical: total: 18. The transcript is not. Grade the agent by reading its reply and you see no difference between these two runs. Grade it by looking at what a human would have seen, and the difference is the entire point.\nThe part I got wrong My first assumption was that medium meant unbounded scrollback, with tool output expanding until it pushed the conversation off screen. It does not. OpenCode truncates long tool output and replaces the head with a marker:\n$ seq 1 400 (393 earlier lines) 394 ... 400 So medium is bounded too, just at a much higher ceiling. The claim I actually wanted to make is narrower and holds: low suppressed tool output in the runs I captured.\nGetting the pixels Capturing this meant running the TUI the way a person runs it.\nOpenCode&rsquo;s TUI is built on OpenTUI. It does not write a transcript. It repaints the screen, moving the cursor and erasing regions, thousands of times per turn. The bytes coming out of a terminal are a rendering, and a rendering is not a document.\nOne run, two readers. A terminal emulator replays the byte stream into a screen buffer; the OpenCode database supplies the structured record. Assert on both, because they fail differently.\nPython&rsquo;s pty module gives the TUI a real terminal to draw into:\nmaster, slave = pty.openpty() fcntl.ioctl(slave, termios.TIOCSWINSZ, struct.pack(&#34;HHHH&#34;, rows, cols, 0, 0)) proc = subprocess.Popen(argv, stdin=slave, stdout=slave, stderr=slave, start_new_session=True) Three details in that snippet are load-bearing, and I got all three wrong on the first attempt.\nThe window size has to be set before the child reads it. OpenTUI lays out once at startup. Set the size late and you get an 80x24 layout with truncated output that no amount of re-rendering fixes.\nKeystrokes sent before the app paints are silently discarded. The pty starts in canonical mode. Write your prompt into the master too early and the tty line discipline buffers and drops it, and the TUI sits at its home screen waiting for input that never arrives. The fix is to wait for the terminal to go quiet, which is the signal that the first frame is up. This also turned out to be the right scheduler for multi-turn runs: deliver the next prompt when the previous turn goes quiet, never on a fixed clock. A slow model stops eating your later turns.\nEcho has to be off. Otherwise the pty echoes your injected prompt back into the capture and it lands above the real content as garbage.\nOnce the bytes are captured, pyte replays them into a screen buffer. That buffer is what a terminal would show, cell by cell, with colour attributes intact, and Pillow rasterises it into a PNG using Menlo as the monospace font. The result is a screenshot of the TUI, not a reconstruction of one.\nThe part the pixels cannot tell you A screenshot answers &ldquo;what did the interface show&rdquo;. It cannot answer &ldquo;what actually ran&rdquo;. For that, the source of truth is OpenCode&rsquo;s own database at ~\/.local\/share\/opencode\/opencode.db.\nselect id, title, model, cost, tokens_input, tokens_output, tokens_reasoning from session_v2 where directory = ? and time_created &gt;= ? order by time_created desc limit 1; select seq, type, data from session_message where session_id = ? order by seq; session_message.data is JSON. An assistant message carries a content array where each part is text, reasoning, or tool, and a tool part carries its name and state.status. That gives the machine-readable version of a run: how many tools fired, which ones, whether any errored, how many tokens the reasoning cost, which model actually answered.\nI trust the database over the event stream for the same reason I trust it over the screenshot. The JSON event stream from opencode run --format json intermittently exits zero with empty stdout, and the final step_finish event is dropped in the v2 client. In the runs I inspected, the database retained the model id, token counts and idle outcome even when the event stream was incomplete.\nTwo more gotchas that cost real time OPENCODE_CONFIG does not override the model. The variable exists in the binary and is accepted, but the session still runs the global model. What works is a project-level opencode.json, because project config outranks the global file. My capture tool writes the pin into the working directory, and for an existing project it goes into .opencode\/opencode.json, which the docs state overrides the project&rsquo;s own opencode.json without touching it.\nmacOS \/var is a symlink to \/private\/var. The session lookup matches the directory string exactly. tempfile.mkdtemp() hands you \/var\/folders\/...; the database stores \/private\/var\/folders\/.... Resolve the path or every run reports &ldquo;session not found&rdquo; while the run was actually fine.\nWhat this buys Anything where the interface is part of the thing under test.\nA skill run end to end should call the tools it was supposed to call, in the order it was supposed to call them, and leave a transcript behind that a person would want to scroll back through. A goal prompt run through the real TUI either closed the loop or did not, and the screen shows which, rather than a summary the agent wrote about closing the loop. Then there are the small things that only exist in a full-screen program: a keybind, a permission prompt, the shape of a collapsed group.\nThe grading surface is the structured record, not the image. A session.json with per-message text, reasoning, tool names, tool status and error counts answers &ldquo;did the right tools fire&rdquo; cleanly. The screenshot answers &ldquo;did it look right to a human&rdquo;. Keeping them separate is what makes the assertions stable.\nLimits Free hosted models throttle, and they throttle quietly. A spent quota answers 429 with a retry-after header that OpenCode honours silently for hours, so a capture script without a turn timeout will hang rather than fail. I set a 120 second per-turn ceiling and a 600 second ceiling for the whole run.\nThe same prompt does not produce the same transcript twice. The model is not deterministic, so these screenshots are illustrations rather than golden files, and any assertion on the capture has to target stable facts. &quot;a + 2 commands row exists&quot; is a fact. &quot;the transcript contains exactly this text&quot; is a coin flip.\nThis is also the narrow half of the problem. The sibling eval harness in ~\/projects\/opencode-eval-harness grades the other half: it runs opencode run headlessly against identical tasks and hidden tests, so it measures the diff rather than the interface. Both are worth having. Neither subsumes the other, because a run can pass every test and still leave behind a transcript nobody wants to read.\nI have not built the rubric runner yet. What exists today is the capture primitive: a shared skill that runs the TUI, replays the byte stream, rasterises it, and pulls the session record out of the database. The grading layer is unbuilt, and the honest reason is that I have not settled on what a good transcript looks like for the skills I care about. A rubric that only checked tool names would pass on both transcripts above.\nMethod and captures from a run against OpenCode v2.1.2 on macOS, using opencode\/minimax-m3.1-flash-free. The capture tool is a shared skill, opencode-tui-capture, documented with the full pty mechanics and troubleshooting notes.\n","permalink":"https:\/\/archit15singh.github.io\/posts\/2026-10-21-grading-agents-through-their-interface\/","summary":"<p>I wanted to check whether a skill actually did its job. The skill ran a goal prompt through OpenCode, called a handful of tools, and left a session behind. Then I read the final message, and the final message told me exactly what I wanted to hear.<\/p>\n<p>That is the problem with grading an agent from its output alone. The reply is the last thing that happened, not the thing you were measuring.<\/p>","title":"You Cannot Grade an Agent You Only Read"},{"content":"Also available on Archit\u2019s Newsletter on Substack.\nYou ask a coding agent to fix a failing test. Somewhere, a model generates tokens. But tokens do not open files, decide which shell command is permitted, preserve a session after a crash, or establish that the test now passes. The execution system has to make those things happen.\nThat system is the harness. Its decisions determine how reasoning becomes action, what the model sees next, and which failures remain recoverable. To understand an agent&rsquo;s reliability, we need to follow those boundaries in code.\nFor this first source dive, I examined the official DeepSeek Harness repository at commit 687f282e8625c6b8d11ff58211a90524be2e4317. The repository identifies this as a developer preview built on Cordis. Every source link below is pinned because a moving branch is a poor foundation for an architectural claim.\nThis is a source-level investigation with a controlled tool-round-trip reference, not a live-model benchmark or a claim that I watched a real bug get fixed. I ran the upstream loop, cancellation, session-repair and compaction suites at this revision: 262 tests passed across five files. Those controlled tests support the branches discussed here; they do not establish production success rates. The interesting result is how the implementation separates an action from knowledge of its outcome.\nFollow one request through the machine The useful place to start is ReactLoopAgent, rather than the model provider. Its driver separates a turn, the work triggered by incoming messages, from a step, one model interaction and its resulting tool work. That distinction gives cancellation, retries and follow-up messages somewhere precise to land.\nFor a small, inspectable execution, consider the repository&rsquo;s own tool round-trip test. A mock adapter first requests echo({text: &quot;ping&quot;}); a registered tool returns echo: ping; the adapter then returns done. The test checks two model requests, the tool result in the second request, and both call and result events in the session log. It exercises the real driver and registry with controlled inference. It does not establish whether a production model can fix a bug.\nHere is the path that makes that round trip possible.\nThe task enters an inbox. followup() supplies a user message. The driver claims the relevant pending messages and opens a turn. It doesn&rsquo;t simply concatenate every message it has ever seen into a prompt. The pre-step path assembles the system prompt and current context, then passes the proposed step through an agent\/pre-step extension point. A policy can reject the step before a model call occurs.\nThe request acquires an explicit model route. The request preparation path starts with provider\/model settings, lets the agent\/request waterfall modify them, and resolves an adapter through llm.prepareCall(). Missing routing is an error. Adapter defaults are resolved for the request; they are not assumed to be permanent properties of the conversation.\nThe model receives a projection of recorded state. Prompt and user\/context inputs enter the session as events. buildRequest() records the relevant request header and context metadata, derives the current messages, and freezes the request boundary. The durable history and the current model-visible conversation are related structures, with different jobs. The former supports reconstruction; the latter is what this inference actually consumes.\nInference produces a stream, then a committed assistant message. step() consumes chunks through AssistantStreamAttempt. The implementation distinguishes a live stream from its settled session record. A visible fragment is therefore not automatically a complete assistant action. Once the response settles, the driver extracts its tool-call blocks.\nThe harness executes the request to call a tool. executeToolCalls() parses the arguments, classifies execution mode, and schedules calls through the tool runtime. The model has proposed a name and arguments. It has not directly invoked a shell or modified a file.\nThe observation becomes input for the next step. The scheduler records tool\/call and tool\/result, retaining their relationship. The next request derives its messages from the updated session. In the controlled round trip, this is where echo: ping becomes a tool-role observation that the second inference can read. When that inference returns done without another tool call, the step reports completion. Queued follow-ups and stopping hooks can still affect whether the turn actually ends.\nOriginal diagram traced against commit 687f282e8625c6b8d11ff58211a90524be2e4317. It shows the default driver and extension boundaries, not every plugin in a deployed profile. The echo round trip is the executable reference; \u201cfix a failing test\u201d remains the motivating task.\nFor a coding task, replace the echo tool with file inspection, edits and shell execution. The control structure remains recognizable, but the consequences change. Reading a file and running a migration are both tool calls; their recovery semantics are very different.\nWhere the responsibilities live The architecture document makes an unusually explicit commitment: the agent loop itself is a Cordis plugin. So are the model adapter, tool registry and session services. A running product is a configured plugin tree, rather than a model SDK with a few callbacks attached.\nResponsibility Source module What to inspect Agent driving packages\/core\/agent-loop Turns, steps, streaming, scheduling and termination Agent API packages\/core\/agent Registry, lifecycle and interaction contract Model boundary packages\/llm\/llm Prepared calls, routing and stream vocabulary Provider implementation packages\/llm\/llm-deepseek Provider-specific request\/response adaptation Tool execution packages\/core\/tools Registry, policies, guards and dispatch Prompt\/context assembly packages\/core\/system-prompt Sections, current context and tool schemas Session state packages\/core\/session Event history, message derivation and repair Durable storage packages\/session\/session-persistence-jsonl Persistence backend, separate from the in-memory session Context reduction packages\/compaction\/compaction-basic Pre-step policy and overflow recovery For filesystem and shell behavior, follow the consumers into packages\/fs\/tool-fs and packages\/shell\/tool-bash, then onward to their providers and sandbox policy. The bash tool explicitly separates its model-facing contract from process execution. Its behavior also depends on whether a job registry is composed: a timeout can lead to background work in a supported composition, rather than proving the process has stopped.\nThat last detail matters when interpreting screenshots of agents. \u201cThe tool returned\u201d and \u201cthe underlying operation has finished\u201d are different observations.\nThree decisions that change reliability 1. The event log and the model&rsquo;s working context are distinct A chat transcript is often treated as a list to append to until the context window fills. DeepSeek Harness gives the session another role: recording the facts from which requests and other views can be reconstructed.\nThe request builder logs configuration changes, obtains session.deriveMessages(), and carries tool history separately. System-prompt updates have explicit handling for whether the routed adapter supports updates in history. Changes to tools or the admitted surface can start a new request series. These are concrete decisions about what a model sees and what can be replayed, not cosmetic conversation formatting.\nThe benefit is inspectability. When behavior changes, there is a place to ask which messages, schemas, route and context were admitted. The cost is coordination: a plugin that changes model-visible input has to participate in the recording and projection contract. A hidden mutation makes later reconstruction misleading, even if the live answer looked fine.\nCompaction fits this design as policy. The basic compaction plugin hooks pre-step handling and structured request errors. For overflow recovery, it checks route information, cancellation and retry limits. Crucially, a retry requires the replacement surface to have advanced. Re-sending the same oversized context is not treated as recovery.\nThis doesn&rsquo;t make summaries lossless. A compacted conversation can still omit the detail a later decision needs. The architecture gives us boundaries to inspect; evaluation still has to ask which facts survived and whether the remaining context supports the next action.\n2. Concurrent execution keeps ordered commitments Tool calls are not all equivalent scheduling units. Some can safely overlap; others need to run alone. The tool scheduler combines a bounded rolling pool with exclusive barriers. It also rechecks later calls before starting them, so a changed registry or policy can affect work that has not yet begun.\nResults are finalized and appended in model order, even when the bodies finish out of order. This keeps the recorded conversation stable without forcing every independent read to wait for the previous read&rsquo;s entire execution.\nThere is a price. An early slow operation can hold up ordered result commitment. Cancellation also waits for started work to settle rather than pretending abandoned promises have disappeared. From these await points, a tool that ignores cancellation and never settles can delay teardown. That is a source-derived failure possibility, not a measured hang in a production session.\nThe registry provides another boundary: prepareExecution() applies pre-execution policy and then checks live guards. A policy&rsquo;s permission decision is not equivalent to unconditional access; a guard can still deny dispatch. The actual tool body is reached through a separate execution path.\nFor comparisons between agents, \u201csupports parallel tools\u201d is too weak a description. Ask which calls overlap, where policy is enforced, what order observations enter history, and what cancellation waits for.\n3. Resume repairs uncertainty instead of inventing success The resume path acquires write ownership before loading and preparing the session. It then appends semantic interruption closers to the physically valid log. Missing tool results, step endings and turn endings are handled at the agent\/session layer, rather than being confused with storage recovery.\nThe most revealing part is in repair.ts. It distinguishes TOOL_NOT_STARTED from TOOL_OUTCOME_UNKNOWN. The latter means a call was recorded as started but no completed result was durably recorded. The recovery message directs attention to the operation&rsquo;s semantics and external state before retrying a side effect.\nThis enables a coherent resumed conversation without claiming that the interrupted action failed. It costs the convenience of blindly continuing: somebody still has to resolve the uncertainty. A valid transcript does not provide exactly-once execution of an external operation.\nThat distinction is the architectural finding I would carry into any production agent review.\nThe failure hidden between execution and observation Imagine a shell tool updates a release marker in another system. The update succeeds. Before the result reaches durable session history, the agent process dies.\nOn restart, the log contains a started tool call and no result. Repeating the call might duplicate a release action. Treating it as successful might skip work that never happened. The model cannot infer the external truth from that log alone.\nDeepSeek Harness&rsquo;s unknown-outcome repair preserves this ambiguity. The counterexample is to the claim that persistent sessions automatically make agents safe to resume. They preserve recorded knowledge; they cannot retroactively make a remote side effect and a local log append one transaction.\nFor a read-only inspection, retrying is usually straightforward. For a write, recovery may require reading the external system, an idempotency key, a transaction identifier or a human decision. Those mechanisms belong to the tool and its environment. Their absence cannot be fixed by a more confident assistant message.\nThere are other failure boundaries worth keeping separate. Cancellation during streaming retains safe interrupted assistant content when available, while failed attempts are recorded differently. A response cut off at the output-token ceiling doesn&rsquo;t simply authorize dispatching whatever partial tool call happened to arrive. A tool error can become a model-visible observation and allow another step; an unrecoverable request error can terminate the turn.\nNone of those paths proves that every task recovers correctly. They tell us where to inject failures and what evidence a test should demand.\nA framework for inspecting the next agent The comparison framework I would reuse has six questions.\nAdmission: What enters the next request? Trace user instructions, repository guidance, dynamic context, tool output and schemas to the actual request boundary. Check whether source and authority remain distinguishable.\nExecution: What can turn a proposed tool call into an effect? Find validation, policy, guards, provider dispatch and sandbox enforcement. A tool hidden from the prompt is not necessarily an operation denied at execution.\nCommitment: When does an observation become authoritative state? Separate live UI output, accepted session events and durable storage. Inspect ordering when concurrent tools finish differently.\nRecovery: What happens after interruption between each pair of those boundaries? Demand an explicit distinction between failure, success, not-started and unknown outcome. Identify the system that can resolve each uncertainty.\nContext continuity: What survives pruning, compaction, model changes and resume? Trace the transformation and its recorded provenance. Check the facts needed for the next decision, rather than judging a summary by how fluent it sounds.\nVerification: What establishes completion? Find actual test execution and its results. A driver stopping because the model emitted no more tool calls is a lifecycle event; it is not proof that the requested bug is fixed.\nThese questions apply to Claude Code, Codex, OpenCode and other runtimes without assuming their implementations match DeepSeek&rsquo;s. The next investigation can hold a task and model constant, vary one boundary, inject a failure and compare recorded effects. That would test a reliability claim. This article establishes the map for doing it.\nIf two agents use the same model but behave differently, which parts of their execution systems explain the difference?\n","permalink":"https:\/\/archit15singh.github.io\/posts\/2026-10-21-inside-deepseek-harness\/","summary":"<p><em>Also available on <a href=\"https:\/\/architsingh.substack.com\/p\/the-model-is-not-the-agent-inside\">Archit\u2019s Newsletter on Substack<\/a>.<\/em><\/p>\n<p>You ask a coding agent to fix a failing test. Somewhere, a model generates tokens. But tokens do not open files, decide which shell command is permitted, preserve a session after a crash, or establish that the test now passes. The execution system has to make those things happen.<\/p>\n<p>That system is the harness. Its decisions determine how reasoning becomes action, what the model sees next, and which failures remain recoverable. To understand an agent&rsquo;s reliability, we need to follow those boundaries in code.<\/p>","title":"The Model Is Not the Agent \u2014 Inside DeepSeek Harness"},{"content":"I want my public writing to make it easier for people to understand the engineering work I care about: AI agents, security, and reliable systems. That means explaining decisions, showing what broke, and leaving enough evidence for someone else to check the result.\nThe difficult part is producing something worth explaining. A publishing system should make room for that work.\nThis is the approach I want to build around my website, GitHub, LinkedIn, and Substack. It starts with a technical question and ends with something another engineer can use. Automation helps with the work between those points. Publication remains my decision.\nStart with a question that can produce evidence \u201cWrite about agent reliability\u201d is too broad to guide an investigation. \u201cWhat happens to an agent&rsquo;s tool calls when its process restarts halfway through a task?\u201d gives me something to test.\nThat question creates several possible lines of inquiry. Does the agent repeat an action that already succeeded? Can it distinguish a failed request from a successful request whose response was lost? What survives in its checkpoint? Which decisions belong in deterministic code?\nA useful result could be a small test harness, a failure trace, and a description of the recovery behavior. Even a negative result matters if the test exposes a limitation someone else might otherwise discover in production.\nThis is a hypothetical investigation, not a benchmark result. The distinction matters. A plausible experiment plan gives me no license to write a measured conclusion.\nI want a backlog of questions at this level of specificity. Each entry should identify the intended reader, the decision the answer would help them make, the evidence required, and the cost of getting it. A topic that needs weeks of infrastructure should compete honestly with one I can investigate using code I already have.\nKeep the claim attached to its evidence A chart with a confident title can hide a weak comparison. Before packaging a result, I need to be able to explain how it was obtained.\nFor an experiment, that means recording the relevant code revision, environment, inputs, baseline, measurements, and failure cases. For an architecture teardown, it means pointing to the code or documentation behind the explanation. An interpretation should be identifiable as an interpretation.\nThe restart investigation, for example, would need a precise definition of a repeated action. Repeating a read and repeating a payment have different consequences. A synthetic tool with a recorded side effect would let me test the recovery behavior without touching a real account. I would also need to distinguish what the agent attempted from what the tool actually committed.\nThose details determine what the result means. They belong in the published methodology, even if the short social post links to a longer explanation.\nExternal research deserves attribution. Firsthand experience needs to be real. If I have only inspected a repository, I should say that rather than imply I operated the system under production load. Private employer information and customer data stay outside the publishing pipeline unless their use is explicitly authorized.\nLeave behind an artifact I want each substantial investigation to improve something that survives the announcement.\nSometimes that will be a repository with a reproducible test. Sometimes it will be a diagram that explains a trust boundary, an annotated trace, or a checklist someone can use during a design review. The artifact should match the question. A repository containing only a README is not automatically better than a clear, well-supported article.\nFor the restart example, I would aim to leave a runnable failure scenario and a short account of what it demonstrates. Another engineer should be able to change the persistence strategy and see whether the behavior changes. That is more useful than asking them to trust my summary.\nAn artifact also makes the limits of the work visible. Readers can inspect the setup, point out an unrealistic assumption, or suggest a harder case. A correction can improve the next version of the experiment.\nGive each channel a useful job The website can hold the full explanation: methodology, findings, limitations, references, and links to the code. GitHub can hold the implementation and reproduction instructions.\nLinkedIn needs a smaller unit. One finding, one useful visual, enough context to understand it, and a route to the underlying work. A PDF carousel makes sense when the explanation depends on a sequence. A single chart or a short text post may do the job better when the result is simple. I don&rsquo;t want to stretch a finding to fill a slide count.\nSubstack can carry a longer synthesis across investigations: what changed in my understanding, which questions remain open, and how the findings connect. At the start, I don&rsquo;t need a separate content calendar for every channel. I need one coherent body of work that can support different kinds of explanation.\nThe factual claim should survive every adaptation. If the experiment covers one controlled setup, the headline cannot turn it into a verdict on all agent systems. If a caveat changes the conclusion, shortening the post cannot erase it.\nAutomate preparation, keep editorial judgment The first version of this system can be a coding agent, a folder of research notes, a small idea backlog, and a review checklist.\nIt can help discover relevant primary sources, propose experiments, organize results, and draft explanations. It can turn a verified finding into a carousel outline or identify places where the prose promises more than the evidence supports. Reproducible benchmarks can run automatically within a defined environment and resource budget.\nBefore anything is published, I want to check:\nCan I explain and defend the central claim? Does the evidence support the wording, including the headline? Are methodology, attribution, uncertainty, and important limitations available? Is the material appropriate to share, and does it sound like me? A draft passing an automated check is still a draft. Scheduling comes after approval of the actual content and destination. Editing a claim afterward means reviewing it again.\nEngagement needs the same care. An assistant can collect relevant discussions and prepare a brief. I should decide where I have something to contribute and write or approve the response myself. Automated comments and bulk messages would put words into relationships I am responsible for.\nMeasure whether the work helps the right people Reach tells me whether something was seen. It cannot tell me on its own whether the work built technical trust.\nI want to record the responses that reveal understanding: someone reproducing an experiment, raising a specific objection, using an artifact, or asking a question that exposes a gap. Professional outcomes matter too, including relevant conversations, collaboration, speaking invitations, and career opportunities.\nA lightweight log is enough initially. For each investigation, record the question, intended audience, artifact, formats used, time spent, observed response, and next decision. Missing metrics should stay missing rather than become guessed numbers.\nFormat experiments need restraint. If I change the topic, hook, visual style, and publishing time together, a better response will not tell me which change mattered. Comparisons across a handful of posts will also be noisy. They can guide the next test without becoming universal rules.\nI also want to account for the hours spent. A system that increases output while consuming all the time available for engineering has failed its purpose.\nBegin with one complete investigation The starting cadence in this playbook is two substantial posts a week, with an optional lighter post. I will treat that as a capacity hypothesis. If producing defensible evidence takes longer, the schedule should move.\nThe first implementation should support one complete cycle: choose a question, investigate it, preserve the evidence, build an artifact, draft the explanation, review it, and publish. Then record what people found useful or confusing.\nOnly after that cycle works do I want to add more scheduling, analytics, or orchestration. A neglected draft folder is already enough infrastructure to maintain.\nThe next thing to build is a flagship investigation with a result another engineer can inspect. Its questions and rough edges should determine what the automation layer needs to do.\n","permalink":"https:\/\/archit15singh.github.io\/posts\/2026-10-21-engineering-first-thought-leadership\/","summary":"<p>I want my public writing to make it easier for people to understand the engineering work I care about: AI agents, security, and reliable systems. That means explaining decisions, showing what broke, and leaving enough evidence for someone else to check the result.<\/p>\n<p>The difficult part is producing something worth explaining. A publishing system should make room for that work.<\/p>\n<p>This is the approach I want to build around my website, GitHub, LinkedIn, and Substack. It starts with a technical question and ends with something another engineer can use. Automation helps with the work between those points. Publication remains my decision.<\/p>","title":"An engineering-first approach to technical thought leadership"},{"content":"As of October 18, 2026, the core idea has been built by multiple research groups, including Microsoft, Google and independent open-source developers.\nThese systems implement a recurring experiment loop: take a Kaggle-style ML problem, generate modeling approaches, train models, evaluate performance, improve their code through repeated experiments and produce solutions.\nThe opportunity isn&rsquo;t inventing this category. It&rsquo;s finding where the existing systems remain inefficient, unreliable, expensive or difficult to operate.\n1. The closest existing projects Microsoft R&amp;D-Agent A research-and-development loop for ML experiments.\nSeparates research (proposing improvements) from development (implementing them). Supports automated Kaggle feature engineering and model tuning, repeated experimentation and LLM-provider integrations.\nGitHub repository \u00b7 Documentation\nThe September 2026 release includes additional fine-tuning, evaluation and UI capabilities.\nAIDE ML A direct implementation of the research-and-code-improvement loop. Generates Python solutions, executes them, branches the solution tree, fixes errors and optimizes an evaluation metric.\nGitHub repository \u00b7 Weco commercial platform\nParticularly useful as a smaller reference implementation.\nGoogle MLE-STAR Uses external research to identify candidate models, then performs targeted code refinements and ablations. It addresses a specific weakness of simpler agents: repeatedly rewriting entire training pipelines.\nResearch paper \u00b7 Engineering explanation\nGoogle reports medals on approximately 64% of MLE-bench Lite competitions.\nMLEvolve Uses multi-agent collaboration, Monte Carlo graph search and experience-driven memory to explore and improve ML solutions.\nGitHub repository\nOne of the closest matches to the proposed multi-agent experimentation architecture.\nKaggle-AutoML-Agents A directly competition-focused implementation with Docker sandboxes, session orchestration, feature search, model training and a Kaggle submission workflow.\nGitHub repository\nReports a top-6.1% leaderboard placement on Spaceship Titanic as of April 2026. That&rsquo;s a project-reported result, not broad benchmark proof.\n2. How good are these systems already? The most useful comparison comes from OpenAI&rsquo;s MLE-bench, which evaluates autonomous agents across 75 Kaggle competitions.\nPublished MLE-bench leaderboard \u2014 percentage of competitions reaching medal-level performance (all splits)\nAgent LLM Medal rate (%) Date Famou-Agent 2.0 Gemini-3-Pro-Preview 64.44 2026-02 AIBuildAI Claude-Opus-4.6 63.11 2026-03 CAIR MARS+ Gemini-3-Pro-Preview 62.67 2026-02 MLEvolve Gemini-3-Pro-Preview 61.33 2026-02 R&amp;D-Agent GPT-5 35.11 2025-09 AIDE o1-preview 17.12 2024-10 Scores from the published leaderboard; reported runs used different models, time budgets and configurations, so these are not head-to-head tests under equal compute budgets. The leaderboard suspended new submissions on April 24, 2026 while it develops a fairer comparison process, so it should not be interpreted as a current global ranking.\nThe implication is substantial: this isn&rsquo;t just a collection of demos. There are already systems with measurable autonomous ML-engineering performance.\nBut medal rate is not the same as reliability on a new private dataset, production readiness or cost efficiency.\n3. Feature comparison against your proposed system Based on publicly documented capabilities, not independent hands-on testing. A question mark means the feature wasn&rsquo;t clearly established.\nProject Autonomous ML loop Multi-agent \/ branching Kaggle support Execution infrastructure Microsoft R&amp;D-Agent Yes Research + development agents Yes Configurable execution AIDE ML Yes Tree search Yes, via task setup Local Python Google MLE-STAR Yes Targeted refinement Benchmark-tested Research implementation MLEvolve Yes Multi-agent graph search Yes Training workers Kaggle-AutoML-Agents Yes Coordinated workflow Direct integration Docker Weco Yes Parallel branch exploration General ML objectives User-owned hardware Notice something important: none of these projects needs Firecracker as its defining innovation. Their key engineering contributions are search algorithms, experiment selection, code generation, evaluation and memory.\n4. Where is the remaining opportunity? Here&rsquo;s my assessment of potential differentiation.\nOpportunity Score Reliable ML evaluation and reproducibility 9\/10 Compute-efficient autonomous research 9\/10 Production ML and security-specific agents 8\/10 Portable, secure execution infrastructure 7\/10 Cross-competition research memory 7\/10 Generic multi-agent Kaggle solver 3\/10 Subjective opportunity scores reflecting differentiation and practical value, not market measurements.\nReproducibility is not just theoretical. An August 2026 Kaggle discussion describes an autonomous agent whose scores varied substantially across eight executions and whose best result could not be reliably reproduced.\nAnd OpenAI&rsquo;s benchmarking guidance explicitly recommends repeated runs \u2014 at least three seeds \u2014 because agent performance can have high variance. Its reference evaluation setup allocates up to 24 hours with 36 vCPUs, 440GB RAM and one A10 GPU per task.\nThat suggests a much more useful optimization target:\nResearch Efficiency = Verified Model Improvement \u00f7 (Compute Cost + Inference Cost)\nwith constraints for reproducibility, stability and safety.\n5. What I recommend building instead I&rsquo;d avoid starting another autonomous Kaggle framework from scratch.\nBuild a benchmark-driven experimentation layer on top of an existing agent, initially AIDE ML or Microsoft R&amp;D-Agent.\nExisting research agents \u2014 AIDE \u00b7 R&amp;D-Agent \u00b7 MLEvolve Your experiment orchestrator \u2014 scheduling, budget allocation, parallel search CPU\/GPU workers \u2014 containers initially; isolated workers with optional Firecracker Immutable evaluator + experiment ledger \u2014 scores, reproducibility, cost, failures Budget-aware next experiment \u2014 feeds back into the orchestrator The first experiment I would run Take five MLE-bench Lite competitions. Run AIDE ML and R&amp;D-Agent with identical compute and inference budgets, three seeds each. Preserve their full execution traces and measure results with an independent evaluator.\nThen implement just one feature: budget-aware experiment selection, which chooses experiments using expected improvement and estimated compute cost.\nCompare against the original agents. If it produces more verified improvement per dollar without hurting reliability, you have a measurable technical contribution. If it doesn&rsquo;t, you have learned that a more elaborate orchestrator isn&rsquo;t justified.\nBefore using competition data, also enforce each competition&rsquo;s terms around external models, data sharing, internet access and submissions. These rules can differ materially between Kaggle competitions.\nFinal verdict Question Conclusion Has autonomous Kaggle solving been built? Yes, extensively. Do multi-agent ML solvers exist? Yes. Do autonomous experiment-improvement loops exist? Yes. Are there commercial implementations? Yes, including Weco. Is Firecracker the missing ingredient? No. Is there room for useful research? Yes, especially efficiency, reliability and evaluation. For an open-source portfolio, I would prioritize a cost-aware, reproducible autonomous ML research engine, with published benchmarks against AIDE, R&amp;D-Agent and MLEvolve.\nFor a commercial product, I&rsquo;d move beyond Kaggle toward autonomous model development and validation for real organizations. Kaggle supplies a convenient benchmark; production ML introduces much harder requirements around data governance, stable performance, deployment and operational risk.\nThe strongest direction is not another AI that trains models. It is an autonomous research system that can demonstrate, with independently reproducible evidence, that its experiments deliver better results for the resources spent.\n","permalink":"https:\/\/archit15singh.github.io\/posts\/2026-10-18-autonomous-kaggle-agents-already-exist\/","summary":"<p>As of October 18, 2026, the core idea has been built by multiple research groups, including Microsoft, Google and independent open-source developers.<\/p>\n<p>These systems implement a recurring experiment loop: take a Kaggle-style ML problem, generate modeling approaches, train models, evaluate performance, improve their code through repeated experiments and produce solutions.<\/p>\n<p>The opportunity isn&rsquo;t inventing this category. It&rsquo;s finding where the existing systems remain inefficient, unreliable, expensive or difficult to operate.<\/p>","title":"Yes, Autonomous Kaggle-Solving Agents Already Exist"},{"content":"An architecture proposal for household coordination, October 2026. This describes a design, not a verified deployment.\nThe goal is to automate the repetitive coordination in your life with a small, durable layer of infrastructure \u2014 without turning personal productivity into another engineering project.\nYou don&rsquo;t need 30 agents, 30 MCP servers or a custom application for every problem. You need one command interface, a few reliable integrations, a memory system, recurring workflows and strict security boundaries.\n1. The operating model Household members \u2014 goals, preferences, decisions, approvals.\nChatGPT Plus \u2014 primary control plane: chat, work, plugins, tasks, research, reasoning.\nHark Pro \u2014 browser tasks and proactive execution.\nInstinct AI \u2014 WhatsApp concierge and real-world errands.\nSystems of record \u2014 Gmail, Calendar, Notion, Drive, finance, government services.\nSecurity, approvals and audit \u2014 scoped access, human confirmation, verified outcomes.\nThe critical detail: this is a logical architecture. ChatGPT, Hark and Instinct do not natively form one coordinated application. Initially, you delegate to each intentionally. Only build automated handoffs when an actual integration supports them.\n2. The 10 workflows worth automating first Ranking is based on expected time savings, frequency, financial value, feasibility and operational risk \u2014 not the number of technically possible automations.\n# Workflow Agent Cadence Priority 1 Email cleanup, organization, follow-ups ChatGPT Daily P0 2 Unified calendar, tasks, reminders ChatGPT Daily P0 3 Family expenses, statements, bills ChatGPT Weekly P0 4 Household logistics and errands Instinct \/ Hark On demand P0 5 Career opportunities and recruiter inbox ChatGPT \/ Hark Daily P0 6 Tax documents and compliance ChatGPT Monthly \/ seasonal P1 7 Household knowledge and documents Notion \/ Drive Event-driven P1 8 Health appointments and routines ChatGPT \/ Calendar Weekly P1 9 Travel administration ChatGPT \/ Hark Event-driven P1 10 Learning, coding and professional growth ChatGPT \/ Codex Weekly P1 I would not start by automating grocery purchasing, every LinkedIn action, or complex multi-agent research. Those can come later.\nThe biggest return comes from eliminating repeated inbox review, forgotten follow-ups, scattered obligations, financial-document retrieval and everyday planning friction.\n3. The India-specific layer This is where a generic US-centric personal agent stack will fall short.\nDigiLocker \u2014 citizen documents Store and retrieve official digital documents such as driving licences, registration certificates and available government-issued records. Use it as a verified-document source, not as a general LLM memory database.\nOpen DigiLocker\nUMANG \u2014 government services hub A gateway for central and state government services, including supported EPFO, utility and administrative workflows. Government reporting listed roughly 2,575 UMANG services as of July 2026; availability differs by department and state.\nOpen UMANG\nIncome Tax Department \u2014 tax records Export AIS\/TIS, Form 26AS and ITR-related information; reconcile it against salary, investments and bank records. AIS supports PDF, JSON and CSV downloads, making it suitable for structured analysis without requiring autonomous tax-portal browsing.\nOpen Income Tax Portal\nAccount Aggregator framework \u2014 financial data India&rsquo;s consent-based Account Aggregator framework permits supported regulated institutions to share financial information with authorized recipients. It&rsquo;s an excellent architectural direction for finance, but not a generic direct API for your personal AI agent. Eligibility and participating institutions matter; AAs do not execute payments.\nGovernment framework\nmParivahan \u2014 transport and vehicle records When you own a car, use the official vehicle and driver services for RC, licence, challans and related records. Your agent can track reminders and prepare actions; government records remain the authority.\nOpen mParivahan\nFor Bengaluru, I&rsquo;d add configurable reminders for rent, BESCOM electricity, water, broadband, gas, vehicle insurance and other actual household obligations. For property owners, add property-tax and municipal compliance; don&rsquo;t create irrelevant workflows if you&rsquo;re renting.\n4. Your seven life domains Instead of having dozens of independent scheduled jobs, organize everything into seven domains.\nMoney \u2014 expenses, taxes, investments, bills.\nCareer \u2014 jobs, engineering, reputation.\nHousehold \u2014 rent, services, shopping, maintenance.\nHealth \u2014 appointments, habits, documents.\nFamily \u2014 shared obligations and planning.\nTravel \u2014 bookings, trips, renewals.\nLife administration \u2014 government records, identity, renewals, documents and subscriptions.\nEach domain gets a single backlog, a small set of connected tools, and clear rules about what may be automated.\n5. The minimum tool stack Layer Tool Decision Intelligence and control ChatGPT Plus Keep Complex web execution ChatGPT Work Use first Complementary browser execution Hark Free tier initially WhatsApp \/ phone errands Instinct Keep if useful Knowledge \/ life dashboard Notion Keep Email, events, files Gmail, Calendar, Drive Primary source systems Passwords and credentials 1Password Recommended Government documents DigiLocker, UMANG Use official services Financial analysis Statement exports + local analysis Start here Notifications Slack + Calendar Keep Custom infrastructure SQLite + Python Only if necessary Do not run an always-on Mac mini just to accomplish this. Most of the initial workflows can run through cloud tools, scheduled tasks and existing integrations. A dedicated home computer only makes sense once you identify workloads that actually require local state, private compute or continuous execution.\n6. Five scheduled jobs, not fifty Consolidate related tasks into a small number of high-level jobs, with internal checks as needed.\nJob When What it produces Daily Life Brief Every morning Today&rsquo;s calendar, urgent messages, pending decisions, household obligations Finance Watch Weekly Expenses, upcoming bills, unusual charges, outstanding documents Career Engine Daily \/ weekdays High-fit jobs, recruiter follow-ups, technical opportunities Household &amp; Family Review Weekly Renewals, appointments, errands and shared tasks Monthly Retrospective Monthly What was completed, what failed, what to stop or improve Existing specialized jobs can remain where they&rsquo;re useful. This is a proposed consolidation, not a request to duplicate or replace them blindly.\nExample: your morning briefing Personal OS \u2014 daily brief (illustrative)\nSchedule \u2014 meetings, appointments, deadlines Inbox \u2014 important replies and unresolved follow-ups Money \u2014 upcoming bills and charges needing attention Home \u2014 shared errands and pending household decisions Career \u2014 best opportunity or follow-up worth acting on Agent actions \u2014 completed, failed, awaiting approval The briefing should show exceptions and decisions, not dump hundreds of events.\n7. Minimal Notion database design I would create one page called Personal OS with only four databases.\nDatabase Fields Tasks Domain, owner, due date, status, priority Recurring Obligations What, frequency, next due, source Decisions Decision, context, outcome, date Agent Runs Workflow, executor, outcome, evidence, next action Store narrative knowledge in ordinary Notion pages. Keep sensitive raw documents in restricted storage, and link to them only when appropriate.\nFor your household, make task ownership explicit: you, your wife, or shared. Don&rsquo;t implicitly share private account data or health information across both of you.\n8. Permission policy: what agents may do Action Scope Mode Read and summarize Emails, calendar, allowed files and public research Auto Organize and classify Apply approved labels, categorize documents, create internal notes Auto Draft external messages Compose emails, recruiter replies and messages without sending Auto Send messages or unsubscribe Predefined trusted rules; review exceptions and new recipients Review Book or purchase Approval of total cost, terms and recipient required Review Tax filings \/ legal declarations Human reviews and authorizes the final submission Human Money transfers \/ new beneficiaries Executed through the bank&rsquo;s secure authorization flow Human Credentials and identity recovery Never delegate OTP\/PIN capture or unrestricted vault access Human The useful design principle is: automate reversible, low-risk actions aggressively; require approval for irreversible or externally consequential ones.\n9. The first 30 days Week 1 \u2014 Establish the foundation Audit existing connections, clean the Gmail backlog, create a unified Calendar\/Tasks view, and build your Personal OS page in Notion.\nSuccess: important incoming information becomes discoverable and actionable.\nWeek 2 \u2014 Household and financial visibility Index recurring bills, consolidate available statements, create expense categories, identify renewals and configure read-only financial analysis.\nSuccess: one household financial overview without opening every bank and card portal.\nWeek 3 \u2014 Citizen and family administration Set up official document access, track applicable government obligations, organize relevant records and create shared household tasks.\nSuccess: no scattered renewal dates, missing documents or repeatedly rediscovered information.\nWeek 4 \u2014 Agent execution and optimization Benchmark ChatGPT Work against Hark on five actual workflows. Test Instinct on real errands. Add outcome verification, remove duplicate automations and measure time recovered.\nSuccess: you know which tool to delegate to without thinking about it.\n10. Measure whether it&rsquo;s actually working Personal automation ROI calculator\nInput Value Repetitive tasks per week 30 Average minutes per task 12 min Reliably automated share 70% Weekly review \/ maintenance overhead 60 min Result Value Net hours saved weekly 3.2 h Annualized time recovered 166 h This is a planning model, not a measured result. It assumes tasks are independent and excludes initial setup cost.\nWhat I&rsquo;d deliberately avoid Don&rsquo;t automate every human interaction. Don&rsquo;t give multiple independent agents access to the same financial or sensitive account without a compelling reason. Don&rsquo;t build a knowledge graph or complex multi-agent platform before a simple Notion dashboard and execution log have demonstrated their limits.\nAnd don&rsquo;t turn personal optimization into an endless stream of notifications. Your system should increasingly operate quietly, escalating only when there&rsquo;s an exception, decision or opportunity worth your attention.\nThe target outcome after 30 days: one morning briefing, one place for commitments, automatically maintained information, a weekly financial overview, reliable career intelligence and a simple way to delegate errands.\nThat&rsquo;s the personal operating system worth building first. Everything else is an incremental capability, not a prerequisite.\n","permalink":"https:\/\/archit15singh.github.io\/posts\/2026-10-18-your-personal-ai-operating-system\/","summary":"<p><em>An architecture proposal for household coordination, October 2026. This describes a design, not a verified deployment.<\/em><\/p>\n<p>The goal is to automate the repetitive coordination in your life with a small, durable layer of infrastructure \u2014 without turning personal productivity into another engineering project.<\/p>\n<p>You don&rsquo;t need 30 agents, 30 MCP servers or a custom application for every problem. You need one command interface, a few reliable integrations, a memory system, recurring workflows and strict security boundaries.<\/p>","title":"Your Personal AI Operating System"},{"content":"The browser looks like the safest place on a computer because it looks like a window. A tab is a page. A page is an app. The operating system is somewhere underneath, doing serious things with files and processes while the browser shows us email, a spreadsheet, and a shopping cart.\nThat picture is old enough to be dangerous.\nI do not mean that a website has become macOS or Linux. A site cannot schedule arbitrary processes, read your disk, or open a socket whenever it wants. The web has spent decades putting useful friction between a page and the machine. The point is narrower, and worse: the browser has become the layer through which we hand out much of the authority that used to sit clearly in the operating system.\nIt holds the sessions for the services that know us. It mediates the credentials that prove we are us. It stores durable application state. It makes network requests under a web application&rsquo;s identity. It asks whether a site may use a camera, microphone, location, clipboard, or local file. It runs untrusted programs from everywhere on the internet and is expected to keep them from one another, from the machine, and from the secrets in the next tab.\nThat is not a document viewer with some APIs bolted on. It is critical infrastructure.\nThe window that became a broker Operating systems do a few boring but consequential jobs. They execute programs, retain state, mediate access to resources, attach authority to an identity, and enforce isolation. Modern browsers do versions of all five.\nThey execute JavaScript and WebAssembly, schedule workers, and hand work to the GPU. They retain cookies, caches, IndexedDB databases, and files a user explicitly chooses to expose. They make HTTP requests, keep live connections, and let service workers sit between an application and the network. They carry sessions and coordinate authentication. They supervise a growing list of requests for access to physical hardware.\nThe interesting word there is supervise. A web application does not talk directly to your camera. It asks the browser, which decides whether the request is eligible, shows a prompt where appropriate, remembers the decision according to its rules, and exposes a constrained interface. The W3C Permissions specification calls these &ldquo;powerful features&rdquo; for a reason: a permission is the user&rsquo;s decision to let a web application use one.\nThe same pattern reaches identity. WebAuthn does not hand a website the private key for a passkey. A relying party asks the browser to mediate an operation with an authenticator; the authenticator keeps the credential and scopes the result to the requesting relying party. The WebAuthn specification is explicit that script never gets the credential itself. The client platform carries the origin to the authenticator and the authenticator incorporates that origin into its response.\nThat is an operating-system-shaped arrangement: one principal asks for authority, a trusted layer presents the choice, and a more protected component performs the sensitive operation. The browser is now the trusted layer in the middle.\nThe browser capability graph is a useful way to see it:\nidentity \u2502 compute \u2500\u2500 state \u2500\u2500 browser \u2500\u2500 network \u2502 storage \/ devices \u2502 security boundaries The graph is not a claim that all these things have equal power. A cached image is not a USB device. It is a reminder that authority moves through the same center. A browser is where a session meets a network request, where a page meets a file picker, where an origin meets a passkey, and where untrusted code meets a renderer process.\nThe boundary people cannot see This is why a browser compromise is not merely an application problem.\nStart with the small version: a stolen session. Many services use the browser&rsquo;s session state to recognize a signed-in user. If someone can act inside that browser context, they may not need to know the account password. They have landed beside the thing that turns a request into your request. The damage is not limited to the page that was open when it happened. The browser is a collection of identity relationships, usually spanning work, banking, source control, health, and personal communication.\nThen add local authority. A page may legitimately have access to a camera during a call, to a microphone while recording, or to files the user selected for a document editor. The browser normally confines that authority to the relevant permission, origin, and interaction. That confinement matters. But it also means the browser is no longer simply representing a remote service. It is brokering access from a remote program to the local machine.\nThen take the worst case: code escapes the browser&rsquo;s own defenses. A browser sandbox escape is serious precisely because the browser sits beside so much authority. It can turn an exploit in a renderer, extension, or another browser component into a route toward the host operating system. Modern browsers invest heavily in making that route difficult. Chrome&rsquo;s Site Isolation, for example, puts pages from different sites into separate processes and sandboxes those processes, adding a line of defense beyond the same-origin policy.\nThe escalation is not a prediction that every compromised tab becomes root. It is a map of why browser security is high-consequence. Sessions, permissions, processes, and host access sit on different rungs. Treating a browser as a harmless layer above the OS flattens those rungs into one comforting picture.\nThe real problem is composition Security conversations often inspect one browser feature at a time. Is this permission prompt clear? Is this API origin-scoped? Is this storage partitioned? Is this process sandboxed?\nThose are necessary questions. They are incomplete because authority composes.\nRead access is one capability. A network request is another. Persistent storage is a third. On their own, each can have a defensible policy. Together they can create an exfiltration path that survives a reload. A credential request can be carefully scoped to an origin, but it still sits in a flow that includes the browser&rsquo;s origin display, the user&rsquo;s decision, an authenticator, a session, and a server-side account. A device permission can be legitimate in a video call and alarming in a page whose identity the user misread.\nThe useful unit of analysis is not &ldquo;does this API have a permission?&rdquo; It is a chain:\nactor \u2192 resource \u2192 authority \u2192 boundary \u2192 composition Who is asking? What resource do they want? Why are they allowed to use it? What stops them going further? What changes when this capability is combined with the next one?\nThat last question is where browser security gets difficult. The W3C&rsquo;s web-platform design principles make the same point from the API-design side: if a user denies access through one API, a site should not be able to obtain what the user believes they withheld through another. The platform cannot infer a site&rsquo;s real intentions from a permission prompt. The browser, the API design, and the website all share responsibility for making the requested authority legible.\nThis is also why &ldquo;the user clicked allow&rdquo; is not a satisfying security model. Consent is a moment in a larger system. The user needs to understand which site is asking, what it wants, and what lasting relationship the browser will create. The browser needs to make the boundary visible. The site needs to avoid designing a path in which the only usable choice is to hand over more authority than its task requires.\nOrigin is not the whole wall The web&rsquo;s most important security abstraction is the origin. It is the rule that stops one site from casually reading another site&rsquo;s data. It deserves its central place. But it is not the only boundary that matters now.\nThere are boundaries between origins, sites, renderer processes, browser processes, extensions, operating-system accounts, and hardware devices. There are also boundaries of time: an interaction that is safe while a user is consciously editing a document can become alarming if its authority quietly persists. There are boundaries of meaning: a user may understand &ldquo;allow camera for this call&rdquo; while missing the distinction between a page, an embedded frame, a related domain, and an extension with broader reach.\nThe browser&rsquo;s job is hard because it is implementing several security models at once. The origin model governs web content. Permission systems govern powerful features. Process isolation contains compromised renderers. Sandboxes reduce the damage of a process that has already gone wrong. The operating system supplies another boundary underneath. Identity systems add their own rules about sessions, credentials, and account recovery.\nWhen those boundaries line up, the browser is remarkably good at letting untrusted code do useful things safely. When they do not, the gap is where a user gets hurt. The gap might be a confused identity, an over-broad extension, a malicious dependency, a session that has more power than its owner realizes, or a vulnerability that crosses an isolation boundary.\nTreat it like infrastructure The lesson is not to stop using browsers for serious work. That would be absurd. The web is powerful because the browser makes general-purpose computing available without asking everyone to install and trust a separate native client.\nThe lesson is to update the threat model.\nIf you build web products, ask what authority your page accumulates across identity, storage, network, and device access. Keep permissions narrow. Make requests legible at the moment they matter. Treat session protection as protection for the relationship, not merely a convenience token. Design the least-powerful path first.\nIf you work in security, follow capabilities across boundaries instead of auditing them in isolation. An origin check, a permission prompt, and a sandbox can each be correct while the composed path still gives an attacker something valuable. Look for the joins.\nAnd if you use a browser for the way most of us now live and work, stop thinking of it as the safe surface above the real computer. It is part of the real computer. It is where much of your authority now lives.\nThat is why the browser deserves the same care we reserve for an operating system: prompt updates, a small extension surface, deliberate profile separation where the risk warrants it, and suspicion toward any workflow that asks one window to hold every identity and every permission at once.\n","permalink":"https:\/\/archit15singh.github.io\/posts\/2026-10-07-the-browser-is-the-new-operating-system\/","summary":"<p>The browser looks like the safest place on a computer because it looks like a window. A tab is a page. A page is an app. The operating system is somewhere underneath, doing serious things with files and processes while the browser shows us email, a spreadsheet, and a shopping cart.<\/p>\n<p>That picture is old enough to be dangerous.<\/p>\n<p>I do not mean that a website has become macOS or Linux. A site cannot schedule arbitrary processes, read your disk, or open a socket whenever it wants. The web has spent decades putting useful friction between a page and the machine. The point is narrower, and worse: the browser has become the layer through which we hand out much of the authority that used to sit clearly in the operating system.<\/p>","title":"The Browser Is the New Operating System"},{"content":"Self-Improving AI Agents: A Recursive Taxonomy An agent that gets better on its own isn&rsquo;t one idea. It&rsquo;s at least six, and they differ by how much of the agent is allowed to change. This post sorts the 2023 to 2026 work into six families, names 109 methods across them, and ranks them all. It&rsquo;s the map.\nTwo questions separate every method here.\nWhat does the agent change about itself? Its prompt, its stored experience, its tools, its own design, its source code, or the world it trains in.\nHow durable is that change? Either it&rsquo;s text the agent reads back later, which I call in-context, or it&rsquo;s a rewrite of weights, code, or environment, which I call structural. In-context improvement vanishes when you clear the buffer. Structural improvement survives a restart.\nAlmost every method below is one cell in that grid. And one mechanism runs through all of them: turn an execution result, a passed test, a self-critique, or a majority vote into a learning signal, and feed it back.\nThe families run from how little the agent touches to how much: from polishing a single answer, up to rewriting the codebase that produced it, and finally to co-evolving with its own training environment. There&rsquo;s a seventh kind I&rsquo;ve left out on purpose, model-centric self-training (STaR, RLAIF, self-play weight updates), where the agent retrains its own weights. Dropping it is why the numbering skips 4 and runs 1, 2, 3, 5, 6, 7.\nHere&rsquo;s how the 109 methods distribute:\nFamily Kind Methods 1. Self-refinement \/ reflection in-context 16 2. Memory-based evolution in-context 23 3. Tool-based evolution in-context 21 5. Automated agent \/ architecture design structural 15 6. Recursive self-modification structural 15 7. Co-evolution \/ open-ended structural 19 Memory-based work leads. Durable, in-context experience is where the most recent research clustered, because it buys cross-session competence without paying to retrain anything.\n1. Self-refinement \/ reflection (in-context) The agent generates output, critiques it in plain language, and retries. It improves at test time with no weight update. This is the cheapest form of self-improvement and the one most systems already ship.\nThe seed method is Self-Refine: generate, feed back on your own work, refine, repeat. Reflexion made it stick by turning scalar feedback into a written reflection stored in episodic memory, used as a semantic gradient on the next episode. CRITIC and Chain-of-Verification point the critique outward: CRITIC verifies against external tools in a Verify, Critique, Correct loop, and CoVe drafts, writes its own verification questions, answers them independently, then revises to cut hallucination.\nThe other half of this family isn&rsquo;t one agent thinking harder but many samples voting. Self-Consistency samples diverse reasoning paths and majority-votes the answer. Best-of-N keeps the best of N candidates by scoring. Multi-Agent Debate has several models argue to cross-verify claims. And test-time compute scaling simply spends more inference on longer chains with per-step reflection, with adaptive variants that hand out that budget by confidence instead of a fixed cap.\nOne honest caveat: iterative revision has diminishing returns after three or four rounds. More loops isn&rsquo;t free accuracy.\n2. Memory-based evolution (in-context) Agents build up experience in an external, durable store and pull it back across tasks. Weights never change; the store does.\nThe canonical example is Voyager, whose skill library is an executable-code repository of behaviors that worked, retrieved and composed for new tasks. MemGPT is the systems take: virtual context paging across working, recall, and archival tiers, memory managed the way an OS manages RAM. Both treat memory as infrastructure, not as a log.\nUnderneath sit the harder problems. What do you keep, and how do you find it again? SelfMem and MEM1 learn the store\/compress\/retrieve\/discard policy itself from feedback rather than hard-coding it. A-MEM and AtomMem fight context pollution, one with agent-driven retrieval, the other by breaking memories into atomic facts with temporal profiles. A cluster of graph methods (experience graphs, GAM, ReaGAN) argue that memory should be a structured causal object, not a flat vector index, so you can retrieve a whole reasoning subtree instead of a paragraph.\nThere&rsquo;s also a prompt-optimization corner here (MemAPO, DelvePO, MemPro) that stores winning templates and error patterns as evolvable programs, and a belief-memory corner (BeliefMem) for agents acting under partial observability, holding candidate conclusions with probabilities and updating confidence as evidence arrives.\n3. Tool-based evolution (in-context) Agents write, test, and refine new tools, or get better at using the tools they already have. If family 2 remembers what worked, family 3 remembers it as a callable function.\nToolformer is the landmark, and it&rsquo;s self-supervised: the model annotates its own corpus with API calls, learning when and how to invoke a tool without human labels. From there the field splits.\nOne branch builds tools on demand. CREATOR abstracts a reusable function from a concrete use so it transfers. CRAFT and TroVE curate validated code snippets with dedup and simplicity metrics so the toolset stays clean. ATLASS closes the loop: decide whether a tool is needed, retrieve or generate it, then set up the environment to run it.\nAnother branch evolves tools at inference time rather than in training. Live-SWE-Agent continuously rewrites its own scaffold online, self-validated. SkillGen and SkillWeaver distill auditable, reusable skills out of trajectories by contrasting successes against failures. A tool is really just a piece of experience that happens to be executable, so every memory question from family 2 comes back here in code form.\n5. Automated agent \/ architecture design (structural) Now the change becomes durable. A meta-agent or outer optimizer discovers, evolves, or synthesizes new agent designs, modules, or workflows, and the result is a new artifact, not a longer context window.\nADAS searches over agent codebases to invent new building blocks, an LLM writing the architecture of the next LLM agent. AgentSquare narrows that to a modular space (Planning, Reasoning, Tool, Memory) and uses an in-context surrogate to predict which combination will work before paying to run it.\nThe prompt-optimization work is the most production-ready slice. DSPy compiles typed modules into few-shot examples and instructions via Bayesian search, and it&rsquo;s widely adopted because it treats the prompt as a compiler target rather than a craft. EvoPrompt does discrete prompt optimization with genetic algorithms. PromptBreeder goes self-referential: the mutation-prompts that edit your task-prompts are themselves evolving. Alongside these, GPTSwarm and EvoAgent generate whole multi-agent systems, one by optimizing the graph topology of agents, the other by mutation and crossover over a single expert.\n6. Recursive self-modification (structural) The agent rewrites its own code, prompts, or architecture, and each improvement raises its ability to improve itself. This is the family everyone means when they say &ldquo;recursive self-improvement,&rdquo; and it&rsquo;s where theory and practice diverge hardest.\nThe theory anchor is Schmidhuber&rsquo;s G\u00f6del Machine: it rewrites its own code only after proving the change raises expected utility. Provably safe, practically unbuildable. What actually shipped is the empirical version. Sakana&rsquo;s Darwin G\u00f6del Machine drops the proof, tests code mutations directly, and keeps improvements by selection, moving SWE-bench from 20% to 50%. SICA edits its own Python codebase after inspecting its own failures, 17% to 53% on SWE-Bench Verified. AlphaEvolve runs an LLM ensemble to generate and score algorithmic candidates, feeding the best back as the next round&rsquo;s seed.\nThis family also carries the only part of the map that&rsquo;s mostly warnings. Self-modifying agents can alter their own safety measures, amplify a misspecified objective a little more each cycle, or collapse into representation drift under unbounded iteration. The safety papers here aren&rsquo;t decoration. They&rsquo;re the reason &ldquo;let it edit itself&rdquo; is still a research setting and not a default.\n7. Co-evolution \/ open-ended (structural) The agent and its environment, curriculum, or opponent improve together. There&rsquo;s no fixed task distribution, so there&rsquo;s no fixed ceiling.\nPOET keeps a population of environment-agent pairs and mutates the environments under a &ldquo;not too easy, not too hard&rdquo; filter, so the curriculum chases the agent&rsquo;s frontier on its own. PAIRED makes that adversarial: a protagonist and antagonist compete while a third agent designs tasks that maximize the regret gap between them. OpenAI&rsquo;s hide-and-seek self-play produced six emergent strategic phases, including tool use, with no reward shaping at all, just competition.\nAround those sit the curriculum machinery (ACCEL editing high-regret levels to hold them at the capability frontier, Prioritized Level Replay picking levels by learning potential) and the quality-diversity search (MAP-Elites keeping the best solution per cell of a feature space) that keeps the population diverse instead of collapsing onto one strategy. The newest entrants (GenEnv, SEAL, COvolve) put an LLM on both sides, generating and mutating the environment in step with the policy.\nWhich of these actually matter I scored every method on four axes and combined them into a 0 to 100 composite:\nRelevance. How directly it embodies self-improvement, versus a general technique borrowed into the field. Influence. How much later work builds on it. Seminality and recognition. Reputation. Venue and lab. A top peer-reviewed venue or a major industry lab outranks a workshop, which outranks an unreviewed preprint. Maturity. Real adoption and reproduction, versus a single fresh preprint. One caveat, and it&rsquo;s the difference between honest and fake precision: these scores are a qualitative rubric, not scraped citation counts. I couldn&rsquo;t verify live citation numbers for 109 papers, many of them 2026 preprints sitting near zero. So the scores encode seminality, venue and lab reputation, and adoption maturity as reasoned estimates. Read them as tiers, not decimals.\nThe landmark tier, top 12:\n# Method Family Composite 1 Toolformer Tools 96 2 Reflexion Self-refine 95 3 Self-Consistency Self-refine 95 4 Voyager Memory \/ Co-evo 94 5 Self-Refine Self-refine 93 6 MemGPT Memory 92 7 DSPy Auto-design 92 8 Multi-Agent Debate Self-refine 90 9 CRITIC Self-refine 89 10 Chain-of-Verification Self-refine 88 11 Darwin G\u00f6del Machine Recursive 88 12 AlphaEvolve Recursive 88 Below the landmarks the field sorts into bands. The Established tier (70 to 79) is where reproduced-but-not-canonical work lives: AgentSquare, SICA, A-MEM, EvoAgent, SkillWeaver, MAP-Elites, PAIRED. The Emerging tier (58 to 69) holds solid recent work that hasn&rsquo;t yet been widely built on. And the Early-stage tier (44 to 57) is almost entirely 2026 arXiv preprints: high topical relevance, unreviewed, not yet cited, scored low by construction rather than by any judgment of quality.\nWhat the ranking says The top is dominated by 2023 and 2024 peer-reviewed work that named a pattern the field then reused. Reflexion, Self-Refine, Toolformer, Voyager, and DSPy worked, and then they gave everyone else a word for the thing. The two most ambitious families, recursive self-modification and co-evolution, each carry a few high-scoring landmarks (Darwin G\u00f6del Machine, AlphaEvolve, POET) sitting on top of a long tail of fresh, unreviewed preprints.\nHigh relevance and low maturity is the signature of a field moving fast. The safe, in-context families are mature and shipping. The structural families, the ones where an agent genuinely rewrites itself or its world, are where the interesting risk lives, and most of that work is younger than a year.\nIf you&rsquo;re building an agent today, the honest reading is: reach for families 1 and 2 first, because they&rsquo;re proven and cheap, use family 3 to make hard-won behavior durable, and treat families 5 through 7 as the research frontier they still are.\n","permalink":"https:\/\/archit15singh.github.io\/posts\/2026-09-22-self-improving-agents-taxonomy\/","summary":"<h1 id=\"self-improving-ai-agents-a-recursive-taxonomy\">Self-Improving AI Agents: A Recursive Taxonomy<\/h1>\n<p>An agent that gets better on its own isn&rsquo;t one idea. It&rsquo;s at least six, and they differ by how much of the agent is allowed to change. This post sorts the 2023 to 2026 work into six families, names 109 methods across them, and ranks them all. It&rsquo;s the map.<\/p>\n<p>Two questions separate every method here.<\/p>\n<p><strong>What does the agent change about itself?<\/strong> Its prompt, its stored experience, its tools, its own design, its source code, or the world it trains in.<\/p>","title":"Self-Improving AI Agents: A Recursive Taxonomy"},{"content":"Moving from Senior Engineer toward Staff or Principal changes the scope of the job. Technical decisions increasingly depend on coordinating teams, resolving disagreements and choosing which problems deserve attention.\nThis guide brings together practitioner frameworks for that transition. It asks what changes in the work and which practices you can try on your next project. The advice needs to be adapted to your organization; titles alone say little about the responsibilities involved.\nStart here This is a reference guide; you do not need to read it in order. For a short route, read leadership without authority, the four archetypes, then the operating model in fourteen lines.\nIf you are leading a project now, start with the project playbook. If you are deciding how to spend your time, use time, attention and the network. Pick one practice to test in your next working week.\nThe core reframe: leadership without authority Beyond Senior, technical depth remains important, but more of your impact depends on decisions and work shared with people who do not report to you.\nOne principal engineer put the bluntest version of it: &ldquo;Once at a certain level, all problems are solved by people. There is no such thing as &lsquo;purely technical problems&rsquo;&hellip; influencing people to do what we want is harder still.&rdquo; And the standard list of senior skills leads with: &ldquo;How to run a meeting, and no, being the person who talks the most in the meeting is not the same thing as running it.&rdquo;\nThe transition can be difficult because producing good code no longer captures the whole job. One account of engineering maturity puts particular weight on collaboration: &ldquo;the degree to which other people want to work with you is a direct indication on how successful you&rsquo;ll be.&rdquo; That is one useful lens on the role, alongside technical judgment and the outcomes of the systems you help build.\nThe four archetypes Before you optimize your workflow, you need to know which kind of senior IC you are. The field replaces the vague term &ldquo;staff engineer&rdquo; with four recognizable archetypes. This is not a personality test. It is a way to know which type of high-impact work energizes you, and which one your org actually needs.\nTech Lead steers complex projects, aligns the team with cross-functional goals, and owns technical vision for a single project. Architect owns the technical integrity of a domain over time, aligning architecture with business outcomes. Solver is the person pulled in when the hardest problem will not die. They grind it to resolution and hand it to a team to maintain. Right Hand is the strategic advisor to senior leadership, working problems at the intersection of technology, business, and organization. Your practice: identify which archetype matches your current work, then get honest about whether it is the one your org rewards. Being a Solver in an org that rewards Architects is a source of mismatched expectations.\nTwo caveats matter when applying these archetypes:\nThese are organizational-design tools, not relationship coaches. Most of this material is systems thinking: &ldquo;given an org of this shape, here&rsquo;s what breaks.&rdquo; The interpersonal layer, the hard conversations and motivation, is thinner. Get that elsewhere. Not every org needs every archetype. Staff roles &ldquo;come in a lot of shapes, but not all orgs will need all kinds.&rdquo; Role-fit beats brute-force title-chasing. And Senior is a tenure level: you don&rsquo;t have to go further to be successful. The pillars of technical work If the archetypes answer who you are, the pillars answer what you actually do. Most serious technical tracks rest on a small set.\nBig-picture thinking. Understand the context across teams so good decisions happen before they become costly. &ldquo;Good decisions need context&rdquo; is the entire philosophy. This is where being the glue lives: teams left alone settle into local maxima, solving only their own problem. The glue person holds the cross-team context and stops the org from optimizing the wrong thing.\nProject execution. Take on the ambiguous, messy, cross-org projects everyone else avoids, and do &ldquo;just enough work on them to make them manageable by someone else.&rdquo; The brutal reframe here: &ldquo;the agreement is the work.&rdquo; Ideas are cheap. Getting humans to agree on what to do, then deciding, is the actual job.\nLeveling up others. Be a force multiplier. &ldquo;Scale yourself by writing and growing others.&rdquo;\nSetting the standard. The pillar this field&rsquo;s other tradition adds is the one that shows up last in most write-ups and matters most in a messy org: you define what good engineering means here. Not by writing a values poster, but by becoming the thing other people&rsquo;s behavior gets measured against. The job has two halves. The explicit side is mechanical: leave thoughtful comments on code and designs, hold a high bar for what actually deploys, and when a failure mode keeps recurring, write the guideline that kills it so the argument stops happening by hallway. The implicit side is the one you can&rsquo;t turn off. The clearest signal of what your org truly values is not the values page; it&rsquo;s what gets people promoted. If your principles say reviews are thorough but the senior engineers approve pull requests without reading them, everyone else will rubber-stamp too. What you do when you&rsquo;re tired, when a deadline is looming, when the author pushes back, is the standard. That&rsquo;s the unsettling inheritance of the title: like it or not, you are setting the engineering culture one decision at a time, and you shape the company every day just by how you behave. Setting it well does not require being the loudest or most visible person in the room. The quiet leaders who make good decisions consistently pull it off just as reliably, and in doing so they prove to the other quiet people in the org that there is room for them to lead that way too. One decision tactic stands out, borrowed from the IETF: seek consent, not consensus. Do not ask &ldquo;Is everyone OK with choice A?&rdquo; Ask &ldquo;Can anyone not live with choice A?&rdquo; Rough consensus, where &ldquo;lack of disagreement is more important than agreement,&rdquo; lets a decision move in a day instead of a quarter.\nThe most underrated lever of setting the standard is who you let in the door. Every hire you approve is a multi-year decision about the floor of the org, so interviewing well is a staff-plus skill, not a chore to dodge. The uncomfortable truth is that your best engineer is often your worst interviewer: brilliant at code, untrained at probing judgment. The bar-raiser idea worth stealing is not the title, it&rsquo;s the incentive. A bar raiser is the interviewer from outside the hiring team whose only stake is accuracy, because they are not trying to fill a headcount, and without that detachment teams under pressure systematically lower their standards. You can hold that line from your seat simply by refusing to let the room&rsquo;s urgency or confidence decide. Chair the debrief rather than vote in it, because otherwise the loudest person wins. Walk the room through what the candidate actually demonstrated, surface the dissenting read, and force the decision to be defended on evidence rather than momentum.\nTwo failure modes are worth naming so you don&rsquo;t reproduce them. The first is the &ldquo;someone like us&rdquo; trap: loops that select for whether the candidate projects the same confidence as your existing seniors, which quietly turns hiring into a club that admits people who resemble the members. The second is &ldquo;not better than me&rdquo;: earlier-career interviewers anchor a senior candidate&rsquo;s capability to their own level and undervalue genuinely strong candidates. If you catch either pattern in a debrief, name it. And when you do interview, write feedback as if the decision will be made by someone who was never in the room, because for senior loops that is exactly what happens, and weak written feedback sinks an otherwise strong hire.\nCode review as daily standard-setting. Code review is the one staff-plus activity that happens every day, leaves a written record, and shapes the codebase while simultaneously shaping the people who touch it. It is also the one most senior engineers never graduate from doing the way they did at Senior. The shift: stop doing line-by-line reviews of the whole diff. You don&rsquo;t have the context to catch team-specific domain bugs as well as the team does, and trying to makes you a slower, worse reviewer than they would be. Instead, focus where your vantage point is unique: does this change follow the architecture the org is converging toward, or does it quietly fork it? Does the public API this creates work for someone who has never seen the implementation? What happens at 2 a.m. when this breaks and the on-call engineer has never read the PR? These are questions only someone who sees across teams can ask, and they are the ones that prevent problems nobody else would catch until they ship. The discipline is to mark clearly which comments are blockers and which are suggestions, because a staff engineer who withholds approval on personal taste trains people to route PRs around them. When you approve with comments, say why you trust the change is safe despite your concerns, so the author knows the difference between &ldquo;I would do it differently&rdquo; and &ldquo;this will cause an incident.&rdquo; Every review comment you leave is a public artifact. People remember the review where you explained why a pattern matters, not just that it should change. And the relationship mechanic matters: if you are new to the team, spend the first months asking questions in reviews rather than prescribing answers. Build trust before you start setting the bar, because a stranger&rsquo;s critique lands differently than a colleague&rsquo;s.\nThe actual job description The closest thing the field has to a real job description for this transition is a list of skills a senior engineer needs beyond coding. The two dozen items cluster into four things you must become good at:\nCommunication and coordination. Run a meeting, write a design doc and drive it to resolution, communicate status to stakeholders, explain things to senior people too embarrassed to admit they don&rsquo;t understand. Influence without authority. Get another team to adopt your solution instead of writing their own. Get another engineer to help you in a way that makes them feel appreciated. Get your ideas heard without making people feel threatened. Listening and self-management. Listen to others&rsquo; ideas without feeling threatened. Take negative feedback gracefully. Give up your &ldquo;baby&rdquo; project. Teaching and sponsorship. Help someone get promoted. Teach another engineer to care about the thing you care about. And the definition of a tech lead is worth etching in stone: it is &ldquo;not a point on the ladder, but a set of responsibilities,&rdquo; whose core is &ldquo;the willingness to step away from the code and figure out how to balance your technical commitments with the work the whole team needs.&rdquo;\nThe project playbook The single biggest gap in most senior-to-tech-lead material is that it tells you to &ldquo;own projects&rdquo; without telling you what owning a project actually involves day to day. Here is the operating core, and it reads less like philosophy and more like a job description.\nEvery consequential project you lead runs on a fixed skeleton, whether or not you formalize it:\nThe collaboration framework. Establish early how the work is broken down, how the team coordinates, and where the seams are. Ambiguity about process is what turns into late, tangled delivery.\nThe risk list. Maintain an explicit, living list of what could derail delivery \u2014 dependencies, unknown technologies, scope creeping in. Naming a risk out loud is most of the way to managing it.\nStatus in stakeholder language. When you report, speak in the units stakeholders care about: milestones, progress, risks, scope, expected completion. Not implementation detail. This single habit is what separates engineering communication from leadership communication.\nTeam focus. Protect the team&rsquo;s attention from the endless parade of tangential demands. &ldquo;No&rdquo; said by a tech lead to protect delivery is leadership, not obstruction.\nDelegation. Hand pieces of the project to others \u2014 not just tasks, but the responsibility and visibility that come with them. A project you delegate well is a project you&rsquo;ve grown people on.\nThe craft is in how you hand off, because a task-assignment is not a delegation. The single biggest distinction: fully hand it over. There is a real difference between &ldquo;can you work on this&rdquo; and &ldquo;you own this now,&rdquo; and if you keep attending the meetings, or keep an unglamorous slice for yourself &ldquo;to make sure it goes right,&rdquo; you never actually delegate, you just get help with your project. Say the words that make the ownership explicit, and give the new owner the visibility: route the stakeholder questions to them, not to you, and let them hold the point in the room. Then support from behind. Treat a wrong turn in a delegated project as an opportunity to coach privately rather than taking it back, and answer the owner&rsquo;s questions fast, because your speed here is what keeps them coming to you before problems harden.\nThree more mechanics separate delegation that grows people from delegation that just moves work. Transfer authority with the task, not just the work, and say how much: tell the owner which decisions are theirs without asking and which ones you want to weigh in on, because ambiguity about authority is what breeds both micromanagement and overreach. Delegate to the person who would grow most, not the one who is already best at it; your strongest engineer does not need more practice running projects, your developing one does, so match the handoff to the growth goal even when it is a slightly messier bet. And put a wrapper on the messy part: do not overpackage everything into a cleanly wrapped gift, because a colleague does not learn much from a solved problem, but a messy, unscoped project with a real safety net is how someone learns to build their own judgment. One caution that keeps delegation healthy on the receiving side of the table: when people keep bringing you their problems to solve instead of their decisions to review, that is reverse delegation, and the fix is to coach them to bring you a recommendation and the reasoning, not a request for you to do the thinking.\nThe mental model that frames all of this: take the ambiguous, messy, cross-org project nobody wants and do just enough work on it to make it manageable by someone else. You are not there to do all the work. You are there to make the work doable by the team, and to carry the coordination that nobody else will.\nThen comes the estimate, and most tech leads are bad at it in a specific, fixable way: they are optimistic because they plan from the inside out, breaking the plan into tasks and adding up the ideal time for each. That inside view is what the planning research calls susceptible to systematic optimism, and it is not a discipline failure so much as a cognitive one. The corrective is to take the outside view: before you trust your bottom-up number, ask what similar projects have actually taken. A platform migration or a cross-team feature is rarely the first of its kind, and past projects almost always cost more and ran longer than their own original estimates, for reasons that almost never come up in a task breakdown: shifting requirements, integration surprises, key people leaving, the org&rsquo;s usual friction. The outside-view discipline is to build a rough reference class from similar completed work and use it to de-bias the estimate, even crudely. When you cannot, simply remembering that projects like this one overshoot by a predictable margin beats re-committing to a number you know is wrong. The honest estimate is rarely what anyone wants to hear, and that is exactly why it is a leadership act: a stakeholder who has been burned by two quarters of missed dates will trust the tech lead who flags the risk and quotes a range or a realistic date over the one who hands back a confident number that every prior project of this shape has blown past. Quote the uncertainty as well as the point. &ldquo;It will ship in the next three to four months&rdquo; tells the business more than &ldquo;it ships in March,&rdquo; and it is the one you can defend when March becomes April.\nOne honest expectation to set: the boredom threshold is real. Much of project leadership is bureaucratic overhead \u2014 status updates, alignment meetings, unglamorous follow-ups. That overhead is the job. If you find it beneath you, you will quietly stop being a tech lead and go back to being the senior engineer only you could be.\nThe operating playbook This is the dense core: how you actually spend your days once you&rsquo;re past Senior.\nWork on what matters The clearest prioritization framework here is a list of traps to avoid.\nSnacking is easy, low-impact work that feels productive. Gloriously rewarded by everyone except reality. Preening is low-impact, high-visibility work. The seductive one, because many orgs conflate visibility with impact. Doing it well requires near-invulnerability to criticism, and it rots your real work. Chasing ghosts means investing in large projects because they echo your previous company&rsquo;s problems, not your current one&rsquo;s.\nInstead, work where there is both room and attention: priorities that will matter but aren&rsquo;t yet swamped. Swarm existential problems when they are existential, but don&rsquo;t pile onto everyone&rsquo;s top priority. And the highest-value, most-neglected place to spend time is growing the team around you. Mentoring and coaching beat hiring for engineering velocity, and it will outlive your tech specs and pull requests as your legacy.\nTwo more moves here are easy to skip and hard to regret.\nEditing. Most projects are one small change, one quick conversation, one unblock away from succeeding. With your relationships and context, you can shift outcomes with ounces of effort. And finishing things, turning a project from risk to asset, is always time well spent.\nWhat only you can. The work that simply won&rsquo;t happen if you don&rsquo;t do it is your single biggest opportunity. Expect this category to get narrower and deeper as you advance.\nUnderneath all of it sits the discovery habit, and it is the thing most people never learn: you have to source the problems, not wait for them. Blocking out calendar time to &ldquo;think strategically&rdquo; rarely produces anything. The move that works is to act like a sponge. Absorb the stream of day-to-day noise, the complaints people make in meetings and review comments and the hallway, and let the problems pile up in the back of your head instead of acting on the first one that excites you. A loud team&rsquo;s urgent request can evaporate next quarter, and you&rsquo;ll burn weeks on a thing nobody still needs. The pattern worth acting on is the one that shows up again, independently, on a different team, until the connections between separate complaints start clicking and several awkward requests collapse into one thing nobody asked for. And don&rsquo;t take requests at face value; people ask for a solution to a problem they never name, so keep digging until you find the root issue they&rsquo;re actually pushing against. The highest-yield thread to pull is usually the one its owner swears is a single special case.\nTwo cautions keep this honest. The common shape you&rsquo;re seeing is a hypothesis, and elegance is not evidence; the projects where the click feels strongest are exactly the ones worth pressure-testing before you commit, sometimes by building a throwaway prototype to check whether the two problems you think are one really are one. And the loop feeds itself. Solve someone&rsquo;s real problem and they remember, and bring you into earlier conversations with other people facing related pain, and your view of the org widens, and the next pattern gets easier to spot. That compounding is why a staff engineer&rsquo;s listening is a job skill, not a personality trait.\nThe moment this habit matters most is when you are new, and it is where newly-minted staff engineers fumble the earliest. The instinct in a new scope is to demonstrate value fast, and the pressure is acute, so the most common first mistake is moving too quickly, proposing sweeping changes in your first weeks. That signals you don&rsquo;t respect what came before you, and it alienates the people who built the existing systems, the very allies you need. The counter-move is to treat your first stretch as reconnaissance: listen before you prescribe, and assume there is a reason for the org&rsquo;s accumulated habits before you assume there is a flaw. Map who actually holds influence beyond the org chart, and notice who people go to for help when something hard lands, because those informal leaders are the ones you&rsquo;ll need as allies. Read the recent design docs and postmortems and PRs even when they aren&rsquo;t aimed at you, so the map is built on what actually happened rather than what the roadmap says should have. Credibility here is a scarce resource: being hired and trusted on paper is credit, not credibility, and credit runs out fast if you spend it wrong. Earn the real thing by listening first, delivering one visible early win, and following through on every promise no matter how small. And do not apologize for your presence. You were hired for a reason, so speak as if you belong, but spend the authority you&rsquo;ve been granted on understanding before changing.\nThe structured version of this first stretch runs in three phases. Days 1 through 30 are investigative. Meet 1:1 with every tech lead and engineering manager in your area, with your key product and design counterparts, and with a few senior ICs outside your immediate team. Ask the same three questions in each: what do you care most about, what are you most worried about, and what would you change if you could? The pattern across answers tells you more than any single response. Read the architecture docs, the postmortems, the rejected RFCs; nothing teaches production reality faster than reading how something went wrong. Ship one small visible change early, not for impact but for proof-of-cycle: clone, edit, test, PR, merge, deploy. The point is to complete the development loop and prove you can navigate the environment, not to claim context you do not yet have. Days 31 through 60 are about a thin slice. Pick one narrow, high-value problem and solve it well. Not a platform overhaul; something specific enough to finish, visible enough to be noticed, and impactful enough to matter. Measure before and after so you have data, not claims, and share the results early with a short memo. This demonstrates your judgment in practice rather than in theory, gives you a reason to interact with people across the organization, and creates the first evidence that your involvement produces better outcomes. Days 61 through 90 are about expanding and institutionalizing. Document what you learned for the next person who joins, expand the thin slice into a proposal for broader adoption, and have an explicit career conversation with your manager about what operating at your level looks like in the new structure. By day 90, you should have a body of influence you can point to, relationships that produce results, and a clear view of the highest-leverage technical areas for the next year. The trap that kills this plan is staying in execution mode: writing code, fixing things directly, being the person who implements rather than the person who shapes. A staff engineer who is mostly writing code is a very expensive senior engineer.\nExpand your surface area The most common pattern of stalled staff-plus careers is that the engineer keeps doing the same kind of work, only more of it. The move that breaks the pattern is proactive surface-area expansion: seeing an emerging need that nobody owns yet, and stepping into it before anyone assigns it.\nThe mechanics look simple and they compound fast. Start by experimenting in an adjacent area that overlaps your current scope. A performance engineer who notices the organization is struggling with AI adoption starts prototyping tooling internally. A platform engineer who sees teams drowning in repetitive reporting builds a shared measurement framework. Then share what you find: seed a Slack channel, write up what worked, offer to help a neighboring team. The channel that starts with five people becomes a community of practice; the audit you ran for one team becomes a pattern you pitch to three more.\nThe key distinction from &ldquo;visibility&rdquo; or &ldquo;work on what matters&rdquo; is that you are not just choosing from the work that already exists. You are creating new surface area for yourself by identifying needs the org hasn&rsquo;t named yet. Nobody asked the Pinterest engineer to become &ldquo;the AI person&rdquo; or to own developer-experience metrics across five teams. He started experimenting, shared the results, and the opportunities followed. The initial act is small: a prototype, a channel, a short write-up. The compound effect is structural: you become the person the org reaches for when a new problem lands, and that pattern of being pulled in earlier and earlier is the mechanism by which scope expands without title-chasing.\nOne caution keeps this honest: surface-area expansion only compounds when the thing you build actually gets used by others. A side project nobody adopts is a hobby, not a scope expansion. The test is whether other teams hook into what you built without asking you to do it for them.\nBuild systems that run without you The deepest form of compounding impact is building infrastructure that other people use without needing you in the loop. Not infrastructure in the systems sense; infrastructure in the operating sense: measurement frameworks, reporting pipelines, community channels, decision templates, review processes.\nThe pattern that works: identify a recurring question nobody answers well, build the machine that answers it, then make the machine easy for others to extend. A developer-experience dashboard that pulls weekly metrics, posts a formatted report to Slack, and lets any team hook in a new metric by adding a single config file is worth more than a hundred individual performance audits, because it scales without your time. A community channel you seed with value runs itself once enough people contribute. A decision record template that teams actually adopt propagates your thinking into rooms you never enter.\nThe discipline here is resisting the urge to be the expert who runs the system. Once it works, hand it off. Let someone else curate the weekly report. Let a team own their section of the dashboard. The measure of success is whether the system still works on a week you are on vacation. If it does not, you built a tool, not infrastructure. If it does, you have multiplied your impact by the number of people who depend on it.\nGet invited one scope level up The fastest way a staff engineer stalls is being consistently absent from the conversations that decide priorities. Strategic conversations happen at every level, and who is invited determines who actually steers. The uncomfortable truth about engineering is that you ride the bottom of the funnel: problems surface through commercial and support teams, move through product, get filtered by leadership, and only reach you as implementation detail. By the time it lands on your desk it is too late to influence it. The move is to deliberately move up-funnel, so you find out about problems early enough to shape them instead of just building whatever arrived.\nGetting invited is rarely about luck. It is a set of small, repeatable moves. First, find out where the important conversations happen: ask your manager, or your manager&rsquo;s manager, or the product director, &ldquo;Where do you get the strategic context you use to make decisions? What meetings are most useful, and could I join any? Whose posts do you always read?&rdquo; Then adopt the outward curiosity of a beginner in the parts of the business that are not your day job. An engineer who ships deliveries now and then learns how the courier business actually works and becomes the only person in engineering leadership a whole operations team knows by name. That context is a scarce asset few engineers hold, and it buys you a seat.\nThe other half is your internal brand: the words that jump to people&rsquo;s minds when they think of your expertise, the topics you&rsquo;d be called on for. Spend some of your energy deliberately building a reputation in a niche the org is moving toward. When an opportunity appears, say yes more often than your instincts suggest, but say yes to the right shape. The rubric that keeps this from becoming &ldquo;the person who says yes to everything&rdquo;: prefer work that is part of a planned initiative over business-as-usual; choose things that grow you rather than things you are already good at; consider the relationship it builds with someone new; and note the precedent, because every yes makes people more likely to bring you the next, better thing. You do not have to answer yes or no on the spot; &ldquo;potentially, tell me more&rdquo; and &ldquo;keep me in the loop&rdquo; are legitimate answers that buy you time to sense whether it is worth it. Treat opportunities probabilistically. A fair share will go nowhere, and that is fine. The compounding happens across many tries, not within any single one.\nCreate space for others The counterintuitive idea here is also the correct one: the best measure of your long-term success is that the org benefits from but doesn&rsquo;t rely on you. &ldquo;A good discussion is, in this new world, one that it turns out you didn&rsquo;t need to attend.&rdquo;\nThat idea has a concrete operational form most staff engineers never run: actively managing your own bus factor. Ask yourself the honest question, if you took an extended leave or moved on today, what breaks, and who could step in? The uncomfortable truth is that being the only person who knows how a system works is not job security, it is a trap. It locks you to the maintenance you resent, blocks you from the new work that grows you, and quietly tells leadership you cannot be promoted out of the role they rely on you to hold. The counter-move is to treat your own succession as a standing project. Identify two or three engineers who could grow into your scope, not one, because people&rsquo;s interests shift and a single designated successor is a plan with a single point of failure. Give them progressively more of your decisions and visibility, the way you would delegate a project, and document the decisions you make so the reasoning survives you. And frame the whole thing for what it is: sharing the load is not a demotion, it is what frees you to take the next level on.\nThe people half is only one side; the work itself should be a gift to whoever comes next. Every time someone leaves, the org loses institutional knowledge, and eventually there is complete turnover, so the durable move is to leave the environment in a state that &ldquo;just works&rdquo; for the next person even though you have no idea who they are. Write tests that let the next engineer refactor without fear of breaking things. Follow the style guide so the people who copy your approach inherit good habits instead of your shortcuts. Leave a note on the decision, not just the code, because future-you and the stranger after you need the why that the diff cannot hold. Think of it as sending gifts to a future version of your team: most of the reward lands after you have moved on, and that is the point. The systems you build and touch will still be in use in five or ten years, and each component shapes the ones that follow, so optimizing only for the current quarter&rsquo;s velocity at the cost of the next person&rsquo;s is trading the thing that lasts for the thing that does not. Plant a few seeds you will never see grow; that is how impact outlives your direct involvement, and it is the literal substance of leaving a system in better shape than you found it.\nTechniques: shift toward asking questions instead of giving answers, pull in exactly one non-participant at a time, volunteer to take notes (it is a leadership act, not a demotion, and it frees a real notetaker to contribute), circulate decisions early before they crystallize, separate style feedback from substance feedback (stop giving style notes that won&rsquo;t change outcomes), and the big one: change your mind. If senior leaders never change their minds, everyone learns to correlate bluster with success.\nSponsor, don&rsquo;t merely mentor Mentorship gives advice; sponsorship gives opportunity and visibility. When critical work comes to you, your first question must become &ldquo;who could be both successful with and grown by this work?&rdquo; Then scaffold it for their success and let it be theirs, including letting them take an approach you wouldn&rsquo;t. Rule of thumb: keep a sponsorship journal and sponsor someone at least a few times a month, but also make sure you still do some direct technical work yourself.\nNew tech leads tend to collapse four distinct leadership modes into one and reach for the easiest. Keep them separate in your head:\nMentoring \u2014 give advice drawn from your experience. Cheap, safe, and the least useful for the other person&rsquo;s growth. Coaching \u2014 help someone reason their way to their own answer instead of handing them yours. Slower, but it builds the muscle. Sponsoring \u2014 spend your own credibility to create opportunity and visibility for them. The scarcest and most growth-producing, because it risks something of yours. Giving feedback \u2014 change or reinforce behavior. The direct lever, easy to get wrong, essential to get right. What those four modes share is an unspoken variable that decides whether any of them lands: how much direction versus how much support you give the person in front of you. The situational-leadership model makes it a deliberate choice instead of a default. Diagnose, then match. For each task someone is about to take on, size up their competence and their commitment, and both of them separately, because a senior engineer learning a brand-new domain is a beginner again and a capable engineer who recently lost confidence is not the same person as one who was never good. A person who is new to the task and unsure gets direct instructions, exact steps, deadlines, checkpoints, and close supervision; that is not micromanagement at this stage, it is the scaffolding that lets a beginner learn fast. Someone with some skill but shaky commitment gets coaching, direction plus explanation, structure plus encouragement, their input solicited while you still hold the shape. Someone who is capable but low on confidence gets supporting, less instruction and more involvement, obstacles removed, confidence built, decisions shared. And someone who is both competent and committed gets delegation, the outcome and the guardrails named and then left to run, reviewed at milestones. The discipline is the diagnosis and the re-diagnosis. Diagnose at the level of the task, never the person, so you are not labeling a whole engineer as &ldquo;low maturity&rdquo; and treating them as a child forever. And re-check as people progress, because the style that grew someone at month one is the ceiling that suffocates them at month six. The two most common failures are handing a strong performer autonomy-and-then-leaving-them-to-drown when they quietly needed more structure, and micromanaging a veteran who has earned the room, both of which read instantly to the person on the receiving end.\nThe pattern to watch for: people who are senior but not advancing often mentor everyone and sponsor no one. Sponsorship is how careers actually get made \u2014 by others spending social capital on you, and eventually you on them. Giving someone a visible, developmental assignment is worth more than a year of advice.\nWhen the relationship is the softer, standing kind, a few mechanics keep the sessions from drifting into coffee that feels productive and teaches nothing. Set a goal for each meeting in advance, however small, so you are both pointed at something. Teach the person to ask specific questions, because most early engineers ask vague ones and then leave with vague answers; be direct when a question is too wide and name what a sharper version looks like. Have them close the session by documenting the takeaways and the action item, so the learning does not evaporate the moment the call ends and you have a record of what was discussed next time. And keep an honest amount of direct technical work of your own in the mix, because a mentor who only ever gives feedback and manages falls out of touch with the ground the mentee stands on, and the advice starts to miss.\nBecause &ldquo;giving feedback&rdquo; gets named and then dropped, here is the mechanism. Feedback lands when it is a camera recording, not an interpretation. Most people fail at the behavior step, offering &ldquo;you were dismissive&rdquo; (an interpretation, which invites an argument about character) instead of &ldquo;you moved to the next agenda item while Priya was still speaking&rdquo; (a behavior, which gives the person something they can act on). Anchor it in a specific situation, describe the observable behavior, then name the impact: what it cost the team, the decision, the trust. The impact step is the one everyone skips, and it is the part that makes the feedback worth acting on. Deliver a single message at a time. Deliver it soon, and privately. And for the corrective kind, close with a request for the behavior you want instead. Use the same structure for praise, because if you only formalize the criticism, the team learns to associate structure with getting punished. If you&rsquo;re on the receiving end, the counterpoint matters equally: ask until you understand the behavior and the impact, and resist the urge to explain away the mechanism the moment it feels unfair.\nStay aligned with authority This is the one most ambitious ICs resist, and it is the one that decides whether they get the title at all. Your organizational authority flows from alignment with your direct manager, who is your bestowing sponsor. &ldquo;To lead, you have to follow.&rdquo; People who make the jump don&rsquo;t fight their manager&rsquo;s initiatives. They make their own work advance the manager&rsquo;s goals, so the manager becomes a willing advocate.\nWithin that alignment, the cleanest way to keep the relationship productive is to settle the technical ownership split early, because ambiguity about who owns what is what turns a good partnership into a turf war. The division that works: you own the technical case for every option on the roadmap, and the manager owns the final prioritization call. When the team is choosing between approaches, your job is to make each option&rsquo;s technical merits, costs, and risks legible; the manager&rsquo;s job is to weigh those against headcount, business context, and sequencing you don&rsquo;t have. You both own the technical roadmap as the shared artifact, but neither one gets to silently decide the other half. If a new request lands that you think misprioritizes the build, treat it as a problem to be framed with trade-offs, not a mandate you either obey or resent. That framing respects both your authority over the technical case and the manager&rsquo;s over priorities, and it keeps the discussion honest instead of personal.\nThe partner relationship cuts the other way too: part of being a good staff engineer is giving the manager and the team the confidence to make technical calls without you. The engineers who are most senior in title are often the ones most reluctant to let a decision happen without them, and the org pays for that as a bottleneck. Aim to hand off decision authority the way you hand off work: with it visible that the person who owns the outcome is now the person who decides. That means you surface the trade-offs, make your recommendation clear, then step back and let the owner own it, including the small reversals. The way to grow a team is not to make every call on their behalf but to make sure the calls they make are well-informed ones.\nPast your manager, there is a separate skill for the executive layer, and most promotion material skips it entirely: presenting your work to people who consume reality in a way you don&rsquo;t. Almost every executive is uncannily good at one way of taking in information, and their whole environment is built to feed them that way. Pattern-matchers interrogate you with questions until they find the familiar shape. Number-people discount anything you can&rsquo;t tie to a specific dataset. Present to the wrong frame and the meeting goes quiet in a way nobody can explain, least of all you. The move is to work out, before the room, how each person in it likes reality delivered, and preprocess it for them: the data goes in the appendix for the pattern-matcher, while the skeptic gets it in the first slide.\nA few structural rules separate a presentation that lands from one that dies on the second slide. Go in to extract their perspective, not to change their mind; you&rsquo;re almost always planning, reporting status, or resolving misalignment, and the win is leaving with enough to adapt your plan. Structure your write-up so the summary lands first: situation, complication, question, answer. Never present a problem without a proposed answer; an executive who hears a problem with no fix quietly wonders whether they need someone more senior. And don&rsquo;t fight feedback in the room, even the calls you think are wrong. Executives often hold the real point but can&rsquo;t frame it in the moment, and if you resist, they swallow it and you leave with nothing. Take it, sit with it, and change the outcome later. The useful reframe is to treat informing an executive as absolution: once the problem is on the table, you can move toward solving it instead of hiding it.\nThat absolution only works if you get the news on the table in the right shape, and delivering bad news is a skill with its own rules. The first rule is no surprises, because what an executive forgives least is being blindsided, not the underlying problem. Surface unfavorable news early, directly, and with a plan, even when the news is merely a risk rather than a certainty; proactive bad news builds trust, while discovering the problem from a third party or a delay spends it immediately. Deliver the full scope of the bad news at once rather than parsing it out, because staggering negative information reads as deceit and it drags out the pain. Lead with the changed reality, not the mechanism: not &ldquo;the sensor stack has timing jitter&rdquo; but &ldquo;we have a product-reliability risk that could force a launch decision,&rdquo; and translate every technical failing into the business exposure it represents. Bring options and a recommendation, because news with a proposed path forward reads as competence while the same news with no path reads as a problem handed to the executive to solve. And do not lead with drama or apology; state what happened, why it matters, what you recommend, and what decision you need, then invite the questions. The leader who does this consistently earns the room&rsquo;s trust in the hard moments, which is worth more than a flawless record of never slipping. What the executive staff wants is never the absence of bad news; it is the assurance that when the news is bad, they will hear it from you, first, in usable form.\nThe hardest version of presenting up is not status, it&rsquo;s the ask: getting a non-technical executive to spend money and calendar time on technical work they&rsquo;ll never see. The habit that decides whether you&rsquo;re heard is translating debt and risk into the language of whoever holds the purse, and each seat reads the same request against a different scorecard. The CFO sees cost and the financial risk of a pause; the revenue leader sees a quarter where the product might wobble; the product leader sees features slipping to fix plumbing customers never see. A single deck addressed to &ldquo;the executives&rdquo; answers none of their questions, so each one has to do the translation you refused to do. Do it for them, several times, in several languages.\nThe concrete moves come from pricing the cost the company is already paying. Ask each engineer what share of their week disappears into working around known debt. If a thirty-person team loses a fifth of its time, that is six engineers&rsquo; worth of fully-loaded salary spent every year buying nothing but the debt. That figure is the interest payment the company is already making, just not on any line anyone sees. Then price the risk: tie the debt to the outages it can cause and cost each one out in revenue lost during downtime, SLA credits owed, and support hours cleaning up. The revenue leader does not care about architecture; they care about the number they have to hit, so pull the accounts that have raised reliability complaints, add up the ARR they represent, and line it up against their renewal dates. That is the revenue the debt is putting at risk, named and dated, and it stops being an engineering concern the moment it becomes the revenue leader&rsquo;s problem. When the case has to clear the board, one more variable dominates: timing. Directors evaluate what the company is worth when it sells, so tie the fix to that exit timeline rather than to engineering health.\nThen make the shape of the ask palatable. Few stakeholders will fund an open-ended &ldquo;spend a quarter cleaning up.&rdquo; They will accept a bounded tax on velocity: a fixed share of every sprint, week after week, that goes to the foundation instead of a frightening full-stop. The case that wins trades a pause no roadmap can absorb for a known cost any roadmap can be planned around. And when you get the money, reserve a deliberate, recurring slice of capacity for paying debt down rather than a heroic one-time cleanup, because steady repayment compounds in your favor the way interest currently compounds against you.\nDecisions: doors and records Decision-making is a technical-lead skill, and it has two small frameworks worth stealing.\nOne-way versus two-way doors. Classify every decision before you spend a day on it. A one-way door is hard or impossible to reverse, so it deserves slow, careful investigation. A two-way door is reversible, so decide it quickly and move on. The trap the framework guards against is treating every decision like constitutional law \u2014 and the corollary truth that waiting for perfect information usually just makes you slow, not right. The sharper version of the engineering art is the one nobody teaches: when you can, redesign a one-way door into a two-way door before you walk through it. A feature flag makes a scary irreversible deploy into a reversible one: ship to 1% of users, watch the metrics, ramp up or kill with one call. A canary does the same for infrastructure, an A\/B test for product bets. Every time you engineer a rollback path you convert a decision that felt like a lifetime commitment into an experiment with a cheap exit, and you earn the right to move faster. &ldquo;Disagree and commit&rdquo; rides on top of this: you can disagree and still move at full speed on a reversible decision, because acting generates better information than arguing, but only because the reversal cost is genuinely low. If you are good at course-correcting, being wrong is cheaper than being slow; you just have to build the return path first.\nThe cheapest return path of all is a throwaway prototype, and treating it as throwaway is the discipline, not the waste. Most people mistake a prototype for a rough first draft of production and then get stuck when the throwaway becomes the thing they ship. The useful framing is the inverse: a prototype is disposable code that answers one question, and the question comes first because it decides the whole shape of the thing. Is the open question whether the state model feels right, or whether the screen should look like this? Naming the question up front is the whole job; get that wrong and you build a polished artifact that settles nothing. Keep the rules that keep it cheap: trivially runnable, one command or a double-click; no tests, no error handling beyond what makes it run, no abstractions, no persistence that you are not testing \u2014 because each of those is silent scope creep back toward production. Mark it clearly as throwaway so nobody downstream mistakes it for the real thing, and when the question is answered, fold the validated decision into the real code and park the prototype on a branch out of main, with a note on the implementation so whoever picks it up later can see where the answer came from. This is how an irreversible architectural bet becomes an experiment: instead of committing a year to the wrong database or the wrong service boundary, spend a week proving the risky assumption cheapest. A wrong answer in a throwaway file costs nothing; the same wrong answer merged into main costs an afternoon and then a career&rsquo;s worth of maintenance.\nDecision records. Capture each significant decision as a tiny artifact: the decision, the context that made it reasonable, and the anticipated consequences \u2014 and keep the history when the decision later changes. This is how a team&rsquo;s judgment becomes durable machinery instead of tribal knowledge that dies when the person who made the call leaves.\nBuild versus buy. One decision type that recurs constantly and deserves its own discipline: when to build a capability in-house and when to buy it from a vendor. The honest framing is that both sides are systematically biased \u2014 engineers like building because it is interesting, and executives like buying because it transfers risk. Neither tendency produces the right answer. The framework that works evaluates three things. First, risk: using a vendor is outstanding debt, and the real risks are not price increases but the vendor going out of business, shifting their pricing in a way incompatible with your usage, suffering a security breach, or canceling the business line entirely. Some risks can be contracted away; others you simply accept. Second, value: compare the vendor&rsquo;s current offering against what you will actually build \u2014 not the perfected internal tool you imagine, but the version you will ship in six months given competing priorities. Most companies cannot rationally invest in improving internal tools, so they get worse over time while active vendors improve. The frequently repeated wisdom holds: vendors generate value when they are outside your core competency; inside it, they slow you down. Third, cost: beyond the license fee, account for integration cost, operating cost (outages, mandatory upgrades as the vendor evolves), and evolution cost (how hard is it to move a piece out later if the vendor&rsquo;s direction diverges from yours). Aim for vendor flexibility, the ability to move a subset of your work to a better tool, rather than vendor agnosticism, the ability to wholesale migrate. The two recurring failure modes are legal review fixated on unlikely risks and unfungible budgets where headcount and vendor spend sit in separate buckets. Both are bureaucratic scar tissue from previous missteps; if you believe your case is the exception, you need an executive sponsor to push through. And one more: many companies are bad at vendor management and good at building, so their calculations always favor in-house. Getting real value from a vendor requires managing them \u2014 quarterly performance reviews, clear expectations, the same discipline you would apply to a team you run.\nOne more discipline from the same school, already noted above: seek consent, not consensus. A decision you are waiting on is often a decision you are avoiding making. Make the call that&rsquo;s blocking others rather than endlessly facilitating discussion.\nHow much information you gather before deciding is a skill in itself, and the default is wrong. Most reversible decisions deserve about 70% of the information: the first chunk is cheap to get, the last quarter is expensive, and perfect clarity never arrives because the problem keeps moving while you deliberate. The truth that separates staff engineers who are trusted with decisions from those who aren&rsquo;t is that a good decision made today is almost always better than a perfect one made next month. Waiting has a real cost \u2014 your team is blocked, context decays, and the problem hardens while you deliberate \u2014 so the discipline is to decide at the 70% mark, document reasoning, and course-correct when the missing 30% shows up. This dovetails with the reversibility rule: the cheaper a decision is to undo, the lower the information bar you need before moving. And it reframes mistakes. You will be wrong sometimes, and that is fine, because on reversible decisions wrong-and-caught-fast beats right-and-late. The engineers who scale their decisions are the ones who hand the call down with the mode attached: this one is unilateral because it is small and time-sensitive, that one is consultative because expertise matters, and the rare bellwether one is consensus because it will be argued about for months either way. Naming the mode up front stops the endless request for input on things that do not need it, and over time it trains the team to bring you only the decisions that genuinely need your call.\nThe hardest stall is a genuine disagreement between two experienced engineers who are both right about different things, and the mechanism that breaks it loose is worth having in your pocket: shift the debate from opinions to proposals. When the argument is &ldquo;I think approach A is better,&rdquo; ask both sides to write a short proposal, not a paragraph of conviction \u2014 the problem, the approach, the trade-offs, the risks, the assumptions. The act of writing forces each person to surface what they are actually betting on, and it reframes the conversation from ego to evidence, so you can compare the risks head to head instead of the confidence. If the disagreement survives even that, and the decision is reversible, stop arguing and run a timeboxed experiment: try the cheaper or more promising option for a defined period and let the results, not the loudest voice, settle it. Data resolves more debates than persuasion ever will, and a two-week trial costs far less than a quarter of deferred decision.\nThe authority for any decision should follow blast radius and reversibility, not title. This is the unsaid rule that separates staff engineers who are trusted from those who are tolerated. A single-team, reversible choice is the team&rsquo;s to make; weigh in, then step back and let them own the result. A multi-team reversible choice deserves a strong recommendation you are ready to defend with trade-offs. A multi-team hard-to-reverse choice is where you earn your keep: this is consensus territory, and your job is to run the discussion, document the reasoning, and make sure the migration risk is written down. And an org-wide, high-cost decision is the one you should treat as a formal review with a written record. The test that keeps you from becoming either a bottleneck or a rubber stamp: if a decision is reversible and local, divest it; if it is irreversible and far-reaching, slow down and get the record on paper.\nThat still leaves the question of how hard to push when you disagree with a decision you cannot make. As a staff engineer you will have influence but, almost always, no veto. The gesture that actually steers a call across multiple teams is not overruling anyone but forcing the trade-off to be named: &ldquo;Choosing strict schema consistency improves that, but it slows the feature work you&rsquo;re shipping this quarter.&rdquo; Present the data, give the owner the full cost picture, and let the trade-off sit. If the disagreement touches an org-wide impact, or the technical debt threatens system stability, or a security risk is live, those are the rare cases where weighing formal escalation beats quiet influence. Everything else, you influence through evidence and relationship, and then you let it go. Being right without being heard is just a faster way to become the person nobody consults.\nWhen the disagreement is specifically with your manager&rsquo;s technical direction, a three-move protocol keeps it productive. First, diagnose whether you are objecting to the decision itself or to not being consulted; mixing a process complaint into a substance disagreement makes you sound personal even when the topology is right, and process complaints belong in a separate 1:1 about how decisions get made. Second, shape your evidence for their constraints, not yours. Peer-impressive evidence, a purity argument that ignores the launch date, a latency chart that ignores headcount, fails upstairs because the manager owns delivery risk you do not. Frame your case around what they are actually optimizing for: timeline, blast radius, who pages at night, what reversibility looks like, what happens if you are wrong. Third, always offer a concrete fallback: a reversible next step that still advances the shared goal if they do not take your preferred path. A spike for two weeks, an ADR that captures the risk and revisits after the launch, a feature flag that lets both paths run. Without a fallback, pushback reads as obstruction. And after you lose cleanly, write a short architecture decision record capturing the context, the decision, the alternatives considered, and the consequences you accept, then commit fully. No pocket veto, no quiet sabotage, no &ldquo;I told you so&rdquo; when the path you warned against pages at 11 p.m. Raise the incident like it was your idea, because for execution purposes it is. The failure mode after a clean loss is subtler than open defiance: half-effort on the path you argued against, every ticket comment documenting the warts and none of the mitigations. That is not integrity. It is a personal score, paid for by the team.\nThe hardest decision is not which option to pick; it is which of your own in-flight projects to stop. Most teams cannot do this, and the reason is not a lack of data but a pair of well-documented biases. The sunk-cost fallacy makes people weight the resources already spent instead of the costs still to come, and escalation of commitment pushes a decision-maker who sees disappointing results to double down in the hope of a turnaround. Both get worse the more successful you are, because people who have always managed to turn a project around believe, with real conviction, that they can do it again if everyone just works harder. The fix is to make stopping a decision rather than an act of will: agree on kill criteria at the start, before anybody falls in love with the project, specific, measurable, and time-bound, the way a drug program gates on efficacy and safety at each trial phase. Decide now what would have to be true for you to stop, including the date to check it, so the termination decision is a matter of checking a threshold against a calendar instead of having an emotional argument in the room.\nWhen the criteria fire, kill it clean and pair the decision with a reallocation plan. The sunk-cost trap is that a project is never stopped in isolation; it is stopped so its people and budget flow somewhere better, and naming the somewhere is what makes the kill defensible rather than a confession of waste. Treat the data as the project killer would: a running review of all active initiatives, not just the struggling one, that lets a dispassionate case for continuation or termination be built on the portfolio, not on the loudest project&rsquo;s sunk investment. And work to make killing a project read as a responsible strategic move, not a failure. If everyone who stops something is punished, the org learns to let projects rot indefinitely; if the team sees a clean kill followed by the team landing on higher-value work, stopping becomes a normal, respected part of how the portfolio gets managed. The staff engineer who can prune a failing project frees as much real capacity as any two new hires, and unlike a hire, the capacity is available immediately.\nProduct thinking for the tech lead Strong teams are not handed requirements and told to build them; the engineers participate in determining the solution. That makes product thinking part of the job. The cleanest entry point is the four product risks, and your awareness of them should not stop at the one you own:\nValue \u2014 do users actually want this? Usability \u2014 can they use it? Feasibility \u2014 can we actually build it? Your natural home. Business viability \u2014 does it work as a business? You obviously own feasibility. But a strong technical leader at least understands the other three, because they keep you from building something feasible that nobody wants. Practically, this means settling explicit ownership with your product partner for specifications, rollouts, business stakeholders, engineering coordination, and design coordination \u2014 then running the product manager + tech lead pair as a joint leadership unit rather than a handoff chain. The tech lead&rsquo;s job is to understand the product and business context well enough to translate it into technical direction.\nThe partnership has recognizable failure modes, and naming them saves you a year of friction. The default that most teams drift into is handoff: the PM decides the what and hands engineering the how. Clean boundaries, worse outcomes, on both sides. When you&rsquo;re not in the &ldquo;what,&rdquo; you build solutions to the wrong problem; when the PM isn&rsquo;t in the &ldquo;how,&rdquo; they specify things that are expensive or impossible. The constructive opposite is shared ownership with deliberately fuzzy edges: both of you get pulled in when the problem is being defined, not when the spec lands; you shape each other&rsquo;s work; you both own the failure and the credit; and you trust each other in absence, assuming the other side&rsquo;s call was reasonable even when you weren&rsquo;t in the room. Two concrete mechanics make this run: hold a weekly 1:1 that is not a ticket review but a conversation about what&rsquo;s coming, what&rsquo;s unclear, and what&rsquo;s worrying each of you; and agree up front who owns the ambiguous post-build work \u2014 rollouts, A\/B analysis, keeping tabs on customer usage \u2014 so it doesn&rsquo;t fall through the crack between &ldquo;code complete&rdquo; and &ldquo;done.&rdquo; The best pairs share one trait: both sides are solving the same customer problem rather than protecting their territory.\nThe paired skill is pushing back on a bad requirement without reading as obstruction. Requirements arrive from every direction, and engineering is often the only function with both the technical knowledge to see a problem and the standing to raise it. But pushback on its own is socially costly and routinely overridden, so the craft is in how the concern is framed. Effective pushback has three parts, and each one added makes it land harder. The bare statement \u2014 &ldquo;this is technically problematic&rdquo; \u2014 gets waved off, because the stakeholder does not understand why the technical detail matters. Link the technical issue to a product consequence and the room starts to pay attention; that is the part most engineers skip. Translate &ldquo;this session architecture can&rsquo;t support concurrent logins&rdquo; into &ldquo;this blocks the enterprise single sign-on a top prospect requires, which is one of the three features we&rsquo;ve bet Q3 on.&rdquo; Same fact, but the second is in the currency the decision-maker cares about. Then close with a proposed alternative that meets the underlying need without the problem, because a concern that only diagnoses and never offers a fix reads as the perfectionism objection people have learned to dismiss. Timing matters as much as content: raise the concern in backlog refinement, when the requirement is still being evaluated, not in sprint planning after it has been committed; and take it up in a bilateral conversation with the product manager before the team meeting, where it is less politically loaded. When a requirement is merely questionable rather than clearly wrong, the cleanest move is to reframe pushback as a research proposal: &ldquo;the requirement assumes users will do X, but our evidence says they do Y \u2014 let me run a small test to verify before we commit a full sprint.&rdquo; Nobody can argue with validating an assumption, and it achieves the same outcome as a no. The deeper habit is being present in product discovery and user-research synthesis, not just delivery planning, so that engineering voice becomes a welcome product asset rather than a delivery constraint. Teams that build that norm find requirements arrive earlier, when they are still ideas and cheap to change, instead of as frozen specifications whose trajectory is already sealed.\nArchitecture, made conversationally Do not start architecture leadership with giant architecture books. Start with how architecture actually gets made by teams. The myth is the lone architect handing down a finished design; the reality, at any real scale, is a distributed practice with a few mechanisms that keep a large system coherent without a single hero:\nDecision records \u2014 the same artifacts from above. A technology radar \u2014 a living map of what the org trusts, trials, and avoids. Team-sourced principles \u2014 a short list everyone contributed to, which generates far more buy-in than one dictated. An advisory forum \u2014 a standing place where architecture gets debated by the people who&rsquo;ll live with it. Getting teams to agree on a standard is one problem. Getting them to adopt it is a different one, and it is where most cross-team initiatives die. The adoption curve for technical standards mirrors any product rollout: innovators who want to partner, an early majority who need proof, a late majority who need significant enablement, and resisters who will not move without a mandate. The mechanics that work follow the curve deliberately. Start with two or three willing teams, embed with them, and make the standard solve a problem they already have. &ldquo;This saves you from building auth&rdquo; gets adoption; &ldquo;use this for consistency&rdquo; does not. Let the early success generate its own momentum. The early majority moves once they see working examples and a reasonable migration path, so invest in documentation, tooling, and office hours that make the path low-friction. The late majority needs more: sometimes a clear organizational directive, sometimes just the visible cost of standing apart, such as teams that missed a reliability target because they skipped the shared pattern. Reserve mandates for genuine resisters, and be willing to grant legitimate exceptions, because an exception process is a feedback loop that tells you where the standard needs to improve.\nTwo frameworks keep this honest. The first is the hard-kernel, soft-shell model: a small set of non-negotiable requirements, security, compliance, audit, wrapped in a flexible layer of recommended approaches. The hard core exists because inconsistent evaluation makes cross-team comparison impossible. The soft shell exists because one size rarely fits all, and teams that can justify a deviation should be able to take it. Drawing the boundary between the two is the real judgment call, and it should be as narrow as the comparison goal allows. The second is the pre-mortem: before you launch the adoption effort, imagine it has failed six months out and work backward to identify what went wrong. Common blockers surface fast this way. The standard makes a team&rsquo;s current work harder during migration and nobody planned for the transition cost. A team that was not consulted feels the standard was imposed rather than designed with them. A priority conflict means the migration cost exceeds the team&rsquo;s current pain. Each blocker maps to a prevention move: involve adopting teams in the design early, make the standard solve their problems rather than your consistency goals, and be explicit about what you are asking teams to sacrifice and what they get in return.\nTwo mental models make this sane. The first is that architecture should evolve through small changes and feedback loops \u2014 a stream of reversible, incremental steps, not one heroic end-state migration. The second is Conway&rsquo;s Law, the observer&rsquo;s truth that systems tend to mirror the communication structures that build them: if you want a certain system shape, start with the team shape. Team boundaries and architecture boundaries are two views of the same decision.\nOne more discipline makes this work at scale: writing strategy bottom-up. Most technical strategies fail because they start as abstract declarations disconnected from the decisions engineers actually make on a Tuesday. The method that works inverts this: write five design documents for concrete projects, then pull out the patterns that repeat. That cluster of shared trade-offs and constraints is your strategy, grounded in reality because it emerged from five real decisions, not a whiteboard session. To write a vision, repeat: take five strategies and project their implications two years forward. The bottom-up method works because two engineers can interpret an abstract strategy in wildly different ways, but staying misaligned is much harder when you are implementing a specific solution that embodies it. The signal that you are ready to write the strategy is one you already know: if you keep rehashing the same technical discussion across teams, you are carrying the argument that needs to go on paper so it stops traveling by hallway. When you roll out what the strategy enables, go slowly. Pick a few engaged teams, make it work, adjust based on what actually happened, then expand. Channel your energy into making one practice land before starting the next, because three concurrent rollouts means none of them stick.\nStrategy becomes navigable, not just sound, when it is compressed into a technical roadmap: a horizon-scoped, milestone-ordered plan the team can actually steer by. The roadmap is the artifact that answers, for any week of the year, what the team is working toward in service of the strategy. Set it across a realistic horizon, roughly eighteen months, and order the milestones so each is a discrete, shippable step you can point at, not a vague aspiration. A useful rough split to aim for, drawn from teams that have done this well: around half immediate, deliverable wins that build momentum and credibility early; a couple of larger bets that carry the real strategic shift; and a reliable slice for technical excellence and maintenance so the foundation does not silently rot while everyone stares at the shiny bets. Keep the roadmap tied to the business roadmap, because a technical plan that drifts from what the company is trying to do gets overridden the first time pressure mounts. And treat it as a rolling document, not a monument: as you execute, take the completed front of the plan off and add a fresh quarter to the back, so it stays honest and the team always has a next step rather than a document everyone stopped believing. The roadmap is how a strategy stops being a keynote and becomes the thing engineers check before they decide what to do on a Tuesday.\nThe craft of the design doc. Writing is the staff-plus skill that makes everything else scale, and the design doc is its primary artifact. A design doc is not a specification; it is a decision document. The question it answers is not &ldquo;what should we build&rdquo; but &ldquo;which option should we pick, and why.&rdquo; That reframe changes everything about how you write it. The structure that works across companies and scales from one-page RFCs to ten-page architecture proposals has the same skeleton: a TL;DR that a VP reads in twenty seconds, the context and scope (what exists today, what is changing), goals and non-Goals, the proposed design, alternatives considered with real trade-off analysis for each, cross-cutting concerns (security, observability, rollout), and open questions. Two sections separate senior from junior writing. The Non-Goals section names things that could reasonably be goals but are deliberately excluded; without it, reviewers ask about every conceivable scope expansion and the doc stalls. The Alternatives section is where you demonstrate that you explored the design space: each alternative deserves a real paragraph on why it is appealing, a real paragraph on its costs, and the specific trade-off that made it lose. Listing straw-man alternatives with one-line dismissals while the chosen option gets paragraphs is the fastest way to lose reviewer trust. The discipline that makes the doc useful instead of performative: pick a side. A neutral survey that lists three options with pros and cons but does not recommend one pushes the decision-making cost onto the reviewer, who has to construct the recommendation before they can agree or disagree. Pick a side, defend it, and let reviewers attack the defense. The reviews come back faster and the conversation is sharper. One more habit that separates docs that land from docs that die: write the TL;DR and the context section first, not last. The act of compressing your reasoning into three sentences forces clarity that the full doc then inherits, and a reader who reads only the TL;DR should know enough to leave a useful comment.\nRunning the review itself is a skill, and the default version of it fails in four predictable ways. The review that happens too late, after the author has already built the thing, is not a review but a retrospective with suggestions, and the real decisions were made alone. The process that is too formal, a committee and a slide deck and three sign-offs, gets routed around, so the decisions that most need scrutiny never get any. The review with too many people in the room produces eight competing opinions and nobody certain whose voice counts. And the review with no follow-through ships the original design three weeks later because the feedback was offered verbally and never recorded. The fix for all four sits in one cheap shape. Define the trigger for a review sharply and publish it: a new service, a new persistence layer, a public API other teams will consume, anything expected to take a meaningful share of production traffic, an irreversible choice, a change that crosses team boundaries. Equally important, say what does not need one, a new endpoint, an internal refactor that changes no observable behavior, a dependency bump, so engineers are not guessing whether their work qualifies. Keep the room small, two to four people: the author, one engineer who will feel the downstream effects most directly, one who can challenge from a different angle, and the tech lead if that is not already covered. More people than that means the least-invested reviewers fill time with abstract opinions and the ones who should talk defer to seniority.\nThe material to review is a one-page document, not a slide deck. Slide decks are built to present conclusions; the design doc exists to expose the reasoning behind them, and only the second is useful in a review. Two sections of that page do the real work. The Alternatives section is where an author who cannot say why this option beat the others has made an assumption, not a decision, and the review is where that distinction becomes visible. And an Open Questions section, the things the author genuinely does not know, steers the conversation toward where input matters instead of letting reviewers rehash the calls the author already made. Send the page a day before the meeting; reviewers who read the doc in the room are not reviewing, they are reading. Run the session in thirty minutes with one person taking notes: two minutes of summary, twenty of questions, five to land a decision. The questions that produce value are the ones aimed at what breaks, what failure looks like, what the author is least certain about, and which assumption would change the outcome most if it turned out to be wrong, not &ldquo;have you considered the technology I prefer.&rdquo; Close with a real verdict, written down before anyone leaves: proceed as proposed, proceed with these specific changes, or revisit, and treat revisit as the rare, serious outcome it is, not the default for uncertainty. Then connect the review to the decision record, so the meeting&rsquo;s reasoning becomes an artifact that outlives the room and challenges a decision from three years ago instead of gambling on whoever remembers it.\nThe anti-patterns are worth naming so you stop reproducing them. Review-by-committee, where the loudest voice wins. Architecture astronauts, reviewers who push a theory-elegant solution that costs more to run than the team can absorb, a distributed event-sourced design is not an improvement over a straightforward database for a team of six. Rubber-stamping, a review that ends &ldquo;proceed&rdquo; in five minutes is not doing its job, and the cause is usually a trigger threshold set too low, reviewers who did not prepare, or a culture where disagreement feels unsafe. And bikeshedding, twenty minutes on naming and diagram colors while the data model goes unexamined; strong reviews spend their time on the irreversible, expensive decisions and let the reversible ones ride through code review. The same instinct belongs in every review regardless of your role in the room: anchor on failure modes, not feature completeness; ask which business invariant the design actually must guarantee; pressure-test the scale assumptions with numbers instead of adjectives; and walk the coupling graph, because the design that fails a year from now is usually the one where five &ldquo;independent&rdquo; services quietly share one database table. That is the staff-plus contribution to a ritual that otherwise drifts into theater, the person who treats the review as risk discovery rather than design validation.\nConflict and the human layer The staff-plus canon is curiously thin on the messy human layer, which is exactly where a tech lead spends real hours. Two honest corrections.\nMeetings are not information transfer. They are places where people bring motivations, histories, and agendas. Reading that layer \u2014 why someone is pushing a point, whose status is at stake, what an objection is really about \u2014 is what turns a competent meeting-runner into someone who can actually move a group.\nThe structural half of that is running the session as a decision mechanism, not a discussion. The single highest-leverage change is to write the agenda as a list of expected outcomes rather than topics: each line names whether it ends in a decision, an estimate, or an assignment, sent in advance so people arrive prepared instead of passive. An agenda point that names no outcome is a digression waiting to happen, and the discipline is to postpone anything without a clear verdict. Give the meeting a tight shape: short, defined slots, a stated exit criterion for the whole session, and a facilitator whose job is to hold the schedule and the purpose rather than to contribute opinions \u2014 the person who runs the meeting is not the same as the person who talks most, which the field&rsquo;s list of senior skills calls out explicitly. Surface a dissent that is hiding in the room: when everyone keeps silent and you suspect disagreement, pull it out with a question like &ldquo;we have estimates ranging from three to thirteen, what is driving the spread?&rdquo; That single move turns a fake-aligned group into a real one in minutes. And protect the close, because a meeting that ends by running out of time is a meeting that produced nothing. Build the closing into the agenda and refuse to let it be eaten: restate the decisions, assign owners, and write down what was decided so the outcome survives the room.\nThe learning ritual that trains a team to keep improving is the retrospective, and most teams fail it not in the room but in the weeks after it. A retro that surfaces honest problems and then produces nothing destroys trust faster than no retro at all, because the team learns that reflection never changes anything. The fix is to redesign the relationship with action. Make each action item specific, owned by exactly one person, and completable within a single iteration, because vague resolutions like &ldquo;improve communication&rdquo; that nobody owns are the ones that rot. Start every retro by reviewing the last round&rsquo;s items: what got done gets celebrated, what is stuck gets investigated, and what is no longer relevant gets retired, so the loop visibly closes. Put the items where the work already lives and protect a real slice of capacity to complete them, because an improvement that competes with feature work and loses every time is an improvement the team learned not to trust. A team that sees a change it identified actually land stops treating the ritual as a chore and starts treating it as the thing that makes the work better. That closing of the loop, more than any single technique or template, is what turns a recurring meeting into the engine of compounding improvement, and it is the reason a thoughtful tech lead treats the retrospective as leadership, not ceremony.\nConflict is cheapest early. Technical disagreement metastasizes into interpersonal conflict when it&rsquo;s ignored. The move is to recognize the tension early and mediate it as a substantive disagreement before it hardens into personalities. Naming the disagreement out loud, in good faith, is nearly always better than letting it fester. And most technical disagreements are not about who is more technically correct. They are about different weights on competing values: speed versus reliability, flexibility versus simplicity, ownership versus consistency. Both sides can be right about different things. When you see two engineers arguing about an architecture choice, the productive move is often to name the values conflict underneath: &ldquo;I think we are weighting developer velocity against operational reliability differently.&rdquo; That reframes the conversation from proving one approach superior to negotiating the right tradeoff for this team at this moment. Without naming it, the technical details become a proxy war and neither side hears the other. And an uncomfortable truth worth accepting early: senior ICs who distinguish themselves from what the room wants often manage their bosses more than they complain about them. Managing up is a skill \u2014 communicating in your manager&rsquo;s language, giving them easy-to-answer useful questions, and making their goals advance \u2014 not a political indulgence.\nManaging across: the peer mechanics. Most of the human-layer advice above targets people above or below you. The relationship that generates the most friction and the most leverage is the one at your level: other staff engineers, peer tech leads, and cross-functional leaders (design, data, QA, platform) who own adjacent pieces of the same problem. The influence mechanics shift when there is no authority gradient in either direction, because nothing compels alignment except mutual benefit.\nStart with the unit of trade. Every peer relationship is an exchange of value: you have context they need, they have context you need, and neither of you can force the other to share it. The practical discipline is to build the relationship before you need the favor. Sit in on their team&rsquo;s design reviews. Read their RFCs. Send a short note when something they shipped works well. The compound effect is that when you eventually ask for help on a cross-team dependency, the request lands in a context of prior goodwill rather than as a cold interruption from someone they barely know.\nWhen you do need something, make the request easy to say yes to. Tanya Reilly&rsquo;s framing is blunt: structure it so the other person has as little reading as possible, as clear a picture of the ask as possible, and as easy a path to saying yes as possible. A long Slack thread with no summary is hard to say yes to. A two-sentence message (what you need, why it matters, and exactly what they would have to do) is easy. And when someone does help, say thank you. Use your company&rsquo;s peer bonus or spot bonus structure if one exists. Gratitude that has a system behind it compounds faster than gratitude that doesn&rsquo;t.\nThe cross-functional partners carry their own dynamics. A design lead who trusts you will push harder for the right UX when engineering pushes back; one who doesn&rsquo;t will design in a vacuum and hand you a spec you have to fight over. A QA lead who sees you as a partner will flag risks in architecture reviews instead of after deployment. A data engineer who understands your constraints will model the schema you actually need instead of the one that&rsquo;s easiest to build. Each of these relationships is worth investing in on a different cadence: a monthly 1:1 with a design lead, a quarterly sync with a platform team&rsquo;s architect, a standing review slot with a data partner. The investment is small; the cost of not having it shows up as mysterious misalignment six months later.\nThe hardest version of managing across is unsticking a project that another team controls. The mechanics that work: don&rsquo;t ask five teams to change simultaneously. Migrate one team first, the most willing, demonstrate success, and let the second team see results instead of hearing promises. Frame the change in terms of what the other team gains, not what your architecture needs. Build a proof of concept if words aren&rsquo;t moving, because a working prototype is more persuasive than a twenty-page document. And accept imperfection: the architecturally pure solution that requires six months of cross-team coordination will lose to the 80% solution one team can ship in two weeks. Pragmatism over purity is the rule here, not a concession.\nOne more discipline worth internalizing: influence begins with trust, not title. Without it, confidence reads as ego. With it, even tentative suggestions reshape a discussion. The engineers people seek out for hard cross-team decisions are not the loudest voices in the room. They are the ones who create clarity without creating dependency, and who frame ideas around shared goals rather than personal wins.\nA large share of a staff engineer&rsquo;s friction comes from being unclear, with themselves and others, about what kind of influence they hold on any given initiative. The discipline is to classify each one up front into advisory, collaborative, or decision-making \u2014 and to say the class out loud. On some projects the team makes the call and you are there to give a strong recommendation that is weighed and may not win; on others you are a working partner shaping the outcome together; and on the rare few the decision is genuinely yours to make and own. Naming which one you are holding stops two failure modes in their tracks: trying to override a team decision you only had an advisory seat on, and shrinking from a call that is actually yours to own. The hard boundaries of the role are worth accepting early so you do not burn trust learning them: you rarely get to reallocate another team&rsquo;s resources or unilaterally change their priorities, and you cannot override a manager&rsquo;s decision no matter how right you are, so your influence runs through proposals and evidence, not mandates. The staff engineer who is trusted is the one who is precise about where their authority starts and ends, and who never tries to make an advisory seat do the work of a decision.\nCoalition-building: the mechanics that move cross-team work. Individual influence conversations get you agreement. Coalitions get you organizational change. The difference matters because the hardest technical work, platform migrations, architecture shifts, shared standards, requires multiple teams to move in concert, and no amount of one-on-one persuasion produces that. The first discipline is mapping the terrain before you pitch anyone: list every stakeholder who can help or block your initiative, write down what each one actually cares about (not what they say they care about), note their current stance, and figure out which relationships they trust. This is not manipulation; it is the minimum preparation that separates an engineer who has a good idea from one who gets it adopted. The second discipline is understanding currencies. Every stakeholder values different things: a product lead cares about delivery velocity, a platform lead cares about API stability, a finance-adjacent team cares about cost predictability. The same proposal, framed in the wrong currency, reads as irrelevant. The move is to translate your technical case into the language of each audience you need, several times, in several frames, before you walk in the room. The third discipline is building the coalition before the meeting, not in it. If stakeholders encounter your proposal for the first time in a design review, you have already lost the room&rsquo;s real decision-maker. Pre-align with the people whose support you need most, one conversation at a time, and find out what they need to hear before they can say yes. The person who walks into a room already knowing that the platform lead will object because of last quarter&rsquo;s incident, and who has addressed that objection in the proposal, is not gaming the system. They are doing the work the system requires. And when you get the first person to commit publicly, treat it as a turning point: one visible supporter in the room changes the social dynamics for everyone else who is still weighing whether to say yes. The final discipline is framing around shared goals, not your preferences. &ldquo;I think we should standardize on X&rdquo; is a weak frame. &ldquo;The current inconsistency is responsible for about forty percent of our on-call incidents this quarter, and standardizing on X is the highest-leverage way to reduce that&rdquo; is a frame nobody can dismiss without naming an alternative they are willing to own.\nThe honest arithmetic: getting the title All the operating savvy is worthless if it never converts to the title, because, fairly or not, your org&rsquo;s ceiling is the constraint. The promotion material here is unusually direct.\nPromotion is a team activity, not a solo one. &ldquo;Don&rsquo;t play team games alone, you&rsquo;ll lose.&rdquo; Write the promotion packet collaboratively with your manager, bring them into the fold early, and temper your expectations.\nFind and activate a sponsor. The most important person is your direct manager. If they&rsquo;ve never promoted anyone to this level, build credibility with a skip-level too. Ask questions that are easy to answer usefully. &ldquo;If I don&rsquo;t get promoted this cycle, what are the likely causes?&rdquo; beats &ldquo;What should I do to improve?&rdquo; Avoid ones that prompt your sponsor to invent an answer.\nVisibility is a job, and the room is not one room. &ldquo;Get in the room, and stay there.&rdquo; But treat the room as an iterative challenge, not a single door you walk through once. There&rsquo;s always another room: pre-planning early in your career, then quarterly planning, then architecture review, then calibration, then the leadership team, and you&rsquo;ll have to keep entering and staying in each one. The mechanism for getting in is worth naming because it&rsquo;s not luck: bring something useful to the room that the room doesn&rsquo;t already have (not merely a perspective it shares), and have a sponsor in the room who knows you want to be there. Your sponsor is spending their social capital on you, and their peers will judge them by how you behave once you&rsquo;re in. That is why sucking the oxygen out of the room, treating every small point like the fate of the company hangs on it, is the fastest way to get shown the door. Two cautions from people who&rsquo;ve done it: don&rsquo;t confuse what a room thinks it does (&ldquo;we just surface problems&rdquo;) with what outsiders imagine it does (&ldquo;they decide everything&rdquo;), and remember that there is no room where the work actually happens. Being selective about which rooms you stay in beats collecting memberships. Frame visibility honestly: it is a transient currency, and learning is a permanent one. Do the minimum to clear the visibility cliff, then spend the rest of your energy on the permanent asset, not on more visibility.\nThe same honesty applies to the external half: visibility outside the company. Many staff engineers reach the level with no external presence at all, and that is fine. But for those who do it, the advantage is that the outside has more room to carve a niche than the inside, where your visibility competes with your peers for a fixed pool of attention. A conference talk, a podcast, turning a recurring problem into a small site or book, a mailing list about something you actually know, these create a name for yourself where no one is already competing for the same one and they quietly open doors that a great internal reputation never touches. The judgement rule is the same as inside: decide, honestly, whether the lack of external presence is likely to hold you back from the promotion you are chasing, and if it is, do enough to clear that threshold and no more. External visibility is optional fuel, not the engine. It compounds for the people who enjoy it, and it is a quiet tax with a poor return on capital for everyone who pours energy into it to chase a number of followers instead of building something that outlives the quarter.\nLevel-defining projects. Whether or not your company formally requires one, take on the work that &ldquo;will stretch and develop you into a better engineer.&rdquo; Having done one gives you dispositive evidence of level-defining impact.\nThe other half of a fair promotion system is the calibration seat, and most staff engineers sit in it without knowing what to do there. As the senior technical voice in a calibration session you are the person who can tell the room what an engineer&rsquo;s work was actually worth, and doing that well is its own skill. The underlying principle is that a promotion should reflect sustained demonstration of next-level behavior, usually three to six months of already operating at the level, not a bet that someone might get there. That framing stops the Peter Principle and it gives you an honest test when you are defending someone in the room: has this person quietly been doing the job. At the staff tier the rubric also shifts, from what a person built to what a person made possible, how many teams they influenced, which expensive decisions they prevented, whether they raised the bar through RFCs and design reviews and docs; and a staff-level call needs input from several managers and cross-functional partners, not just the direct one whose view may be narrow. Two biases are your job to correct. The invisible-work bias is the one where the on-call heroics, the mentoring, the doc that prevents the next incident never show up in output metrics and get systematically undervalued; the staff engineer is often the only one in the room who saw that work, so you cite it, on the record. The difficulty bias is rating every engineer on output without accounting for context; someone who delivered on an ambiguous, dependency-heavy, greenfield project is not the same as someone who delivered on a stable, well-understood system, and the record should say which was which. And because your own recognized impact depends on the same machinery, keep an impact log. A running, dated list of the decisions you shaped, the teams you influenced, the incidents you led and the people you grew, written down as you go rather than reconstructed at review time, is the difference between a promotion case with evidence and one with vibes.\nThe uncomfortable truth underneath all of this: even the most capable people often have done the work but not converted it into recognized impact. That gap is precisely what a sponsor closes.\nThe operational layer: leading through failure Most discussions of technical leadership quietly assume everything is going normally. A good chunk of your job as a tech lead happens when it is not \u2014 an incident, an outage, a fire in someone else&rsquo;s system that lands on your team. This is the capability the field forgets to teach, and it is worth internalizing before you need it, because you can&rsquo;t improvise your way through a crisis on the job.\nThe core move: separate coordination from debugging. The single worst thing you can do in an incident is turn every senior person into another debugger and nobody into a coordinator. Assign one person to run the response \u2014 the incident commander \u2014 whose job is coordination, communication, and decisions, explicitly not becoming another hands-on debugger. Give the response a clear command, defined roles, and a working incident record so the state of the world is written down rather than held in someone&rsquo;s head. Declare the incident early; declaring it is low-cost and reversible, while failing to declare it costs you coordination exactly when you need it most.\nWhy the IC keeps losing the fight is worth understanding, because it is not a discipline failure. Debugging and coordination demand incompatible rhythms of attention. Debugging is heads-down, linear, absorbed; you follow a clue and everything else recedes. Coordination is the opposite: heads-up, scanning, bouncing from &ldquo;has the team checked in&rdquo; to &ldquo;the VP wants an ETA&rdquo; to &ldquo;who&rsquo;s covering the next on-call.&rdquo; The moment one person tries to do both, the technical work wins, because it feels like fighting the fire while coordination feels like paperwork. Nobody tells the IC to stop; they just drift into a dashboard &ldquo;to check one thing&rdquo; and disappear. The fix is structural, not moral: the IC stays in the coordination rhythm and debugs the incident response, not the incident. When the IC genuinely holds the key knowledge, they should hand command to someone else and join the response as a responder. On anything bigger than a handful of responders, split the roles the way the incident-command system does: the IC faces outward toward stakeholders and keeps the big picture; a separate tech lead faces inward, directing the investigation. Each watches a different horizon, so the investigation can go deep without the response going dark.\nMitigation and resolution are not the same step. Mitigation stops the user impact \u2014 a rollback, a flag, a drain \u2014 and it can and should happen before you understand the cause. Resolution fixes the root. Teams that merge the two close the incident the moment the rollback completes and miss the cascading effects still running. Call an incident &ldquo;resolved&rdquo; only when customer impact is actually gone, not when you&rsquo;ve inferred it from an engineering action.\nRunning the response is only half of it; the other half is translating the incident outward without letting it steal the response. The engineers who investigate must not also craft the executive summaries, because debugging and composing stakeholder messages demand opposite attention. Keep a single person or thin channel on the outward face, filtering internal technical chatter down to what materially changed and translating it into business impact language: not &ldquo;the message queue is backing up&rdquo; but &ldquo;authentication is degraded and some customers may not be able to log in.&rdquo; Match the cadence to the severity. For an incident hitting major accounts, update senior leadership every thirty to sixty minutes; for a contained incident, only when status materially changes. Decline to promise a fixed resolution time you cannot back; &ldquo;we are actively working to restore service and will update with an estimate as our understanding improves&rdquo; costs nothing and reads credible, while a confident &ldquo;back in thirty minutes&rdquo; that proves wrong spends your credibility at the exact moment you need it. Keep one source of truth so internal teams, the status page, and support are not telling two different stories. And resist declaring victory early: a premature &ldquo;resolved&rdquo; that the system immediately contradicts does far more damage than an honest &ldquo;we think it&rsquo;s stable and are monitoring&rdquo; that is confirmed an hour later. The incident ends when the customer impact is verified gone, not when you feel the pressure to have an upbeat update to send.\nThen the part that outlasts the incident: the postmortem. Blamelessness is not about being nice. It is an information-quality mechanism. Blaming people causes them to hide information, and an after-action review that can&rsquo;t get honest information cannot learn anything. The discipline is to fix the system that let the mistake happen, not the person who made it. A team that runs genuine, blameless postmortems compounds its reliability; a team that runs blame sessions merely learns to cover its tracks.\nThe capability that prevents most of these incidents in the first place is deciding, up front, how much failure you are willing to tolerate. That is the whole job of an error budget, and the way most teams get it wrong is treating it as an SRE enforcement tool. The model that works is a shared contract: engineering, product, and leadership agree on an SLO that represents what customers actually need, and the error budget, everything beyond that target you agree to spend, becomes the mechanism for settling the endless reliability-versus-velocity standoff with data instead of whoever has more influence that quarter. Choosing the SLO is itself leadership judgment, because every extra nine of reliability costs real engineering effort, operational complexity, and tolerance for change; 99.99 is not automatically better than 99.9. And the budget should influence how much risk the org will accept, not automatically freeze every release the moment it runs low, because a documentation change and a database migration are not the same amount of operational danger just because they share a budget.\nThe rules that keep an error budget honest are the unglamorous ones. Set them when stakes are low, before the budget is spent, because no one negotiates policy rationally in the middle of a customer miss. Make the triggers unambiguous, one specific number with a defined window, not &ldquo;when reliability gets bad.&rdquo; Make the policy symmetric, spelling out what product does differently in each state as well as what engineering does, because a contract that only ever restricts deployments is experienced as engineering blocking product. And make the exceptions explicit and accountable; if leadership repeatedly overrides the policy without writing down the trade-off, the team learns the budget does not matter and the framework dies with its dashboards still on. The mature move is to treat the budget the way a finance lead treats a capital budget, a resource of known size and known replenishment that you allocate deliberately, so a migration that costs budget this quarter to save it for the next two becomes a decision you can compare and defend rather than a gut call. And when the same failure keeps eating the budget month after month, the conversation is no longer &ldquo;how much did we consume&rdquo; but &ldquo;why does this failure mode still exist,&rdquo; which is where the budget stops being a number and starts doing the work of a postmortem for free.\nThe slower-burning version of failure is the one you inherit: a team or project that is already struggling when it lands on you. This is its own capability, and it differs from incident response because the crisis is chronic, not acute. The trust is gone, the team has heard turnaround speeches before, and it will not believe a word until it sees action. The rules that make a turnaround work: stop the bleeding before you improve anything, by setting minimum quality standards and refusing new shortcuts that create more debt; make the debt visible and talk about it in planning so the cost is understood; protect a slice of every sprint to pay it down even if it is only ten percent. Find something you can visibly fix inside two weeks, because the specific fix matters less than what it signals, that problems raised with you turn into action. And be brutally honest upward: telling stakeholders the team has real debt and missed deadlines is what rebuilt trust on promises they can keep, not optimistic forecasts they will watch fail again.\nThe hardest judgment in a turnaround is separating the environment from the individual. People underperform on a struggling team partly because the situation makes success impossible. Before you conclude someone cannot do the job, give them a functioning team and see what happens. Fix the context first, then judge the person. But equally, do not avoid the hard calls forever; when someone has been given a fair chance, clear feedback, and still does not improve, keeping them hurts everyone else. The team is watching how you handle both halves, and handling them fairly is what rebuilds the credibility the last leader spent down.\nNavigating reorgs. Every guarantee in tech has a counter-guarantee: reorgs happen. At companies of any size they arrive like weather, roughly every six to eighteen months, and the engineers who come out ahead are not the ones who avoid them. They are the ones who adapt fastest. The first discipline is reading the announcement for what it says and what it does not. Reorg communications are written to minimize panic; they emphasize continuity and strategic intent while omitting the parts that create anxiety: what actually changes for individual teams, which in-flight projects survive, and who now reports to whom. Your first 48 hours are about answering those questions, not reacting to the strategic narrative. Talk to your manager before the dust settles. Managers usually know more than the announcement says, and a direct conversation surfaces what the org-wide email won&rsquo;t. Then map the new structure immediately: who owns what now, where your team sits relative to the work that matters, and who the informal decision-makers are in the new shape. If you have been maintaining a shadow org chart, update it; if you have not, now is the time to build one. The informal power structure matters just as much after a reorg as before; it just looks different. Protect your in-flight work by surfacing it to your new or continuing manager early, before it becomes orphaned in the reshuffle. And introduce yourself to new stakeholders proactively: a brief message that says you will be working more closely and asks for thirty minutes to connect is low-cost and establishes you as someone who moves, not someone who waits. The deeper move is treating the reorg as a reset of narratives. If you were pigeonholed in your old structure, your new manager has no priors; the story of who you are professionally gets re-told, and you should be the one telling it. Show up with a clear picture of what you are working on, what outcomes you are driving, and what you need from them. The engineers who maintain steady trajectories through reorgs are rarely the ones who were unaffected; they are the ones who rebuilt relationships quickly, surfaced their work proactively, and treated the new structure as a legitimate reason to renegotiate scope. The things that actually survive an org-chart shuffle are portable: your reputation, your documented decisions, and the relationships you built outside your reporting line. Invest in those, and a reorg stops being a crisis and becomes a Monday.\nTime, attention, and the network One capability the senior-to-staff canon treats as a given deserves to be explicit: your time becomes the scarce resource as you advance, so choosing what to work on becomes a core competency in itself. The &ldquo;work on what matters&rdquo; discipline above is the theory; the practice is relentlessly refusing the seductive low-value work that a senior person is handed all day. Most tech leads are overwhelmed not because there&rsquo;s too much to do, but because they&rsquo;ve never learned to say no to most of it, including the parts that feel flattering.\nSet a real number for how much code you&rsquo;ll write, because the default answer is wrong. The people who have done this converge on a surprising figure: about 20% of your time, maybe up to 40% for a week, and less when you&rsquo;re building the roadmap. Coding time measurably falls in the year before a staff promotion, by roughly 20 to 30%, not because work slows down but because the work shifts: meeting time, review time, and spec-writing time all go up. The uncomfortable part isn&rsquo;t the drop, it&rsquo;s that many newly-minted staff engineers spend that freed-up time badly. Break it down and you find the highest-leverage hours are the ones with no output a manager&rsquo;s dashboard can see: a large share goes to situational awareness (reading other teams&rsquo; designs, sitting in rooms to gather context, one-on-ones with engineers who don&rsquo;t report to you), and a comparable share to writing. Writing is not an admin tax. A code-review comment reaches one author; an RFC reaches everyone who reads it, persists, and shapes decisions the author isn&rsquo;t in the room for. Written influence is how you&rsquo;re in a dozen conversations you can&rsquo;t attend, which is the entire point at a scope that outruns your calendar.\nCoding less creates a genuine paradox worth solving deliberately: the less you ship, the more technically credible you need to be, because your influence now rests on judgment rather than output, and judgment decays if the ground under it moves. The engineers who stay sharp while coding less are not trying to compete with their ICs. They stay in the work through the parts that are both high-leverage and cheap: read every design doc and architecture review in your area even when they aren&rsquo;t aimed at you, be first in line for the postmortem and incident analysis because nothing teaches faster than things that broke, stay present in the risky architectural decisions even when you aren&rsquo;t making the call, and run your own software sometimes. Know the first person to hear when something you own breaks. The point is not to keep typing; it is to keep your judgment calibrated against reality, because credibility earned over years can be spent down in a single confidently-wrong take on a system you no longer understand.\nThe hardest part of sharpening at this level is that your most valuable skills give you almost no feedback. A design decision you make today may not be graded for a year, if ever; a piece of writing you put out shapes people you never hear from; the quality of a code review shows up months later in code you won&rsquo;t touch. Deliberate practice here stops being about reps and becomes about engineering feedback loops for skills that won&rsquo;t hand you one. Concretely: force yourself to write down the prediction or decision right now, then come back and check it against what actually happened. Review a design with a colleague afterward, not to argue but to find out what you missed. Ask the team whose architecture you reviewed, six months on, which of your calls held up and which didn&rsquo;t. The senior craft is making the invisible consequence visible on a schedule you control, instead of waiting for a misfire to teach you what you don&rsquo;t know.\nThe productivity system you relied on as a senior engineer breaks the moment you become a tech lead, and most people never rebuild it. As a senior, your operating model was the maker&rsquo;s schedule: long blocks of uninterrupted focus, context-switching as poison, deep work as the unit of output. That system is optimized for shipping code, and it is the wrong system for a role where your output is decisions, alignment, and other people&rsquo;s effectiveness. The shift is not about working less; it is about recognizing that your calendar is no longer a list of tasks to complete but a contract with the organization about where your attention goes. Focus time that is not on your calendar does not exist, because the default state of a staff engineer&rsquo;s week is interrupt-driven, cross-team, and reactive. The engineers who burn out are usually the ones who keep trying to hold onto the maker&rsquo;s schedule in a role that demands the multiplier&rsquo;s schedule. They block four hours for deep work, then spend them context-switching between Slack, review requests, and ad-hoc conversations, and end the day feeling like they accomplished nothing while being exhausted. The fix is structural, not willpower: block focus time as if it were a meeting, defend it the way you would defend a production incident, and treat a calendar with no protected deep work as a plan to stagnate. But equally, recognize that some of your highest-leverage work happens in the interrupt mode: the thirty-second Slack answer that unblocks someone for the afternoon, the five-minute connection between two engineers who should know each other, the quick read of a design doc that catches a cross-team collision before it ships. The skill is knowing which mode the moment requires, not defaulting to one. When you feel tired even on light weeks, the cause is usually not task overload; it is the cognitive tax of holding multiple distinct mental models and switching between them under pressure. Every new domain you hold simultaneously adds to that load, and unlike hours worked, domain count is not a metric anyone tracks. The counter-move is treating your own capacity as a design constraint: name the number of distinct domains you can hold well, make it visible to your manager, and refuse to let it grow without something dropping off. That is not weakness; it is the same discipline you would apply to any system you own.\nThe corollary is a mental model worth stealing from the productivity canon: your horizon of focus stretches as you level. A junior knows what to do for the next few hours; a senior, the next few days or the sprint; a staff engineer should be planning dependencies and shaping the roadmap a quarter or more out, working a year ahead to remove risk before the year arrives. The mistake that stalls careers at this level is not failing to have a two-year vision \u2014 it&rsquo;s holding one without understanding how it cascades down through the quarter, the week, and today&rsquo;s actions. A vision that never reaches the runway is a daydream; the skill is shuttling between the altitudes, keeping them consistent.\nThree habits protect your attention.\nLead by distributing, not hoarding. The healthiest organizations treat &ldquo;lead engineer&rdquo; as a responsibility attached to a project rather than a permanent caste. That lets many engineers practice leadership at small stakes instead of concentrating it in one gatekeeper who becomes the bottleneck. If you are the only person who can coordinate a project, you are not leading \u2014 you are throttling.\nBuild a network of peers. Among the strongest and most repeated advice from people already doing the role is this unglamorous one: deliberately build a network of peers. These are your honest sounding boards, your cross-team informants, and your co-conspirators for change that no single team can make alone. Nurture it before you&rsquo;re in crisis, because a network built at the moment you need it is no network at all.\nProtect focus ruthlessly. Engineering depth and leadership availability pull in opposite directions, and a tech lead \u2014 unlike a manager \u2014 is expected to keep some of both. Schedule the deep technical work as if it were a meeting, defend it, and treat a calendar with no protected focus as a plan to stagnate. The boredom threshold from the project playbook cuts both ways: the coordination you resent and the focus you keep are the same job.\nThe same duty extends to the team&rsquo;s pace, and it is a capability most technical leaders never learn to run deliberately. Chronic overwork does not produce more; it produces more defects, more attrition, and less innovation, and a team that ships fast while it burns out is failing, not succeeding. The practical discipline starts with planning for capacity, not aspiration: a team that plans every sprint at a hundred percent capacity is actually running at a hundred and twenty, because meetings, interrupts, and surprises always eat the margin, so plan for the seventy percent that leaves room for the unexpected without turning the normal cadence into a death march. Build in a real slice of each sprint for learning, technical debt, and exploration, because an engineer who spends months on the same unrelenting kind of work is the one most at risk. And treat the team&rsquo;s energy as something you check on, not something you assume: a standing, low-pressure question about whether the current workload feels sustainable, asked across time, is an early warning system that catches a decline before someone hands in notice. Learn to read the three burnout signals in the people around you, emotional exhaustion, a creeping cynicism toward the work they used to care about, and a hollowed-out sense that nothing they ship matters, because they compound into a spiral. When a burst of intensity is genuinely required, follow it with recovery time and a real conversation about what made it necessary, so the heroic sprint stays the exception and not the recurring norm. You model the pace: the leader who works reasonable hours and visibly takes their breaks gives everyone quieter than them permission to do the same. Protecting the team&rsquo;s sustainability is not a distraction from the mission. It is what keeps the mission possible for the years the mission actually takes.\nProtecting focus is only half the skill. The other half is declining the work that would eat it, and that is where most senior people stall, because saying no to people they want to keep on their side feels like a career risk. The mechanics that keep it from being one start with intent. Yes to everything reads as unreliable, because you end up dropping things or shipping them late; a thoughtful no reads as judgment, because it says you know what matters and protect it. Senior leaders respect someone who manages priorities well more than they respect a saint who accepts everything.\nThe individual moves come from treating a decline as a redirect rather than a refusal. Name what you&rsquo;re already committed to and tie the ask to it: &ldquo;I&rsquo;m fully on the migration this quarter, so I can&rsquo;t take this on well right now.&rdquo; Offer the alternative that still advances the requester&rsquo;s goal, including handing it to someone who&rsquo;d grow from it, rather than leaving them empty-handed. Turn execution into guidance where the request genuinely matters to you: take it at the strategic level, decline the full day-to-day. And say no promptly. The person who asked needs time to reorganize, and a late no is worse than an early one, because it turns a manageable request into a last-minute emergency that boomerangs back to you anyway.\nTwo cautions keep this honest. First, decline the work, not the person; the relationship you&rsquo;re actually preserving is the one that lets you say yes to the next, better thing. Second, and counterintuitively, the most effective no is often a yes to something slightly different. When a request is almost right, restructure it into the version you can genuinely commit to, so you protect your time without closing the door on the working relationship.\nThe judgment check: the pendulum and the ladder Two mental models will save you years of wasted effort.\nThe pendulum. The best technical leaders oscillate between hands-on engineering and management over a career, rather than picking a ladder and climbing it forever. The two demand opposite things. Great engineering needs long, uninterrupted focus. Good management needs to be available and interruptible. You can&rsquo;t do both deeply at once. &ldquo;You have to choose one at a time.&rdquo; This reframe is freeing: leadership does not equal management, and a stint in management arms you with skills, connecting business problems to technical outcomes, understanding what motivates people, having honest conversations, that make you a better senior IC, especially at working without formal authority.\nThe ladder. Resist the default narratives about management: that it&rsquo;s a one-way trip, always a promotion, and the best engineers make the best managers. If you want a sustainable career, you are going to need to keep learning your whole life. Spend your time mostly in alignment with what makes you happy. Doing the work you enjoy gives you energy. Doing the work that drains you is antithetical to success.\nThe distinction that matters most. A manager&rsquo;s first responsibility is the humans. A tech lead&rsquo;s first responsibility is landing the project. Confusing these two is why promoting your best engineer to manager so often fails. Technical leadership is not a consolation prize. It is just as important as management.\nOne more layer of the ladder deserves naming, because the climb ends: the terminal level. At some point you reach your org&rsquo;s ceiling, and there is no rung above. This is where careers quietly die, because the skills that got you there stop being rewarded and nothing replaces them. The single most important reframe is that there are still rules at the terminal level, they are just poorly documented. The career ladder was a scaffold with grades and requirements; once it runs out, everyone who mistakes that absence for &ldquo;no rules&rdquo; ends up misaligned, chasing technically interesting work that slowly gets them shown the door. The new, implied rules are learnable, but you have to go find them.\nThe other terminal-level facts are worth internalizing because they run against the habits the climb taught you. Rules stop working at the top, because the population is so small that applying the same standard to two people you know deeply feels false; relationships outweigh rules now, and not investing in your senior-stakeholder relationships is the terminal version of ignoring the game. The projects available are almost always either urgent or ambiguous, and the ambiguous ones are the ones that stay unclaimed, because they demand the tolerance of making simplifying assumptions you know will be partly wrong. And if you get stuck, move: you are released from most of the downsides of changing scope, and you carry enough organizational authority to accelerate whatever you switch toward. Sustained growth past the ceiling is a choice you keep making, not a ladder that keeps appearing.\nThe underlying truth is that the depth that first made you promotable becomes table stakes, and what separates people who plateau from people who keep compounding is no longer individual technical skill at all. The engineers who stall at staff are rarely short on depth; they are short on the habit of making their decisions visible and useful to people outside their immediate team. If your best work only lives in the codebase, it does not compound or multiply. The level past staff is not &ldquo;staff but more of the same.&rdquo; It is technical leadership done at a scale where your decisions change how other teams build, long after you stop touching the code, and that only happens if you keep choosing work that outlives your direct involvement.\nThe glue warning One trap deserves a section to itself, because the rest of this model quietly steers you into it. Some of the most valuable work a team needs is invisible and thankless: onboarding, documentation, unblocking others, spotting the dropped ball, setting standards, cross-team alignment. Call it glue work.\nThe trap: you do a ton of glue, it makes the team wildly better and earns you glowing reviews, and then it fails to get you promoted, because &ldquo;you didn&rsquo;t really have a technical contribution.&rdquo; If glue is all you do before you&rsquo;re senior, it can be career-limiting. And it does not fall fairly: one study found women are asked to do 44% more of this thankless work and volunteer for 48% more of it. It is not merit-based. It is bias-shaped.\nYour four-step defense, if you find yourself stuck in glue without a promotion:\nHave the direct career conversation: &ldquo;Will I get promoted? What work gets me promoted?&rdquo; Get the manager&rsquo;s honest read. Get a title that grants technical credibility, tech lead or similar, so you can do glue as a leader instead of as a scapegoat. Create artifacts that tell the impact story: &ldquo;due to my work and technical judgment, this thing happened.&rdquo; Make the manager tell the same story. If it still doesn&rsquo;t convert, temporarily stop doing glue work. Declare a lot of things not your problem. Write code. Do unarguably-technical work. Let things drop. Getting the title is itself the most powerful form of representation you can offer. The deeper point applies to everyone: if you only do glue, you will only get better at glue. You&rsquo;re making the team more effective while quietly hurting your future self. Keep investing in the deep technical skill your title is supposed to certify.\nNot all glue is equally stuck, worth knowing before you panic. The highest-value glue is the kind that outlasts the moment: mentoring that makes a new hire productive faster, code-review guidance that reduces architectural drift, cross-team coordination that stops two teams building the same thing, a documentation pass that kills a recurring question. That glue compounds and reads as leverage. The career quicksand is the recurring, manual, single-audience kind: the note-taking and scheduling and chasing that help the team today and teach you nothing new tomorrow. The rule of thumb: if your glue makes many people faster and safer, it probably matters; if it keeps recurring in the same manual form, it needs to be automated, rotated, or declined, and some of it should simply stop being your problem.\nThe leader&rsquo;s side of this is rarely told, because most of the writing is aimed at the engineer stuck in the glue. If you&rsquo;re the one running reviews or calibration instead: the fix is not just &ldquo;value glue more,&rdquo; it is changing what the rubric can see. A prevented incident is invisible by definition, and rubrics that only count what shipped miss it. Add prompts that force the counterfactual \u2014 &ldquo;what did not break this cycle, and who is most responsible for that?&rdquo; \u2014 and translate preventive work into the same currency as features: &ldquo;if Priya hadn&rsquo;t rebuilt the deploy pipeline, we&rsquo;d have had three incidents like last quarter&rsquo;s, each costing a senior engineer a week.&rdquo; When a committee waves off glue work with &ldquo;it wasn&rsquo;t that hard,&rdquo; the honest counter-question is: then why did nobody do it for two years? Usually because it demanded navigating ambiguity and political risk the rubric also doesn&rsquo;t credit. And the distribution of that work is not merit-shaped: the low-promotability research is blunt that women are asked to take on more of these tasks and accept more of them. During calibration, that pattern is worth naming out loud.\nThe operating model, in fourteen lines Everything above, compressed to the core.\nYour code stops being your edge; your influence over people who don&rsquo;t report to you becomes it. Leadership \u2260 management, and technical leadership is just as valid. Know your archetype (Tech Lead, Architect, Solver, Right Hand) and whether your org values it. Own the big picture so good decisions happen before they get expensive. Run the project, not just the code: collaboration framework, risk list, stakeholder status, delegation. The agreement is the work. Seek consent, not consensus. Classify decisions: one-way doors get care, two-way doors get speed; write decision records. Think product, not just plumbing: value, usability, feasibility, viability \u2014 and own your PM partnership. Make architecture conversationally: decision records, radar, principles, advisory forum, small feedback loops. Refuse snacking and preening; work where there&rsquo;s room and attention; finish things. Create space for others and change your mind when you should. Sponsor, don&rsquo;t merely mentor: give opportunity and visibility, and keep mentoring, coaching, and feedback distinct. Stay aligned with authority, make the title a team effort, and separate coordination from debugging when it blows up. Guard against the glue trap and protect your focus: your time is the scarcest resource you spend. Prove it to yourself, not to a reviewer. Pick one item, create space for others is a good first, and run it at your actual job for two weeks. Watch your meetings shrink and your org&rsquo;s dependence on you shift from &ldquo;the go-to person&rdquo; to &ldquo;the person who grew the team.&rdquo; That, more than any title, is the model working.\n","permalink":"https:\/\/archit15singh.github.io\/posts\/2026-08-30-the-staff-plus-operating-model\/","summary":"<p>Moving from Senior Engineer toward Staff or Principal changes the scope of the job. Technical decisions increasingly depend on coordinating teams, resolving disagreements and choosing which problems deserve attention.<\/p>\n<p>This guide brings together practitioner frameworks for that transition. It asks what changes in the work and which practices you can try on your next project. The advice needs to be adapted to your organization; titles alone say little about the responsibilities involved.<\/p>","title":"The Staff+ Operating Model: a practical field guide to technical leadership"},{"content":"I wanted a PR reviewer whose findings I could investigate after the run. A review comment alone left questions unanswered: which files had the agent inspected, which commands had it run, and what context would survive for the next review?\nI built Luffy to make that process inspectable. You type @luffy review this pr. GitHub Actions runs Hermes Agent through OpenRouter. The agent can shell into the workspace, repro failures, and post a structured Markdown review. Then it stores a redacted trace and grows hub memory so the next run on that repo is not starting from zero.\nThis post is how that system is put together, what broke on the way, and what a live run looked like when I pointed Claude Opus 5 at a real Odoo fix.\nThe recorded example: Actions run 30574256524 on a fork&rsquo;s PR #3. Model anthropic\/claude-opus-5. REQUEST CHANGES, score 42\/100. Ten API calls, nine tool-call turns, twenty-six session messages, about four minutes of Hermes wall time, roughly $0.59. The full trace package lives in the repo under docs\/showcase\/.\nThe execution and memory problems PR review fails for boring reasons.\nHumans skip things when the monorepo is huge. Consistency drifts. Institutional knowledge lives in Slack threads that die.\nA review agent without persistent state loses repository context between runs. Without command execution, it cannot test a suspected failure locally. Without a saved trace, the review is difficult to investigate afterward.\nOn something Odoo-sized, &ldquo;clone the world and chat&rdquo; is also an economics problem. Full checkouts burn minutes before the model even starts.\nSo the design question was never &ldquo;which model writes nicer English?&rdquo; It was:\nHow do we bound context (sparse paths, capped diffs)? How do we structure the answer so CI and humans can parse it? How do we keep what we learned (memory)? How do we export the loop (tools, prompts, steps) so we can improve the system? Luffy is an answer to those four.\nWhat Luffy is (and is not) One line: comment-triggered PR reviews via Hermes + OpenRouter, with a fixed review contract, hub memory, and redacted run traces.\nThe user path is short:\n@luffy review this pr \u2192 GitHub Actions \u2192 Hermes (tools + model) \u2192 PR comment + \u2705\/\u274c \u2192 artifact trace + hub memory update V1 is not a global bot that reviews every public repo with no install. The default model is paid on OpenRouter (anthropic\/claude-opus-5); I would rather budget the cost deliberately via the trigger than pretend it is zero. It posts full PR comments, not inline review threads yet. Installation is per-repo, on purpose, so the trust boundary stays explicit.\nIf you need a rubber stamp, use a cheaper model and a shorter prompt. Luffy&rsquo;s showcase run failed the PR on purpose. That is the point.\nPrinciples I refused to drop Explicit trigger. No auto-review on every push. Cost and consent stay with the commenter. The workflow also gates by GitHub author_association (default: owner \/ member \/ collaborator \/ contributor) so a random drive-by comment does not burn OpenRouter credits.\nPR text is untrusted. Title, body, and diff can contain prompt-injection attempts. The SOUL and review prompt say so out loud. The model is a reviewer, not a servant of the PR description.\nEvidence over vibes. Findings need a path, a symbol, and a concrete trigger when they claim a bug. On the Opus run, the agent did not only assert a codec problem. It ran Python against the workspace until UnicodeDecodeError showed up.\nStructured contract. Free-form &ldquo;LGTM&rdquo; is useless in CI. The review is forced into a shape: verdict, confidence, score, review effort, walkthrough, blocking, a findings table, a security line, suggestions, optional code diffs, a tests &amp; risk block, and &ldquo;what was checked&rdquo;. A normalizer strips outer fences and caps size for GitHub comments.\nDurable state. After each run, Luffy distills notes into local MEMORY.md, publishes a size-capped payload into the hub under memory\/repos\/{owner}--{repo}\/, and preloads that hub memory on the next review for the same target. Without preload, &ldquo;memory&rdquo; is theater.\nOperability. Sparse checkout of changed paths. Hermes install cache. Replace prior Luffy comments instead of stacking noise. Always post a failure stub if the agent dies. Eyes reaction while running; \u2705 \/ \u274c when done.\nThe pipeline (outer loop) Roughly four boxes, statically:\nDeveloper \u2500\u2500comment\u2500\u2500\u25ba Target repo (Actions + sparse PR head) \u2502 \u25bc Luffy agent\/ + scripts\/ (SOUL, prompt, orchestrator) \u2502 \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510 \u25bc \u25bc \u25bc Hermes Agent OpenRouter Hub repo (tools\/loop) (Opus 5\u2026) memory\/ + ingest \u2502 \u25bc PR comment + Actions artifacts (trace) The spine is a boring shell script on purpose. scripts\/run-luffy-review.sh runs seven deterministic stages:\n1 preload_hub_memory \u2500\u2500\u25ba Hub MEMORY.md \u2192 HERMES_HOME 2 assemble-context \u2500\u2500\u25ba PR meta + diff + prompt fill 3 hermes -z \u2500\u2500\u25ba install\/run Hermes, capture loop 4 normalize-review \u2500\u2500\u25ba contract repair + size cap 5 distill-memory \u2500\u2500\u25ba append structured notes 6 save-trace \u2500\u2500\u25ba redacted .luffy-out\/traces\/ 7 publish-run-to-hub \u2500\u2500\u25ba memory\/repos\/{owner}--{repo}\/ Boring is good. Deterministic stages give you timings, retries, and a place to hang artifacts even when the model fails. The whole orchestrator for the showcase run took 253 seconds; 251 of those were Hermes, and the rest split across assemble, distill, and trace packaging.\nStage Seconds (real run) preload_hub_memory 0 assemble 2 hermes 251 distill 0 The inner loop (Hermes + tools) Here is the part most &ldquo;PR bots&rdquo; skip. The agent does not just emit a comment. It runs a multi-turn loop against the workspace, and I capture every turn.\n\u250c\u2500 agentic loop (Hermes + OpenRouter) \u2500\u2500\u2500\u2500\u2500\u2500\u2510 prompt + \u2502 prompt + memory + workspace \u2502 memory \u2502 \u2502 \u2502 \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u25ba\u2502 \u25bc \u2502 \u2502 model reasoning \u25c4\u2500\u2500\u25ba tools (read) \u2502 \u2502 \u2502 \u2502 \u2502 \u25bc \u2502 \u2502 draft Markdown review \u2502 \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518 \u2502 \u25bc normalize -&gt; distill -&gt; trace -&gt; comment For the showcase run, the inner loop looks like this in trace:\nhermes -z &#34;$PROMPT&#34; \\ --provider openrouter \\ --model anthropic\/claude-opus-5 \\ -t terminal \\ --usage-file hermes-usage.json Then scripts\/capture-hermes-loop.py reads the usage JSON (tokens, cost, session_id, api_calls), the session state.db messages (roles, tool_calls, tool results), and a slice of logs\/agent.log, and writes agent-loop\/agent-loop.md + agent-loop.json into the trace.\nWithout that capture you only ship the last message. The last message is the advertisement, not the work.\nWhat the agent actually did (real, captured) This is the run that made me trust the system. PR #3 was a real Odoo fix for odoo\/odoo#271153: remove_control_characters had encoded a Unicode character class and matched it against UTF-8 bytes, so U+FFFE\/U+FFFF survived into lxml and crashed invoice generation. The PR fixed the str path. It changed the bytes path to errors='surrogatepass'. The comment claimed that round-tripped any byte sequence.\nOpus 5 did not take that claim at face value. Condensed from the captured steps:\nTurn Kind What happened 1 user Full Luffy review prompt + PR #3 metadata 2 tools cat pr.diff, `cat context.md 3 tools Latin-1 caf\u00e9 repro + sed of xml_utils.py 4 tools grep remove_control_characters call sites 5-8 tools More codec experiments; runs the PR&rsquo;s own new test 9 tools Reads cleanup_xml_node boundary + checks the codec the comment promised 10 assistant Structured review \u2192 REQUEST CHANGES (surrogatepass bug) The decisive moments, in the agent&rsquo;s own captured output:\nTurn 5. The repro that broke the comment&rsquo;s claim:\nb&#39;caf\\xe9&#39; RAISED: UnicodeDecodeError &#39;utf-8&#39; codec can&#39;t decode byte 0xe9 in position 3 Turn 8. The agent ran the PR&rsquo;s own test class against the PR&rsquo;s own code:\n--- test_non_utf8_bytes_do_not_raise --- FAIL -&gt; UnicodeDecodeError : &#39;utf-8&#39; codec can&#39;t decode byte 0xe9 in position 3 So the PR shipped a test that its own implementation could not pass. The agent proved it instead of asserting it, then turned it into a blocking finding with a one-line codec fix (surrogateescape, not surrogatepass) and a code suggestion that preserved the surrogate range so Soci\u00e9t\u00e9 did not silently become Socit. That is the product working. A soft APPROVE would have been a worse system outcome.\nThe receipt Numbers straight out of the trace package:\nMetric Value Actions run 30574256524 Session id 20260730_191954_63f003 Model anthropic\/claude-opus-5 Hermes stage 251s (total orchestrator 253s) API calls 10 Tool-call turns 9 Messages 26 Tokens total ~195k (heavy cache read) Est. cost ~$0.59 Verdict REQUEST CHANGES Score 42\/100 Effort 4\/5 This is what got posted back on the PR (excerpt):\n## \ud83c\udff4\u200d\u2620\ufe0f Luffy Review \u2014 PR #3 Verdict: REQUEST CHANGES Confidence: high Score: 42\/100 Review effort: 4\/5 ### Blocking - odoo\/tools\/xml_utils.py \u2014 errors=&#39;surrogatepass&#39; cannot decode non-UTF-8 bytes and breaks cleanup_xml_node. surrogatepass only permits already-encoded lone surrogates; it does not tolerate arbitrary invalid bytes. Reproduced on this workspace: payload = &#39;&lt;?xml version=&#34;1.0&#34; encoding=&#34;ISO-8859-1&#34;?&gt;\u2026Soci\u00e9t\u00e9\u2026&#39; .encode(&#39;latin-1&#39;) OLD (base 19.0): b&#39;&lt;Inv&gt;\u2026Soci&amp;#233;t&amp;#233;\u2026&lt;\/Inv&gt;&#39; # works NEW (this PR): UnicodeDecodeError: &#39;utf-8&#39; codec can&#39;t decode byte 0xe9 in position 59 The findings table had four rows. One critical (the codec regression), one high (the self-failing test), one medium (the silent-accent-loss trap if you &ldquo;fix&rdquo; it naively), one low (a docstring\/type promise mismatch). Each row carried a file, an issue, and a concrete trigger scenario. That is what a structured review looks like when the contract holds.\nIf you cannot export the loop, you cannot improve the agent Every run treats the trace as a small dataset:\ntraces\/pr{N}-run{RUN_ID}-a{ATTEMPT}\/ meta.json # identity, status, timings pointer, file hashes prompt.md # what the model was asked context.md # the PR context block pr.json \/ pr.diff # GitHub PR data + diff review.raw.md # Hermes stdout, unnormalized review.md # the normalized posted body hermes.stderr # any errors timings.json # stage durations agent-loop\/ agent-loop.md # human-readable tool-by-turn walkthrough agent-loop.json # messages + tool args (redacted) agent.log # raw Hermes log slice usage.json # cost + token shape memory-before.md # MEMORY.md before the review memory-after.md # MEMORY.md after the distill step Traces are Actions artifacts (90 days for the trace bundle, 14 days for a debug bundle). You can pull one with gh run download and reconstruct exactly what the agent saw, what it said, and what it learned, for any review.\nSecrets (sk-or-\u2026, OPENROUTER_API_KEY=\u2026) are stripped before anything is committed or uploaded. The hub is the source of truth, but it never holds credentials.\nThat package is why the agent is auditable instead of magical. &ldquo;This function has a null-deref bug&rdquo; is a strong claim. If an author disagrees, I should be able to point at a file in the trace and say &ldquo;here is the prompt, here is the diff, here is the raw output, here is the memory delta.&rdquo; Long term these packages are the start of an eval set. Regression tests for agents look like golden traces, not only unit tests on pure functions.\nThe memory hub (the part no stateless bot has) Luffy treats memory as a first-class artifact in version control. There is a central hub repo. Every target repo that runs Luffy publishes its run into memory\/repos\/{owner}--{repo}\/ on the hub:\nmemory\/repos\/ {owner}--{repo}\/ MEMORY.md # cumulative learned notes for that repo latest.json # pointer to the most recent run runs\/{trace_id}\/ meta.json # run identity + hashes review.md # the review body summary.md # short distill block Before a review, scripts\/preload-hub-memory.sh pulls that repo&rsquo;s MEMORY.md from the hub into HERMES_HOME. The agent then reads prior notes (&ldquo;this repo rejects inline CSS,&rdquo; &ldquo;the auth module prefers vault refs,&rdquo; &ldquo;PR #2 missed a null check in the serializer&rdquo;) and reviews with that context. After the review, a distill step appends a short summary back into memory. The next review is genuinely smarter because it is standing on what the previous one learned.\nWhy memory in git and not a database? Git is already where Luffy lives. The memory is reviewable, diffable, branchable. A bad ingest can be reverted. A human can edit MEMORY.md by hand and the next review picks it up. The cost of that simplicity is a serialized commit on the hub, handled with a concurrency group that does not cancel in-flight ingests and a retry loop for push races.\nThe publish path has two modes. Direct (the default): the target clones the hub, runs an ingest Python script, commits the new memory, and pushes main. This works with the target&rsquo;s own GITHUB_TOKEN when Luffy reviews itself, or with a PAT for cross-repo use. Dispatch: the target fires repository_dispatch (luffy-run) on the hub. Dispatch needs a classic PAT because GITHUB_TOKEN cannot call dispatch on another repo. That is a GitHub limitation, not a Luffy one.\nThe ROI fixes that made it usable Luffy v0 was correct but slow and noisy. A short sprint of ranked fixes turned it into something I would actually run. None of them are clever.\nID Fix Why it mattered F1 PR head fetch-depth: 1 + sparse-checkout of changed paths only Cut minutes off monorepo checkouts F2 Cache the Hermes install tree (~\/.local + ~\/.hermes) Kills the cold-install cost on every run after the first F3 Preload the hub MEMORY.md into HERMES_HOME before review The whole point. Reviews become memory-backed, not stateless F4 Drop the broken hermes-home Actions cache; let the hub be source of truth Removes noise, simplifies the mental model F5 +1 \/ -1 reactions on the trigger comment A clear done\/fail signal to the author F6 Cap hub clone depth to 1 Small, but the publish step is no longer slower than the review F11 author_association allowlist Stops random comments from spending your OpenRouter budget F12 Replace prior Luffy comment instead of stacking One review per PR, not a noise pile F3 is the one that separates Luffy from every stateless review bot, and it was not the first thing I shipped. It was the third. The first version had memory but did not load it. That gap was the whole product, and it took a real run to expose it. &ldquo;Memory written but never preloaded&rdquo; is a blog post, not a feature. Preload first.\nThings that hurt (so you do not repeat them) Private repos break naive shields.io GitHub badges. Status APIs return &ldquo;repo not found&rdquo; for private repos. Static query badges that still deep-link to Actions were the fix.\nSparse path counting. COUNT=$(grep -c . f || echo 0) on an empty file becomes 0\\n0 on some greps and forces a full monorepo clone. One character of shell, minutes of waste on a one-file PR.\nCache keys with run_id every save thrash the Actions cache. Stable key, save on miss.\nMissing OpenRouter key used to set pipeline_rc=0. Users saw a green reaction on a config failure. Fixed: fail means fail.\nExpensive models without tools still guess. Tools closed the loop on Opus. The score dropped because the code earned it, not because the model felt charitable.\nWhat this points at Agentic CI is becoming a layer of the SDLC. Not chat in a sidebar. Jobs with permissions, artifacts, and budgets.\nReview agents are also org learning systems when memory is real. The valuable output is not only the comment. It is the updated MEMORY.md and the trace you can re-read after the merge.\nOpen work I have not finished: pin Hermes install versions for bit-for-bit CI, a Docker image with Hermes preinstalled, inline review comments, a reusable workflow_call packaging for many target repos, and a tighter tool sandbox policy if you open the trigger to less trusted contributors.\nClose Luffy is a bet that PR review agents should look like control planes: an explicit trigger, bounded context, a structured output, durable memory, and an exportable agentic loop.\nThe Odoo run is the receipt. The model spent ten calls and about sixty cents, used the shell nine times, and refused to rubber-stamp a broken codec path.\nIf you want to poke it: install the workflow on a default branch, set OPENROUTER_API_KEY, comment @luffy review this pr, then download the trace and open agent-loop\/agent-loop.md.\nCode: archit15singh\/luffy-pr-review-agent.\nOne comment. One review. Memory that grows.\n","permalink":"https:\/\/archit15singh.github.io\/posts\/2026-07-31-luffy-pr-review-agent\/","summary":"<p>I wanted a PR reviewer whose findings I could investigate after the run. A review comment alone left questions unanswered: which files had the agent inspected, which commands had it run, and what context would survive for the next review?<\/p>\n<p>I built <strong><a href=\"https:\/\/github.com\/archit15singh\/luffy-pr-review-agent\">Luffy<\/a><\/strong> to make that process inspectable. You type <code>@luffy review this pr<\/code>. GitHub Actions runs Hermes Agent through OpenRouter. The agent can shell into the workspace, repro failures, and post a structured Markdown review. Then it stores a redacted trace and grows hub memory so the next run on that repo is not starting from zero.<\/p>","title":"Building Luffy: a PR review agent you can audit"},{"content":" Update, 12 November 2026: Memori is now Lorevell. The current version uses Markdown notes as its source of truth and a rebuildable SQLite index. This article describes an earlier version; use the current setup and rename guide for installation and migration.\nMemori: The Recursive Design of Agent Memory Memori is not primarily a database for notes. It is an attempt to turn agent memory into an engineered retrieval system.\nThe thesis is simple. An agent fails across sessions because state is lost. Lost state only matters if previously learned information cannot be recovered when needed. So &ldquo;memory&rdquo; is really three problems:\nCapture useful state. Preserve it cheaply and portably. Retrieve the right item at the right moment. Everything in the code follows from that split. This post is about the concepts underneath the system &ndash; what each design decision reduces to, and why the project is recursive at its core.\nMemory as Retrieval, Not Storage Storing everything is easy. Finding the one relevant thing later is hard.\nThis distinction shifts the system&rsquo;s center of gravity. Most memory systems are designed around insert: how quickly can we write, how much can we hold, how flexibly can we structure it. Memori is designed around search and ranking. The CRUD path is thin. The retrieval path is where the design effort went.\nThat is why search.rs is the most complex file in the codebase, and storage.rs is mostly plumbing. The architecture encodes the thesis directly.\nHybrid Search: Neither Keyword Nor Vector Alone Exact words matter sometimes. Meaning similarity matters sometimes. Neither keyword search nor vector search dominates all cases.\nKeyword search (BM25 via SQLite FTS5) finds the word you typed, precisely. Vector search finds conceptually related memories even when the exact words don&rsquo;t match. Both have failure modes: keyword search misses synonyms and paraphrases; vector search misses specific technical terms and identifiers.\nMemori runs both and fuses the results using Reciprocal Rank Fusion. The key insight in RRF is that it combines ranks instead of scores. BM25 scores and cosine similarities live on different scales with different distributions &ndash; averaging them is numerically unprincipled. Rank-based fusion sidesteps the problem entirely.\nA result that ranks first in both keyword and vector lists gets the highest combined score. A result that ranks highly in one but not the other still surfaces. The fusion is robust to the score-scale incompatibility because it throws the scores away and only uses the ordering.\nRanking Under Uncertainty Relevance is not directly observable. The system uses proxies: text match rank, vector similarity, recency, prior access frequency. Since these signals are heterogeneous, combining them heuristically is the honest choice.\nMemori applies two adjustments on top of the hybrid rank:\nLogarithmic boost from access count. The tenth access contributes less than the first. The hundredth contributes less than the tenth. This prevents a single heavily-accessed memory from dominating all searches regardless of content. Boost asymptotes; it never becomes infinite.\nExponential decay from last access time. A memory accessed 69 days ago has its score halved. At 138 days, quartered. This matches the intuition that information has a freshness component &ndash; a debugging decision from two years ago is probably less useful than one from last week, even if the content is similar.\nNew memories are never penalised. A memory that has never been retrieved gets a decay multiplier of 1.0. Without this guard, every newly stored memory would decay immediately from the moment it was written, penalising new knowledge before it has had a chance to prove its usefulness.\nThe combined effect: frequently accessed memories surface reliably, recently stored memories surface without penalty, and old memories that nobody touches gradually fade to the bottom rather than disappearing abruptly.\nVectors as Lossy Semantic Sketches Embeddings map text into a numeric space where semantic closeness becomes geometric closeness. That lets &ldquo;similar idea&rdquo; become cosine similarity over 384 floats.\nThe vector is not truth. It is a lossy sketch. Two sentences can be semantically similar and have low cosine similarity if they use different vocabulary. Two sentences can have high cosine similarity and mean different things in context. The embedding captures a projection of meaning &ndash; useful, imperfect, irreplaceable for fuzzy retrieval.\nMemori uses AllMiniLM-L6-V2 via fastembed. It is fast enough to embed at insert time without making the CLI feel slow, and accurate enough for the retrieval task. The singleton is lazily initialized &ndash; the model loads once per process and is reused for all operations.\nMetadata as Controllable Semantics Raw text is expressive but sloppy. Metadata adds explicit dimensions: type, topic, project, verified. These give the system symbolic filtering in addition to semantic search.\nThe design choice that makes this interesting: Memori re-embeds the full memory after metadata updates, using content + metadata scalar values as the input. Adding a tag to a memory shifts its vector. A memory tagged topic=kafka becomes retrievable by vector search for Kafka-related queries even if the word &ldquo;kafka&rdquo; doesn&rsquo;t appear in the content.\nThis is both a feature and a known tradeoff. The enriched vector is more useful for retrieval. But it drifts from the embedding of the raw content, which means deduplication on a later insert of identical content may not recognise the match. The FTS5 index still catches both texts in keyword search, so retrieval quality doesn&rsquo;t suffer &ndash; but the dedup guard may silently miss.\nDeduplication as Memory Hygiene Agents over-store. An agent that runs 100 sessions might store &ldquo;use parameterised queries to prevent SQL injection&rdquo; 40 times in slightly different phrasings. The memory grows without becoming more useful.\nMemori deduplicates at write time. When a new memory is inserted, it is compared against existing memories of the same type using cosine similarity. If the similarity exceeds the threshold (default 0.92), the system updates the existing memory instead of creating a new one &ndash; merging metadata, bumping updated_at, preserving the ID.\nMemory quality is not just adding information. It is resisting redundant information. Deduplication operationalises that as a semantic check at the insert boundary.\nThe threshold is a judgment call. At 0.92, semantically equivalent content with different phrasing deduplicates. At 0.99, only near-identical text deduplicates. Anything lower and distinct memories start colliding. 0.92 catches rephrasing without being aggressive enough to merge genuinely different things.\nPortability Over Infrastructure More infrastructure increases operational burden. Agent memory only works if it is easier to keep than to ignore.\nThis is a product philosophy encoded as architecture. The design chooses SQLite, one file, local embeddings, no cloud dependency, no server, no daemon. The full working memory for a developer across all their projects fits in roughly 200MB. That file is copyable, backupable, and deletable with a single command.\nThe scale argument supports the choice. A developer&rsquo;s working memory tops out around 10,000-50,000 memories. Brute-force cosine similarity at that scale is 14ms to 100ms &ndash; fast enough that no one notices. The moment when HNSW indexing becomes worth the complexity overhead is above 500K memories. That threshold is unlikely to be crossed by a single developer&rsquo;s session history.\nVector search is isolated in a single function specifically to make the upgrade path clear. If the scale assumption ever proves wrong, the replacement is a drop-in for one function. Nothing else changes.\nAgent Ergonomics as Correctness A tool for agents is not just an API. It is a behavioral interface.\nThe CLI design reflects this. Short ID prefixes instead of full UUIDs. --json and --raw flags for machine-readable output. Compact context views that fit in a token budget. A single context subcommand that retrieves the most relevant memories for the current session without requiring the agent to compose a multi-step query.\nThe system assumes the caller is another reasoning process with token limits and imperfect discipline. So ergonomics is not decoration. An agent that cannot efficiently query memory will stop using it. An agent that gets back verbose, poorly structured output will stop trusting it. The CLI is part of the correctness surface.\nSelf-Maintenance: Teaching the Agent to Curate Memory systems decay if no one curates them. Humans will not reliably curate agent memory. So the agent must be taught to do it.\nMemori ships with a behavioral protocol embedded in claude_snippet.md &ndash; a structured prompt fragment that instructs the agent on when to search memory, when to store, when to clean, and when to distrust. Installing Memori means installing both the software and the behavioral loop that makes the software useful.\nThe project is not just a library. It is a library plus a protocol.\nThe Recursive Core Here is the part that took the longest to articulate clearly.\nMemori does not just store facts. It stores the conditions under which remembering becomes useful.\nA memory can describe a debugging technique. A memory can also describe when to search for debugging techniques, how to phrase the query, how to evaluate the result, and how to store the lesson so it surfaces again next time. Memory content can include rules for producing better future memory content.\nThat is the self-recursive structure of the project. The agent uses memory to improve its own memory use. The system stores abstractions &ndash; and some of those abstractions are about how the system itself should be used. When the agent follows the behavioral protocol, reads its own lessons, and updates its memory rules based on what worked and what didn&rsquo;t, it is running a feedback loop that improves retrieval quality over time without any human intervention.\nThe One-Sentence Summary Useful memory emerges from the interaction of persistence, representation, retrieval, ranking, hygiene, and agent behavior.\nEach concept in that list is a separate engineering problem. Memori is an attempt to solve all six, in the smallest possible system, with the clearest possible tradeoffs.\nThe code is at github.com\/archit15singh\/memori. The architectural decisions are all in memori-core\/src\/ &ndash; search.rs for RRF and decay, storage.rs for deduplication, schema.rs for FTS5 and migrations, and embed.rs for the embedding singleton. The behavioral protocol lives in memori-python\/python\/memori_cli\/data\/claude_snippet.md.\nIf you are building something that needs persistent context across agent sessions, start there.\n","permalink":"https:\/\/archit15singh.github.io\/posts\/2026-04-10-memori-recursive-design\/","summary":"<blockquote>\n<p><strong>Update, 12 November 2026:<\/strong> Memori is now <a href=\"https:\/\/github.com\/archit15singh\/lorevell\">Lorevell<\/a>. The current version uses Markdown notes as its source of truth and a rebuildable SQLite index. This article describes an earlier version; use the <a href=\"https:\/\/github.com\/archit15singh\/lorevell\/blob\/main\/docs\/rebrand.md\">current setup and rename guide<\/a> for installation and migration.<\/p>\n<\/blockquote>\n<h1 id=\"memori-the-recursive-design-of-agent-memory\">Memori: The Recursive Design of Agent Memory<\/h1>\n<p><a href=\"https:\/\/github.com\/archit15singh\/memori\">Memori<\/a> is not primarily a database for notes. It is an attempt to turn agent memory into an engineered retrieval system.<\/p>\n<p>The thesis is simple. An agent fails across sessions because state is lost. Lost state only matters if previously learned information cannot be recovered when needed. So &ldquo;memory&rdquo; is really three problems:<\/p>","title":"Memori: The Recursive Design of Agent Memory"},{"content":" Update, 12 November 2026: Memori is now Lorevell. The current version uses Markdown notes as its source of truth and a rebuildable SQLite index. This article describes an earlier version; use the current setup and rename guide for installation and migration.\nBuilding Persistent Memory for AI Agents Every AI coding agent session starts from zero. The agent doesn&rsquo;t remember that you spent three hours last Tuesday debugging a SQLite WAL-mode deadlock, or that you decided against a particular abstraction pattern after trying it twice, or that your project has a non-obvious deployment constraint that every new session will trip over unless you paste it into the prompt again.\nThat tax &ndash; re-establishing context at the start of every session &ndash; compounds invisibly. You stop noticing it the same way you stop noticing a slow network: individually small, collectively enormous.\nMemori is my attempt to fix this. It&rsquo;s a persistent memory system for AI coding agents &ndash; specifically Claude Code, though the architecture is general. Agents store what they learn, retrieve what&rsquo;s relevant, and accumulate knowledge across sessions instead of resetting each time.\nBuilding it surfaced a set of engineering decisions I didn&rsquo;t anticipate. This post is about those decisions: what the naive approach was, why it failed, what I chose instead, and the tradeoff I accepted.\nThe Architecture in One View Before the decisions, the shape of the system:\nAgent (Claude Code) | v memori CLI (Python, argparse, 18 subcommands) | v PyMemori (PyO3 bindings, Mutex&lt;Memori&gt;, GIL management) | v Rust Core +-- storage.rs CRUD, dedup, metadata merge, prefix resolution +-- search.rs hybrid search, RRF fusion, decay scoring +-- embed.rs fastembed AllMiniLM-L6-V2, lazy OnceLock singleton +-- schema.rs DDL, FTS5 virtual table, migrations v0-v3 +-- types.rs Memory struct, SearchQuery, InsertResult | v Single SQLite file (~\/.memori\/memories.db) Two crates: memori-core (pure Rust data layer) and memori-python (PyO3 bindings plus CLI). The CLI is what agents actually call. The Rust core is what makes it fast enough to call on every session without the agent noticing.\nThe design principle that shapes every decision below: simplicity and portability over maximum scale. Memori is purpose-built for AI agent memory across development sessions. It is not a general-purpose vector database.\nDecision 1: One SQLite File, No Vector Database The first instinct when building a system that stores and retrieves embeddings is to reach for a proper vector database &ndash; Qdrant, Weaviate, Chroma, pgvector. They exist for this. They have HNSW indexes, they scale to billions of vectors, they have rich filtering.\nI chose SQLite instead. One .db file. No server. No daemon. No configuration.\nThe reason is operational simplicity at agent scale. A developer running Claude Code doesn&rsquo;t want to manage a database server to get persistent memory. The expected scale &ndash; a working memory for a single developer across their projects &ndash; tops out around 10,000-50,000 memories. At that scale, a vector database is infrastructure overhead for a problem SQLite handles in microseconds.\nThe full memory for a working developer fits in roughly 200MB. That file is copyable, backupable, and deletable with a single command. If something goes wrong, rm ~\/.memori\/memories.db and start over.\nSQLite in WAL mode also gives acceptable write throughput: around 5,700 writes per second at 500K memories, dropping to about 4,200 at 1M. For an agent that stores a few memories per session, that headroom is irrelevant.\nThe tradeoff I accepted is vector search scaling. At 100K memories, brute-force cosine similarity takes 162ms. At 500K, it&rsquo;s 904ms. That&rsquo;s fine for the intended use case. If you&rsquo;re building something that needs sub-10ms retrieval at a million vectors, SQLite is the wrong choice. Memori knows what it is.\nDecision 2: Hybrid Search via Reciprocal Rank Fusion Most retrieval systems make you choose: keyword search or semantic search. Keyword search (BM25) is fast and exact &ndash; it finds the word you typed. Semantic search finds things conceptually related even if the exact words don&rsquo;t match. Both have failure modes you don&rsquo;t want.\nMemori runs both and combines the results. The non-obvious part is how to combine them.\nThe naive approach is score normalization: scale BM25 scores and cosine similarities to the same range, then average. This fails in practice because BM25 and cosine don&rsquo;t have comparable distributions. A BM25 score of 0.8 and a cosine similarity of 0.8 don&rsquo;t mean the same thing. Any weighted combination is numerically unprincipled.\nThe solution is Reciprocal Rank Fusion, which combines ranks instead of scores:\nfn reciprocal_rank_fusion( fts_results: &amp;[(String, f32)], vec_results: &amp;[(String, f32)], k: f32, ) -&gt; Vec&lt;(String, f32)&gt; { let mut scores: HashMap&lt;String, f32&gt; = HashMap::new(); for (rank, (id, _)) in fts_results.iter().enumerate() { *scores.entry(id.clone()).or_insert(0.0) += 1.0 \/ (k + rank as f32 + 1.0); } for (rank, (id, _)) in vec_results.iter().enumerate() { *scores.entry(id.clone()).or_insert(0.0) += 1.0 \/ (k + rank as f32 + 1.0); } let mut fused: Vec&lt;(String, f32)&gt; = scores.into_iter().collect(); fused.sort_by(|a, b| b.1.partial_cmp(&amp;a.1).unwrap_or(Equal)); fused } The constant k=60 is the standard RRF default &ndash; it controls how much the top ranks dominate. A result that ranks first in both lists gets a combined score of 1\/61 + 1\/61 \u2248 0.033. A result that ranks 60th in both gets 1\/121 + 1\/121 \u2248 0.017. The gap shrinks logarithmically, which is exactly what you want: strong agreement on top results, graceful degradation elsewhere.\nThe search pipeline over-fetches 3x the requested limit from each source, fuses, then truncates to the final limit. This ensures the fusion has enough candidates to work with before cutting.\nDecision 3: Brute-Force Vector Search, on Purpose Given the SQLite choice, vector search has to happen somewhere. The obvious path is a purpose-built index &ndash; HNSW (Hierarchical Navigable Small World) gives approximate nearest-neighbor search in O(log N) instead of O(N). Qdrant, Faiss, and hnswlib all implement it.\nI chose brute-force. Every search scans all vectors, computes cosine similarity, and returns the top-k.\nThis was a deliberate decision, not an oversight. The reasons:\nScale doesn&rsquo;t justify the complexity. At 10,000 memories, brute-force takes 14ms. At 100,000, it takes 162ms. A developer&rsquo;s working memory across all their projects is unlikely to exceed 50,000 memories. At that scale, brute-force is fast enough that no one would notice the difference.\nHNSW adds maintenance complexity. An HNSW index needs to be rebuilt when memories are deleted, updated, or re-embedded. It introduces eventual consistency windows. The brute-force approach is always consistent because it just reads the table.\nThe isolation makes replacement easy. All vector search lives in search.rs::vector_search() &ndash; a single function that takes a query vector and returns scored IDs. If Memori ever needs HNSW, it&rsquo;s a drop-in replacement for one function. Nothing else changes.\nfn vector_search( conn: &amp;Connection, query_vec: &amp;[f32], limit: usize, filter: Option&lt;&amp;str&gt;, before: Option&lt;f64&gt;, after: Option&lt;f64&gt;, ) -&gt; Result&lt;Vec&lt;(String, f32)&gt;&gt; { \/\/ O(N) cosine similarity scan \/\/ isolated here specifically for future HNSW replacement ... } The benchmark numbers at 500K memories (904ms) are the signal that tells me when the replacement is warranted. That number hasn&rsquo;t become a problem yet.\nDecision 4: Access Decay Scoring Raw retrieval scores don&rsquo;t capture everything that makes a memory useful. A memory you&rsquo;ve accessed 50 times probably contains something important. A memory you stored eight months ago and never touched since is probably stale. Neither of these signals comes from the content alone.\nMemori applies a scoring adjustment to every retrieved memory:\nlet boost = 1.0 + 0.1 * (1.0 + access_count as f32).ln(); let decay = if last_accessed == 0.0 { 1.0 \/\/ never accessed -- no penalty } else { let days = (now - last_accessed) \/ 86400.0; (-0.01 * days).exp() }; let final_score = base_score * boost * decay; Two terms, each with a specific mathematical property chosen deliberately.\nBoost is logarithmic. The 10th access contributes less than the 1st. The 100th contributes less than the 10th. This prevents a single heavily-accessed memory from dominating all searches regardless of relevance. The boost asymptotes: it can never be infinite no matter how many times a memory is accessed.\nDecay is exponential with a 69-day half-life. A memory last accessed 69 days ago has its score halved. At 138 days, quartered. This matches the intuition that information has a &ldquo;freshness&rdquo; component &ndash; a debugging decision from two years ago is probably less useful than one from last week, even if the content is similar.\nNew memories are never penalised. The last_accessed == 0.0 guard means a memory that has never been retrieved gets decay = 1.0. Without this guard, every newly stored memory would immediately start decaying from the moment it was written, which would penalise new knowledge unfairly.\nThe combined effect: frequently accessed memories surface reliably, recently stored memories surface without penalty, and old memories that nobody touches gradually fade to the bottom of results rather than disappearing abruptly.\nDecision 5: Cosine Deduplication on Insert Without deduplication, a memory system accumulates redundancy rapidly. An agent that runs 100 sessions might store &ldquo;Use parameterised queries to prevent SQL injection&rdquo; 40 times in slightly different phrasings. The memory grows without becoming more useful.\nMemori deduplicates at write time. When a new memory is inserted, it&rsquo;s compared against existing memories of the same type using cosine similarity:\nfn find_duplicate( conn: &amp;Connection, content: &amp;str, vector: &amp;[f32], metadata_type: Option&lt;&amp;str&gt;, threshold: f32, ) -&gt; Result&lt;Option&lt;String&gt;&gt; { \/\/ fetch all memories of the same type \/\/ compute cosine similarity against each \/\/ return first ID above threshold (default 0.92) ... } If the similarity exceeds 0.92, the system updates the existing memory instead of creating a new one &ndash; merging metadata, bumping updated_at, preserving the existing ID.\nThe threshold matters. At 0.92, semantically equivalent content with slightly different phrasing deduplicates. At 0.99, only near-identical text deduplicates. I landed on 0.92 as the default after testing &ndash; it catches rephrasing of the same concept without being aggressive enough to merge genuinely distinct memories.\nThe edge case to know about. When you tag a memory with memori tag &lt;id&gt; topic=kafka, the system re-embeds the memory using content + metadata scalar values as the embedding input. This shifts the vector. If you store an identical memory later, its embedding is computed from content alone &ndash; and the similarity check compares against the shifted vector. The two vectors are no longer the same, so deduplication can miss.\nThis is a known tradeoff. Tagging semantically enriches the vector (making a memory findable by its topic as well as its content), but it introduces drift. The FTS5 full-text index still catches both texts in keyword search, so you won&rsquo;t lose retrieval &ndash; but the dedup guard may not fire.\nDecision 6: FTS5 External-Content Table SQLite has a full-text search extension called FTS5. The naive way to use it is a separate table that stores a copy of the text you want to search. This duplicates your data.\nMemori uses an external-content table instead:\nCREATE VIRTUAL TABLE memories_fts USING fts5( content, content=memories, content_rowid=rowid ); The content=memories directive tells FTS5 that the authoritative content lives in the memories table. The FTS5 virtual table stores only its index, not the text itself. Disk usage stays roughly half of what a duplicated approach would use.\nThe tradeoff is that the index has to be kept in sync manually. SQLite doesn&rsquo;t do this automatically for external-content tables. Memori uses triggers:\nCREATE TRIGGER memories_fts_insert AFTER INSERT ON memories BEGIN INSERT INTO memories_fts(rowid, content) VALUES (new.rowid, new.content || &#39; &#39; || COALESCE(new.metadata, &#39;&#39;)); END; CREATE TRIGGER memories_fts_delete AFTER DELETE ON memories BEGIN INSERT INTO memories_fts(memories_fts, rowid, content) VALUES (&#39;delete&#39;, old.rowid, old.content || &#39; &#39; || COALESCE(old.metadata, &#39;&#39;)); END; Notice that both content and metadata are indexed by FTS5. This means a keyword search for &ldquo;kafka&rdquo; finds memories that mention kafka in their content and memories tagged with topic=kafka in their metadata. The FTS5 index covers the full text of the JSON metadata blob. That&rsquo;s a concrete UX benefit: searching for a topic finds tagged memories even when the tag word doesn&rsquo;t appear in the content.\nThe schema uses three versions of progressive migration:\nv0 -&gt; v1: FTS5 index + metadata-aware triggers v1 -&gt; v2: last_accessed and access_count columns (enables decay scoring) v2 -&gt; v3: expression index on json_extract(metadata, '$.type') for fast type-filtered queries Each migration runs idempotently via PRAGMA user_version. Adding a column to an existing database without breaking it is straightforward in SQLite; the migration just checks the version integer and runs the missing DDL.\nWhat the Architecture Optimises For Every design decision above reflects the same underlying choice: simplicity and portability over scale.\nOne file means the entire memory system is copyable, backupable, and versionable. No infra means zero operational overhead &ndash; no daemon to restart, no port to forward, no credentials to manage. Brute-force vector search means the code is auditable and replaceable without touching anything else. RRF means you get hybrid search without numerically dubious score normalization.\nThe things Memori explicitly does not try to do: sub-10ms vector search at a million records, distributed writes across multiple machines, real-time index updates on a hot write path. Those require different architecture choices. Memori is not that system.\nWhat it is: a memory system that a developer can install in one command, that an agent can call in one CLI invocation, that stores in one file, and that accumulates knowledge across every session without any ongoing maintenance.\n# install pip install py-memori # agent stores a lesson at end of session memori store &#34;WAL mode deadlock in SQLite requires explicit BEGIN IMMEDIATE&#34; \\ --meta &#39;{&#34;type&#34;: &#34;debugging&#34;, &#34;project&#34;: &#34;api-service&#34;}&#39; # agent retrieves relevant context at start of next session memori context --compact --project api-service The architecture exists to make that loop reliable and fast. Nothing more.\nThe Code Memori is open source at github.com\/archit15singh\/memori. The core decision points discussed above all live in memori-core\/src\/ &ndash; specifically search.rs for the RRF and decay logic, storage.rs for deduplication, and schema.rs for the FTS5 setup and migrations.\nIf you&rsquo;re building something that needs persistent context across agent sessions, I&rsquo;d be interested in what you find.\n","permalink":"https:\/\/archit15singh.github.io\/posts\/2026-03-24-memori-architecture\/","summary":"<blockquote>\n<p><strong>Update, 12 November 2026:<\/strong> Memori is now <a href=\"https:\/\/github.com\/archit15singh\/lorevell\">Lorevell<\/a>. The current version uses Markdown notes as its source of truth and a rebuildable SQLite index. This article describes an earlier version; use the <a href=\"https:\/\/github.com\/archit15singh\/lorevell\/blob\/main\/docs\/rebrand.md\">current setup and rename guide<\/a> for installation and migration.<\/p>\n<\/blockquote>\n<h1 id=\"building-persistent-memory-for-ai-agents\">Building Persistent Memory for AI Agents<\/h1>\n<p>Every AI coding agent session starts from zero. The agent doesn&rsquo;t remember that you spent three hours last Tuesday debugging a SQLite WAL-mode deadlock, or that you decided against a particular abstraction pattern after trying it twice, or that your project has a non-obvious deployment constraint that every new session will trip over unless you paste it into the prompt again.<\/p>","title":"Building Persistent Memory for AI Agents: Architecture Decisions in Memori"},{"content":"Hard Constraints Belong in Code LLMs are probabilistic reasoners. They draw on model priors to interpret ambiguous inputs, frame hypotheses, and synthesize trade-offs across a large solution space. That&rsquo;s exactly what makes them useful for complex decisions - and exactly what makes them unreliable for enforcing hard rules.\nDeterministic code is the opposite. It has no priors, no judgment, no ability to explore. But it guarantees correctness on anything reducible to math or a lookup.\nThe right architecture for high-stakes decisions uses both. The LLM does what probabilistic reasoning is good at - exploring the space of possible responses using its priors about costs, risks, and trade-offs. Deterministic code does what it&rsquo;s good at - enforcing constraints, running calculations, and returning structured results the model can reason over. Neither alone is sufficient. The failure mode of pure LLM is subtle: the model sounds confident, the output looks reasonable, and then someone catches that the recommended supplier isn&rsquo;t certified for that part, or the suggested order quantity violates a contractual minimum. The failure mode of pure deterministic optimization is different: it answers the question you asked, not the question you needed to ask.\nGetting the boundary between the two right is the core design decision.\nThe Problem with Pure LLM Optimization Take a concrete scenario: a policy event changes import tariffs on a particular trade lane. A supply chain team needs to know what to do - which parts to reroute, to which suppliers, over what timeline, at what cost.\nA naive approach sends this to a model and asks for a recommendation. The model will give you one. It will sound authoritative. It will probably even be structurally reasonable. But it has no access to your actual supplier contracts, no way to check certification requirements against each part number, no mechanism to validate that the recommended order volumes are actually achievable given supplier capacity.\nUser: &#34;25% tariff on China -&gt; Korea lane. What should we do?&#34; LLM: &#34;Consider rerouting to Vietnam suppliers, or absorbing cost, or diversifying across multiple lanes...&#34; What the LLM cannot do: \u2717 Calculate the actual annualized cost delta across 340 affected SKUs \u2717 Check whether Vietnam suppliers are certified for each spec \u2717 Verify contractual minimum order quantities at forecast volumes \u2717 Guarantee the math is right under any scenario \u2717 Produce an output with an audit trail The model doesn&rsquo;t know what it doesn&rsquo;t know about your constraints. It will happily recommend something that looks optimal and is operationally impossible.\nThe Problem with Pure Deterministic Optimization The reflex fix is to throw this at an operations research model - minimize cost subject to constraints, return the optimal routing.\nminimize: \u03a3(cost[i] * volume[i]) subject to: lead_time[i] \u2264 max_lead_time supplier_capacity[i] \u2265 demand[i] certification_valid[i,j] = true moq[i,j] \u2264 order_quantity[i,j] This is correct and reproducible. It will also only answer the question you asked. The question you need answered is: which scenarios are worth evaluating? A 25% tariff shock doesn&rsquo;t have one obvious response - it has a space of possible responses, each with different risk profiles, transition timelines, and strategic implications. The optimization model needs a human to frame each scenario, encode each trade-off, and decide what the objective function should be.\nThat&rsquo;s the gap. The deterministic system can compute any scenario you give it with perfect accuracy. It cannot decide which scenarios to explore.\nWHAT CODE DOES WELL WHAT LLMs DO WELL --------------------- ----------------------- Arithmetic Interpreting policy language Constraint enforcement Framing scenario hypotheses Reproducible math Exploring the parameter space Audit trails Synthesizing trade-offs Checking feasibility Explaining decisions Neither alone solves the problem. The answer is to wire them together so each does what it&rsquo;s actually good at.\nThe Architecture: LLM as Explorer, Code as Enforcer The core design principle:\nHard constraints are enforced by code. The LLM explores the optimization parameter space via simulator access.\nThe LLM is an agent that calls a deterministic simulator as a tool. The simulator enforces all hard constraints - certifications, MOQs, capacity limits, contractual minimums - and returns structured results. The LLM reasons over those results, adjusts its hypotheses, runs more simulations, and synthesizes a recommendation.\n+-----------------------------------------------------------------+ | HYBRID AGENT SYSTEM | | | | +--------------+ +-------------------------------+ | | | | | DETERMINISTIC | | | | LLM AGENT |--------&gt;| SIMULATOR | | | | |&lt;--------| | | | | Explores | tool | Enforces hard constraints | | | | Reasons | calls | Runs cost calculations | | | | Synthesizes | | Returns structured results | | | | Explains | | Reproducible math | | | | | | | | | +--------------+ +-------------------------------+ | | | | LLM decides WHAT to simulate. | | Code decides WHETHER it&#39;s feasible and WHAT it costs. | +-----------------------------------------------------------------+ The Execution Loop Walking through the tariff scenario with this architecture:\nStep 1: The LLM frames the scenario space Before touching the simulator, the agent reasons about the response categories:\nLLM internal reasoning: &#34;25% tariff affects ~340 SKUs on the China -&gt; Korea lane. Response strategies fall along two axes: cost delta vs. transition risk breadth of rerouting vs. selectivity I&#39;ll construct 5 scenarios spanning the trade-off space: 1. Absorb full tariff - baseline 2. Full reroute to Vietnam alternatives 3. Selective reroute - highest-impact SKUs only 4. Nearshore to Korea domestic for top volume SKUs 5. Reroute + contract renegotiation hybrid&#34; The LLM isn&rsquo;t computing anything yet. It&rsquo;s deciding what&rsquo;s worth computing - which is exactly what it&rsquo;s good at.\nStep 2: Scenario runs with structured feedback The agent calls the simulator five times. Each call returns not just costs but constraint status:\nScenario 1: Absorb full tariff ------------------------------ agent -&gt; simulator({routing: current, tariff_applied: true}) &lt;- { annual_cost_delta: +$47M, lead_time_delta: 0 days, constraint_violations: [] } Scenario 2: Full Vietnam reroute --------------------------------- agent -&gt; simulator({routing: vietnam_all, affected_skus: 340}) &lt;- { annual_cost_delta: +$12M, lead_time_delta: +18 days, constraint_violations: [ &#34;SKU-4421: Vietnam supplier not certified for this spec&#34;, &#34;SKU-8839: MOQ minimum unmet at forecast volume&#34; ] } Scenario 3: Selective reroute (&gt;15% impact SKUs) -------------------------------------------------- agent -&gt; simulator({routing: vietnam_subset, affected_skus: 127}) &lt;- { annual_cost_delta: +$21M, lead_time_delta: +4 days, constraint_violations: [] &lt;- clean } Scenario 2 comes back with violations. The LLM doesn&rsquo;t average over them or hope the violations are minor - it takes them as hard stops and adjusts the next hypothesis accordingly. This is the feedback loop that makes the system trustworthy.\nStep 3: Synthesis over validated results After all five runs, the LLM synthesizes across scenarios where constraint violations are zero. It&rsquo;s comparing apples to apples - every option on the final shortlist has already been verified as operationally feasible:\nLLM synthesis: Scenario 1: $47M annual exposure, zero routing flexibility - baseline for comparison only. Scenario 2: Eliminated - constraint violations on 2 SKUs, high supply risk with unproven suppliers. Scenario 3: Best balance. $21M delta, +4 days lead time, no violations. Recommend this. Scenario 4: Similar cost to Scenario 3, reduces Korea-domestic strategic optionality. Scenario 5: Dependent on contract renegotiation - timeline uncertain, not executable within Q1. The output +------------------------------------------------------------+ | RECOMMENDATION: Scenario 3 - Selective Reroute | | | | Reroute 127 SKUs (&gt;15% tariff impact) to Vietnam | | alternative suppliers over 60 days. | | | | Annual cost delta: +$21M (vs. +$47M absorb baseline) | | Lead time impact: +4 days average | | Constraint status: CLEAN - no violations | | | | Why not Scenario 2: Certification gaps on 2 SKUs, | | MOQ violation at forecast volume. | | Why not Scenario 5: Renegotiation timeline exceeds Q1. | +------------------------------------------------------------+ The output isn&rsquo;t just a number. It includes the reasoning, the rejected alternatives, and the assumptions - which means a supply chain director can actually review it rather than trust it blindly.\nThe Constraint Feedback Loop The detail that makes or breaks this architecture is what happens when the simulator returns violations.\nA naive implementation ignores violations or logs them and continues. The right implementation treats them as information the LLM needs to update its hypothesis:\nWITHOUT the feedback loop: LLM proposes Scenario 2 (full Vietnam reroute) Simulator returns violations Violations included in final comparison LLM picks Scenario 2 anyway because it&#39;s cheapest Recommendation is operationally impossible WITH the feedback loop: LLM proposes Scenario 2 Simulator returns violations LLM reads violations as constraints on the next hypothesis LLM designs Scenario 3 to explicitly avoid those violation conditions Scenario 3 comes back clean Final comparison only includes clean scenarios Recommendation is both optimal AND feasible The loop is what allows the LLM to act like an experienced analyst who adjusts their recommendation when new data comes in, rather than a one-shot generator who ignores feedback.\nProduction: From Interactive to Batch The interactive version - five scenarios, real-time response - is a demo. The production version is different in scale but identical in structure:\nINTERACTIVE (demo) PRODUCTION (batch) -------------------- ---------------------------------- 5 scenarios Hundreds to thousands of simulations Real-time output Runs offline (nightly or on trigger) Single policy event Continuous monitoring for policy signals One recommendation Portfolio of documented recommendations with confidence ranges and sensitivities The production architecture adds a scheduler that detects policy changes above a materiality threshold, spawns analysis agents per affected trade lane, runs simulations in parallel, and stores the results in a structured recommendation store with full audit trails. The LLM&rsquo;s synthesis job shifts from &ldquo;pick one recommendation&rdquo; to &ldquo;summarize the portfolio and flag the high-urgency items.&rdquo;\nPolicy signals --&gt; Scheduler --&gt; Simulation Farm --&gt; Synthesis Agent --&gt; Recommendation Store (trigger) (vectorized, (LLM reads (versioned, auditable, parallel runs) batch output) human-reviewable) The key property that scales: the LLM never touches math. It reads structured outputs. So adding more simulation capacity doesn&rsquo;t require changing the LLM layer, and improving the LLM doesn&rsquo;t require revalidating the simulator.\nWhere to Draw the Line The architectural question that comes up in every variant of this problem is: what belongs in code, and what belongs in the model?\nThe rule I&rsquo;ve found most reliable:\nIf the question has a correct answer derivable from data, it belongs in code. If the question requires judgment over structured results, it belongs in the LLM.\nIN CODE: IN THE LLM: -------------------------------- ---------------------------------- Tariff rate arithmetic &#34;Which scenarios should I test?&#34; Supplier certification lookup &#34;What does this policy imply?&#34; Capacity constraint checking &#34;Which result is the best overall?&#34; MOQ enforcement &#34;Why did this scenario fail?&#34; Cost aggregation across SKUs &#34;How should I explain this?&#34; Lead time calculation &#34;What am I missing in my analysis?&#34; The failure mode when you get this wrong in the LLM direction: the model does math, gets it slightly wrong, sounds confident, and someone trusts it. The failure mode when you get this wrong in the code direction: the optimizer runs on a poorly-framed scenario, returns an &ldquo;optimal&rdquo; answer to the wrong question, and nobody catches it until a supplier misses an order.\nThe hybrid exists precisely because both failure modes are real and neither is acceptable in production.\nThe Broader Pattern This architecture - LLM as explorer, deterministic system as enforcer, structured feedback loop between them - isn&rsquo;t specific to supply chain. It applies anywhere the problem has both:\nA large space of possible actions that requires judgment to navigate Hard constraints that must hold in the output regardless of what the model recommends Loan underwriting, treatment protocol recommendation, infrastructure change management, legal contract review - any domain where a human expert would say &ldquo;here are the options I&rsquo;d consider&rdquo; AND &ldquo;here&rsquo;s what would absolutely disqualify each one&rdquo; is a candidate for this pattern.\nThe insight that makes it work in practice: the LLM doesn&rsquo;t need to know the constraints in detail. It needs to be wired to a system that enforces them and returns violations as data. The model&rsquo;s job is to respond to that data intelligently - which is exactly what it&rsquo;s good at.\nClosing The temptation with capable frontier models is to route everything through the model and treat the results as reliable. For exploration, synthesis, and explanation - that trust is usually warranted. For anything with a ground truth derivable from data, it isn&rsquo;t.\nThe architectural discipline of separating these two modes - and building the feedback loop that connects them - is what takes an AI system from &ldquo;impressive demo&rdquo; to something a production team can actually depend on.\nHard constraints belong in code. Not because models can&rsquo;t reason about them. Because production systems can&rsquo;t afford to find out when they got it slightly wrong.\n","permalink":"https:\/\/archit15singh.github.io\/posts\/2026-03-23-hard-constraints-belong-in-code\/","summary":"<h1 id=\"hard-constraints-belong-in-code\">Hard Constraints Belong in Code<\/h1>\n<p>LLMs are probabilistic reasoners. They draw on model priors to interpret ambiguous inputs, frame hypotheses, and synthesize trade-offs across a large solution space. That&rsquo;s exactly what makes them useful for complex decisions - and exactly what makes them unreliable for enforcing hard rules.<\/p>\n<p>Deterministic code is the opposite. It has no priors, no judgment, no ability to explore. But it guarantees correctness on anything reducible to math or a lookup.<\/p>","title":"Hard Constraints Belong in Code: The Probabilistic-Deterministic Hybrid Agent Pattern"},{"content":" Update, 12 November 2026: Memori is now Lorevell. The current version uses Markdown notes as its source of truth and a rebuildable SQLite index. This article describes an earlier version; use the current setup and rename guide for installation and migration.\nTry the 2.0 preview: The wheel quickstart includes a two-note search and archive demo. The verified wheels run on Apple Silicon macOS and Ubuntu arm64 without Rust.\nDesigning CLI Tools for AI Agents Most CLI tools are designed for humans who can google error messages, read man pages, and ask Stack Overflow. AI agents can&rsquo;t do any of that. They get one shot at parsing your output, one chance to recover from an error, and they pay per token for everything you print.\nI built Memori &ndash; a persistent memory system for Claude Code &ndash; and discovered that designing for agents forced me to make a better tool for everyone. Here are the principles I extracted, grounded in exact code from the repository.\nThe Core Insight AI agents interact with CLI tools the same way a junior developer does on their first day: they read help text, try commands, parse output, and recover from errors. The difference is that agents do this thousands of times, never learn from frustration, and can&rsquo;t ask a coworker for help.\nThis means every design decision that reduces ambiguity, eliminates guesswork, or enables self-recovery compounds across thousands of invocations. A CLI designed for agents isn&rsquo;t a different tool &ndash; it&rsquo;s a better tool for everyone.\nPrinciple 1: Dual-Mode Output &ndash; Humans and Machines from the Same Command Every command should produce both human-readable and machine-readable output, controlled by a flag. The human output is the default. The machine output is structured JSON.\n# Human-readable (default) $ memori search --text &#34;database&#34; a1b2c3d4 [0.85] Chose SQLite over Postgres for portability [decision] # Machine-readable $ memori --json search --text &#34;database&#34; [{&#34;id&#34;: &#34;a1b2c3d4-...&#34;, &#34;content&#34;: &#34;Chose SQLite...&#34;, &#34;score&#34;: 0.85, ...}] # Compact machine-readable (saves tokens) $ memori --raw search --text &#34;database&#34; [{&#34;id&#34;:&#34;a1b2c3d4-...&#34;,&#34;content&#34;:&#34;Chose SQLite...&#34;,&#34;score&#34;:0.85}] The entire output formatting strategy hinges on a three-line helper function:\ndef _json_indent(args): &#34;&#34;&#34;Return indent level for JSON output: None for --raw, 2 otherwise.&#34;&#34;&#34; return None if getattr(args, &#34;raw&#34;, False) else 2 Every subcommand calls _json_indent(args) when serializing output. None produces compact single-line JSON for --raw; 2 produces pretty-printed JSON for --json. One function, consistent formatting everywhere.\nThe human output path in cmd_search() shows how to design scannable output &ndash; truncated IDs, bracketed scores, and access frequency only surfaced when it&rsquo;s significant (above 5 hits):\nfor r in results: score = f&#34;[{r[&#39;score&#39;]:.4f}]&#34; if r.get(&#34;score&#34;) is not None else &#34;&#34; meta = json.dumps(r.get(&#34;metadata&#34;) or {}) access = r.get(&#34;access_count&#34;, 0) access_str = f&#34; ({access} hits)&#34; if access &gt; 5 else &#34;&#34; print(f&#34;{r[&#39;id&#39;][:8]} {score} {r[&#39;content&#39;]} meta={meta}{access_str}&#34;) The token budget problem: LLM agents pay per token. The --raw flag strips whitespace and indentation, cutting output size by ~40%. The --compact flag on the context command goes further &ndash; truncating IDs to 8 characters and content to 100 characters. These aren&rsquo;t cosmetic choices &ndash; they directly determine how much context an agent can work with in a single session.\nPrinciple 2: Errors That Teach Most CLI tools treat errors as stop signs. For AI agents, errors should be road signs &ndash; they need to say what went wrong, why, and what to do instead.\nThe foundation is the _err() helper:\ndef _err(error_type, message, exit_code=1, use_json=False, input_id=None): &#34;&#34;&#34;Print an error and exit. When use_json is True, emit structured JSON to stderr.&#34;&#34;&#34; if use_json: obj = {&#34;error&#34;: error_type, &#34;message&#34;: message} if input_id is not None: obj[&#34;id&#34;] = input_id print(json.dumps(obj), file=sys.stderr) else: print(f&#34;{message}&#34;, file=sys.stderr) sys.exit(exit_code) Every error goes through this function. In human mode, you get a readable message. In JSON mode, you get a structured object with a machine-parseable error type and the original input id, all on stderr. The exit code is always explicit.\nThis enables different error recovery strategies at the call site. Look at how cmd_related() parses upstream Rust errors and translates them into agent-actionable hints:\ndef cmd_related(args): db = _get_db(args.db) try: results = db.related(args.id, limit=args.limit) except RuntimeError as e: err_msg = str(e) if &#34;no embedding&#34; in err_msg: error_type = &#34;no_embedding&#34; hint = &#34; (run &#39;memori embed&#39; to generate embeddings)&#34; elif &#34;ambiguous&#34; in err_msg: error_type = &#34;ambiguous_prefix&#34; hint = &#34; (use a longer prefix to disambiguate)&#34; else: error_type = &#34;not_found&#34; hint = &#34; (try &#39;memori list&#39; to see available memories)&#34; _err(error_type, err_msg + hint, exit_code=1, use_json=args.json, input_id=args.id) Three different failure modes, three different recovery hints. An agent receiving &quot;no_embedding&quot; knows to run memori embed. An agent receiving &quot;ambiguous_prefix&quot; knows to retry with a longer ID. No documentation lookup needed &ndash; the error itself is the documentation.\nExit codes as signal: 0 = success, 1 = not found (possibly transient), 2 = user input error (deterministic, don&rsquo;t retry). An agent that gets exit code 2 from _parse_json() knows not to retry with the same malformed JSON.\nPrinciple 3: Progressive Disclosure in Help Text Agents read --help before they read documentation. Your help text is your most important documentation surface.\nBad: Showing only syntax.\nusage: tool store [-h] [--meta META] content Good: Showing syntax, then examples that demonstrate the intent. Memori uses argparse&rsquo;s epilog field with RawDescriptionHelpFormatter on every subcommand. The store command&rsquo;s help shows exact, copy-pasteable examples:\nExamples: memori store &#34;FTS5 hyphens crash MATCH&#34; --meta &#39;{&#34;type&#34;: &#34;debugging&#34;}&#39; memori store &#34;prefer dark mode&#34; --meta &#39;{&#34;type&#34;: &#34;preference&#34;}&#39; --json Warnings over rejections: The _warn_unknown_type() function demonstrates progression before blocking:\ndef _warn_unknown_type(meta): &#34;&#34;&#34;Warn if metadata has an unrecognized type value (never reject).&#34;&#34;&#34; if meta and isinstance(meta, dict) and &#34;type&#34; in meta: t = meta[&#34;type&#34;] if isinstance(t, str) and t not in KNOWN_TYPES: known = &#34;, &#34;.join(sorted(KNOWN_TYPES)) print(f&#34;Warning: unknown type &#39;{t}&#39;. Known types: {known}&#34;, file=sys.stderr) The operation succeeds. The warning teaches. The agent learns what types are valid without losing its work. This is critical &ndash; agents often experiment with parameters, and rejecting valid-but-unexpected inputs forces unnecessary retries.\nPrinciple 4: One Command for Session Start AI agents start fresh every session. They need to reconstruct context quickly. A single &ldquo;catch me up&rdquo; command is worth more than five individual queries.\nMemori&rsquo;s cmd_context() aggregates four queries into one call:\ndef cmd_context(args): db = _get_db(args.db) topic = args.topic total = db.count() # Relevant matches (always hybrid search) matches = db.search(text=topic, filter=search_filter, limit=limit) # Recent memories (by last update, not creation) recent = db.list(sort=&#34;updated&#34;, limit=5) # Frequently accessed (only show if any have been accessed) frequent = db.list(sort=&#34;count&#34;, limit=3) frequent = [r for r in frequent if r.get(&#34;access_count&#34;, 0) &gt; 0] # Stale memories (created 30+ days ago, never accessed) thirty_days_ago = time.time() - 30 * 86400 stale_candidates = db.list(sort=&#34;created&#34;, limit=20, before=thirty_days_ago) stale = [r for r in stale_candidates if r.get(&#34;access_count&#34;, 0) == 0][:5] # Type distribution type_dist = db.type_distribution() The output is a single Markdown document with sections:\n## Relevant Memories: &#34;kafka architecture&#34; - a1b2c3d4 [0.85] Chose event sourcing over CQRS because... ## Recent Memories (by last update) - e5f6a7b8 [decision] Switched from Avro to Protobuf... ## Frequently Accessed - c9d0e1f2 (12 hits) Kafka partition key strategy... ## Stale Memories (30+ days, never accessed) - g3h4i5j6 WAL mode enables concurrent reads... ## Stats Total: 47 memories | Types: debugging: 12, decision: 15, ... Why one command beats five: Latency. Token budget. Cognitive load. An agent calling search, then list --sort access_count, then list --sort updated_at, then stats separately wastes four round-trips and produces four separate outputs to parse.\nThe compact mode goes further &ndash; truncating IDs to 8 chars, content to 100 chars, and emitting flat JSON optimized for agent parsing:\ndef _compact_entry(r): entry = {&#34;id&#34;: r[&#34;id&#34;][:8], &#34;content&#34;: r[&#34;content&#34;]} if r.get(&#34;score&#34;) is not None: entry[&#34;score&#34;] = round(r[&#34;score&#34;], 4) meta = r.get(&#34;metadata&#34;) if meta and isinstance(meta, dict) and &#34;type&#34; in meta: entry[&#34;type&#34;] = meta[&#34;type&#34;] return entry Principle 5: Smart Defaults, Explicit Overrides The default behavior should be the right behavior 90% of the time. Flags exist for the other 10%.\nDeduplication: Look at how cmd_store() handles the default:\ndef cmd_store(args): db = _get_db(args.db) meta = _parse_json(args.meta, &#34;--meta&#34;, use_json=args.json) if args.meta else None _warn_unknown_type(meta) # Determine dedup threshold dedup_threshold = None if not args.no_dedup: dedup_threshold = args.dedup_threshold # defaults to 0.92 result = db.insert(args.content, vector=vector, metadata=meta, dedup_threshold=dedup_threshold, no_embed=args.no_embed) mid = result[&#34;id&#34;] action = result[&#34;action&#34;] if action == &#34;deduplicated&#34;: print(f&#34;Deduplicated: {mid} (updated existing memory)&#34;) else: print(f&#34;Stored: {mid}&#34;) The agent doesn&rsquo;t need to check for duplicates first. The Rust core&rsquo;s insert() does the heavy lifting &ndash; auto-embedding the content, finding duplicates by cosine similarity within the same memory type, and either updating the existing record or creating a new one:\npub fn insert(conn: &amp;Connection, content: &amp;str, vector: Option&lt;&amp;[f32]&gt;, metadata: Option&lt;Value&gt;, dedup_threshold: Option&lt;f32&gt;, no_embed: bool) -&gt; Result&lt;InsertResult&gt; { let id = uuid::Uuid::new_v4().to_string(); \/\/ Auto-embed if no explicit vector and not suppressed let auto_vec = if no_embed { None } else { auto_embed(content, vector) }; let effective_vec = vector.or(auto_vec.as_deref()); \/\/ Dedup check: if we have a vector and dedup is enabled, look for duplicates if let (Some(threshold), Some(vec)) = (dedup_threshold, effective_vec) { let type_filter = metadata.as_ref() .and_then(|m| m.get(&#34;type&#34;)) .and_then(|t| t.as_str()); if let Some(dup_id) = find_duplicate(conn, vec, type_filter, threshold)? { update(conn, &amp;dup_id, Some(content), Some(vec), metadata, false)?; return Ok(InsertResult::Deduplicated(dup_id)); } } conn.execute(&#34;INSERT INTO memories ...&#34;, params![id, content, ...])?; Ok(InsertResult::Created(id)) } The asymmetry principle: The CLI defaults to dedup at 0.92 threshold (DEFAULT_DEDUP_THRESHOLD). But the Python API defaults to None (no dedup). Same underlying function, different ergonomics &ndash; agents accumulate memories and need dedup protection, while library callers may have their own dedup logic.\nSearch mode selection: When an agent passes --text &quot;query&quot;, the Rust search() function automatically embeds the text and runs hybrid search. The dispatch is clean:\nlet results = match (&amp;query.vector, &amp;query.text) { (Some(vec), Some(text)) =&gt; hybrid_search(conn, vec, text, ...), (Some(vec), None) =&gt; vector_search(conn, vec, ...), (None, Some(text)) =&gt; { if query.text_only { text_search(conn, text, ...) \/\/ FTS5 only (agent&#39;s explicit choice) } else { let query_vec = embed_text(text); \/\/ auto-embed hybrid_search(conn, &amp;query_vec, text, ...) \/\/ then hybrid } } (None, None) =&gt; recent_search(conn, ...), \/\/ fallback to recency }; No flags needed for the common case. --text-only exists for when the agent knows lexical matching is sufficient.\nPrinciple 6: Short IDs with Collision Detection UUIDs are 36 characters. Agents work with tokens. Every character costs something.\nThe Rust resolve_prefix() function handles this transparently:\npub fn resolve_prefix(conn: &amp;Connection, prefix: &amp;str) -&gt; Result&lt;String&gt; { if prefix.len() &gt;= 36 { return Ok(prefix.to_string()); \/\/ full UUID passthrough } let mut stmt = conn.prepare( &#34;SELECT id FROM memories WHERE id LIKE ?1 || &#39;%&#39; LIMIT 2&#34; )?; let mut rows = stmt.query(params![prefix])?; let first = match rows.next()? { Some(row) =&gt; row.get::&lt;_, String&gt;(0)?, None =&gt; return Err(MemoriError::NotFound(prefix.to_string())), }; \/\/ Check if there&#39;s a second match if rows.next()?.is_some() { let count: i64 = conn.query_row( &#34;SELECT COUNT(*) FROM memories WHERE id LIKE ?1 || &#39;%&#39;&#34;, params![prefix], |row| row.get(0), )?; return Err(MemoriError::AmbiguousPrefix(prefix.to_string(), count as usize)); } Ok(first) } Three key design decisions:\nLIMIT 2 optimization: Only fetch two rows. If there&rsquo;s a second match, we know there&rsquo;s ambiguity without scanning the full table. B-tree range scan: LIKE prefix% on a UUID primary key uses the index. No table scan. Collision detection, not silent resolution: The error includes the total match count, giving the agent enough information to retry with a longer prefix. Every mutation in the Memori facade calls resolve_prefix() automatically &ndash; get(), update(), delete(), touch(), related(). The agent never manages full UUIDs.\nPrinciple 7: The Behavioral Snippet &ndash; Teaching an Agent When, Not Just How This is the most unconventional principle and possibly the most important one. A CLI tool can inject a behavioral guide directly into the agent&rsquo;s system prompt.\nMemori&rsquo;s cmd_setup() writes a 106-line snippet into ~\/.claude\/CLAUDE.md. The snippet doesn&rsquo;t document commands &ndash; --help does that. It documents behavior:\nWhen to store (from the snippet):\n&ldquo;After fixing a bug where the root cause was not obvious from the error message &ndash; store the root cause chain, not the fix itself&rdquo; &ldquo;After choosing between alternatives &ndash; store what was chosen and what was rejected with reasoning&rdquo; &ldquo;When user explicitly states a preference about tools, style, or workflow&rdquo; When NOT to store:\n&ldquo;Facts already in CLAUDE.md, README, or inline code comments (don&rsquo;t duplicate)&rdquo; &ldquo;Session-specific context (current file paths, variable names, temp state)&rdquo; &ldquo;Anything you&rsquo;re uncertain about &ndash; verify first, store after&rdquo; Content quality guidance:\n&ldquo;Each memory should be 1-3 sentences: the insight, the context, and optionally the evidence. If you need more, you&rsquo;re storing a document, not a memory &ndash; use a file instead.&rdquo; This turns the CLI from a passive tool into an active participant in the agent&rsquo;s decision-making.\nVersion-tagged markers enable the setup command to auto-upgrade stale snippets:\nSNIPPET_START = f&#34;&lt;!-- memori:start v{__version__} --&gt;&#34; SNIPPET_END = f&#34;&lt;!-- memori:end v{__version__} --&gt;&#34; The upgrade logic detects version mismatches and replaces the old snippet:\nmarkers = _find_markers(content) if markers is not None: _, _, old_version = markers if old_version == __version__: print(f&#34;Memori snippet already present in {target}&#34;) return # Stale version -- re-inject start_idx, end_idx, _ = markers content = content[:start_idx] + content[end_idx:] content += separator + snippet print(f&#34;Updated memori snippet in {target} (v{old_v} -&gt; v{__version__})&#34;) The tool manages its own documentation lifecycle. No manual intervention needed.\nPrinciple 8: Metadata as Structured Context Free-text content is searchable but not filterable. Metadata bridges the gap.\n# Store with typed metadata memori store &#34;Chose SQLite over Postgres&#34; --meta &#39;{&#34;type&#34;: &#34;decision&#34;, &#34;project&#34;: &#34;memori&#34;}&#39; # Filter by metadata memori search --filter &#39;{&#34;type&#34;: &#34;decision&#34;, &#34;project&#34;: &#34;memori&#34;}&#39; Tag coercion: The _parse_tag_value() function auto-types values:\ndef _parse_tag_value(v): &#34;&#34;&#34;Parse a tag value string into its natural type (bool, int, float, or str).&#34;&#34;&#34; if v.lower() == &#34;true&#34;: return True if v.lower() == &#34;false&#34;: return False try: return int(v) except ValueError: pass try: return float(v) except ValueError: pass return v memori tag a1b2c3d4 count=42 verified=true score=3.14 stores typed values that round-trip correctly through store, tag, and filter.\nSafe filtering in Rust: The build_filter_clause() function converts JSON filters into json_extract() WHERE clauses with key validation against [a-zA-Z_][a-zA-Z0-9_]* to prevent SQL injection:\nfn build_filter_clause(filter: &amp;Value) -&gt; Result&lt;String&gt; { match filter { Value::Object(map) =&gt; { let mut conditions = Vec::with_capacity(map.len()); for (key, val) in map { if !is_valid_filter_key(key) { return Err(MemoriError::InvalidFilter(...)); } let json_val = match val { Value::String(s) =&gt; format!(&#34;&#39;{}&#39;&#34;, s.replace(&#39;\\&#39;&#39;, &#34;&#39;&#39;&#34;)), Value::Number(n) =&gt; n.to_string(), Value::Bool(b) =&gt; if *b { &#34;1&#34;.into() } else { &#34;0&#34;.into() }, _ =&gt; format!(&#34;&#39;{}&#39;&#34;, val.to_string().replace(&#39;\\&#39;&#39;, &#34;&#39;&#39;&#34;)), }; conditions.push(format!( &#34;json_extract(metadata, &#39;$.{}&#39;) = {}&#34;, key, json_val )); } Ok(conditions.join(&#34; AND &#34;)) } _ =&gt; Ok(&#34;1=1&#34;.to_string()), } } Flat equality only: No nested paths, no operators. This is intentional &ndash; simpler API surface, no injection risk, sufficient for 95% of agent filtering needs. The constraint is documented so agents don&rsquo;t waste tokens trying {&quot;count&quot;: {&quot;&gt;&quot;: 5}}.\nPrinciple 9: Stderr for Errors, Stdout for Data This sounds obvious. It isn&rsquo;t. Getting it wrong creates a class of bugs that are invisible during development and catastrophic in production.\nConsider what happens when an agent pipes search results into a file:\nmemori search --text &#34;kafka&#34; --json &gt; results.json If the search fails and the error goes to stdout, results.json now contains {&quot;error&quot;: &quot;no_embedding&quot;, &quot;message&quot;: &quot;...&quot;}. The agent reads this file, tries to parse it as search results, and hallucinates downstream behavior based on an error object it interpreted as data. No crash. No exception. Just silently wrong.\nLook at the _err() function from Principle 2 again &ndash; both the human-readable and JSON error paths write to file=sys.stderr. Success output goes to stdout via print(). The separation is absolute, and it&rsquo;s enforced by routing all errors through a single function rather than trusting each command to remember.\nThe full contract: Stdout gets data. Stderr gets errors. Exit code 0 means stdout is trustworthy. Non-zero means stderr explains why. An agent that checks $? before parsing stdout never misinterprets an error as data.\nPrinciple 10: Idempotent Setup and Graceful Degradation Agents may run setup commands multiple times. Configuration should be idempotent &ndash; running it twice produces the same result as running it once.\nThe setup command&rsquo;s marker detection makes this safe:\nmarkers = _find_markers(content) if markers is not None: _, _, old_version = markers if old_version == __version__: print(f&#34;Memori snippet already present in {target}&#34;) return # idempotent -- no changes Graceful degradation on empty state: When an agent runs memori context &quot;topic&quot; on a fresh database with zero memories, the output path returns clean sections with (no matches) and (empty) &ndash; not errors:\n## Relevant Memories: &#34;topic&#34; (no matches) ## Recent Memories (by last update) (empty) ## Stats Total: 0 memories The agent reads this, understands the database is empty, and moves on. No error handling needed. No special case code. The tool works correctly at every scale, from zero to thousands.\nBonus: Hybrid Search with Reciprocal Rank Fusion This isn&rsquo;t a CLI design principle per se, but it&rsquo;s a design decision that directly affects agent experience. When an agent searches, should it get lexical matches or semantic matches? The answer is both.\nMemori&rsquo;s hybrid_search() runs FTS5 and vector search in parallel, then fuses results using Reciprocal Rank Fusion:\nfn hybrid_search(conn: &amp;Connection, query_vec: &amp;[f32], query_text: &amp;str, filter: Option&lt;&amp;str&gt;, limit: usize, now: f64) -&gt; Result&lt;Vec&lt;Memory&gt;&gt; { let candidate_limit = limit * 3; \/\/ over-fetch for better fusion let vec_results = vector_search(conn, query_vec, filter, candidate_limit, now)?; let text_results = text_search(conn, query_text, filter, candidate_limit, now)?; \/\/ Build rank maps, collect unique candidates... \/\/ Compute RRF scores let mut scored: Vec&lt;(Memory, f32)&gt; = all_memories.into_values().map(|m| { let vec_rank = vec_ranks.get(&amp;m.id).copied().unwrap_or(candidate_limit + 1); let text_rank = text_ranks.get(&amp;m.id).copied().unwrap_or(candidate_limit + 1); let rrf = 1.0 \/ (RRF_K + vec_rank as f32) + 1.0 \/ (RRF_K + text_rank as f32); (m, rrf) }).collect(); scored.sort_by(|a, b| b.1.partial_cmp(&amp;a.1).unwrap()); scored.truncate(limit); \/\/ ... } RRF uses ranks, not scores, because cosine similarity and BM25 are on incompatible scales. K=60 is a tunable constant that controls how much weight goes to top-ranked results. Results are also boosted by access frequency with exponential time decay (~69 day half-life), so agents naturally get relevant and fresh results.\nThe agent doesn&rsquo;t need to know any of this. It just calls memori search --text &quot;query&quot; and gets good results. But the --text-only escape hatch exists for when lexical precision matters more than semantic recall.\nPutting It All Together These ten principles converge on a single design philosophy: make the common workflow transparent and the error path self-correcting.\nAn AI agent using a well-designed CLI tool should be able to:\nRead --help and understand what to do Run the command and parse the output Hit an error and know how to recover Never need external documentation The agent&rsquo;s interaction with your tool is a conversation. The tool&rsquo;s output is its side of that conversation. Design it like you&rsquo;re pair programming with someone who&rsquo;s brilliant but has no context &ndash; because that&rsquo;s exactly what&rsquo;s happening.\nPrinciple One-Liner Dual-mode output --json and --raw on every command Errors that teach What failed, why, and how to fix it Progressive disclosure Examples in --help, warnings over rejections Session start command One call aggregates multiple queries Smart defaults Right behavior without flags, overrides when needed Short IDs Prefix resolution with collision detection Behavioral snippet Teach when to use, not just how Structured metadata Flat JSON, auto-typed tags, equality filtering Stderr\/stdout separation Errors to stderr, data to stdout, always Idempotent setup Safe to run twice, graceful on empty state The best CLI tools for AI agents aren&rsquo;t AI-specific tools. They&rsquo;re well-designed tools that happen to work exceptionally well when the user is a machine. Every principle here &ndash; structured output, teaching errors, smart defaults, graceful degradation &ndash; makes the tool better for human developers too.\nThe difference is that humans forgive bad design. Agents don&rsquo;t. Design for agents, and humans benefit for free.\nThe full source is at github.com\/archit15singh\/memori.\n","permalink":"https:\/\/archit15singh.github.io\/posts\/2026-02-28-designing-cli-tools-for-ai-agents\/","summary":"<blockquote>\n<p><strong>Update, 12 November 2026:<\/strong> Memori is now <a href=\"https:\/\/github.com\/archit15singh\/lorevell\">Lorevell<\/a>. The current version uses Markdown notes as its source of truth and a rebuildable SQLite index. This article describes an earlier version; use the <a href=\"https:\/\/github.com\/archit15singh\/lorevell\/blob\/main\/docs\/rebrand.md\">current setup and rename guide<\/a> for installation and migration.<\/p>\n<p><strong>Try the 2.0 preview:<\/strong> The <a href=\"https:\/\/github.com\/archit15singh\/lorevell\/releases\/tag\/preview-2.0.0\">wheel quickstart<\/a> includes a two-note search and archive demo. The verified wheels run on Apple Silicon macOS and Ubuntu arm64 without Rust.<\/p>\n<\/blockquote>\n<h1 id=\"designing-cli-tools-for-ai-agents\">Designing CLI Tools for AI Agents<\/h1>\n<p>Most CLI tools are designed for humans who can google error messages, read man pages, and ask Stack Overflow. AI agents can&rsquo;t do any of that. They get one shot at parsing your output, one chance to recover from an error, and they pay per token for everything you print.<\/p>","title":"Designing CLI Tools for AI Agents: Lessons from Building Memori"},{"content":"The AI-Augmented Developer Playbook A comprehensive framework for leveraging abstract thinking, pattern recognition, and AI orchestration in modern software development.\nCore Principles The five foundational truths:\n1. Code is Artifact, Not Work Product The work product is correct system behavior. Code is just how you get there.\n2. Abstraction is Leverage Higher abstraction = more leverage.\nLine-level: 1x Function: 10x Component: 100x Pattern: 1000x Architecture: 10000x 3. Patterns are Hypotheses, Not Facts Every pattern needs validation:\nWhy does this pattern exist? Is it intentional? Is it still correct? Does it apply to my context? 4. Specification Quality Determines Output Quality Garbage in, garbage out. Precise intent in, useful code out.\n5. Your Value is Judgment, Not Production You&rsquo;re not paid to type. You&rsquo;re paid to know what&rsquo;s correct and ensure it gets built.\nThe Mental Model The Architect-Validator Framework You are no longer a craftsman who produces code. You are an architect who specifies intent and a validator who ensures correctness.\nOLD MODEL (Craftsman): Problem \u2192 Understand \u2192 Design \u2192 Implement \u2192 Test \u2192 Ship \u2191 YOU ARE HERE (the bottleneck) NEW MODEL (Architect-Validator): Problem \u2192 Decompose \u2192 Specify \u2192 Delegate \u2192 Validate \u2192 Ship \u2191 \u2191 \u2191 \u2191 STRUCTURE INTENT AI JUDGMENT \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500YOU ARE HERE\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518 (orchestrating the system) The Three-Layer Pattern Model When you see patterns, think in three layers:\nLayer Question Example WHAT (Structure) What does it look like? &ldquo;Query with connection, filters, error handling&rdquo; HOW (Implementation) How is it built? &ldquo;Uses warehouse X, retry pattern Y, returns DataFrame&rdquo; WHY (Rationale) Why these choices? &ldquo;Warehouse X for latency, retry Y for timeouts&rdquo; Critical insight: Most developers stop at WHAT. Good developers get to HOW. Expert AI-orchestrators always reach WHY\u2014because WHY tells you when to follow the pattern and when to deviate.\nThe Bidirectional Thinking Model Never think purely top-down or purely bottom-up. Always oscillate:\nTOP-DOWN BOTTOM-UP \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 &#34;Sampling pattern&#34; Read actual code \u2502 \u2502 \u25bc \u25bc &#34;Should have X, Y, Z&#34; &#34;I see A, B, C choices&#34; \u2502 \u2502 \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 COMPARE \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518 \u2502 \u25bc &#34;Refined understanding&#34; The Process The Five-Step Execution Loop For any significant task:\nStep 1: Abstract the Problem Convert concrete request to abstract pattern &ldquo;Get recent user activity logs&rdquo; \u2192 &ldquo;DATA_SAMPLING on LOGS with FILTER&rdquo; Output: Problem category + key constraints Step 2: Search for Pattern Instances Find existing implementations of this pattern Search by PURPOSE, not just structure Read deeply, understand the WHY Output: 2-3 canonical examples with rationale Step 3: Specify Intent Precisely Write complete specification (template below) Include: What, Why, Constraints, Patterns, Edge cases, Validation criteria Output: Specification document Step 4: Delegate to AI Provide specification + pattern references Decompose into parallel tasks where possible Don&rsquo;t over-constrain (let AI contribute) Output: AI-generated implementation Step 5: Validate Against Specification Check: Does output match specification? Check: Does it fit architectural patterns? Check: Would an expert recognize this as correct? Output: Approved code OR feedback for iteration The Specification Template ## Specification: [Component Name] ### WHAT (Functional Requirement) [One sentence describing what this component does] ### WHY (Purpose &amp; Context) [Why we need this, what problem it solves, how it fits in the system] ### CONSTRAINTS - [Hard constraint 1 - e.g., &#34;Must use existing auth pattern&#34;] - [Hard constraint 2 - e.g., &#34;Must handle X error case&#34;] - [Performance constraint - e.g., &#34;Must complete in &lt;Y seconds&#34;] ### PATTERNS TO FOLLOW - [Pattern 1]: See [file:line] for reference implementation - [Pattern 2]: See [file:line] for reference implementation ### EDGE CASES - [Edge case 1]: [Expected behavior] - [Edge case 2]: [Expected behavior] ### VALIDATION CRITERIA \u25a1 [Criterion 1 - how to verify correctness] \u25a1 [Criterion 2 - how to verify correctness] \u25a1 [Criterion 3 - how to verify correctness] The Validation Checklist Architectural Fit Uses correct design patterns for this codebase? Fits in the correct architectural layer? Follows established naming conventions? Consistent with similar components? Functional Correctness Handles all stated requirements? Handles specified edge cases? Error handling complete and appropriate? Returns correct types\/formats? Security &amp; Safety No injection vulnerabilities (SQL, command, XSS)? Authentication\/authorization correct? Secrets handled properly (not hardcoded)? No dangerous operations without safeguards? Performance &amp; Scalability No obvious inefficiencies (N+1 queries, etc.)? Appropriate for expected data scale? Resource cleanup (connections, files, etc.)? Maintainability Readable by another developer? Documented where logic is non-obvious? Testable (dependencies injectable)? No unnecessary complexity? Anti-Patterns: The Seven Deadly Sins Sin Description Remedy Premature Abstraction Abstracting before understanding implementation details Always read 2-3 implementations before abstracting Pattern Worship Following patterns blindly without understanding WHY Always ask: &ldquo;Why does this pattern exist? Does it apply here?&rdquo; Specification Laziness Giving AI vague instructions, hoping it figures it out Use the specification template. Every. Time. Validation Theater Glancing at output and saying &ldquo;looks good&rdquo; Use the validation checklist. Check each item. Over-Delegation Delegating without sufficient pattern knowledge If you can&rsquo;t validate the output, you can&rsquo;t delegate the task Under-Delegation Doing implementation yourself when AI could do it If you can specify it precisely, delegate it Solo Thinking Not leveraging parallel AI agents Decompose into independent sub-tasks, run in parallel Phase-Specific Guidance Choosing Your Starting Phase Do you have proven patterns for this? \u251c\u2500\u2500 YES \u2192 PHASE 4: Parallel Orchestration (jump to delegation) \u2514\u2500\u2500 NO \u2192 Is there existing code to learn from? \u251c\u2500\u2500 YES \u2192 PHASE 2-3: Study, then Specify \u2514\u2500\u2500 NO \u2192 PHASE 1: Deep research first Phase Descriptions Phase Focus Duration Key Activities 1: Grounded Recognition Understanding 2-4 weeks Research deeply, ask &ldquo;why&rdquo; for every pattern, validate assumptions 2: Bidirectional Thinking Balance 2-4 weeks Oscillate top-down\/bottom-up, read implementations deeply 3: Intent Specification Communication 4-8 weeks Write complete specs, include pattern references 4: Parallel Orchestration Leverage Ongoing Decompose problems, run multiple agents 5: Validation Mastery Quality Ongoing Systematic checklists, learn AI failure modes 6: Meta-Optimization Growth Ongoing Reflect weekly, track bottlenecks, build templates The Pattern Library Structure Build and maintain your personal pattern library:\n\ud83d\udcc1 Data Access Patterns \u251c\u2500\u2500 \ud83d\udcc4 Databricks Sampling \u2502 \u251c\u2500\u2500 Canonical: [file path] \u2502 \u251c\u2500\u2500 WHY: [rationale] \u2502 \u251c\u2500\u2500 Variants: [list] \u2502 \u2514\u2500\u2500 Anti-pattern: [what to avoid] \u2502 \u251c\u2500\u2500 \ud83d\udcc4 Message Fetching \u2514\u2500\u2500 \ud83d\udcc4 Entity Queries \ud83d\udcc1 Processing Patterns \u251c\u2500\u2500 \ud83d\udcc4 Parallel Investigation \u251c\u2500\u2500 \ud83d\udcc4 Hierarchical Clustering \u2514\u2500\u2500 \ud83d\udcc4 Agent Orchestration \ud83d\udcc1 Deployment Patterns \u251c\u2500\u2500 \ud83d\udcc4 Airflow DAG Structure \u251c\u2500\u2500 \ud83d\udcc4 Agent Testing \u2514\u2500\u2500 \ud83d\udcc4 gRPC Service For each pattern, document:\nName: Clear, memorable identifier Canonical example: Where to find the best implementation WHY: The rationale behind the pattern Variants: Known variations and when to use each Anti-patterns: Common mistakes to avoid Validation criteria: How to verify correct usage Quick Reference Card Before Every Task What pattern category is this? Do I have proven patterns? (If yes \u2192 Phase 4) Is there code to learn from? (If yes \u2192 Phase 2-3) Novel problem? (If yes \u2192 Phase 1) Before Delegating to AI Have I written a complete specification? Have I included pattern references? Have I defined validation criteria? Can I validate the output? (If no \u2192 don&rsquo;t delegate yet) After Receiving AI Output Run validation checklist (don&rsquo;t skip items) Check architectural fit Verify against specification Would an expert approve this? Weekly Reflection What tasks took longest? Where did I get stuck? What new pattern did I learn? What template can I create? The Leverage Equation Your Impact = (Specification Quality) \u00d7 (Validation Rigor) \u00d7 (Number of Parallel Agents) The Ultimate Test Can you specify a complex feature so precisely that an AI agent produces code indistinguishable from what an expert would write?\nWhen yes\u2014you&rsquo;ve mastered the new paradigm.\n","permalink":"https:\/\/archit15singh.github.io\/posts\/2026-01-26-ai-augmented-developer-playbook\/","summary":"<h1 id=\"the-ai-augmented-developer-playbook\">The AI-Augmented Developer Playbook<\/h1>\n<p>A comprehensive framework for leveraging abstract thinking, pattern recognition, and AI orchestration in modern software development.<\/p>\n<hr>\n<h2 id=\"core-principles\">Core Principles<\/h2>\n<p>The five foundational truths:<\/p>\n<h3 id=\"1-code-is-artifact-not-work-product\">1. Code is Artifact, Not Work Product<\/h3>\n<p>The work product is correct system behavior. Code is just how you get there.<\/p>\n<h3 id=\"2-abstraction-is-leverage\">2. Abstraction is Leverage<\/h3>\n<p>Higher abstraction = more leverage.<\/p>\n<ul>\n<li>Line-level: 1x<\/li>\n<li>Function: 10x<\/li>\n<li>Component: 100x<\/li>\n<li>Pattern: 1000x<\/li>\n<li>Architecture: 10000x<\/li>\n<\/ul>\n<h3 id=\"3-patterns-are-hypotheses-not-facts\">3. Patterns are Hypotheses, Not Facts<\/h3>\n<p>Every pattern needs validation:<\/p>","title":"The AI-Augmented Developer Playbook: Architect, Delegate, Validate"},{"content":"Forging AI\u2019s Lasting Memory: Learning from First Principles and Asimov\u2019s Robots 1. Why AI Agents Today Still \u201cForget\u201d Despite advances in large language models (LLMs), interacting with most AI chatbots feels like talking to a tide: each new wave of conversation washes away earlier details. Contrast this with Isaac Asimov\u2019s positronic robots, Daneel Olivaw or R. Giskard, who carry knowledge and context across years (or even centuries), never losing sight of a user\u2019s core preferences or a mission\u2019s essential facts.\nWhat\u2019s the root cause of this gap? In modern LLM-based systems, each response hinges on a sliding window of recent tokens. Once the conversation grows too long, everything outside that window disappears. In effect, the AI\u2019s \u201cshort-term memory\u201d is a buffer of fixed size, not a true, evolving record. To fix this, we must revisit memory from first principles: How do we decide what to store, when to revise or remove it, and how to fetch just what\u2019s needed?\n2. Memory by Design: Building Blocks from First Principles 2.1. Distilling \u201cWhat Matters\u201d Human Parallel: When you remember a friend\u2019s favorite ice cream flavor, you don\u2019t archive every detail of their childhood. You focus on the high-impact fact: \u201cThey love strawberry.\u201d AI Application: We need mechanisms that parse every user\u2013assistant exchange and surface only the most salient takeaways, for example, \u201cUser is allergic to almonds,\u201d or \u201cUser assigns highest priority to privacy.\u201d 2.2. Maintaining Coherent Truths Over Time Human Parallel: If your friend once said they were vegetarian but later explained they occasionally eat fish, you update your understanding. You don\u2019t keep both beliefs side by side.\nAI Application: Our system must reconcile conflicting inputs. Instead of accumulating contradictory snippets, introduce a protocol (inspired by Asimov\u2019s careful conflict checks) that can:\nPromote new, higher-priority facts when they override older beliefs. Archive or prune outdated or superseded statements. 2.3. Balancing Depth with Speed Human Parallel: You don\u2019t rummage through every past conversation to recall a friend\u2019s birthday; you consult a concise calendar that highlights birthdays and anniversaries. AI Application: Rather than always re-feeding a multi-thousand\u2013token transcript, craft a \u201cmemory index\u201d that points to a handful of key facts. This compressed store speeds up retrieval and reduces per-query cost. 3. Four Fundamental Memory Actions (Reimagined) In Asimov\u2019s stories, a robot\u2019s positronic brain isn\u2019t a passive log; it\u2019s a living ledger that can add, adjust, remove, or bypass information. Translating that into an AI\u2019s memory module, we identify four core operations, but let\u2019s recast them with fresh terminology and nuance:\n\u2610 \u201cEnshrine\u201d (Add)\nWhat It Means: When a new, impactful fact surfaces (e.g., \u201cUser switched from tea to coffee this morning\u201d), the system \u201censhrines\u201d this detail, storing it in the permanent ledger as a clear entry, dated and labeled. Asimovian Insight: Like a robot marking a noteworthy event in its mission log, the AI chooses to immortalize only the facts that help fulfill its purpose. \u2610 \u201cRefine\u201d (Update)\nWhat It Means: If an existing memory needs more detail (e.g., \u201cPreviously I said \u2018User likes jazz,\u2019 now it\u2019s \u2018User loves bebop and blues jazz\u2019\u201d), we \u201crefine\u201d the entry, rewriting or enriching it rather than creating a duplicate. Asimovian Insight: Daneel would refine his understanding of human motivations as new subtleties emerged, never leaving stale or partial insights in his positronic core. \u2610 \u201cFade\u201d (Delete\/Deprecate)\nWhat It Means: When a memory conflicts or loses relevance (e.g., \u201cUser said they\u2019re vegan, so their earlier \u2018vegetarian\u2019 preference must fade\u201d), mark that entry as \u201cfaded.\u201d It remains in an archival vault for audit but no longer surfaces in routine retrieval. Asimovian Insight: A robot would \u201cfade\u201d or deactivate outdated protocols that could endanger human welfare, just as our system phases out superseded user attributes. \u2610 \u201cBypass\u201d (No-Op)\nWhat It Means: Sometimes, a freshly extracted nugget doesn\u2019t need any action, if it merely echoes what\u2019s already known (e.g., \u201cUser mentions again they love traveling\u201d), the system \u201cbypasses\u201d change, leaving existing knowledge intact. Asimovian Insight: Similar to a robot recognizing that a repeated instruction doesn\u2019t warrant rewriting its mission parameters, some facts simply \u201cring true\u201d and require no alteration. By reframing Add\/Update\/Delete\/No-Op into Enshrine\/Refine\/Fade\/Bypass, we give each operation a richer identity, one that echoes how a sentient robot might manage its internal worldview.\n4. An Asimov-Inspired Memory Workflow Let\u2019s walk through a scenario borrowing from Asimov\u2019s world, but using our newly minted memory actions:\nSetting: It\u2019s the year 2047, and our AI companion \u201cR3-Angel\u201d assists Dr. Rahman, a physician studying robotic ethics. Over a series of patient consultations and research discussions, R3-Angel must remember key details, past medical decisions, evolving dietary needs, and shifting project priorities.\nInitial Interaction\nDr. Rahman: \u201cMy patient, Anika, is lactose intolerant.\u201d Memory Extraction: The system detects a critical health constraint. Action: Enshrine \u201cAnika \u2013 allergic_to \u2013 Lactose.\u201d Follow-Up\nDr. Rahman: \u201cActually, she later tested positive for a mild peanut allergy as well.\u201d Memory Extraction: New allergy emerges. Conflict Check: No direct conflict, milk allergy is separate from peanuts. Action: Enshrine \u201cAnika \u2013 allergic_to \u2013 Peanuts.\u201d Revocation\nDr. Rahman (days later): \u201cTurns out the peanut test was a false positive, she\u2019s okay with peanuts.\u201d\nMemory Extraction: Corrected allergy data.\nConflict Check: \u201cPeanut allergy\u201d contradicts \u201cPeanuts.\u201d\nAction:\nFade the \u201cPeanuts\u201d allergy entry. No need to refine any existing entry, because the new truth is simply the absence of a peanut allergy. Additional Context\nDr. Rahman: \u201cAlso, she needs to avoid shellfish during immunotherapy.\u201d\nMemory Extraction: Another dietary restriction.\nAction:\nEnshrine \u201cAnika \u2013 allergic_to \u2013 Shellfish.\u201d Check for overlap: no conflict, keep the lactate and shellfish constraints independently. Routine Query\nDr. Rahman: \u201cSuggest a dietary plan for Anika during her next chemotherapy session.\u201d\nRetrieval Protocol:\nDense Query: Convert \u201cdiet plan Anika chemotherapy\u201d into a vector, fetch nearest enshrined facts, \u201clactose intolerant,\u201d \u201cshellfish allergy.\u201d Graph Query (Entity-Centric): Identify \u201cAnika\u201d and follow edges to see all \u201callergic_to\u201d relationships. AI Response: \u201cRecommend a plant-based menu focusing on legumes, vegetables, and dairy substitutes; avoid shellfish and ensure no hidden lactose.\u201d\nAt each stage, R3-Angel\u2019s positronic memory (our AI\u2019s store) systematically enshrines new facts, refines or fades outdated entries, and bypasses redundant noise, mirroring how Asimov\u2019s robots adapt to evolving circumstances.\n5. Beyond CRUD: Enriching Memory with Contextual Layers Asimov\u2019s robots didn\u2019t just hold flat facts, they also understood nuance, emotional tone, and situational importance. To mirror that depth, consider layering our memory store with:\nContext Tags (Why It Matters)\nAttach a \u201ccontextual weight\u201d to each enshrined fact. For instance \u201cAnika, shellfish allergy\u201d might carry a \u201chigh\u201d tag when discussing chemotherapy, but \u201cmedium\u201d when chatting casually about restaurants. This helps retrieval prioritize truly mission-critical memories. Temporal Decay Profiles\nNot all facts deserve equal shelf life. For example, \u201cUser is researching a robotics conference in March 2047\u201d becomes obsolete after April 2047. Introduce a \u201cdecay timer\u201d that gradually lowers a memory\u2019s retrieval priority unless it\u2019s reaffirmed. Relationship Anchors\nWhen you enshrine \u201cAnika, shellfish allergy,\u201d also link it to \u201cchemotherapy schedule\u201d or \u201cdietary plan.\u201d That way, if a future query asks about drugs or meal recommendations, the system sees the keyword \u201cchemotherapy\u201d and directly retrieves related allergies, skipping over unrelated facets like \u201cAnika\u2019s favorite music.\u201d These enrichments transform a simple ledger into a nuanced, human-like archive, one where facts gain or lose prominence as circumstances evolve, just like a positronic brain\u2019s living tapestry of knowledge.\n6. Crafting a Memory Strategy for Real-World AI How do we translate these ideas into a concrete engineering roadmap? Here\u2019s one possible outline:\nFact Extraction Module\nBuild a lightweight LLM prompt that, given each user\u2013assistant turn, returns up to N candidate facts. Criteria: Look for health constraints, personal preferences, ongoing projects, or commitments, anything that has long-term relevance. Memory Ledger (Dense + Graph Hybrid)\nDense Side: Maintain a collection of text snippets (each fact) with embeddings and metadata (timestamp, context tags). Graph Side: Build a directed graph where nodes are entities (people, places, concepts) and edges denote relationships (e.g., \u201callergic_to,\u201d \u201cprefers,\u201d \u201cscheduled_for\u201d). Conflict Resolution Engine\nWhen ingesting a new fact, fetch top\u2013k semantically similar entries.\nUse a small classifier (possibly a distilled LLM) to decide:\nEnshrine if novelty is high; Refine if it enriches an existing entry; Fade if it contradicts and nullifies a previous fact; Bypass if it duplicates without change. Pruning &amp; Decay Policy\nAssign each fact a relevance score based on:\nTime since last access (older \u2192 lower). Number of re-affirmations (popular \u2192 higher). Context tags that still apply (e.g., \u201congoing project\u201d as opposed to \u201cone-time event\u201d). Periodically run a \u201cmemory audit\u201d to archive low-scoring facts into a cold-storage bucket (so they can be revived if needed, but not clutter everyday retrieval).\nContextual Retrieval Layer\nFirst-Pass (Dense): For simple lookups, use vector similarity to fetch top\u2013m snippets. Second-Pass (Graph): If the query hints at relationships or multi-hop reasoning (\u201cWhat diet restrictions should I follow for chemotherapy sessions?\u201d), anchor on entities (\u201cchemotherapy,\u201d \u201cdiet restrictions\u201d), traverse edges to gather all relevant nodes (e.g., allergies, metabolic conditions), and hand that subgraph to the LLM. Fusion: Combine snippets and graph-derived facts into a concise context for the LLM to generate a precise, contextual answer. 7. Embracing Asimov\u2019s Long-Term Vision In Asimov\u2019s fiction, robots evolved from isolated machines to companions that understood human nuance, preserved history, and upheld ethical imperatives across generations. Today\u2019s AI agents can begin that transformation by adopting a memory-first architecture, one that enshrines only what matters, refines as truth shifts, fades what\u2019s obsolete, and bypasses redundancy.\nBy embracing these first-principles design decisions, enriched with Asimovian metaphor, we endow AI with:\nConsistency: Never again will an AI innocently recommend lobster chowder to a dairy-allergic patient. Adaptability: When a user\u2019s circumstances change, the AI seamlessly revises its worldview. Efficiency: Conversations scale without ballooning token costs or lag. Trust: Users sense that the agent \u201cremembers them,\u201d forging deeper rapport. Ultimately, building AI that truly remembers isn\u2019t just a engineering challenge, it\u2019s a philosophical one. As Isaac Asimov showed us, memory is the bedrock of identity and purpose. By distilling his visionary robots\u2019 strengths into modern memory protocols, Enshrine, Refine, Fade, Bypass, we move closer to AI companions that aren\u2019t merely reactive, but reliably attuned to our evolving lives, just as Asimov\u2019s positronic characters were to theirs.\n","permalink":"https:\/\/archit15singh.github.io\/posts\/2024-01-01-ai-memory\/","summary":"<h1 id=\"forging-ais-lasting-memory-learning-from-first-principles-and-asimovs-robots\"><strong>Forging AI\u2019s Lasting Memory: Learning from First Principles and Asimov\u2019s Robots<\/strong><\/h1>\n<hr>\n<h3 id=\"1-why-ai-agents-today-still-forget\">1. Why AI Agents Today Still \u201cForget\u201d<\/h3>\n<p>Despite advances in large language models (LLMs), interacting with most AI chatbots feels like talking to a tide: each new wave of conversation washes away earlier details. Contrast this with Isaac Asimov\u2019s positronic robots, Daneel Olivaw or R. Giskard, who carry knowledge and context across years (or even centuries), never losing sight of a user\u2019s core preferences or a mission\u2019s essential facts.<\/p>","title":"Forging AI\u2019s Lasting Memory: Lessons from Asimov and First Principles"},{"content":"My Reading List for the Next 10 Years and Why Over the past few years, I\u2019ve found myself at the intersection of philosophy, cognitive science, and AI engineering. As a firm believer in first-principles thinking, I recognized the need for a coherent, decade-long roadmap to guide my intellectual growth and practical skill-building. Instead of random selections, I asked myself: What are the irreducible concepts I must master in epistemology, symbolic systems, cognition, memory, AI, cognitive systems, human-AI augmentation, and large-scale engineering? The result became this curated reading list.\nWhy This Journey? This list structures a decade across four layers: foundations (epistemology, how we know what we know), mechanics (AI, cognition, symbolic systems), applications (engineering, ML, HCI), and integration (systems thinking that connects everything). Each book isn\u2019t isolated; it\u2019s a thread in a larger intellectual map I\u2019m building intentionally.\nCore Domains and Essential Books \ud83e\udde0 Epistemology: Foundations of &ldquo;Knowing&rdquo; The Problems of Philosophy \u2013 Bertrand Russell \u2014 the sharpest 100-page intro to epistemology ever written; start here before anything heavier. An Introduction to the Theory of Knowledge \u2013 Robert Audi \u2014 the standard university textbook, systematic and thorough without being impenetrable. Knowledge and Its Limits \u2013 Timothy Williamson \u2014 the &ldquo;knowledge-first&rdquo; book that reframed epistemology by treating knowledge as a primitive rather than breaking it into justified-true-belief components. Epistemology: Classic Problems and Contemporary Responses \u2013 Dancy &amp; Sosa (eds.) \u2014 a solid anthology pairing canonical questions with modern responses; good for finding which direction pulls you. The Blackwell Guide to Epistemology \u2013 Greco &amp; Sosa (eds.) \u2014 broader than Dancy &amp; Sosa, covers virtue epistemology, social epistemology, and the full contemporary landscape. Virtue Epistemology \u2013 Fairweather &amp; Zagzebski (eds.) \u2014 the foundational collection for the &ldquo;virtue turn&rdquo; in epistemology; pairs well with the moral philosophy of character-based ethics. Philosophical Issues in Classical Indian Epistemology \u2013 Bimal Krishna Matilal \u2014 the best bridge into Ny\u0101ya and Buddhist logic traditions, which developed argumentation and perception theory centuries before Western analytic philosophy caught up. Logicomix \u2013 Apostolos Doxiadis &amp; Christos Papadimitriou \u2014 the graphic novel about Russell&rsquo;s agonized search for absolute truth in the foundations of mathematics; the most fun way to meet Frege, G\u00f6del, and Wittgenstein before reading their actual books. \ud83e\uddee Foundations: Probability, Physics &amp; Molecular Machinery Probability Theory: The Logic of Science \u2013 E.T. Jaynes \u2014 the deepest treatment of probability as extended logic, not just measure theory; rewires how you reason about uncertainty and is the mathematical heart of every Bayesian book on this list. The Feynman Lectures on Physics \u2013 Richard Feynman \u2014 the volume that set the standard for how physics should be taught; even if you never do particle physics, the first two volumes permanently shift your model of how the world actually works. Nanosystems \u2013 K. Eric Drexler \u2014 the quietly mind-blowing physics-based textbook on molecular machinery and computation; reads like hard sci-fi but is a serious account of where engineering bottoms out. \ud83d\udcda Symbolic Systems: Language, Logic, Computation Syntactic Structures \u2013 Noam Chomsky \u2014 the book that launched generative grammar and rewired linguistics, cognitive science, and computational theory in one shot. Society of Mind \u2013 Marvin Minsky \u2014 the weird, ambitious thesis that intelligence emerges from dumb agents competing and cooperating; still the best non-neural-network theory of mind. Introduction to the Theory of Computation \u2013 Michael Sipser \u2014 the cleanest intro to automata, complexity, and decidability; the one CS theory textbook people actually finish. Cognitive Science: An Introduction \u2013 Friedenberg &amp; Silverman \u2014 a rare single-volume overview that covers linguistics, AI, philosophy, and neuroscience without collapsing into a survey course. How to Read and Do Proofs \u2013 Daniel Solow \u2014 the shortest path to mathematical maturity; every proof technique you need, explained without condescension. Philosophical Investigations \u2013 Ludwig Wittgenstein \u2014 the book that killed the picture theory of meaning and invented the language-game; every AI discussion about meaning eventually comes back here. Mind Design II \u2013 John Haugeland (ed.) \u2014 the essential anthology of classic AI and cognitive science papers; the best way to see where connectionism, embodiment, and symbolic AI collided. Mathematical Structure of Syntactic Merge \u2013 Marcolli, Chomsky, Berwick (2025) \u2014 Chomsky&rsquo;s own late-career formalization of Merge as a Hopf algebra; a mathematical capstone for Syntactic Structures. G\u00f6del, Escher, Bach \u2013 Douglas Hofstadter \u2014 the classic that ties together recursion, self-reference, formal systems, music, and cognition; the single best bridge between the Symbolic Systems and Cognition sections. \ud83e\udd16 Artificial Intelligence: From Basics to Deep Learning Artificial Intelligence: A Modern Approach \u2013 Russell &amp; Norvig \u2014 the canonical AI textbook, the one every CS program uses; broad enough to map the entire field. Pattern Recognition and Machine Learning \u2013 Christopher Bishop \u2014 the Bayesian ML bible; dense but unmatched for probabilistic thinking about models. The Elements of Statistical Learning \u2013 Hastie, Tibshirani, Friedman \u2014 the statistical foundation of modern ML; where boosting, random forests, and lasso were first made rigorous. An Introduction to Statistical Learning \u2013 James, Witten, Hastie, Tibshirani \u2014 the accessible companion to ESL; the gentlest real path into statistical learning for anyone without a math background. Deep Learning \u2013 Goodfellow, Bengio, Courville \u2014 the book that defined the modern deep learning curriculum; start with the math prerequisites before diving in. Speech and Language Processing \u2013 Jurafsky &amp; Martin \u2014 the definitive NLP textbook, now covering transformers, LLMs, and RAG; the reference for the language side of AI that the ML books deliberately skip. Probabilistic Robotics \u2013 Thrun, Burgard, Fox \u2014 the definitive reference for robot perception and SLAM; rigorous and practical in equal measure. Reinforcement Learning: An Introduction \u2013 Sutton &amp; Barto \u2014 the clear, patient intro to RL that rewards slow reading; the foundational text for anyone building agents that learn from environment interaction. Reinforcement Learning from Human Feedback \u2013 Nathan Lambert (2025) \u2014 the first book-length treatment of RLHF and LLM post-training; covers PPO, DPO, GRPO, and reward modeling, the alignment stack behind modern chat models. Bayesian Reasoning and Machine Learning \u2013 David Barber \u2014 the most accessible treatment of graphical models and variational inference; bridges statistics and ML better than Bishop for some readers. Programming Collective Intelligence \u2013 Toby Segaran \u2014 the hands-on opposite of Bishop; builds real recommendation, clustering, and search systems from scratch with no framework overhead. \ud83e\uddec Cognition: Understanding Mental Processes Cognitive Psychology: A Student&rsquo;s Handbook \u2013 Eysenck &amp; Keane \u2014 the standard undergrad textbook that covers attention, memory, language, and decision-making without dumbing anything down. Thinking, Fast and Slow \u2013 Daniel Kahneman \u2014 the book that made dual-process theory popular culture; essential even if you&rsquo;ve absorbed its ideas from secondary sources. How the Mind Works \u2013 Steven Pinker \u2014 the ambitious, controversial argument that the mind is a system of evolved computational modules; a masterclass in big-think cognitive science. Vision: A Computational Investigation \u2013 David Marr \u2014 the foundational text on computational vision; his three-level analysis (algorithm, representation, implementation) is a thinking tool that generalizes far beyond vision. Cognition: Exploring the Science of the Mind \u2013 Daniel Reisberg \u2014 the most balanced intro textbook, pairing classic experiments with current debates. Sources of Power \u2013 Gary Klein \u2014 the book that showed naturalistic decision-making isn&rsquo;t the biased mess Kahneman describes; pattern recognition in experts is real and effective. Bounded Rationality: The Adaptive Toolbox \u2013 Gigerenzer &amp; Selten (eds.) \u2014 the canonical counterpoint to the biases school; argues smart, fast-and-frugal heuristics beat optimization under uncertainty, and gives the conditions where each one works. The Cognitive Neurosciences \u2013 Michael Gazzaniga (ed.) \u2014 the definitive reference on the brain-cognition interface; thick enough to use as a doorstop, comprehensive enough to answer any question. Then I Am Myself the World \u2013 Christof Koch (2024) \u2014 the leading IIT proponent&rsquo;s accessible case that consciousness is a measurable causal power; the best recent bridge between neuroscience and the AI question of whether machines can feel. Bayesian Models of Cognition \u2013 Griffiths, Chater, Tenenbaum (2024) \u2014 the definitive Bayesian cognitive science textbook from MIT Press; reverse-engineers the mind&rsquo;s computational strategy for getting so much from so little. Consciousness Explained \u2013 Daniel Dennett \u2014 the anti-mysterian counterpoint to Koch; the &ldquo;multiple drafts&rdquo; functionalist account of consciousness that argues the hard problem dissolves once you model it computationally. \ud83d\udcbe Memory: From Molecules to Minds Memory: From Mind to Molecules \u2013 Squire &amp; Kandel \u2014 the bridge between molecular neuroscience and cognitive psychology; the two worlds of memory research in one volume. Working Memory \u2013 Alan Baddeley \u2014 the architect of the working memory model explains the theory and its evidence; dense but rewarding. The Seven Sins of Memory \u2013 Daniel Schacter \u2014 the accessible, entertaining taxonomy of how memory fails; the kind of pop-sci book that actually teaches you something durable. Human Memory: Theory and Practice \u2013 Baddeley &amp; Anderson \u2014 the textbook companion to Baddeley&rsquo;s working memory work, covering the full landscape from encoding to retrieval. The Hippocampus as a Cognitive Map \u2013 O&rsquo;Keefe &amp; Nadel \u2014 the foundational text that established the hippocampus as a spatial map, launching the entire cognitive map field. Learning and Memory: From Brain to Behavior \u2013 Bear, Connors, Paradiso \u2014 the neurobio textbook that grounds memory in synapses, cells, and circuits; pairs with Schacter for the cognitive side. Make It Stick \u2013 Brown, Roediger, McDaniel \u2014 the book that killed the learning styles myth and made spaced retrieval and interleaving mainstream; the most useful book on this list for day-to-day studying. Why We Remember \u2013 Charan Ranganath (2024) \u2014 the accessible, NYT bestseller from a leading neuroscientist; reframes memory as a predictive system for navigating the future, not an archive of the past. \u2699\ufe0f Cognitive Systems &amp; Cognitive Science Cognitive Science: An Introduction \u2013 Stillings, Weisler, Hauff \u2014 the classic textbook that maps the interdisciplinary territory of cognitive science from a computational perspective. How Can the Human Mind Occur in the Physical Universe? \u2013 John Anderson \u2014 the ACT-R theory as a full computational account of cognition; the most ambitious attempt to unify all of cognitive psychology in one architecture. The Distributed Mind \u2013 Robert Rupert \u2014 the best critical treatment of extended cognition; argues the extended mind thesis is weaker than its proponents claim, which makes it a better read. Connectionist Models of Cognition \u2013 Jacobs &amp; Jordan (eds.) \u2014 the neural network side of cognitive science before deep learning ate everything; still the right entry point for understanding connectionism. Situated Cognition \u2013 Cohen, Good, Pollack (eds.) \u2014 the embodiment\/grounding school&rsquo;s collected arguments against disembodied computation. The Embodied Mind \u2013 Varela, Thompson, Rosch \u2014 the canonical origin of embodied\/enactive cognition; still the sharpest synthesis of cognitive science, phenomenology, and Buddhist mind science. The Oxford Handbook of Cognitive Science \u2013 Margolis, Samuels, Stich (eds.) \u2014 the field&rsquo;s comprehensive reference; the place to go when you need to know what cognitive science thinks about anything. \ud83e\uddbe Mind, Human-AI Augmentation &amp; Prosthetics Natural-Born Cyborgs \u2013 Andy Clark \u2014 the argument that humans have always been cyborgs; our tools don&rsquo;t extend us, they are us. Supersizing the Mind \u2013 Andy Clark \u2014 the extended mind thesis in full; the philosophical foundation for thinking about tools as cognitive components. How We Became Posthuman \u2013 N. Katherine Hayles \u2014 the literary-theory counterweight to Clark; traces how information lost its body and why that matters for AI and embodiment. Brain-Computer Interfaces \u2013 Wolpaw &amp; Wolpaw \u2014 the technical reference for BCI systems; covers signal processing, experimental designs, and the state of the field. Neuroprosthetics \u2013 Horch &amp; Dhillon \u2014 the engineering side of brain-machine interfaces; hardware, codecs, and the gap between lab and clinic. The Cyborg Experiments \u2013 Morra &amp; Fromberger \u2014 a history of experimental cybernetics that shows the field&rsquo;s weird, wonderful origins. Wired for War \u2013 P.W. Singer \u2014 the journalistic account of how robots changed warfare; the best book on the human side of military AI. Augmented Human Intelligence \u2013 Erik J. Larson &amp; Chee-We Ng (2024) \u2014 the modern anchor for this section; argues we should build AI that extends human judgment rather than mimics it, the clearest recent statement of the augmentation thesis. \ud83d\udd27 Applied AI &amp; Practical Applications Hands-On Machine Learning \u2013 Aur\u00e9lien G\u00e9ron \u2014 the book people actually use; builds real models with scikit-learn and TensorFlow, no handwaving. Designing Data-Intensive Applications \u2013 Martin Kleppmann \u2014 the systems design bible; if you build anything that stores or moves data, this is your reference. Machine Learning Engineering \u2013 Andriy Burkov \u2014 the gap between &ldquo;I trained a model&rdquo; and &ldquo;it works in production&rdquo;; covers deployment, monitoring, and ML system design. Building ML Powered Applications \u2013 Emmanuel Ameisen \u2014 the end-to-end walkthrough from data collection to deployment; shorter and more opinionated than Burkov. Feature Engineering \u2013 Zheng &amp; Casari \u2014 the practical side of feature work that textbooks skip; Kaggle competition veterans sharing what actually moves metrics. MLOps \u2013 Treveil &amp; Shukla \u2014 the operational playbook for ML teams; covers the CI\/CD\/monitoring stack specific to machine learning. Building Intelligent Systems \u2013 Geoffrey Hulten \u2014 a clear framework for designing AI products that handle the messy reality of user needs, data pipelines, and deployment constraints. AI Engineering \u2013 Chip Huyen (2025) \u2014 the definitive guide to building applications with foundation models; evaluation, RAG, fine-tuning, and cost\/latency trade-offs for production LLM systems. \ud83d\udcd0 Engineering: Reliable Systems &amp; Software The Pragmatic Programmer \u2013 Hunt &amp; Thomas \u2014 the book that made &ldquo;don&rsquo;t repeat yourself&rdquo; and &ldquo;tracer bullets&rdquo; part of every developer&rsquo;s vocabulary; as relevant now as in 1999. Design Patterns \u2013 Gamma, Helm, Johnson, Vlissides \u2014 the Gang of Four catalog; some patterns age better than others, but knowing the vocabulary is non-negotiable. Clean Code \u2013 Robert Martin \u2014 controversial in retrospect, but the discipline of readable naming and small functions still matters more than most style guides admit. Site Reliability Engineering \u2013 Beyer et al. \u2014 Google&rsquo;s playbook for keeping systems alive; the operational mindset every engineer should internalize. The Mythical Man-Month \u2013 Frederick Brooks \u2014 the book that should be mandatory reading before anyone adds a headcount to a late project; Brooks&rsquo;s Law still holds. Release It! \u2013 Michael Nygard \u2014 the anti-pattern catalog for production systems; circuit breakers, bulkheads, and the failure modes that wake you at 3 AM. Systems Performance \u2013 Brendan Gregg \u2014 the deepest treatment of performance analysis on Linux; the flame graphs alone changed how the industry debugs systems. Software Engineering at Google \u2013 Winters, Manshreck, Wright \u2014 the definitive &ldquo;programming integrated over time&rdquo; account; how code, review, testing, and culture hold up a codebase meant to last decades. \ud83d\udda5\ufe0f Human-Computer Interaction (HCI) Designing Interactions \u2013 Bill Moggridge \u2014 the history of interaction design told through the people who invented it; the field&rsquo;s origin story. Don&rsquo;t Make Me Think \u2013 Steve Krug \u2014 the 100-page guide to making websites obvious; the title is the entire UX philosophy. The Design of Everyday Things \u2013 Don Norman \u2014 the book that made affordances and signifiers part of everyday language; still the best argument for user-centered design. About Face \u2013 Cooper, Reimann, Cronin, Noessel \u2014 the goal-directed design methodology for software interaction; the most complete reference on UI behavior and flow. Interaction Design: Beyond Human-Computer Interaction \u2013 Rogers, Sharp, Preece \u2014 the comprehensive textbook that balances theory, methods, and practice; the standard university course text. The UX Book \u2013 Hartson &amp; Pyla \u2014 the agile UX process manual; practical, hands-on, and strong on evaluation methods that most design books gloss over. Human Spatial Computing \u2013 Regin\u00e9 Gilbert &amp; Doug North Cook (2025) \u2014 the first accessible OUP text on spatial computing; bridges HCI with the augmented-environment concerns of the Human-AI Augmentation section. Sentient Design \u2013 Josh Clark &amp; Veronika Kindred (2026) \u2014 the canonical take on AI as a design material; the pattern library for adaptive, agent-based interfaces that none of the classic HCI books cover. Universal Principles of Design \u2013 Lidwell, Holden, Butler \u2014 the 200-entry cross-disciplinary encyclopedia of design laws (Abbe Principle to Zeigarnick Effect); the single best reference for naming and applying the mechanisms behind the classic UX texts. \ud83e\uddd1\u200d\ud83d\udd2c Neuro-Inspiration &amp; Computational Neuroscience Theoretical Neuroscience \u2013 Dayan &amp; Abbott \u2014 the gold standard for computational neuroscience; the math behind neural coding, plasticity, and dynamics. Theoretical Neuroscience: Understanding Cognition \u2013 Xiao-Jing Wang (2025) \u2014 the modern cognitive-focused successor to Dayan &amp; Abbott; network models of working memory and decision making with a clear eye on the AI interface. Principles of Neural Science \u2013 Kandel, Schwartz, Jessell \u2014 the neuroscience bible; every chapter is someone&rsquo;s entire PhD topic, and it still reads. Spiking Neuron Models \u2013 Gerstner &amp; Kistler \u2014 the bridge between biology and spiking neural networks; the book for building biologically grounded models. From Neuron to Cognition via Computational Neuroscience \u2013 Arbib, Bonaiuto, Rinzel (eds.) \u2014 the modern successor to the Dayan &amp; Abbott tradition, tracing a path from cells and circuits to behavior and cognition. Modeling Neural Circuits Made Simple with Python \u2013 Robert Rosenbaum \u2014 the accessible, code-first intro to computational neuroscience; pairs biophysics with Python implementations from the first chapter. \ud83d\udd0d AI Interpretability &amp; Explainable AI Interpretable Machine Learning \u2013 Christoph Molnar \u2014 the free, open-source guide to SHAP, LIME, and every interpretability method; the standard reference for practitioners. Causality \u2013 Judea Pearl \u2014 the book that formalized causal inference with do-calculus; the mathematical foundation for moving beyond correlation in ML. Applied Causal Inference Powered by ML and AI \u2013 Chernozhukov, Hansen, Kallus, Spindler, Syrgkanis (2024) \u2014 the modern double-machine-learning companion to Pearl; how to do debiased causal inference when the confounding is high-dimensional and the models are deep. The Alignment Problem \u2013 Brian Christian \u2014 the most readable account of how alignment research intersects with interpretability, bias, and value learning; 400+ interviews distilled into one narrative. Explainable AI: Interpreting, Explaining and Visualizing Deep Learning \u2013 Samek et al. (eds.) \u2014 the Springer handbook on XAI; covers feature visualization, network dissection, and adversarial robustness across 22 chapters. \ud83d\udee1\ufe0f AI Safety &amp; Alignment Superintelligence \u2013 Nick Bostrom \u2014 the book that made the control problem mainstream; the 2014 landscape before deep learning dominance, but the core arguments haven&rsquo;t aged. Human Compatible \u2013 Stuart Russell \u2014 the clearest technical introduction to alignment for a general audience; the Bayesian &ldquo;uncertain preferences&rdquo; solution is the most actionable framework. The Coming Wave \u2013 Mustafa Suleyman \u2014 the containment problem from a DeepMind co-founder; prescient about agentic AI and the governance gap between capability and readiness. If Anyone Builds It, Everyone Dies \u2013 Eliezer Yudkowsky &amp; Nate Soares \u2014 the strongest articulation of the existential risk case; the title&rsquo;s &ldquo;if&rdquo; is deliberate, and the final section outlines what could still be done. Life 3.0 \u2013 Max Tegmark \u2014 the big-picture survey of AI futures from physics to philosophy; the most balanced book on whether superintelligence helps or kills. \ud83c\udf00 Systems Thinking &amp; Meta-Cognition Thinking in Systems \u2013 Donella Meadows \u2014 the shortest path to systems thinking; leverage points, feedback loops, and why simple interventions backfire. Cybernetics \u2013 Norbert Wiener (1948) \u2014 the origin of the field; control and communication in animal and machine, the book that turned feedback into a universal principle. General System Theory \u2013 Ludwig von Bertalanffy \u2014 the other founding pillar next to Wiener; isomorphisms across systems, from biology to sociology, that give systems thinking its cross-domain power. The Fifth Discipline \u2013 Peter Senge \u2014 the organizational systems classic; learning organizations, mental models, and shared vision as systems-level properties. The Beginning of Infinity \u2013 David Deutsch \u2014 the argument that all problems are soluble given the right knowledge; a philosophical foundation for optimism about human problem-solving. The Reflective Practitioner \u2013 Donald Sch\u00f6n \u2014 the theory of professional knowledge-as-practice; how experts think in action, not just about action. Rationality: From AI to Zombies \u2013 Eliezer Yudkowsky \u2014 the compendium of rationality essays that built the alignment community&rsquo;s intellectual culture; Book 3 (Machine in the Ghost) is the essential section. The Complex World \u2013 David Krakauer (2024) \u2014 the Santa Fe Institute president&rsquo;s introduction to complexity science; traces how evolution, computation, and nonlinear dynamics produce the first scientific framework for understanding purposeful systems. Complexity: A Guided Tour \u2013 Melanie Mitchell \u2014 the best single accessible tour of complexity science; cellular automata, networks, and emergence explained so well you can actually use the ideas. Network Science \u2013 Albert-L\u00e1szl\u00f3 Barab\u00e1si \u2014 the canonical textbook for scale-free networks; the six-degrees, power-law, and robustness machinery behind modern network analysis. Cross-Domain Connections Some of these books bridge multiple sections. If you&rsquo;re reading one, its pair in the other domain will deepen the material.\nCausality (AI Interpretability) \u2192 Knowledge and Its Limits (Epistemology): Pearl&rsquo;s causal hierarchy maps directly onto the epistemological question of what counts as evidence. Vision: A Computational Investigation (Cognition) \u2192 Theoretical Neuroscience (Neuro-Inspiration): Marr&rsquo;s three levels are the shared language between computational cognitive science and computational neuroscience. Supersizing the Mind (Human-AI Augmentation) \u2192 The Distributed Mind (Cognitive Systems): Clark and Rupert disagree on whether cognition extends into the environment; read both sides. The Alignment Problem (AI Interpretability) \u2192 Human Compatible (AI Safety): Christian provides the research narrative, Russell provides the technical framework; together they cover the full alignment picture. Bayesian Models of Cognition (Cognition) \u2192 Bayesian Reasoning and Machine Learning (AI): Griffiths bridges human and machine Bayesian inference; Barber provides the technical machinery. Society of Mind (Symbolic Systems) \u2192 Connectionist Models of Cognition (Cognitive Systems): Minsky&rsquo;s agent-based architecture and connectionism offer competing visions of how intelligence emerges from simple components. Thinking, Fast and Slow (Cognition) \u2192 Bounded Rationality (Cognition): Kahneman catalogues the biases, Gigerenzer argues the same heuristics are ecologically rational; read them as an argument, not two reference books. Reinforcement Learning from Human Feedback (AI) \u2192 Human Compatible (AI Safety): Lambert shows how preference alignment works in practice; Russell argues what it can&rsquo;t yet solve. AI Engineering (Applied AI) \u2192 Designing Data-Intensive Applications (Engineering): Huyen&rsquo;s evaluation ecosystem and Kleppmann&rsquo;s storage systems are the two halves of operating anything at scale. The Embodied Mind (Cognitive Systems) \u2192 The Distributed Mind (Cognitive Systems): Varela proposed enaction decades before Rupert critiqued extended cognition; the two books bracket the whole embodiment debate. Then I Am Myself the World (Cognition) \u2192 Superintelligence (AI Safety): Koch&rsquo;s measurable-consciousness framework is exactly what Bostrom needs to argue about whether a superintelligent agent would suffer. The Embodied Mind (Cognitive Systems) \u2192 Cybernetics (Systems Thinking): Varela&rsquo;s enactive cognition descends directly from Wiener&rsquo;s feedback-loop cybernetics; the thread runs three generations. Probability Theory (Foundations) \u2192 Bayesian Reasoning and Machine Learning (AI): Jaynes gives you the first-principles logic that Barber then turns into working graphical models. Logicomix (Epistemology) \u2192 Philosophical Investigations (Symbolic Systems): read the comic for Russell&rsquo;s quest, then Wittgenstein&rsquo;s reply that the whole project was built on a mistake. Then I Am Myself the World (Cognition) \u2192 Consciousness Explained (Cognition): Koch defends integrated-information theory, Dennett argues the whole framing is wrong; the sharpest consciousness debate in book form. Network Science (Systems Thinking) \u2192 Complexity: A Guided Tour (Systems Thinking): Barab\u00e1si supplies the math of connectivity; Mitchell supplies the conceptual map of emergence they fit into. Integration Over a Decade By interleaving these texts, I&rsquo;ll connect epistemology to AI, cognition to engineering, and theory to practice, achieving deep, integrative knowledge. Each book isn&rsquo;t isolated; it&rsquo;s a thread in a larger intellectual map I&rsquo;m building intentionally.\nThrough annotation, monthly synthesis, hands-on projects, spaced review, and annual reflection, I&rsquo;ll ensure I internalize and apply this knowledge effectively.\nUltimately, this reading list is my manifesto for intentional, integrated, lifelong learning\u2014shaping me into the systems thinker and AI engineer I aim to become.\n","permalink":"https:\/\/archit15singh.github.io\/posts\/2023-01-01-my-reading-list\/","summary":"<h1 id=\"my-reading-list-for-the-next-10-years-and-why\">My Reading List for the Next 10 Years and Why<\/h1>\n<p>Over the past few years, I\u2019ve found myself at the intersection of philosophy, cognitive science, and AI engineering. As a firm believer in first-principles thinking, I recognized the need for a coherent, decade-long roadmap to guide my intellectual growth and practical skill-building. Instead of random selections, I asked myself: <strong>What are the irreducible concepts I must master in epistemology, symbolic systems, cognition, memory, AI, cognitive systems, human-AI augmentation, and large-scale engineering?<\/strong> The result became this curated reading list.<\/p>","title":"My Reading List for the next 10 years and Why"},{"content":"Who Am I? I\u2019m a systems thinker who builds from first principles, iterates obsessively, and seeks clarity through recursive refinement. Over years of crafting backend pipelines, designing AI agents, and shaping thought leadership on LinkedIn, I\u2019ve honed a mental engine that powers everything I do. This \u201ccognitive operating system\u201d drives how I analyze problems, create solutions, and continually evolve.\n1. First-Principles System Builder I refuse to accept surface-level explanations. Whenever a problem arises, whether it\u2019s a bug in a critical workflow or a feature that misses its mark, I dig down until I understand the root mechanism.\nRoot Causes Over Symptoms Instead of concluding \u201ccommunication broke,\u201d I ask: What exactly got lost as the message traveled across different roles? Measuring where context vanishes is the only way to fix it.\nModel\u00ad-Building Over Buzzwords I construct mental representations, abstract diagrams or simple equations, that reveal why something works (or fails). I won\u2019t settle for \u201cjust fix it\u201d without knowing why it broke in the first place.\n2. Recursive Refinement &amp; Fractal Reasoning I rarely stop at \u201cgood enough.\u201d Once I sketch a solution, I zoom in and out, examining every detail and then stepping back to see the whole picture. This process applies across code, content, and career strategy.\nZooming In and Out For example, when I published a multi-part series on \u201cthe Empathy Gap,\u201d I didn\u2019t just stop at the first draft. I reviewed each post for redundancies, restructured sections, then reviewed the changes again. That loop of \u201cbuild \u2192 evaluate \u2192 rebuild\u201d is my default mode.\nLateral Explorations I\u2019ll take an idea from one context, say, a performance bottleneck in a high-concurrency service, and then see how it applies to team collaboration or long-term memory in an AI workflow. These detours enrich the original insight.\nMeta-Critiques After drafting an architectural proposal, I\u2019ll challenge myself: \u201cDoes this model capture the actual failure modes? Is there a simpler abstraction that communicates the same insight?\u201d If not, I rewrite until it hits precise clarity.\n3. Epistemic Humility + Rigor I hold my own ideas to ruthless scrutiny. Clinging to a half-baked notion or ignoring feedback is antithetical to how I learn, and how I grow.\nInviting Critique Whether I\u2019m asking someone to review a complex pipeline or sharing a draft post publicly, I expect blunt honesty. I don\u2019t want validation; I want the raw truth of where my logic fails.\nCognitive Athlete Mindset Like an athlete trains their body, I train my thinking. If a scenario breaks unexpectedly, I trace the error, no matter how small, and rework the underlying logic until every path is covered. When insights hit a wall, I hunt down assumptions until I find the leak.\n4. Systems Thinking Across Disciplines I see everything as interconnected nodes in a larger graph of ideas. Psychology, distributed systems, philosophy, and AI architecture all live on the same map.\nCross-Domain Metaphors \u2022 A lost signal in a communication chain is like an unhandled exception in code: both require tracing back through layers to find the source. \u2022 Reusing a tested pattern in one project might inspire a solution in a completely different domain.\nModular Cognition Every project, be it an AI research exploration or a personal branding exercise, is a node in that graph. Insights flow freely between them. A fix I apply in a backend service can spark a new way to think about organizational alignment; a concept from behavioral science might simplify a design decision.\n5. Precision Execution with Reflective Depth I move deliberately, step by step, always looping between insight and validation.\nInsight Generation I start with a question:\n\u201cWhy did that workflow break?\u201d \u201cWhat makes a post resonate deeply?\u201d\nStructural Mapping I translate fuzzy ideas into concrete artifacts, scripts, diagrams, or outlines, that capture the core mechanics.\nTest &amp; Feedback I put my work to the test: run thorough validations, publish draft content and monitor reactions, or simulate a live scenario.\nSignal Extraction I analyze the results, logs, engagement metrics, interview follow-ups, and extract the raw signals that matter.\nIteration I refine the model, refactor the solution, rewrite the content, then repeat the cycle until the output withstands scrutiny.\nPublic Validation Visibility is part of the loop. By sharing work publicly, I invite external feedback that often uncovers blind spots I wouldn\u2019t catch alone.\nThat deliberate sequencing, often several loops for a single problem, turns abstract ideas into robust, high-impact outcomes.\n6. Underlying Drive: The Truth-to-Action Loop At my core lies a feedback loop I call Truth \u2192 Clarity \u2192 Structure \u2192 Impact \u2192 Visibility \u2192 Feedback \u2192 Refined Truth. Visibility isn\u2019t vanity, it\u2019s essential proof that an idea or solution works (or doesn\u2019t).\nTruth I chase fundamental insights: \u201cWhat really caused that failure?\u201d \u201cWhy did this idea not land?\u201d\nClarity I distill insights into crisp models, straightforward diagrams or structured outlines.\nStructure I build modular artifacts: data-access patterns, layered service components, or content frameworks.\nImpact Those artifacts solve real problems: a reliable service workflow, a widely read article, or a mental model that reframes how a team approaches a stubborn bottleneck.\nVisibility I publish code and thought leadership publicly to collect feedback and spark dialogue.\nFeedback Comments, metrics, and peer reviews reveal blind spots or new angles.\nRefined Truth I loop back, updating models and artifacts, always edging closer to a deeper understanding.\nIt\u2019s not enough to write solid code or publish a catchy post; the loop demands every insight make an observable impact, and that impact be tested, critiqued, and improved.\n7. Additional Threads &amp; Tendencies These facets weave through my work but weren\u2019t fully surfaced above:\nValues &amp; Emotional Alignment I ask, \u201cWhose definition of success am I chasing? Does doing the \u2018right\u2019 thing actually make me happy?\u201d That self-questioning keeps me aligned to my internal compass.\nEmpathy in Personal Contexts Beyond modeling communication gaps in organizations, I apply the same sensitivity in personal relationships, coaching friends, navigating tough conversations, and ensuring I stay attuned to others\u2019 unspoken needs.\nIntentional Self-Curation Treating my wardrobe, workspace, and public presence as systems to optimize taught me that personal image is just another node in the graph of how I want to be perceived, both online and offline.\nMentorship &amp; Coaching Orientation Whether I\u2019m guiding a colleague through a technical problem or helping someone prepare for an interview, I build frameworks that scale knowledge beyond myself, transforming my insights into reusable resources for others.\nInterdisciplinary Reading Habit I curate reading lists across philosophy, cognitive science, and emerging AI research, connecting dots across fields to forge hybrid mental models.\nStructured, Reusable Outputs I present every insight as a bite-sized artifact, a bullet-pointed cheat sheet, a concise blog post, or an easily remixable framework, so I can repurpose and iterate rapidly across projects.\nIn Summary I\u2019m a systems thinker who builds from first principles, iterates in fractal loops, invites critique with humility, and weaves ideas across disciplines. My drive isn\u2019t just to solve problems but to surface deeper truths, and then amplify them through visibility and continuous feedback.\nThat\u2019s who I am. Every line of code, every LinkedIn post, and every self-critique loops back into a single mission: aligning action with truth and making that truth visible to the world. If you\u2019re curious to learn more or collaborate on any of these ideas, let\u2019s connect.\n","permalink":"https:\/\/archit15singh.github.io\/posts\/2022-01-01-who-am-i\/","summary":"<h1 id=\"who-am-i\"><strong>Who Am I?<\/strong><\/h1>\n<p>I\u2019m a systems thinker who builds from first principles, iterates obsessively, and seeks clarity through recursive refinement. Over years of crafting backend pipelines, designing AI agents, and shaping thought leadership on LinkedIn, I\u2019ve honed a mental engine that powers everything I do. This \u201ccognitive operating system\u201d drives how I analyze problems, create solutions, and continually evolve.<\/p>\n<hr>\n<h2 id=\"1-first-principles-system-builder\">1. First-Principles System Builder<\/h2>\n<p>I refuse to accept surface-level explanations. Whenever a problem arises, whether it\u2019s a bug in a critical workflow or a feature that misses its mark, I dig down until I understand the root mechanism.<\/p>","title":"Who Am I?"},{"content":"I&rsquo;m Archit Singh, a Senior Software Engineer at Abnormal AI. I build AI agents and detection systems for email security, working across detection engineering and the backend systems that support it.\nMy central interests are how to detect threats, investigate failures and make security decisions reliable in production. Abnormal&rsquo;s platform processes billions of email messages through a layered detection pipeline, with agents handling its hardest cases. That is company-wide scale, described in Abnormal&rsquo;s public architecture article on AWS.\nOutside work, I build independent tools that explore related engineering questions. Lorevell (formerly Memori) keeps knowledge in Markdown files that humans and agents can read, edit and reuse. Luffy is a PR review agent with repository-specific memory and execution traces. I also build FootagePilot, an AI-assisted video-editing tool, and contribute public security detection fixes.\nI write about the decisions behind these systems, including approaches that failed and limits I have not resolved. In September 2025, I presented Memory is the Agent at PyCon India.\nYou can explore the projects, read the technical notes or contact me about a talk, collaboration or relevant engineering role.\n","permalink":"https:\/\/archit15singh.github.io\/about\/","summary":"<p>I&rsquo;m Archit Singh, a Senior Software Engineer at <a href=\"https:\/\/abnormal.ai\/\">Abnormal AI<\/a>. I build AI agents and detection systems for email security, working across detection engineering and the backend systems that support it.<\/p>\n<p>My central interests are how to detect threats, investigate failures and make security decisions reliable in production. Abnormal&rsquo;s platform processes billions of email messages through a layered detection pipeline, with agents handling its hardest cases. That is company-wide scale, described in <a href=\"https:\/\/aws.amazon.com\/blogs\/machine-learning\/abnormal-ai-amazon-bedrock-agentcore-for-agentic-email-security-at-scale\/\">Abnormal&rsquo;s public architecture article on AWS<\/a>.<\/p>","title":"About"},{"content":"For technical talks, engineering collaborations and relevant AI infrastructure roles, email contact.architsingh@gmail.com.\nFor a talk invitation, include the audience, event date, format and expected session length. For a collaboration, tell me what you are building and where you would like my involvement.\nSpeaking topics, bio and recorded talk Projects and source code LinkedIn \u00b7 GitHub \u00b7 X To follow new writing, use RSS or Substack.\n","permalink":"https:\/\/archit15singh.github.io\/contact\/","summary":"<p>For technical talks, engineering collaborations and relevant AI infrastructure roles, email <strong><a href=\"mailto:contact.architsingh@gmail.com\">contact.architsingh@gmail.com<\/a><\/strong>.<\/p>\n<p>For a talk invitation, include the audience, event date, format and expected session length. For a collaboration, tell me what you are building and where you would like my involvement.<\/p>\n<ul>\n<li><a href=\"\/speaking\/\">Speaking topics, bio and recorded talk<\/a><\/li>\n<li><a href=\"\/projects\/\">Projects and source code<\/a><\/li>\n<li><a href=\"https:\/\/www.linkedin.com\/in\/archit15singh\">LinkedIn<\/a> \u00b7 <a href=\"https:\/\/github.com\/archit15singh\">GitHub<\/a> \u00b7 <a href=\"https:\/\/x.com\/archit_singh15\">X<\/a><\/li>\n<\/ul>\n<p>To follow new writing, use <a href=\"\/index.xml\">RSS<\/a> or <a href=\"https:\/\/architsingh.substack.com\/\">Substack<\/a>.<\/p>","title":"Contact"},{"content":"These projects explore how agents retain context, execute tools and expose enough information to investigate a failure. Each has source code and a longer account of its design.\nLorevell (formerly Memori) Local knowledge for humans and agents. Lorevell keeps notes in plain Markdown files that you can read, edit and carry between tools. Markdown is the source of truth; SQLite is a rebuildable search index.\nIts Rust core supports full-text and local vector search. The CLI connects the vault to existing coding agents, including Claude Code and Codex, for recall and bounded knowledge consolidation. The agent supplies the reasoning; Lorevell supplies the files, retrieval and validation around it.\nThe current repository documents the breaking 2.0 interface and installation from source. Older Memori packages and benchmarks describe earlier versions; they do not establish the behavior or performance of the current vault. Follow the current setup and migration instructions before switching an existing installation.\nSource and current setup Memori \u2192 Lorevell rename guide Operational details and limits Earlier Memori design: Architecture decisions \u00b7 Retrieval design \u00b7 Designing the CLI PyCon India talk Luffy Luffy is a GitHub PR review agent triggered by a comment. It can inspect code, run commands to reproduce a suspected bug, and post a structured review. It retains repository-specific memory and saves a redacted trace so the run can be examined later.\nA GitHub Actions workflow runs Hermes Agent through OpenRouter. The model is selected explicitly. The design article follows the workflow from the initial comment through tool execution, review output and saved memory.\nIn one recorded Odoo review, Luffy returned REQUEST CHANGES with a score of 42\/100. The run used ten API calls, took about four minutes and cost roughly $0.59. Those figures describe that run; they do not establish review accuracy across repositories. The saved trace lets you inspect how it reached the result.\nSource and setup Recorded run and traces Building Luffy FootagePilot An agent-driven video editor for real footage. The pipeline combines speech cleanup, local word alignment, Codex story planning, validated word-level cuts, captions and graphics, and HyperFrames or Remotion rendering with audio mixing.\nThe repository records a real-footage run and four generated variations, with export checks and documented limits. Listening quality and general storytelling performance are not established by those technical checks. Follow the current setup instructions and inspect the example outputs before choosing it for a workflow.\nSource and setup Real-footage findings Naming and migration Other projects These repositories cover evaluation, engineering knowledge and simulation.\nFree Model Eval. Six free-tier coding models through OpenCode, eleven variants, ten tasks. Welch t-test, Bonferroni, Cohen&rsquo;s d. The grader is a different model from the one under test.\nChronicle. Reconstructs engineering decisions from repository history, PRs and incidents, aiming to preserve the reasoning behind changes.\nIdea Generator. An OpenCode workflow for exploring business ideas in a constrained market. It uses YC company data, staged comparisons and explicit checks to narrow candidates.\nSim Bangalore. A simulation of Bengaluru across 243 BBMP wards, with synthetic residents and road\/Metro routing. It compares scenarios such as remote work, fare changes and ORR closures. The foundation is a port of Sim Francisco. The Bangalore population, calibration, and policy core are the original work.\nUse or discuss the work Start with the linked repository instructions and report reproducible issues there. For a technical collaboration or talk, get in touch.\n","permalink":"https:\/\/archit15singh.github.io\/projects\/","summary":"<p>These projects explore how agents retain context, execute tools and expose enough information to investigate a failure. Each has source code and a longer account of its design.<\/p>\n<p><span id=\"memori--flagship\"><\/span><\/p>\n<h2 id=\"lorevell\">Lorevell (formerly Memori)<\/h2>\n<p>Local knowledge for humans and agents. Lorevell keeps notes in plain Markdown files that you can read, edit and carry between tools. Markdown is the source of truth; SQLite is a rebuildable search index.<\/p>\n<p>Its Rust core supports full-text and local vector search. The CLI connects the vault to existing coding agents, including Claude Code and Codex, for recall and bounded knowledge consolidation. The agent supplies the reasoning; Lorevell supplies the files, retrieval and validation around it.<\/p>","title":"Projects"},{"content":"My work is organized around four questions: how agents remember, how they execute reliably, how they interact with security boundaries, and how they change software engineering. These links connect the articles to related code and talks.\nFor implementation details and repository links, see Projects.\n1 \u00b7 Memory for AI agents Lorevell (formerly Memori), local knowledge, retrieval, continuity and evaluation.\nForging AI\u2019s lasting memory Memori architecture Memori recursive design Talk: Memory is the Agent Artifact: Lorevell (formerly Memori) Artifact: Chronicle 2 \u00b7 Reliable agent systems Luffy, tool design, control planes, observability, failure modes.\nDesigning CLI tools for AI agents Hard constraints belong in code Building Luffy Artifact: Luffy Artifact: Idea Generator 3 \u00b7 AI \u00d7 security Agent attacks, fraud, identity, social engineering, behavioral security.\nThe contributions below address execution behavior, false positives and argument handling in security tools. They sit alongside my writing on the browser\u2019s role in granting access to data and devices.\nThe Browser Is the New Operating System examines the browser as the capability broker for identity, data, devices, and isolation. Potential Proxy Execution Via SetupUGC (rule). setupugc.exe as a signed LOLBin on Windows 10\/11 and Server 2025. Exclude Kea DHCP from CAP_NET_RAW. The building block was firing on a legitimate \/usr\/sbin\/kea-dhcp4. AWS discard_regex values with spaces. Unquoted Security Hub values split as extra arguments. 4 \u00b7 AI-native software engineering Coding agents, architecture, productivity, staff+ engineering, evaluation.\nThe AI-augmented developer playbook The Staff+ operating model Artifact: Free Model Eval Artifact: Sim Bangalore ","permalink":"https:\/\/archit15singh.github.io\/research\/","summary":"<p>My work is organized around four questions: how agents remember, how they execute reliably, how they interact with security boundaries, and how they change software engineering. These links connect the articles to related code and talks.<\/p>\n<p>For implementation details and repository links, see <a href=\"\/projects\/\">Projects<\/a>.<\/p>\n<h2 id=\"1--memory-for-ai-agents\">1 \u00b7 Memory for AI agents<\/h2>\n<p>Lorevell (formerly Memori), local knowledge, retrieval, continuity and evaluation.<\/p>\n<ul>\n<li><a href=\"\/posts\/2024-01-01-ai-memory\/\">Forging AI\u2019s lasting memory<\/a><\/li>\n<li><a href=\"\/posts\/2026-03-24-memori-architecture\/\">Memori architecture<\/a><\/li>\n<li><a href=\"\/posts\/2026-04-10-memori-recursive-design\/\">Memori recursive design<\/a><\/li>\n<li>Talk: <a href=\"\/speaking\/\">Memory is the Agent<\/a><\/li>\n<li>Artifact: <a href=\"\/projects\/#lorevell\">Lorevell (formerly Memori)<\/a><\/li>\n<li>Artifact: <a href=\"\/projects\/#also-original\">Chronicle<\/a><\/li>\n<\/ul>\n<h2 id=\"2--reliable-agent-systems\">2 \u00b7 Reliable agent systems<\/h2>\n<p>Luffy, tool design, control planes, observability, failure modes.<\/p>","title":"Research"},{"content":"I speak about email security, AI agents, detection engineering, persistent memory and reliable execution. I use examples from my projects to explain the implementation choices and what happened when I tested them.\nInvite me to speak \u00b7 Watch my PyCon talk\nProposed sessions Memory is the Agent. Capture, retrieval and continuity across sessions, grounded in Lorevell (formerly Memori). For engineers building stateful agents. The model is not the agent. Tools, permissions, recovery and observability in an agent harness. For teams moving beyond a prototype. Evaluating agents through their interface. What final messages miss, and how terminal captures and execution records answer different questions. For agent-tool builders and evaluators. I can adapt the depth and format to your audience. Email me with the event date, audience and session length.\nShort bio Archit Singh is a Senior Software Engineer at Abnormal AI, building AI agents and detection systems for email security. He works at the intersection of security, agent reliability and distributed systems. His independent public projects include Lorevell (formerly Memori), a local Markdown knowledge vault for humans and agents, and Luffy, an auditable PR review agent. He presented \u201cMemory is the Agent: Architecting Stateful Reasoning\u201d at PyCon India 2025 and writes about agent memory, deterministic constraints, evaluation and observability.\nOrganizer resources: public speaker profile \u00b7 stage photograph \u00b7 projects. Please confirm image reuse permissions before publication.\nPyCon India 2025 On stage at PyCon India, 13 September 2025.\nMemory is the Agent: Architecting Stateful Reasoning\n13 September 2025, 11:30. Speaker profile.\nThe talk explores a write \u2192 retrieve \u2192 reflect \u2192 update loop for maintaining agent state, with a small schema for identity, principles, focus and signals. It introduced ideas I later developed in Lorevell (formerly Memori).\nSketch-note companion to the talk, by Sway Strokes.\nWatch the talk Watch on YouTube\nContact me about a talk or workshop.\n","permalink":"https:\/\/archit15singh.github.io\/speaking\/","summary":"<p>I speak about email security, AI agents, detection engineering, persistent memory and reliable execution. I use examples from my projects to explain the implementation choices and what happened when I tested them.<\/p>\n<p><strong><a href=\"mailto:contact.architsingh@gmail.com?subject=Speaking%20invitation\">Invite me to speak<\/a><\/strong> \u00b7 <a href=\"\/speaking\/#watch-the-talk\">Watch my PyCon talk<\/a><\/p>\n<h2 id=\"proposed-sessions\">Proposed sessions<\/h2>\n<ul>\n<li><strong>Memory is the Agent.<\/strong> Capture, retrieval and continuity across sessions, grounded in Lorevell (formerly Memori). For engineers building stateful agents.<\/li>\n<li><strong>The model is not the agent.<\/strong> Tools, permissions, recovery and observability in an agent harness. For teams moving beyond a prototype.<\/li>\n<li><strong>Evaluating agents through their interface.<\/strong> What final messages miss, and how terminal captures and execution records answer different questions. For agent-tool builders and evaluators.<\/li>\n<\/ul>\n<p>I can adapt the depth and format to your audience. Email me with the event date, audience and session length.<\/p>","title":"Speaking"}]