> For the complete documentation index, see [llms.txt](https://docs.openagrinet.global/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.openagrinet.global/technical/ai-layer/agent-based-and-tool-driven-design.md).

# Agent-Based and Tool-Driven Design

Rather than relying on a single monolithic model, the AI module uses an agent-based architecture. Different agents are responsible for:

* Moderating and validating user queries
* Understanding intent and orchestrating tool calls
* Generating follow-up suggestions where applicable

All meaningful actions, such as fetching weather data, searching advisory content, or checking scheme status, are performed via explicit tools and APIs. The language model’s role is limited to reasoning, routing, and response composition.

This design improves safety and predictability, enables easier auditing and monitoring and allows independent evolution of tools and models

The AI module uses capability-based tools rather than use case–specific logic. Each user query is first classified by intent, and the AgriNet Agent then invokes the appropriate tool with structured parameters. The same tools are reused across deployments like Maha VISTAAR and Bharat VISTAAR, with differences only in which tools are enabled.

#### <mark style="color:green;">Maha VISTAAR</mark>

| Use Case                   | Tool Chain / Key Tools                                                    | Purpose of Tool(s)                                                                                                                                              | Typical Parameters                                    |
| -------------------------- | ------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------- |
| Advisory                   | search\_terms → search\_documents → get\_advisory                         | Identifies standard agricultural terminology, retrieves relevant advisory documents, and generates grounded pest, disease, and farming practice recommendations | crop, pest/disease symptoms, crop stage, district     |
| Mandi Prices               | fetch\_agristack\_data OR mandi\_prices                                   | Retrieves real-time commodity prices across mandis using farmer location or user-provided district and commodity                                                | commodity, district / market, date                    |
| Scheme Information         | get\_scheme\_codes → get\_scheme\_info OR get\_multiple\_schemes\_info    | Retrieves verified scheme benefits, eligibility criteria, and application process details; supports multiple scheme retrieval based on farmer need              | scheme category, farmer category, eligibility context |
| Weather Forecast           | fetch\_agristack\_data OR forward\_geocode → get\_weather                 | Retrieves real-time weather forecast using farmer coordinates or location from query                                                                            | location OR latitude/longitude, forecast date         |
| Warehouses (Agri Services) | fetch\_agristack\_data OR forward\_geocode → agri\_services               | Identifies warehouse and storage infrastructure availability based on location and commodity                                                                    | district OR coordinates, commodity, service type      |
| AgriAssistant Contact      | fetch\_agristack\_data OR forward\_geocode → contact\_agricultural\_staff | Retrieves verified contact details of local agricultural extension officers and support staff                                                                   | district OR coordinates, service type                 |
| Maha DBT Status            | get\_scheme\_status                                                       | Retrieves application and benefit disbursement status for MahaDBT schemes (requires authentication context)                                                     | farmer ID / beneficiary ID (auto if authenticated)    |
| Weather Historical         | fetch\_agristack\_data OR forward\_geocode → get\_historical\_weather     | Retrieves historical weather and rainfall trends for planning and analysis                                                                                      | location OR coordinates, date range                   |

#### <mark style="color:green;">Bharat VISTAAR</mark>

| Use Case                   | Tool Chain / Key Tools                                    | Purpose of Tool(s)                                                                                                                              | Typical Parameters                                   |
| -------------------------- | --------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------- |
| Scheme Information         | search\_terms → search\_documents → scheme\_info          | Identifies scheme-related terminology, retrieves verified scheme documents, and provides scheme benefits, eligibility, and application guidance | scheme name, scheme category, farmer category, state |
| PM-Kisan Grievance Check   | pmkisan\_grievance\_status                                | Retrieves grievance status from PM-Kisan grievance systems and returns current resolution stage                                                 | grievance ID, registered mobile number               |
| PMFBY Status Check         | pmfby\_scheme\_status (OTP validation → status retrieval) | Retrieves crop insurance application and claim status from PMFBY systems with OTP-based authentication validation                               | policy ID, farmer ID, OTP (if required)              |
| SHC Status Check           | shc\_scheme\_status                                       | Retrieves Soil Health Card test processing and report generation status from SHC systems                                                        | SHC ID, registered mobile number                     |
| PM-Kisan Instalment Status | pmkisan\_scheme\_status                                   | Retrieves PM-Kisan instalment disbursement and payment status from official programme systems                                                   | beneficiary ID, registered mobile number             |
| Advisory                   | search\_terms → search\_documents → get\_advisory         | Identifies standard crop and issue terminology, retrieves advisory documents, and provides grounded agricultural recommendations                | crop, pest/disease issue, crop stage, district       |
|                            |                                                           |                                                                                                                                                 |                                                      |

####


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.openagrinet.global/technical/ai-layer/agent-based-and-tool-driven-design.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
