Bhujal Mitra: District-Level Groundwater Advisor
Inspiration
Maharashtra’s agriculture is the backbone of the state, yet it remains at the mercy of a depleting and invisible resource: groundwater. While the government publishes extensive policy documents and historical data, this information stays trapped in 50-page PDFs or complex CSVs that a farmer cannot use in the field. We were inspired to bridge this "data-to-decision" gap. We wanted to build a "Mitra" (friend) that doesn't just show charts, but tells a farmer exactly what to do over the next 30 days based on the science of soil moisture and the reality of local law.
What it does
Bhujal Mitra is a high-precision advisory tool. A farmer selects their district and asks a question in their native language. The system then:
- Forecasts: Uses a time-series model to predict groundwater levels for the next 24 hours, 7 days, and 30 days.
- Retrieves: Searches a vectorized database of Maharashtra groundwater policies to find relevant legal or subsidy context.
- Advises: Generates a structured response with specific farm actions (e.g., "Switch to drip irrigation now as levels will drop by 15% next week") and provides the "Evidence" so the farmer can trust the source.
- Communicates: Provides everything in English, Hindi, and Marathi using the Param-1 (2.9B) model.
How we built it
We leveraged the Databricks Lakehouse architecture to handle the entire lifecycle:
- Data Engineering: We focused on a "Pune Fragment" strategy to ensure high data density. We ingested groundwater target data from the India Data Portal and integrated daily soil moisture features from AI Kosh (AgriKosh).
- The Forecast Engine: We built a residual GBT (Gradient Boosted Trees) regressor using Spark MLlib. The model calculates the delta between current levels and future predictions based on rainfall lags and rolling soil moisture windows.
- Math Note: We used a recursive forecasting strategy where the prediction at $t+1$ is fed back as a feature for $t+2$: $$\hat{y}{t+n} = f(\hat{y}{t+n-1}, x_{t+n}, \text{lags})$$
- RAG Pipeline: We processed state policy PDFs into Delta Lake, converted them into semantic embeddings, and used Databricks Vector Search for real-time retrieval.
- The UI: A Databricks App (Streamlit) acts as the command center, calling Model Serving endpoints for both the advisory logic (Llama-3) and the Indic translations (Param-1).
Challenges we ran into
- The Sparsity Trap: Real-world Indian groundwater data is messy. Many stations had missing months. Instead of deleting them, we implemented a Moving Average Imputation strategy in Spark, which preserved the temporal trend without introducing noise.
- Resource Constraints: Working within the 15GB RAM limit of the Free Edition meant we couldn't process all-India data. We had to be "resource-aware" by filtering specifically to the Pune geo-patch early in the pipeline to prevent Spark OOM (Out of Memory) errors.
- Translation Nuance: Agricultural terms in Marathi are highly specific. Standard models often missed the context of "percolation tanks" or "borewell recharge." We had to carefully prompt the Param-1 model to prioritize technical accuracy over literal translation.
Accomplishments that we're proud of
- Evidence-Based AI: We are proud that our app doesn't just "hallucinate" advice. Every response includes a "Context Snapshot" showing the raw forecast numbers and the specific policy paragraph it cited.
- Indic-First Design: Successfully deploying the Param-1 (2.9B) model to handle Marathi and Hindi ensures this tool is actually accessible to the 80% of farmers who don't use English as their primary language.
- Full Lifecycle: We didn't just build a chatbot; we built a data pipeline that goes from raw government CSVs to a live, deployed Databricks App.
What we learned
- Data Locality Matters: We learned that a "Small Data" approach (high-quality regional data) often outperforms "Big Data" (noisy national data) when building specialized advisory tools.
- Lakehouse Efficiency: Using Delta Lake for structured storage made it incredibly easy to "Time Travel" back to previous versions of our data during the cleaning phase.
- The Power of Quantization: Smaller models like Param-1 (2.9B) are surprisingly robust for specific tasks like translation and can run efficiently in resource-constrained environments.
What's next for Bhujal Mitra
We plan to scale Bhujal Mitra from the Pune fragment to the entire state of Maharashtra.
- IoT Integration: We want to allow farmers to upload their own local sensor data to "fine-tune" the district-level forecast for their specific farm.
- Voice-to-Voice: Implementing a voice interface so farmers can speak their questions while working in the field.
- Automated Subsidy Matching: Linking the policy engine directly to the "MahaDBT" portal so farmers can apply for irrigation subsidies with one click from the app.
Built With
- amazon-web-services
- databricks
- databricksapps
- delta-lake
- jupyter
- llm
- pyspark
- python
- rag
- serverless
- silver
- sql
- streamlit
- time-series
Log in or sign up for Devpost to join the conversation.