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-First Multilingual Kirana Daily Ledger and Beckn Sync

Format
Code-aware
Lines
105
Sections
11
Linked challenge
Build an Offline-First Multilingual Kirana Daily Ledger and Beckn Sync

Prompt source

Original prompt text with formatting preserved for inspection.

105 lines
11 sections
No variables
1 code block
## Build
Capture regional voice sales entries and offline stock adjustments on local devices. Reconcile buffered changes and export verified Beckn inventory update payloads when network connectivity is detected.

## User
Small township retail shopkeeper

## Workflow
1. Record spoken daily stock adjustments in regional audio or localized text offline.
2. Normalize colloquial units into metric standards and build local SQLite transaction journals.
3. Detect network availability to run mock Bhashini translation pipelines into standard schema descriptors.
4. Generate Beckn Core 1.0.0 post-fulfillment inventory sync payloads for human shopkeeper confirmation.

## Interface
Offline-capable web dashboard with audio upload button, local SQLite cache viewer, and sync confirmation modal.

## Data
Use mock Bhashini API fixtures for NMT and synthetic Beckn retail catalog templates from GitHub repository.
Starter examples below are synthetic. They are not downloaded records.

## Source
[Beckn protocol specifications](https://raw.githubusercontent.com/beckn/protocol-specifications/master/README.md)
Implements Beckn Core 1.0.0 message and context packet structures for asynchronous catalog and post-fulfillment updates.

## Tools
pydantic-ai, fastapi, sqlite3.
Ensures type-safe validation of offline inventory journals and schema compliance for Beckn transaction packets.
Local quantized Llama model or hosted Claude API for dialect term extraction.

## 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 vernacular item names and informal measures into metric quantities within local storage.
- Validate outgoing Beckn payload against version 1.0.0 context and message schema constraints.
- Queue offline transactions without loss during simulated network disconnection drills.
- Display human reconciliation diff before dispatching server-to-server catalog updates.

## Starter Examples
```json
[
  {
    "input": {
      "store_id": "kirana-rural-102",
      "connectivity": "offline",
      "log_entry": {
        "spoken_text": "chana dal 5 bori aayi aur 3 packet tel bika",
        "language_code": "hi"
      }
    },
    "expected_output": {
      "journal_status": "buffered",
      "parsed_items": [
        {
          "item": "chana_dal",
          "delta": 5,
          "unit": "bag_50kg",
          "action": "restock"
        },
        {
          "item": "cooking_oil",
          "delta": -3,
          "unit": "packet_1l",
          "action": "sale"
        }
      ],
      "sync_pending": true
    }
  },
  {
    "input": {
      "store_id": "kirana-rural-102",
      "connectivity": "online",
      "log_entry": {
        "spoken_text": "namak khatam ho gaya",
        "language_code": "hi"
      }
    },
    "expected_output": {
      "journal_status": "synchronized",
      "parsed_items": [
        {
          "item": "table_salt",
          "delta": 0,
          "unit": "packet_1kg",
          "action": "out_of_stock"
        }
      ],
      "beckn_payload": {
        "context": {
          "domain": "nic2004:52110",
          "action": "update",
          "core_version": "1.0.0"
        },
        "message": {
          "items": [
            {
              "id": "salt-1",
              "quantity": {
                "available": {
                  "count": 0
                }
              }
            }
          ]
        }
      },
      "sync_pending": false
    }
  }
]
```

## Safety
Simulates all Beckn network posts; does not alter production retail inventory or execute monetary settlements.
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.