{"slug": "farmer-rank-ai-using-generative-ai-to-connect-farmers-with-the-right-buyers", "title": "Farmer Rank AI: Using Generative AI to Connect Farmers with the Right Buyers", "summary": "Shaik Inzamam, a B.Tech Computer Science student and aspiring AI engineer from India, built Farmer Rank AI, a generative AI-powered agricultural marketplace assistant that helps buyers find and connect with suitable farmers based on crop type, quantity, quality, price, and location. The project aims to make agricultural trading more accessible, transparent, and efficient for farmers and buyers in India by using natural language processing to understand buyer requests and rank farmers accordingly.", "body_md": "Introduction\n\nHello, I am Shaik Inzamam, a B.Tech Computer Science student and aspiring AI engineer from India.\n\nI enjoy building practical AI solutions using Generative AI, large language models, backend development, cloud technologies, and automation tools. I am especially interested in creating solutions that address real problems faced by local communities.\n\nFor the Gen AI Academy APAC – Meet the Builders initiative, I am sharing my project:\n\nFarmer Rank AI\n\nFarmer Rank AI is a Generative AI-powered agricultural marketplace assistant that helps buyers find and connect with suitable farmers based on crop type, quantity, quality, price, and location.\n\nThe goal of the project is to make agricultural trading more accessible, transparent, and efficient for farmers and buyers in India.\n\nThe Local Problem\n\nAgriculture plays an important role in India, but many farmers still face challenges when trying to connect directly with genuine buyers.\n\nFarmers may have quality produce available, but they often lack visibility and access to the right market. Buyers also face difficulties identifying farmers who can meet their exact requirements.\n\nFor example, a buyer may need:\n\n500 kilograms of tomatoes\n\nGrade A quality\n\nA maximum price of ₹20 per kilogram\n\nA farmer located near Bengaluru\n\nImmediate availability\n\nFinding the right farmer manually can take a lot of time. Buyers may need to contact several farmers individually before finding a suitable match.\n\nAt the same time, smaller farmers may be ignored because they do not have access to advanced digital platforms or strong marketing networks.\n\nSome of the major problems include:\n\nDifficulty connecting farmers directly with buyers\n\nLimited visibility for small and regional farmers\n\nTime-consuming manual search\n\nLack of intelligent farmer ranking\n\nIncomplete information about crop quantity and quality\n\nPoor location-based matching\n\nLack of transparency in recommendations\n\nCommunication gaps between farmers and buyers\n\nThe Idea Behind Farmer Rank AI\n\nFarmer Rank AI acts as an intelligent bridge between agricultural buyers and farmers.\n\nInstead of manually selecting multiple filters, a buyer can describe their requirement in normal language.\n\nFor example:\n\nI need 500 kg of Grade A tomatoes near Bengaluru for under ₹20 per kg.\n\nThe application understands the request, extracts the important information, searches available farmer listings, and recommends the most suitable farmers.\n\nThe platform does not simply return a long list of results. It ranks farmers according to how closely they match the buyer’s needs.\n\nIt also explains why each farmer was recommended.\n\nExample Buyer Request\n\nA buyer can enter:\n\nFind farmers who can supply 500 kg of Grade A tomatoes near Bengaluru for less than ₹20 per kilogram.\n\nThe application extracts structured information such as:\n\n{\n\n\"crop\": \"tomato\",\n\n\"quantity_kg\": 500,\n\n\"quality_grade\": \"A\",\n\n\"preferred_location\": \"Bengaluru\",\n\n\"maximum_price_per_kg\": 20\n\n}\n\nThe system then searches the available farmer data and evaluates each farmer using multiple conditions.\n\nThese conditions include:\n\nCrop availability\n\nQuantity available\n\nQuality grade\n\nPrice per kilogram\n\nLocation\n\nDistance from the buyer\n\nFarmer reliability\n\nPrevious buyer preferences\n\nHow Farmer Rank AI Works\n\nThe application follows a structured AI workflow.\n\nStep 1: Buyer Enters a Requirement\n\nThe buyer enters a crop requirement using natural language.\n\nThe buyer does not need to understand technical filters or database fields.\n\nExample:\n\nI need 1,000 kg of onions near Hyderabad within ₹25 per kilogram.\n\nStep 2: Gemini Understands the Request\n\nGoogle Gemini processes the request and identifies important information such as:\n\nCrop name\n\nRequired quantity\n\nQuality grade\n\nLocation\n\nMaximum budget\n\nBuyer intent\n\nStep 3: Structured Filters Are Created\n\nThe natural-language request is converted into structured search filters.\n\nThis makes it easier for the backend to search available farmer listings.\n\nStep 4: Matching Farmers Are Retrieved\n\nThe system searches farmer records based on the extracted requirements.\n\nFarmers who do not meet the basic conditions are removed.\n\nFor example, a farmer may be excluded when:\n\nThe crop does not match\n\nThe available quantity is too low\n\nThe price exceeds the buyer’s budget\n\nThe farmer is too far from the preferred location\n\nThe required quality grade is unavailable\n\nStep 5: Farmers Are Ranked\n\nThe remaining farmers receive a ranking score.\n\nThe ranking system considers:\n\nCrop match\n\nQuantity match\n\nQuality match\n\nPrice match\n\nLocation relevance\n\nDistance\n\nFarmer availability\n\nBuyer preferences\n\nStep 6: Gemini Generates Explanations\n\nGemini generates a simple explanation for each recommendation.\n\nExample:\n\nThis farmer is recommended because they have 600 kg of Grade A tomatoes available at ₹18 per kilogram and are located close to Bengaluru.\n\nStep 7: Buyer Reviews the Results\n\nThe buyer receives a ranked list of farmers with:\n\nFarmer name\n\nCrop\n\nAvailable quantity\n\nQuality grade\n\nPrice\n\nLocation\n\nMatching score\n\nRecommendation reason\n\nContact option\n\nStep 8: Buyer Connects With the Farmer\n\nAfter reviewing the results, the buyer can contact the selected farmer and continue the discussion.\n\nGoogle AI and Google Cloud Technologies\n\nGoogle technologies play an important role in the architecture of Farmer Rank AI.\n\nGoogle Gemini is the main Generative AI layer of the project.\n\nIt is used to understand buyer requirements written in natural language.\n\nGemini helps the application perform tasks such as:\n\nDetecting buyer intent\n\nExtracting crop names\n\nExtracting required quantities\n\nUnderstanding quality grades\n\nIdentifying locations\n\nExtracting budget constraints\n\nConverting text into structured data\n\nGenerating farmer recommendation explanations\n\nSummarizing matching results\n\nSupporting multilingual requests\n\nProducing easy-to-understand responses\n\nGemini makes the application more natural because buyers can communicate with the system like they would communicate with another person.\n\nVertex AI provides a managed platform for working with Gemini models on Google Cloud.\n\nVertex AI can help Farmer Rank AI:\n\nAccess Gemini securely\n\nManage AI model requests\n\nConfigure generation settings\n\nHandle production workloads\n\nMonitor AI usage\n\nEvaluate model responses\n\nImprove prompt quality\n\nScale AI operations\n\nVertex AI can also support future improvements such as prompt evaluation, model monitoring, and AI response testing.\n\nThe backend of Farmer Rank AI can be deployed using Google Cloud Run.\n\nCloud Run allows the application to run as a containerized service without manually managing servers.\n\nCloud Run is useful because it provides:\n\nAutomatic scaling\n\nContainer-based deployment\n\nSecure API hosting\n\nReduced infrastructure management\n\nFaster deployment\n\nSupport for backend services\n\nPay-per-use infrastructure\n\nWhen a buyer submits a query, the backend running on Cloud Run receives the request, communicates with Gemini, searches farmer data, and returns ranked recommendations.\n\nGoogle Cloud Firestore can store structured information used by the application.\n\nThis includes:\n\nFarmer profiles\n\nFarmer names\n\nCrop listings\n\nCrop quantity\n\nCrop quality\n\nPrice per kilogram\n\nFarmer location\n\nContact information\n\nBuyer preferences\n\nSearch history\n\nRecommendation history\n\nCrop availability status\n\nFirestore supports real-time updates, which can be useful when farmers update crop quantity, price, or availability.\n\nGoogle Cloud Storage can be used to store larger files that should not be saved directly in the database.\n\nExamples include:\n\nCrop images\n\nFarmer profile images\n\nFarmer verification documents\n\nQuality certificates\n\nDataset files\n\nGenerated reports\n\nApplication screenshots\n\nDemo assets\n\nThe database can store the file reference, while the actual file remains securely stored in Cloud Storage.\n\nGoogle Maps Platform can improve location-aware farmer recommendations.\n\nIt can help the application:\n\nConvert addresses into coordinates\n\nCalculate distances\n\nDisplay farmer locations\n\nIdentify nearby farmers\n\nEstimate travel distance\n\nSupport regional searches\n\nImprove logistics planning\n\nFor example, when a buyer requests tomatoes near Bengaluru, the system can prioritize farmers located closer to the buyer.\n\nLocation information can become an important part of the ranking score.\n\nFarmer Rank AI uses several sensitive credentials, such as AI keys, database credentials, and service configuration.\n\nGoogle Cloud Secret Manager can securely store:\n\nGemini credentials\n\nDatabase connection details\n\nAuthentication secrets\n\nExternal API keys\n\nApplication configuration values\n\nThis prevents sensitive keys from being written directly into the project source code.\n\nFarmer Rank AI uses Docker for containerization.\n\nThe backend Docker image can be stored in Google Artifact Registry before deployment.\n\nThe deployment process can follow these steps:\n\nBuild the application\n\nCreate the Docker image\n\nPush the image to Artifact Registry\n\nDeploy the image to Cloud Run\n\nMake the backend API available to the frontend\n\nArtifact Registry provides a secure location for storing and managing container images.\n\nGoogle Cloud Build can automate the project build and deployment workflow.\n\nWhen new code is pushed, Cloud Build can:\n\nInstall project dependencies\n\nRun build commands\n\nBuild the Docker image\n\nPush the image to Artifact Registry\n\nDeploy the application to Cloud Run\n\nThis makes deployment faster and reduces manual work.\n\nCloud Logging can record important application events.\n\nExamples include:\n\nBuyer queries\n\nGemini requests\n\nGemini response errors\n\nFarmer search results\n\nRanking workflow activity\n\nDatabase errors\n\nAPI failures\n\nSafety validation events\n\nLogging makes it easier to debug the application and understand how users interact with the system.\n\nCloud Monitoring can track the health and performance of the application.\n\nIt can monitor:\n\nNumber of requests\n\nAPI response time\n\nError rate\n\nCloud Run performance\n\nResource usage\n\nService availability\n\nFailed AI requests\n\nMonitoring is important for maintaining a reliable production application.\n\nFirebase Authentication can be used to manage secure user access.\n\nIt can support:\n\nFarmer registration\n\nBuyer registration\n\nEmail login\n\nGoogle login\n\nUser authentication\n\nRole-based access\n\nSecure sessions\n\nFarmers and buyers can have separate profiles and different application permissions.\n\nThe frontend application can be hosted using Firebase Hosting.\n\nFirebase Hosting can provide:\n\nFast web hosting\n\nHTTPS support\n\nGlobal content delivery\n\nEasy deployment\n\nIntegration with Firebase services\n\nThe Next.js frontend can communicate with the backend deployed on Cloud Run.\n\nGoogle-Powered Workflow\n\nThe complete Google-powered application workflow can operate as follows:\n\nA buyer opens the web application hosted using Firebase Hosting.\n\nThe buyer signs in through Firebase Authentication.\n\nThe buyer enters an agricultural requirement in natural language.\n\nThe frontend sends the query to the backend deployed on Cloud Run.\n\nThe backend sends the buyer query to Gemini through Vertex AI.\n\nGemini identifies the buyer’s intent and converts the request into structured filters.\n\nFarmer listings are retrieved from Firestore.\n\nGoogle Maps Platform calculates location relevance and distance.\n\nThe ranking workflow evaluates crop, quantity, grade, price, and proximity.\n\nGemini generates a clear explanation for every recommendation.\n\nCrop images and farmer documents are retrieved from Cloud Storage when required.\n\nRanked farmer results are returned to the buyer.\n\nCloud Logging records important workflow events.\n\nCloud Monitoring tracks service performance.\n\nSecret Manager protects sensitive credentials.\n\nCloud Build and Artifact Registry support deployment updates.\n\nSystem Architecture\n\nFarmer Rank AI uses a modular architecture so that each component has a clear responsibility.\n\nBuyer\n\n|\n\nv\n\nNext.js Web Application\n\n|\n\nv\n\nFirebase Authentication\n\n|\n\nv\n\nBackend API on Google Cloud Run\n\n|\n\n+--------------------------+\n\n| |\n\nv v\n\nGemini through Vertex AI Firestore\n\n| |\n\nv v\n\nIntent Extraction Farmer Records\n\n| |\n\n+-------------+------------+\n\n|\n\nv\n\nGoogle Maps Platform\n\n|\n\nv\n\nFarmer Ranking Engine\n\n|\n\nv\n\nGemini Explanation Generator\n\n|\n\nv\n\nRanked Farmer Results\n\nOther Google Cloud services support the application:\n\nCloud Storage -> Crop images and documents\n\nSecret Manager -> API keys and credentials\n\nArtifact Registry -> Docker images\n\nCloud Build -> Automated deployment\n\nCloud Logging -> Application logs\n\nCloud Monitoring -> Performance monitoring\n\nComplete Technology Stack\n\nGoogle AI and Cloud Stack\n\nGoogle Gemini API\n\nVertex AI\n\nGoogle Cloud Run\n\nGoogle Cloud Firestore\n\nGoogle Cloud Storage\n\nGoogle Maps Platform\n\nGoogle Cloud Secret Manager\n\nGoogle Artifact Registry\n\nGoogle Cloud Build\n\nGoogle Cloud Logging\n\nGoogle Cloud Monitoring\n\nFirebase Authentication\n\nFirebase Hosting\n\nApplication Development Stack\n\nNext.js\n\nNode.js\n\nTypeScript\n\nExpress.js\n\nMastra\n\nDocker\n\nGit\n\nGitHub\n\nData and Retrieval Stack\n\nPostgreSQL\n\nQdrant\n\nVector-based retrieval\n\nStructured farmer filtering\n\nAI-powered ranking workflow", "url": "https://wpnews.pro/news/farmer-rank-ai-using-generative-ai-to-connect-farmers-with-the-right-buyers", "canonical_source": "https://dev.to/shaik_inzamam_7/farmer-rank-ai-using-generative-ai-to-connect-farmers-with-the-right-buyers-1ege", "published_at": "2026-07-23 13:30:54+00:00", "updated_at": "2026-07-23 14:05:02.067594+00:00", "lang": "en", "topics": ["generative-ai", "artificial-intelligence", "natural-language-processing", "ai-products"], "entities": ["Shaik Inzamam", "Google Gemini", "Farmer Rank AI", "Gen AI Academy APAC"], "alternates": {"html": "https://wpnews.pro/news/farmer-rank-ai-using-generative-ai-to-connect-farmers-with-the-right-buyers", "markdown": "https://wpnews.pro/news/farmer-rank-ai-using-generative-ai-to-connect-farmers-with-the-right-buyers.md", "text": "https://wpnews.pro/news/farmer-rank-ai-using-generative-ai-to-connect-farmers-with-the-right-buyers.txt", "jsonld": "https://wpnews.pro/news/farmer-rank-ai-using-generative-ai-to-connect-farmers-with-the-right-buyers.jsonld"}}