An AI-powered platform connecting farmers who generate carbon credits with businesses that purchase them β turning sustainable agriculture into verified, tradeable climate action.
Farmers log their practices; the platform's AI scores their carbon sequestration; those scores become credits listed on a live marketplace. Businesses browse, buy, and receive certified proof of offset.
- Quantify and monetize COβ sequestration from sustainable farming across India
- Create a new income stream for smallholder farmers beyond crop yield
- Provide businesses with satellite-verified, auditable carbon offsets
- Use AI recommendations to continuously improve sustainable practice adoption
India is home to over 100 million smallholder farmers who bear the greatest burden of climate change while contributing the least to it. These farmers already practice many forms of sustainable agriculture β cover cropping, no-till farming, agroforestry β but receive no financial recognition for the carbon these practices sequester.
Carbon-Kisan Credit changes that:
- Creates a new income stream entirely separate from crop yield, helping farmers survive bad harvest seasons.
- Uses satellite verification (not self-reporting) so farmers don't need to maintain complex documentation β the platform does the heavy lifting.
- Provides AI-driven guidance in local languages so farmers know exactly which practices will improve their score and earnings, removing guesswork.
- Pays directly via UPI, reaching farmers instantly without bank intermediaries or bureaucratic delays.
Corporate sustainability commitments are under increasing regulatory and public scrutiny. Businesses need carbon offsets that are credible, auditable, and traceable β not certificates from opaque registries.
Carbon-Kisan Credit provides:
- Satellite-verified offsets backed by NDVI analysis of real farmland, not estimates or projections.
- Full auditability β every credit is linked to a specific farm parcel, GPS coordinates, and a time-stamped satellite scan.
- Direct social impact β purchases demonstrably improve farmer livelihoods, enabling companies to report both carbon and ESG impact from a single transaction.
- Competitive pricing by eliminating the layers of brokers and intermediaries typical in traditional carbon markets.
Real Soil Organic Carbon (SOC) verification requires deep physical soil sampling. However, biomass (how healthy and dense the plants are) directly correlates with the amount of carbon being sequestered into the soil via roots and decaying matter. We use NDVI as the measure of biomass.
In the _extrapolate_carbon function, we utilize a simplified linear regression formula often found in remote sensing preliminary studies:
Where:
- SOC is the Soil Organic Carbon in tonnes per hectare.
- NDVI_mean is the average vegetation index for the farm over a year.
- Ξ± and Ξ² are correlation constants (which you can adjust to calibrate your model if you introduce hardware sensor data later).
Analysis of the dual problem (COβ emissions + farmer poverty), definition of Farmer and Business user profiles, and creation of a unified Design System.
API Gateway and Authentication Service established. All four databases provisioned (User, Farm Data, Carbon Credit Records, Transaction). Satellite and farmer input data pipelines integrated.
Farmer Dashboard, Business Dashboard, and Carbon Marketplace UI launched. Pilot onboarding of initial users from both roles for early feedback.
Farm data collected from satellite feeds and farmer inputs. AI Scoring Engine trained and deployed to calculate carbon scores, producing the first batch of tradeable credits.
Carbon credits listed on the live marketplace. Business users browse and purchase. Marketplace transaction logic β listing, reservation, and purchase initiation β goes live.
Payments processed via UPI/Stripe gateway. Transaction DB updated in real time. Farmer payouts automatically calculated and disbursed.
Digital certificates (PDF) generated for each completed trade. Recommendation Engine refined with post-trade data. Continuous feedback loop and impact tracking activated.
All traffic routes through a central FastAPI application which exposes modular endpoints:
- Land Mapping (
/land): Handles automatic farm boundary detection from a single pin-drop (/auto-boundary) and manual GPS walks (/walk-boundary) using Google Earth Engine's segmentation algorithms. - Digital MRV (
/mrv): The core Measurement, Reporting, and Verification engine. It takes a farm's GeoJSON polygon, analyzes 12 months of Sentinel-2 satellite data to calculate NDVI, and extrapolates it to estimate carbon sequestration in tonnes and its equivalent INR value. - AI & Voice (
/ai): Interfaces with the Google Gemini model. Provides daily, region-specific insights (/daily-insights) and powers a conversational chatbot (/chat) that can answer farmer queries with context about their specific farm data. - Document Generation (
/docs): Generates HTML-based certificates of carbon credit purchase (/certificate/{cert_id}), which can be converted to PDFs.
- Carbon Scoring (
gee_engine.py): Processes Sentinel-2 satellite data to compute the Normalized Difference Vegetation Index (NDVI) as a proxy for biomass and soil organic carbon. - Farm Auto-Mapping (
auto_mapper.py): Uses Google Earth Engine's SNIC algorithm to automatically segment and vectorize a farm plot from a single coordinate. - Agronomist AI (
ai_service.py): Leverages Google Gemini to provide actionable insights on weather, market rates, and government schemes, plus a conversational chat interface for farmers.
- Sources: User-provided GPS coordinates (pin-drop or walk), external satellite imagery (Copernicus/S2_SR_HARMONIZED).
- Database: Firestore (via
firebase-admin) for storing user data, farm polygons, and generated carbon credit records.
- Google Earth Engine: Provides the core satellite imagery and processing power for NDVI analysis and farm boundary detection.
- Google Gemini: Powers all generative AI features, including regional insights and the farmer chatbot.
- Firebase: Acts as the primary backend database for the application.
Farm Boundary β MRV Analysis β Credit Generation β Marketplace Listing
β Business Purchase β Payment β Farmer Payout β Digital Certificate
- Data Collection: A farmer defines their land boundary using either a single pin-drop (auto-detection) or a GPS walk via the
/api/landendpoints. - AI Scoring: The farm's GeoJSON polygon is sent to
/api/mrv/analyze. TheDigitalMRVEngineuses Google Earth Engine to calculate the mean NDVI, farm area, and estimate carbon tonnes sequestered. - Credit Listing: The calculated carbon tonnage is converted into tradeable credits and listed on the marketplace (handled by the frontend and Firestore).
- Purchase & Payment: A business purchases the credits through the platform.
- Certification: Upon successful transaction, a unique certificate is generated via
/api/docs/certificate/{cert_id}for the business, serving as proof of their carbon offset. The credit is retired in the database.
- Python 3.8+
- A Google Cloud Platform project with Earth Engine API enabled.
- A Firebase project with a credentials file (
.json). - A Google Gemini API Key.
-
Clone the repository:
git clone https://github.com/anshumansingh987/agrivatorscarbonkissan.git cd agrivatorscarbonkissan -
Create and configure your environment file. Copy the example file and fill in your credentials:
cp .env.example .env
Open
.envand populate the following variables:GEMINI_API_KEY="your_gemini_api_key" GEE_PROJECT_ID="your-gcp-project-id" FIREBASE_CREDENTIALS_PATH="/path/to/your/firebase-credentials.json"GEMINI_API_KEYβ obtain from Google AI Studio.GEE_PROJECT_IDβ your Google Cloud project ID with Earth Engine API enabled.FIREBASE_CREDENTIALS_PATHβ absolute path to the.jsonservice account key downloaded from your Firebase project settings under Project Settings β Service Accounts β Generate new private key.
-
Create and activate a virtual environment (recommended):
python -m venv venv # On Linux/macOS: source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install dependencies:
pip install -r app/requirements.txt
This installs FastAPI, Uvicorn, the Google Earth Engine Python client, Firebase Admin SDK, Google Generative AI SDK, and all other required packages.
-
Authenticate with Google Earth Engine:
earthengine authenticate
This opens a browser window for OAuth. After authentication, your credentials are cached locally. You only need to run this once per machine. Ensure the GCP project linked to your
GEE_PROJECT_IDhas the Earth Engine API enabled in the Google Cloud Console. -
Initialize Firebase: Ensure your Firebase project has Firestore enabled (in Native mode). The credentials file specified in
FIREBASE_CREDENTIALS_PATHmust belong to a service account with Firebase Admin or Cloud Datastore User roles. -
Run the FastAPI server:
uvicorn app.main:app --reload
The API will be available at
http://127.0.0.1:8000. You can explore all endpoints interactively via the auto-generated Swagger docs athttp://127.0.0.1:8000/docs.
Note: On first run, Google Earth Engine may take a few extra seconds to initialize as it authenticates with the GCP project. This is normal behaviour.
Farmers: Register β Add farm parcels β Log sustainable practices β Monitor carbon score β Receive payouts.
Businesses: Register β Browse marketplace β Purchase credits β Download digital certificate β Access impact reports.
| Name | Role |
|---|---|
| Anshuman Singh | Backend Lead |
| Rishi Raj | UI/UX Lead |
| Harshil Srivastava | Frontend Lead |
| Akshat Kumar Singh | Research & Deployment Lead |
Carbon-Kisan Credit β Turning sustainable farming into climate action.
