<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Hargunnofficial on Medium]]></title>
        <description><![CDATA[Stories by Hargunnofficial on Medium]]></description>
        <link>https://medium.com/@hargunnofficial?source=rss-894f2dfced4c------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*15ukw1AKibX1CY_7</url>
            <title>Stories by Hargunnofficial on Medium</title>
            <link>https://medium.com/@hargunnofficial?source=rss-894f2dfced4c------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 27 Nov 2026 21:10:22 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@hargunnofficial/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Building FarmerMate: How I Recreated an AI Agronomist for Small Farmers (For Free)]]></title>
            <link>https://medium.com/@hargunnofficial/building-farmermate-how-i-recreated-an-ai-agronomist-for-small-farmers-for-free-2fd96d053d98?source=rss-894f2dfced4c------2</link>
            <guid isPermaLink="false">https://medium.com/p/2fd96d053d98</guid>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[agriculture]]></category>
            <dc:creator><![CDATA[Hargunnofficial]]></dc:creator>
            <pubDate>Fri, 20 Nov 2026 15:21:27 GMT</pubDate>
            <atom:updated>2026-11-20T15:21:27.172Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xVLeD_O-u2h1Gz-yPPjlPA.png" /></figure><h3>My TKS Focus Build: a FarmerChat-style AI farm adviser that knows your weather, reads your leaves, and shows where its advice comes from</h3><p>In my Learn article, I wrote about generative AI as the modern agronomist. I talked about my mom’s brother in Punjab, who tried growing purple rice because it was rare and could sell for more, and how one very rainy season spoiled the whole crop. My family went back to the crops that survive harsh weather, and that was the end of it.</p><p>That story stuck with me, because the problem wasn’t that he didn’t work hard. The problem was that he didn’t have the right information at the right time. Nobody told him “a heavy rain week is coming, here is what that does to this crop, here is what you can do about it.”</p><p>So for the Build stage, I didn’t want to just read about AI agronomists anymore. I wanted to build one. The goal of Build at TKS is to recreate something that already exists, to prove I can actually do it. So I picked FarmerChat, an AI farming assistant made by Digital Green for farmers in India and Africa, and I built my own version from scratch. I called it <strong>FarmerMate</strong>.</p><p>This article goes through what it does, how it works under the hood, the problems I hit, and what is still not good enough.</p><h3>What FarmerMate does</h3><p>A farmer opens the app on their phone, enters their location and the crops they grow, and then they can:</p><ul><li><strong>Ask anything</strong> in English or Hindi, by typing or speaking, and get short, practical steps back. It can read its answers aloud too.</li><li><strong>Get advice that knows their farm.</strong> Every answer uses the 7-day weather forecast for their exact location and the crops they grow.</li><li><strong>Scan a leaf.</strong> Take a photo and get the most likely disease or pest, how confident the AI is, and what to do next.</li><li><strong>See the source.</strong> Answers are grounded in a library of farming guides, and the app shows which guide it used.</li><li><strong>Get weather alerts</strong> for rain, wind, heat, frost and fungal risk, plus the best window to spray.</li><li><strong>Start with “Today on your farm.”</strong> The home screen shows the 3 or 4 things that matter today: disease risk, irrigation, the best spray window and weather warnings.</li><li><strong>See a 7-day disease risk forecast</strong> for each crop, worked out hour by hour from the weather.</li><li><strong>Plan watering.</strong> The app works out how many millimetres of irrigation each crop needs over the next 3 days.</li><li><strong>Track crop stages.</strong> Enter a sowing date and it tracks the growth stage and the days left to harvest.</li><li><strong>Use it offline.</strong> The app opens without internet and shows the last saved forecast, and every leaf scan is saved in a field log.</li></ul><p>And it costs nothing to run. It uses the Gemini API free tier, Open-Meteo for weather (no key needed), and Vercel’s free hosting. That mattered to me, because I want the app to stay free for farmers. If I ever charge for something, it will be the hardware, not the advice.</p><h3>The architecture</h3><p>FarmerMate has three parts: the app on the phone, a small server, and Google’s Gemini model.</p><p>When a farmer asks a question, this is what happens:</p><ol><li>The phone sends the question, the farmer’s location, crops and weather forecast to my server (/api/chat, or /api/scan for photos).</li><li>The server checks the input is safe and sensible.</li><li>It searches my knowledge base of farming guides and picks the best matches. This is the RAG step.</li><li>It builds a hidden “system prompt” that includes the weather, the crops, the farm brain’s numbers (more on that below) and those guides.</li><li>It sends everything to Gemini and returns the answer plus the sources to the phone.</li></ol><p>A fair question is: why have a server at all? Why not let the phone talk to Gemini directly? The answer is the API key. If the key lived inside the app, anyone could open the code, copy it, and burn through my free quota in an afternoon. So the phone only ever talks to my server, and only the server knows the key.</p><h3>Deep dive 1: RAG, and why I used BM25</h3><p>The biggest risk with an AI agronomist is that it sounds confident and is wrong. A large language model answers from memory, and its memory can be outdated, too general, or just made up. For a farmer, a wrong spray recommendation costs real money.</p><p>The fix for this is called <strong>RAG (Retrieval-Augmented Generation)</strong>. Before asking the AI anything, you search a trusted library for the most relevant information and paste it into the prompt. The model then answers from those notes instead of only from memory, and you can show the farmer exactly where the advice came from.</p><p>I wrote 32 farming guides based on public extension advice from ICAR, state agricultural universities and the FAO’s integrated pest management material. Then I needed a way to find the right guides for each question.</p><p>Most RAG tutorials use embeddings and a vector database. I went with <strong>BM25</strong> instead, which is the classic ranking formula that search engines used for years. Three reasons: it runs locally, it needs no extra API calls (so it stays free), and with only 32 guides, a simple keyword method works well.</p><p>Here is how BM25 scores a guide against a question, in plain words:</p><ul><li><strong>Rare words count more.</strong> If “blight” appears in only one guide, a question containing “blight” strongly points to that guide. Common words like “crop” barely count. This is called IDF (inverse document frequency).</li><li><strong>Repeating a word helps, but with diminishing returns.</strong> A guide that says “aphid” five times is more relevant than one that says it once, but not five times more. The parameter k1 (I used 1.4) controls how fast that flattens out.</li><li><strong>Long guides don’t get an unfair advantage.</strong> A longer guide naturally contains more words, so scores get adjusted by length. The parameter b (I used 0.75) controls how strong that adjustment is.</li></ul><p>On top of standard BM25, I added two things of my own. If a guide is about one of the farmer’s own crops, its score gets multiplied by 1.25. And any guide scoring under 1.0 is thrown out, so the AI doesn’t get fed irrelevant notes just to fill space. The top 3 guides go into the prompt.</p><p>Before any of this, the text gets cleaned up: lowercased, common words like “the” and “how” removed, and very light stemming so that “leaves” matches “leaf” and “spraying” matches “spray”.</p><p><strong>The Hindi problem.</strong> The cleanup step removes every character that isn’t a-z or 0–9, which on its own would delete Hindi completely. A Hindi question like “टमाटर की पत्तियाँ पीली हो रही हैं” (my tomato leaves are turning yellow) would find nothing. My fix was a map of common Hindi farm words to English (टमाटर to tomato, पत्तियाँ to leaves, पीली to yellow, झुलसा to blight and so on) that gets applied before the cleanup. It’s not real translation, but it means Hindi questions find the right guides, and Gemini still replies in Hindi.</p><h3>Deep dive 2: Giving the AI context about the farm</h3><p>A generic chatbot will tell you “spray fungicide when you see spots.” A good agronomist will tell you “don’t spray tomorrow, it’s going to rain 18 mm and it’ll wash off. Spray Thursday evening.” The difference is context.</p><p>FarmerMate pulls a 7-day forecast from Open-Meteo for the farmer’s exact location: temperature, humidity, wind, rainfall and chance of rain for each day. My server turns that into plain text and puts it in the system prompt along with the farmer’s crops, today’s date and the matched guides.</p><p>The system prompt also has rules I wrote for how FarmerMate should answer. A few that matter most:</p><ul><li>Use the forecast actively: warn about rain before spraying or irrigating, and flag humidity-driven disease risk.</li><li>Name the type or active ingredient of a pesticide, but <strong>never invent an exact dose</strong>. Tell the farmer to follow the label.</li><li>If unsure, say so, ask for a clearer photo, and point to the Kisan Call Centre (1800–180–1551) or the local Krishi Vigyan Kendra.</li><li>Only talk about farming, and keep answers short with numbered steps.</li></ul><p>One problem I ran into was time. The model knew the date but not the farmer’s local time, so it could tell someone to “spray this morning” when it was already 5 pm. So now the app sends the local time too, and the prompt tells the AI that if it’s already afternoon or evening, it should suggest the evening or tomorrow morning instead. Small thing, but it’s the kind of mistake that makes a farmer stop trusting the app.</p><h3>Deep dive 3: The farm brain (predictive models on the phone)</h3><p>Version 1 of FarmerMate could only react: you asked, it answered. For v2 I wanted it to spot problems before the farmer even asks. So I built what I call the farm brain: three small models that run on the phone itself. They need no AI call, cost nothing and still work offline.</p><p><strong>Crop stage.</strong> The FAO-56 method splits every crop’s life into four stages: establishment, development, mid-season and late season. FarmerMate counts the days since sowing and maps them onto the average stage lengths for that crop. That tells it what the plant needs right now and roughly how many days are left until harvest.</p><p><strong>Water need.</strong> This uses the FAO-56 formula: crop water use = reference evapotranspiration (ET₀) × crop coefficient (Kc). ET₀ is how much water a reference grass field loses to the air on a given day, and Open-Meteo gives it for free. Kc adjusts that for the crop and its stage, because a young plant uses far less water than one at its peak. FarmerMate adds this up over the next 3 days and subtracts the rain that will actually be useful. The answer comes out in millimetres, and 1 mm is 1 litre per square metre, so a farmer can act on it straight away. Paddy rice is the exception: the app just reminds the farmer to keep the recommended water level.</p><p><strong>Disease risk.</strong> Most fungal diseases can only infect a plant when the temperature is right and the leaves stay wet for long enough. Plant pathologists call these infection periods. For each disease I set a temperature band and count the hours in a day that are both inside that band and wet (humidity of 90% or more, or rain). For late blight, 6 or more wet hours between 10 and 24°C means medium risk, and 10 or more means high risk. Rust, blast, early blight, purple blotch and anthracnose each have their own band and thresholds. The app runs this hour by hour across the 7-day forecast, so it can say “high late blight risk on Thursday” instead of a vague “watch out for disease.”</p><p><strong>Spray window.</strong> It also finds the first hour in the next 3 days that is calm (wind up to 12 km/h), not too hot (up to 32°C) and dry for the 6 hours after, so the spray doesn’t drift away or get washed off.</p><p>The part I like most is that these numbers don’t just sit on a screen. They’re also written into Gemini’s system prompt. So when a farmer asks “should I water today?”, the AI answers with that farm’s actual millimetres and growth stage instead of generic advice. The AI is the voice, but the farm brain does the maths. It also taught me something: the most useful features in the app aren’t AI at all. They’re decades-old agronomy formulas, fed with good weather data.</p><h3>Deep dive 4: Leaf scanning with structured output</h3><p>For the leaf scan, the phone first shrinks the photo to 1024 px. That keeps uploads fast on weak rural internet and keeps requests inside free-tier limits.</p><p>The tricky part was the answer format. If you ask an AI “what’s wrong with this leaf?”, you get a different shaped paragraph every time, which is hard to show nicely in an app. So instead I give Gemini a <strong>JSON schema</strong>, a fixed form it has to fill in. The fields include:</p><ul><li><strong>isPlant</strong>: is this even a plant? (People will test it with photos of their cat.)</li><li><strong>issue</strong> and <strong>category</strong>: fungus, bacteria, virus, pest, nutrient, water or heat stress, healthy or unknown</li><li><strong>severity</strong>: healthy, watch, or action</li><li><strong>confidence</strong>: low, medium, or high, and the prompt tells it to use “low” if the photo is blurry or the symptoms are ambiguous</li><li><strong>steps</strong>: 3 to 5 treatment steps, plus a prevention tip and a weather note linking the forecast to the problem</li></ul><p>Because the output always has the same shape, the app can always show a clean result card, and the farmer always sees how sure the AI is. I think that confidence field is one of the most important parts of the whole app. An AI that admits “I’m not sure, take a closer photo” is more trustworthy than one that always sounds certain.</p><h3>Deep dive 5: Keeping it free, reliable and locked</h3><p>Running on free tiers sounds great until the model is busy or you hit the daily limit in the middle of a demo. Google’s free tier also gives every model its own daily quota and retires old models a few times a year, so depending on one model was never going to work. So I built a model router. Each kind of task has its own ordered list of models: chat starts with the cheap, fast Flash-Lite models (around 500 free requests a day each), while leaf photos start with the strongest Flash model, because reading a leaf is harder. If a model is busy (503 or 500), the server waits under a second and retries once. If it’s still busy, out of quota (429) or retired (404), the server moves to the next model and puts the failed one on a cooldown, 15 minutes for a used-up daily quota and 6 hours for a retired model, so it doesn’t waste time asking it again. A bad API key fails straight away, because no backup model will fix that.</p><pre>for (const model of models) {<br>  for (let attempt = 0; attempt &lt; 2; attempt++) {<br>    try { return await callModel(model, body, apiKey); }<br>    catch (err) {<br>      const busy = err.status === 503 || err.status === 500;<br>      if (busy &amp;&amp; attempt === 0) { await sleep(1000); continue; }<br>      if (busy || err.status === 429 || err.status === 404) break;<br>      throw err;<br>    }<br>  }<br>}</pre><p>Since I’m sharing FarmerMate with my TKS group, I also added a password lock. The important detail is that the check happens on the <strong>server</strong>, not just on the login screen. The chat and scan endpoints refuse every request without a valid login cookie, so nobody can skip the lock by calling the API directly. Wrong guesses are slowed down, and the cookie lasts 30 days.</p><p>Finally, I wrote 30 automated tests. They cover the farm brain (crop stage, water need, disease risk and spray window), the RAG search in English and Hindi, both APIs, input validation, the model router (retired, busy and out-of-quota models, plus a rejected API key) and the password lock. The tests use a fake Gemini server, so running them never spends my real quota. The whole project has zero external dependencies, just Node.js.</p><h3>What’s still not good enough</h3><p>I want to be clear about the limits, because this is a prototype and not something a farmer should bet their harvest on yet.</p><ul><li><strong>The knowledge base is small.</strong> 32 guides that I wrote myself from public sources. An actual agronomist needs to review them before real farmers rely on them.</li><li><strong>Photo diagnosis can be wrong</strong>, especially with blurry photos or diseases that look alike. That’s why the app shows confidence and sends serious cases to the Kisan Call Centre or KVK.</li><li><strong>Free-tier trade-offs.</strong> There are per-minute and per-day limits, and on the free tier Google may use requests to improve its products. Fine for a prototype, not for a real launch.</li><li><strong>Chat history only lives on the phone.</strong> Switch phones and it’s gone.</li><li><strong>The farm brain gives estimates, not measurements. </strong>My disease rules are simplified versions of published models, leaf wetness is guessed from humidity, and the weather comes from a forecast, not a sensor in the field. The stage lengths are averages, not tuned to a variety or region.</li></ul><p>This connects back to something from my Learn article. When I asked my family whether they would trust an AI farm adviser, the answer was basically: only if it has proof that it actually helped farmers succeed. FarmerMate works, but it doesn’t have that proof yet. Getting it is the real next step.</p><h3>Industry validation and what comes next</h3><p>For validation, I’m going straight to someone who does this for real. I’m reaching out to Dr. Sandeep Jain at Punjab Agricultural University, a plant pathologist who works on late blight forecasting, to check my disease rules, since that’s the part of FarmerMate where a wrong number could mislead a farmer the most. After that, I want an agronomist to review the 32 guides and test the leaf scanner against real cases, because those are the other weak spots. I’m also going to show it to my dad, who does agriculture as a side business, to see if it gives advice he would actually follow.</p><p>For the Iterate stage, these are the upgrades I’m looking at:</p><ul><li><strong>Semantic search</strong> with embeddings, plus a much bigger knowledge base built from real ICAR crop manuals</li><li><strong>Testing the disease forecast against real outbreak reports, like PAU’s late blight advisories, and tuning the rules for each region</strong></li><li><strong>More languages</strong>: Punjabi, Marathi, Tamil</li><li><strong>Mandi prices</strong> and government scheme info</li><li><strong>Real field data.</strong> A DIY weather station or soil sensor that feeds data from the actual field, not just a regional forecast. Weather can be completely different from one village to the next, and I want to test the first one on my mom’s plants.</li></ul><p>Long term, the plan is to start digital with the app and then connect my own hardware to it, like a weather tracker and eventually a drone that scans the field and sends the data straight to FarmerMate. The software stays free. The hardware is what pays for it.</p><p>The code is on my GitHub: <a href="https://github.com/hargunnofficial-pixel/farmermate">github.com/hargunnofficial-pixel/farmermate</a></p><h3>About me</h3><p>I’m Hargunn Bassi, an IB student in Dubai and a TKS innovator focused on AI in AgTech. My family farms in Punjab, which is why I care about this. My goal is to build several businesses and use what they make to fund a philanthropic company that helps people and the environment. FarmerMate is one of my first steps toward that.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2fd96d053d98" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[From Data Swarms to Field Decisions: Generative AI as the Modern Agronomist]]></title>
            <link>https://medium.com/@hargunnofficial/from-data-swarms-to-field-decisions-generative-ai-as-the-modern-agronomist-989d09ab27df?source=rss-894f2dfced4c------2</link>
            <guid isPermaLink="false">https://medium.com/p/989d09ab27df</guid>
            <category><![CDATA[agriculture]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[agritech]]></category>
            <category><![CDATA[agriculture-technology]]></category>
            <dc:creator><![CDATA[Hargunnofficial]]></dc:creator>
            <pubDate>Tue, 06 Oct 2026 10:25:42 GMT</pubDate>
            <atom:updated>2026-10-29T02:23:20.768Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YF78sGQ-A20VabrHMLi2zA.png" /></figure><p><em>My uncle bet a season on purple rice and lost it to the rain. I wanted to know if an AI could have changed that.</em></p><p>My mom’s brother farms in Punjab, India. A while back he tried something almost nobody around him was growing: purple rice. The logic was simple. It’s rare there, rare things sell for more, and when your land is limited, profit per acre decides everything.</p><p>Then the rain came. It was a very wet season, the crop spoiled, and that was the end of the experiment. My family went back to the crops they already knew could take a beating from the weather.</p><p>Nobody in that story was careless. He made a business decision with the information he had. What he didn’t have was anyone to tell him how purple rice copes with a wet year, how likely a wet year was, or who would actually buy it at the price he was hoping for.</p><p>That person exists. They’re called an agronomist. He just didn’t have one.</p><p>So I went looking for an answer to one question: can generative AI be that person for farmers like him? What I found surprised me. The technology is further along than I expected, and that turns out to be the smaller half of the problem.</p><h3>Farmers aren’t short on data. They’re short on someone to read it.</h3><p>Britannica describes <a href="https://www.britannica.com/science/agronomy">agronomy</a> as the part of agriculture concerned with growing field crops and managing soil. In practice, an agronomist is a crop doctor and a business adviser in one. They look at your soil, your weather, your seed and your market, then tell you what to plant and what to do about it week by week.</p><p>The trouble is the ratio. In India, <a href="https://oar.icrisat.org/11401/1/Agriculture-Extension-System-in-India-A-Meta-analysis.pdf">one government extension worker serves about 1,162 farms</a>, when the recommended number is 750. An extension worker is the government’s version of a farm adviser. One person cannot know a thousand fields.</p><p>Meanwhile the data has exploded, and this is what I mean by “data swarms” in the title. Satellites photograph fields every few days. Weather models update by the hour. Then there are soil tests, mandi (market) prices, pest alerts, government scheme rules and decades of research papers. A lot of it is free. Almost none of it reaches a farmer in a form he can act on before lunch.</p><p>So the gap was never information. The gap is translation: turning a swarm of data into one sentence like “wait four days before you sow.”</p><h3>Why this is bigger than my family</h3><p>According to the UN’s Food and Agriculture Organization (FAO), <a href="https://www.fao.org/newsroom/detail/Small-family-farmers-produce-a-third-of-the-world-s-food/en">five out of every six farms in the world are smaller than two hectares</a>, and together they grow roughly a third of its food.</p><p>Those small farms hold a resource nobody can do without, yet many still make the year’s biggest decisions on instinct.</p><p>The weather isn’t getting kinder either. In 2025, floods in Punjab <a href="https://www.tribuneindia.com/news/punjab/looking-back-2025-lack-of-policy-floods-wreaked-havoc-on-farming/">damaged crops on 4.3 lakh acres</a> (430,000), including 3.47 lakh acres of paddy. My uncle’s ruined rice is the kind of season farmers there now have to plan for.</p><h3>How an AI agronomist actually works</h3><p>A plain chatbot is not an agronomist. Ask a general model a farming question and you tend to get advice like “use the right amount of fertilizer,” which is true and useless. A farmer needs the kilos per hectare and the day to apply it. Researchers in the journal Nature Food <a href="https://www.nature.com/articles/s43016-023-00867-x">tested GPT on advice for cassava farmers in Nigeria</a> and found enough problems that they want human experts kept in the loop.</p><p>The systems that work wrap the language model in four layers.</p><ol><li><strong>Listen.</strong> The farmer asks by voice, text or a photo of a sick leaf, in their own language. Digital Green, the non-profit behind FarmerChat, says voice is <a href="https://www.digitalgreen.org/insights/v2-launch-performance">the first thing farmers reach for</a>.</li><li><strong>Look it up.</strong> The model doesn’t answer from memory. It first pulls from a library of checked material, a method called retrieval-augmented generation, or RAG. I think of it as an open-book exam where someone trustworthy picked the book.</li><li><strong>Add the live data.</strong> Weather forecast, soil, crop and market prices. This is where the data swarm plugs in.</li><li><strong>Ask, then answer.</strong> Good advisers ask questions first. The newest FarmerChat asks for things like your acre size or a photo before it replies.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jUe23fc5tBIefs4a207yvw.png" /></figure><p>Does it work? On paper, yes. Microsoft Research gave GPT-4 the exam American crop advisers take to renew their certification, and <a href="https://www.microsoft.com/en-us/research/publication/gpt-4-as-an-agronomist-assistant-answering-agriculture-exams-using-large-language-models/">it scored 93%</a>. But an exam and a field are very different places. On an exam, the question comes with everything you need to answer it. A farmer’s question usually doesn’t, and the next section shows why that matters.</p><h3>One level deeper: tracing one guava question through the pipeline</h3><p>Step 2 is where most of the clever engineering happens, so I want to follow one real question all the way through it, my family’s: “Our guava leaves are turning yellow. What should we do?” Most numbers come from Digital Green’s <a href="https://www.microsoft.com/en-us/research/publication/farmer-chat-scaling-ai-powered-agricultural-services-for-smallholder-farmers/">2024 technical paper on FarmerChat</a>, written with Microsoft Research. FarmerChat has been rebuilt since, so treat these as how it worked in 2024.</p><p><strong>1. Build the library.</strong> Before any farmer asks anything, someone collects trusted documents and cuts them into pieces called chunks, usually a few hundred tokens long (a token is about three quarters of a word). One <a href="https://aclanthology.org/2024.emnlp-main.15">Microsoft study</a> used 256-token chunks. FarmerChat cuts wherever the topic changes instead, which is called semantic chunking. Guava makes this easy, because Indian guidance on guava nutrition is already written as one short entry per nutrient, so every entry can be its own chunk. FarmerChat’s India library already covers guava.</p><p><strong>2. Turn every chunk into numbers.</strong> An embedding model reads each chunk and turns it into a long list of numbers. OpenAI’s smaller embedding model, for example, gives <a href="https://zilliz.com/ai-models/text-embedding-3-small">1,536 numbers per chunk</a>. FarmerChat uses a custom model of its own. I find it easiest to think of the numbers as coordinates. Chunks that mean similar things end up near each other, even if they use completely different words.</p><p><strong>3. Score every chunk against the question.</strong> The question is turned into numbers the same way, and every chunk gets a score called cosine similarity, which checks how closely two lists of numbers point in the same direction. Near 1 means very similar and near 0 means unrelated. A made-up three-number example shows the maths: if the question is (0.8, 0.5, 0.1), a nitrogen chunk (0.7, 0.6, 0.2) scores 0.98 and a pest chunk (0.1, 0.2, 0.9) scores 0.31. A real system does the same sum with 1,536 numbers.</p><p><strong>4. Keep the top 10 and rerank them.</strong> In the 2024 version, FarmerChat took the 10 best-scoring passages, had GPT-4 filter and reorder them, and gave the best ones to GPT-3.5 to write the reply. Questions in Swahili or Hindi were translated into English first and the answer translated back, because answering directly in local languages worked worse. Each answer took about 9 seconds.</p><p><strong>5. Look at what comes back.</strong> This is the part that surprised me. At least three entries should score highly, because all three are about yellow leaves:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5UWpHkdc6IlMuaxoxWfC2g.png" /></figure><p>Sources: nitrogen from the <a href="https://en.vikaspedia.in/viewcontent/agriculture/crop-production/integrated-pest-managment/ipm-for-fruit-crops/ipm-strategies-for-guava/nutritional-deficiencies-of-guava?lgn=en">NIPHM guava guide</a>; <a href="https://agritech.tnau.ac.in/horticulture/plant_nutri/guava_ir.html">iron</a> and <a href="https://agritech.tnau.ac.in/horticulture/plant_nutri/guava_sul.html">sulphur</a> from Tamil Nadu Agricultural University.</p><p>So retrieval worked. It found the right three passages even though I never typed nitrogen, iron or sulphur. What it can’t do is pick between them, because the thing that decides it, whether the older or the newer leaves are turning yellow, isn’t in my question. Tamil Nadu Agricultural University’s guidance even <a href="https://agritech.tnau.ac.in/agriculture/pdf/Diagnosis%20of%20nutritional%20disorders.pdf">warns that symptoms can mislead</a> and suggests a leaf test to be sure. This is exactly why layer 4 exists. The best first reply is another question: “Is it the older leaves or the new ones?” Skip that step and the model just picks a passage, and a farmer could end up buying urea for what is really an iron problem.</p><p><strong>6. How well does it actually work?</strong> In Digital Green’s test of more than 1,000 questions, 71% of what it retrieved was relevant, and about 80% of its answers stuck to the documents. FarmerChat answered about 75% of the questions farmers sent, and two-thirds of the misses happened because the library had nothing on the topic. I assumed the AI model would be the weak link. Mostly it’s the library.</p><p><strong>Why not just teach the model the facts directly?</strong> That’s called fine-tuning, and for adding facts the research isn’t on its side. Microsoft researchers <a href="https://aclanthology.org/2024.emnlp-main.15">compared the two methods</a> and found retrieval did better, and fine-tuned models struggled to learn a new fact unless they saw it written many different ways. Fine-tuning still helps with how a model answers. Another <a href="https://www.microsoft.com/en-us/research/publication/rag-vs-fine-tuning/">Microsoft study on agriculture</a> found it raised accuracy by about 6 percentage points, and adding retrieval on top gave another 5. So real systems use both. CGIAR trained AgriLLM on 146,000 expert-checked questions and answers, while FarmerChat keeps its facts in a library it can update. Fine-tuning teaches the model how to answer, and retrieval tells it what’s true this season.</p><p>None of this makes it perfect. If an old guideline is still sitting in the library, or the search grabs the wrong chunk, the model will repeat it just as confidently as everything else.</p><h3>Who is building this right now</h3><p>This isn’t a lab idea anymore. These are the six projects I kept running into, from a non-profit to a giant seed company to the Indian government.</p><p>Sources for the table: <a href="https://www.digitalgreen.org/insights/v2-launch-performance">FarmerChat</a>, <a href="https://www.bayer.com/en/agriculture/article/genai-for-good">E.L.Y.</a>, <a href="https://analyticsindiamag.com/deep-tech/kissanai-unveils-dhenu-1-0-llm-for-indias-agricultural-challenges/">Dhenu</a>, <a href="https://www.drishtiias.com/daily-updates/daily-news-analysis/bharat-vistaar">Bharat-VISTAAR</a>, <a href="https://www.cgiar.org/news-events/news/digital-transformation-agricultural-research-already-underway">AgriLLM</a>, <a href="https://cropin.com/resource-blogs/meet-cropin-sage/">Sage</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dMFHhKl2TnvPEUIwYrdS8Q.png" /></figure><p>Three details stood out to me. First, cost. Digital Green’s <a href="https://www.microsoft.com/en-us/research/publication/farmer-chat-scaling-ai-powered-agricultural-services-for-smallholder-farmers/">technical paper</a> puts in-person extension at about $35 for each farmer who adopts a new practice, and its farmer-made videos at $3.50. Its early estimate with generative AI is <a href="https://openai.com/index/digital-green/">$0.35</a>. These are its own numbers and don’t measure quite the same thing, but even a rough 100x drop is why I think this could reach two-acre farms. Second, Bayer gave E.L.Y. to its agronomists instead of replacing them, and hasn’t shared the starting score behind its 40% claim. Third, AgriLLM was <a href="https://www.eurekalert.org/news-releases/1109162">built in Abu Dhabi</a>, one emirate over from where I live.</p><h3>The part nobody has solved: trust</h3><p>This year McKinsey <a href="https://www.mckinsey.com/industries/agriculture/our-insights/global-farmer-insights">asked 5,500 farmers in ten countries</a> how they make decisions. 17% already use generative AI for farm work. Only 6% name it as a source they trust, while 56% say an agronomist is one of their top influences.</p><p>So farmers are curious enough to try it but not convinced enough to bet a season on it. My family is the same: they won’t trust an AI adviser until it shows proof it has helped real farmers.</p><p>Their doubts are fair. A <a href="https://www.frontiersin.org/journals/remote-sensing/articles/10.3389/frsen.2026.1839369/full">2026 review</a> by Shalini Gakhar and Raj Kumar Singh of the International Rice Research Institute maps what can go wrong with AI farm advice and how serious each risk is.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sWHRB5MIfr9I-ssTv7hQ0g.png" /></figure><p>Three of its high risks stood out to me, and I’ve added a fourth.</p><p><strong>Confident mistakes.</strong> Language models can make things up and sound completely sure, and the review found none of the systems it studied had automatic checks for invented answers. A wrong diagnosis means the wrong spray, and the farmer pays for both. The main defence right now is limits plus testing. FarmerChat may only answer from approved documents, and in Digital Green’s 1,000-question test about 80% of its answers stayed true to them. That leaves about a fifth that need work.</p><p><strong>The rare crop problem.</strong> Models are strongest where a lot has been written. The review warns that advice systems do worse for smallholder crops like millets and pulses, and for places that barely appear in the training data. Purple rice in Punjab is exactly that kind of crop. Two-thirds of the questions FarmerChat can’t answer fail because its library has nothing on them, and the fix so far is slow: log those questions and write new content by hand. So the farmers trying something new, who need advice most, get the weakest answers.</p><p><strong>Weak signal, misheard words.</strong> The farmers who need this most often have the worst internet, and the review rates poor connectivity as a high risk too. Bharat-VISTAAR gets around it with an ordinary phone line. Voice helps, but only if the system hears farming words correctly, and Digital Green says reliable voice is <a href="https://www.digitalgreen.org/insights/v2-launch-performance">one of the gaps it is still closing</a>.</p><p><strong>Nobody to blame.</strong> If a human adviser gets it wrong, you know where he lives. If a chatbot gets it wrong, who pays? Nobody has a clear answer yet. Bayer’s answer for now is to keep a person in the loop: E.L.Y. advises the agronomist, and the agronomist advises the farmer.</p><h3>A stress test: my family’s guava plan</h3><p>Recently my family has been talking about growing guavas to sell in India. The thinking is that wealthier buyers like them and will pay a high price.</p><p>If that sounds familiar, it should. It’s the purple rice logic again: a premium crop for a premium price. I’d like this one to end differently.</p><p>So here’s what I’d want an AI adviser to tell us first.</p><ul><li>What is the real demand for guavas near us, and at what price?</li><li>What soil do they need, and is ours right?</li><li>How do we plant and fertilize, step by step?</li><li>What does a bad weather year do to them?</li><li>Which businesses buy guavas in bulk, and can you connect us to them?</li></ul><p>From what I’ve read, today’s tools can make a decent attempt at the middle three. The first and the last are where they go quiet, and those two decide whether you make any money. Growing something well is only half of a market. The other half is someone willing to pay for it.</p><p>That last question is the opportunity I’d build on. An adviser that says “grow guavas” is a chatbot. An adviser that says “grow guavas, and here are three buyers who want them” is a business partner.</p><h3>My hot take</h3><p>My hot take is that the AI agronomist race won’t be won by whoever has the smartest model. It will be won by whoever can prove results first.</p><p>The models can already pass the exam. What’s missing is what my family would actually ask for, which is proof. Show us farmers like us, with land like ours, who followed the advice and did better. If that proof were real, my family would happily pay a monthly subscription. Without it, no feature list will change their minds.</p><p>Right now that proof mostly doesn’t exist. The <a href="https://www.frontiersin.org/journals/remote-sensing/articles/10.3389/frsen.2026.1839369/full">2026 review</a> looked at eleven deployed farm advice systems, and none had reported hard outcomes like yield gains measured in a randomised trial. They report users and satisfaction, which isn’t the same as showing a farmer earned more.</p><p>What does exist is good evidence for the older, simpler version: farm advice sent by text message or recorded voice call, with no AI involved. To me, that’s the bar an AI adviser has to beat.</p><ul><li>Trials pooled in a <a href="https://doi.org/10.1126/science.aay3038">review in the journal Science</a> found farm advice sent by phone raised yields by about 4% and the odds of using recommended inputs by 22%. A <a href="https://pmc.ncbi.nlm.nih.gov/articles/PMC12167173/">2025 meta-analysis</a> found gains of about 6% in both yield and income.</li><li>The closest match to my family is a <a href="https://precisiondev.org/wp-content/uploads/2025/02/Odisha_RCT_02052025.pdf">randomised trial in Odisha, India</a>, run by researchers from Harvard, the University of Maryland and Precision Development. Half of 13,675 rice farmers got Ama Krushi, a free weekly voice call with agronomists’ advice. Their harvest went up about 4% on average and 9% in areas hit by heavy rain, though it didn’t help against a sudden river flood. It cost $0.37 per farmer per year.</li></ul><p>The best evidence for AI advisers is a <a href="https://60decibels.com/insights/farmers-ai-recommendations/">60 Decibels survey</a> of 450 FarmerChat users in Kenya, where seven in 10 said they’d used its advice in the past month. That’s encouraging, but it’s self-reported. It tells us what farmers say they did, not what happened to their harvest. So the bar for AI isn’t zero. A $0.37 voice call already raises harvests by a few percent, and an AI adviser has to prove it does clearly better. As far as I can find, nobody has run that trial yet.</p><p>The strongest argument against me is that being everywhere matters more than proof. Ama Krushi reached millions of farmers years before its trial results came out, and Bharat-VISTAAR is free, works without a smartphone and has the government behind it. Something like that could win just by getting there first. I take that seriously, but I’d argue word of mouth is a kind of proof too, just at the size of one village. Digital Green’s researchers found farmers trusted FarmerChat after trying its advice on a small patch of their own field.</p><p>Two results would change my mind. If Bharat-VISTAAR reaches most Indian farmers without ever publishing outcome data, being everywhere beat proof. And if the first proper trial of an AI adviser shows it does no better than a simple voice call like Ama Krushi, the extra intelligence isn’t worth paying for.</p><p>So here are three predictions I’m willing to be wrong about.</p><p><strong>1. Track records become the product.</strong> Within five years, I think serious AI advisers will publish a scoreboard by district and crop: who followed the advice and what happened to their yield and income, checked by an outsider. The 60 Decibels survey is a first step. The next is measuring harvests instead of asking about them.</p><p><strong>2. The winners will connect farmers to buyers.</strong> Advice that ends in a sale proves its value in rupees, which solves trust and the business model at once. Digital Green already says its <a href="https://www.digitalgreen.org/insights/v2-launch-performance">next step</a> is helping farmers act on advice.</p><p><strong>3. Human agronomists get multiplied, not replaced.</strong> Farmers still trust people far more than AI, as McKinsey’s 56% against 6% shows. My guess is that one agronomist with AI will cover ten thousand farmers instead of one thousand, while the AI takes the 2 a.m. questions.</p><p>I could be wrong on the timing. I don’t think I’m wrong on the order: trust first, then scale.</p><h3>Would it have saved the purple rice?</h3><p>Probably not the crop. No model stops rain.</p><p>But I think it could have changed the decision. An adviser with the weather record, the soil data and the going price for purple rice might have said: try it on a small patch first, keep the hardy crops on the rest, and here’s who would buy it. That’s a smaller loss, and a lesson that doesn’t cost a whole season.</p><p>To me that’s what an agronomist really is. Someone who makes your experiments cheaper. Farmers like my uncle have always been willing to experiment. They’ve just been doing it alone.</p><h3>Sources</h3><ul><li><a href="https://www.britannica.com/science/agronomy">Britannica, Agronomy</a></li><li><a href="https://oar.icrisat.org/11401/1/Agriculture-Extension-System-in-India-A-Meta-analysis.pdf">Nandi and Nedumaran, Agriculture Extension System in India (2019)</a></li><li><a href="https://www.fao.org/newsroom/detail/Small-family-farmers-produce-a-third-of-the-world-s-food/en">FAO, Small family farmers produce a third of the world’s food (2021)</a></li><li><a href="https://www.tribuneindia.com/news/punjab/looking-back-2025-lack-of-policy-floods-wreaked-havoc-on-farming/">The Tribune, Punjab floods 2025</a></li><li><a href="https://www.microsoft.com/en-us/research/publication/farmer-chat-scaling-ai-powered-agricultural-services-for-smallholder-farmers/">Singh et al., Farmer.Chat (2024)</a></li><li><a href="https://www.nature.com/articles/s43016-023-00867-x">Tzachor et al., Nature Food (2023)</a></li><li><a href="https://www.microsoft.com/en-us/research/publication/gpt-4-as-an-agronomist-assistant-answering-agriculture-exams-using-large-language-models/">Silva et al., GPT-4 as an Agronomist Assistant?</a></li><li><a href="https://aclanthology.org/2024.emnlp-main.15">Ovadia et al., Fine-Tuning or Retrieval? (2024)</a></li><li><a href="https://www.microsoft.com/en-us/research/publication/rag-vs-fine-tuning/">Balaguer et al., RAG vs Fine-tuning (2024)</a></li><li><a href="https://zilliz.com/ai-models/text-embedding-3-small">Zilliz, text-embedding-3-small</a></li><li><a href="https://en.vikaspedia.in/viewcontent/agriculture/crop-production/integrated-pest-managment/ipm-for-fruit-crops/ipm-strategies-for-guava/nutritional-deficiencies-of-guava?lgn=en">NIPHM, Nutritional deficiencies of guava</a></li><li>Tamil Nadu Agricultural University: guava <a href="https://agritech.tnau.ac.in/horticulture/plant_nutri/guava_ir.html">iron</a> and <a href="https://agritech.tnau.ac.in/horticulture/plant_nutri/guava_sul.html">sulphur</a>, <a href="https://agritech.tnau.ac.in/agriculture/pdf/Diagnosis%20of%20nutritional%20disorders.pdf">diagnosis guide</a></li><li><a href="https://www.digitalgreen.org/insights/v2-launch-performance">Digital Green, FarmerChat V2 (2026)</a></li><li><a href="https://openai.com/index/digital-green/">OpenAI, Digital Green case study</a></li><li><a href="https://www.bayer.com/en/agriculture/article/genai-for-good">Bayer, E.L.Y.</a></li><li><a href="https://analyticsindiamag.com/deep-tech/kissanai-unveils-dhenu-1-0-llm-for-indias-agricultural-challenges/">Analytics India Magazine, Dhenu</a></li><li><a href="https://www.drishtiias.com/daily-updates/daily-news-analysis/bharat-vistaar">Drishti IAS, Bharat-VISTAAR</a></li><li><a href="https://www.eurekalert.org/news-releases/1109162">EurekAlert, UAE AI ecosystem for agriculture</a></li><li><a href="https://www.cgiar.org/news-events/news/digital-transformation-agricultural-research-already-underway">CGIAR, AgriLLM</a></li><li><a href="https://cropin.com/resource-blogs/meet-cropin-sage/">Cropin, Sage</a></li><li><a href="https://www.mckinsey.com/industries/agriculture/our-insights/global-farmer-insights">McKinsey, Global Farmer Insights 2026</a></li><li><a href="https://www.frontiersin.org/journals/remote-sensing/articles/10.3389/frsen.2026.1839369/full">Gakhar and Singh, Frontiers in Remote Sensing (2026)</a></li><li><a href="https://doi.org/10.1126/science.aay3038">Fabregas, Kremer and Schilbach, Science (2019)</a></li><li><a href="https://pmc.ncbi.nlm.nih.gov/articles/PMC12167173/">Beach et al., Global Food Security (2025)</a></li><li><a href="https://precisiondev.org/wp-content/uploads/2025/02/Odisha_RCT_02052025.pdf">Cole et al., Odisha trial (2025)</a></li><li><a href="https://60decibels.com/insights/farmers-ai-recommendations/">60 Decibels, FarmerChat survey (2025)</a></li></ul><h3>About me</h3><p>I’m Hargunn Bassi, a 16-year-old IB student in Dubai. My family farms in Punjab, and my dad runs agriculture as a second business, so I talked this article through with him.</p><p>I’ve been building things for a while: AI photo colourising on Twitter, dropshipping, a sports channel that reached around 30,000 views a short, a movie edits channel and digital products on Gumroad. Most didn’t last, but each one taught me something, like understanding a product before you sell it.</p><p>More recently my team entered the USAII hackathon, where we built a tool that checks whether a news story is fake and gives people the answer in their own language.</p><p>My next project is an AI farm adviser app like FarmerChat, then the hardware to feed it: weather tracking for your exact location, and later drones that scan a field and send what they see to the AI agronomist.</p><p>Long term, I want to build several businesses and use what they earn to fund a philanthropic company that works on social and environmental problems. Farming sits right where those two meet.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=989d09ab27df" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>