Skip to content

Agricultural decision-support project · 2025

FarmGenius

A React and FastAPI prototype that connects crop-image analysis, yield estimation, market views, multilingual assistance, voice controls, and micro-farm planning.

Contribution
Full-stack engineering · AI and data integration
Build
Hackathon prototype · 2025
farmgenius.appOpen frontend
FarmGenius frontend showing its intelligent farming home page
Frontend preview

The interface is live. Backend services are currently offline, so AI and data actions will not return live results.

The projectAgricultural decision-support prototype

I built FarmGenius as six connected farming tools: diagnose a crop, estimate yield, inspect market context, use voice or multilingual chat, and compare practical small-plot farming systems.

Implemented workflows

What a user can do

Every workflow below maps to a real React route and a corresponding backend service or endpoint in the repository.

01

Check a crop image

Upload a plant photo, validate its type and size, and receive Gemini-assisted observations with practical treatment guidance.

02

Estimate crop yield

Enter crop, land, season, soil, nutrient, rainfall, and optional map coordinates to calculate yield and field recommendations.

03

Compare market context

Filter and sort crop-price rows, open a crop trend view, review a market summary, and export the visible table as CSV.

04

Ask an agricultural assistant

Choose a specialist, continue a session in English, Hindi, or Marathi, and use speech capture or spoken-answer controls.

05

Plan a micro-farm

Combine plot, budget, soil, water, sunlight, labour, and risk inputs to compare systems, crops, resource use, and subsidies.

Code architecture

How the project is connected

Every farming request enters through a typed API contract, reaches one focused domain engine, and returns an explainable result to the interface.

FarmGenius decision pipelineTyped request → explainable result
Farmer input
Crop image
Field + location
Question + language
Plot constraints
FastAPI · /api/v1Validated task boundary

Each route validates one farming task, then calls only the domain engine it needs.

Crop healthUpload validation → AI adapter
YieldCoefficients → optional weather
MarketSpecialist agent → price context
Micro-farmFilter → compatibility score
Intelligence + data
GeminiImage + language reasoning
Weather + mapsLive location context
Local datasetsCosts · crops · subsidies
Structured response
Returned to the interface
Crop guidance
Yield + market view
Multilingual answer
Ranked farm systems
Representative paths

Three examples show where AI, rules, and datasets enter the system.

01Diagnose a crop
  1. Image
  2. File checks
  3. Gemini Vision
  4. Actionable guidance
02Estimate yield
  1. Field inputs
  2. Pydantic model
  3. Rules + weather
  4. Explained estimate
03Plan a micro-farm
  1. Constraints
  2. Dataset filters
  3. Compatibility score
  4. Top three systems

Deterministic yield and planning logic stays separate from Gemini. Market trends are prototype data, and in-memory agent context is not presented as durable production storage.

Implementation

Engineering decisions

Task-specific API contracts

The backend does not send every request through one prompt. Image analysis, yield, market, voice, chat, and planning use separate endpoints and schemas.

AI only where it helps

Gemini handles image interpretation and natural-language guidance; repeatable calculations use rules, coefficients, and structured datasets.

Graceful external context

Weather and geocoding enrich yield results when credentials and coordinates are available, while the base estimate still has a deterministic path.

Explainable planning output

Micro-farm recommendations expose cost, ROI, payback, compatible crops, water, electricity, prices, and subsidies instead of one opaque score.

Project stack

Tools used

React 19PythonFastAPIPydanticGeminiOpenWeatherGoogle MapsRechartsPandas · XGBoost
Prototype boundaries

Market trend history is simulated and some price data is curated for dependable demonstrations; agent context is kept in memory; the current micro-farm endpoint falls back to payback-based ROI when its runtime inputs do not match the saved model metadata. Gemini, weather, maps, and advanced speech paths require external credentials. These are presented as prototype boundaries, not production claims.

Project links

Explore the implementation.

Open projectView source
Resume