Skip to main content
Back to Prompt Library
implementation

Build the application

Inspect the original prompt language first, then copy or adapt it once you know how it fits your workflow.

Linked challenge: Build an Offline Multilingual Micro-Farmer Produce Aggregator

Format
Code-aware
Lines
87
Sections
11
Linked challenge
Build an Offline Multilingual Micro-Farmer Produce Aggregator

Prompt source

Original prompt text with formatting preserved for inspection.

87 lines
11 sections
No variables
1 code block
## Build
Aggregate smallholder farm harvest estimates using offline dialect speech logs. Compile certified produce lots and synchronize standardized Beckn catalog offerings upon reconnection.

## User
Farmer Producer Organization collection manager

## Workflow
1. Record spoken daily harvest quantities from multiple farmers in local regional languages offline.
2. Aggregate crop yields into unified grading categories and log quality indicators locally.
3. Trigger Bhashini NMT pipelines when cellular connectivity is established to harmonize naming.
4. Generate a pooled Beckn Core 1.0.0 catalog update payload for manager approval.

## Interface
Offline PWA with farmer voice entry, local lot aggregation tables, and network sync inspector.

## Data
Use mock agricultural grade catalogs and synthetic Bhashini translation response fixtures.
Starter examples below are synthetic. They are not downloaded records.

## Source
[Bhashini documentation](https://bhashini.gitbook.io/bhashini-apis)
Utilizes Bhashini NMT pipeline and language configuration calls mapped to ISO-639 language codes.

## Tools
mastra-ai, pydantic, sqlite3.
Provides modular workflow orchestration for chaining offline state caches with external translation services.
Local or hosted LLM to classify unstructured harvest grades into official agricultural standards.

## Deliverables
Submit runnable source, pinned dependencies, setup commands, a working interface, example outputs, and a recorded end-to-end demo. Include tests and an action log.

## Acceptance
- Parse dialect crop terms and vernacular weight units into metric equivalents.
- Preserve offline transaction integrity during repeated connection drops.
- Construct verified Beckn catalog items with pooled inventory quantities.
- Require user sign-off on aggregated lots prior to outbound network synchronization.

## Starter Examples
```json
[
  {
    "input": {
      "fpo_id": "fpo-kisan-01",
      "offline_records": [
        {
          "farmer": "Ramesh",
          "text": "dus quintal desi tamatar tayaar hai",
          "lang": "hi"
        },
        {
          "farmer": "Suresh",
          "text": "pandrah quintal hybrid tamatar tayaar",
          "lang": "hi"
        }
      ]
    },
    "expected_output": {
      "aggregated_lots": [
        {
          "crop": "tomato",
          "variety": "desi",
          "weight_kg": 1000
        },
        {
          "crop": "tomato",
          "variety": "hybrid",
          "weight_kg": 1500
        }
      ],
      "sync_ready": true,
      "beckn_catalog_items": 2
    }
  },
  {
    "input": {
      "fpo_id": "fpo-kisan-01",
      "offline_records": [
        {
          "farmer": "Kavita",
          "text": "thoda gehu bacha hai",
          "lang": "hi"
        }
      ]
    },
    "expected_output": {
      "aggregated_lots": [],
      "sync_ready": false,
      "error": "indefinite_quantity_flagged",
      "requires_field_measurement": true
    }
  }
]
```

## Safety
Maintains local staging of farm produce without creating binding supply contracts or modifying production systems.
Use mock external writes. Require human review before any real deployment.

Adaptation plan

Keep the source stable, then change the prompt in a predictable order so the next run is easier to evaluate.

Keep stable

Hold the task contract and output shape stable so generated implementations remain comparable.

Tune next

Update libraries, interfaces, and environment assumptions to match the stack you actually run.

Verify after

Test failure handling, edge cases, and any code paths that depend on hidden context or secrets.