Inspiration

Farmers often have to make an important decision: where should they sell their crop? The nearest mandi is not always the best option, and comparing different markets can be difficult when information is spread across different sources.

We wanted to build a system that makes this decision simpler. Instead of requiring farmers to manually search through mandi information, we envisioned an AI-powered agent that could understand their crop details, recommend a suitable mandi, suggest alternatives, and answer questions naturally.

This idea led us to build KisanMandi-Agent — an AI-powered mandi recommendation and conversational assistant designed around the farmer's selling decision.

What it does

KisanMandi-Agent provides two main ways for farmers to interact with the system.

First, a farmer can provide structured information such as:

  • State
  • District
  • Crop
  • Variety
  • Quantity in quintals

The system processes this information and returns a recommended mandi along with alternative options.

Second, farmers can interact with the AI agent conversationally. Instead of navigating through complicated interfaces, they can ask natural-language questions such as:

"Where should I sell my wheat?"

The agent provides a response based on the available mandi information and the context of the user's question.

The application also provides a structured API through FastAPI and automatically generated OpenAPI/Swagger documentation, making the backend easy to test and integrate with the frontend.

How we built it

We built KisanMandi-Agent as a full-stack application with a clear separation between the user interface, backend APIs, recommendation workflow, and AI agent.

Frontend

The frontend was built using React and Vite. It provides the farmer-facing interface for entering crop information, viewing recommendations, and interacting with the AI assistant.

Backend

The backend was built using FastAPI. It exposes REST APIs for:

  • Health checks
  • Mandi recommendations
  • AI agent conversations

The backend uses structured request and response models so that the frontend can reliably consume the results.

AI Agent

For the conversational component, we integrated Strands Agents. The agent provides a natural-language interface for mandi-related questions instead of restricting users to predefined interactions.

Challenges we ran into

One of our biggest challenges was getting the application to work reliably after moving from local development to production.

During local development, the frontend communicated with the backend using:

http://127.0.0.1:8000

This worked locally but obviously could not work for users accessing the deployed application.

We therefore had to update the frontend to use the production backend URL.

We also encountered a CORS issue after deployment. The browser initially blocked requests from the Vercel frontend to the Render backend because the production frontend origin was not allowed by the backend.

We configured CORS correctly in FastAPI and then tested the complete frontend-to-backend flow again.

Another challenge was keeping the recommendation functionality and conversational agent cleanly separated while still exposing them through a simple user experience.

These deployment and integration issues taught us that building a working AI application is not only about the AI itself — the entire system has to work together reliably.

Accomplishments that we're proud of

We are proud that we turned the initial idea into a working end-to-end deployed application.

Some accomplishments we are particularly proud of are:

Built a functional farmer-facing web application. Integrated Strands Agents into the project. Created a FastAPI backend with structured REST endpoints. Built a mandi recommendation workflow with alternative recommendations. Added a conversational AI interface for mandi-related questions. Successfully connected the React frontend to the production backend. Resolved production CORS and API connectivity issues. Deployed the frontend and backend as separate production services. Added OpenAPI/Swagger API documentation. Created architecture and deployment documentation for the project. Maintained a public GitHub repository with the project's source code and documentation.

Most importantly, we are proud that the system can be used as a complete workflow rather than remaining only a local prototype.

What we learned

This project taught us a lot about building and deploying an AI application from end to end.

We learned how to integrate Strands Agents into a real application rather than treating an AI agent as an isolated component.

We also learned the importance of designing clear boundaries between the frontend, backend APIs, recommendation logic, and agent layer.

From the engineering side, working through the production deployment issues was especially valuable. We learned about:

REST API integration FastAPI CORS Production frontend/backend communication Structured API responses OpenAPI documentation React and Vite deployment Debugging production connectivity issues Agent integration and orchestration

The biggest lesson was that a successful AI project requires more than an intelligent response. The entire system — from the user's browser to the backend and agent — must work reliably together.

What's next for KisanMandi Agent

KisanMandi-Agent is designed to be extended beyond the current prototype.

Our next steps would include integrating richer and more comprehensive mandi datasets, improving the recommendation logic, incorporating more accurate transportation-cost information, and supporting additional crops and markets.

We would also like to make the system more accessible through multilingual and voice-based interactions, allowing farmers to communicate with the agent in the languages they are most comfortable using.

In the longer term, we envision KisanMandi-Agent becoming a more capable decision-support system where farmers can ask increasingly complex questions about their selling options and receive clear, actionable recommendations.

Our goal is simple:

Use AI not just to provide information, but to help farmers make better decisions.

Built With

Share this project:

Updates

Submission history