Skip to content

Add an Indian retail-banking multi-turn tool-use environment #2880

Closed

Description

@krishnpci

Use cases, pain points, and background

Customer-support agents that must act on a customer's account — not just answer questions — are a high-value RL target. Retail banking has a different tool surface (deposits, loans, cards, mandates, cheques, servicing requests, knowledge lookup, human hand-off) and, in the Indian setting, its own rules that general models get wrong by defaulting to US financial context: KYC/re-KYC gating on writes, INR rate cards and EMIs, government schemes (PMJJBY, APY, SSY, PPF), TDS and Form 15G/H. There is no Gym environment today in which an agent has to complete a banking request end to end with the right tool calls in the right order and be scored on the resulting database state, and no reward designed so that a group of attempts at the same task carries a training gradient rather than only a pass/fail leaderboard number.

Description:

Add resources_servers/indian_banking: a multi-turn environment in which the policy staffs the chat desk of a synthetic India-based retail bank. The agent converses with an LLM-simulated customer, operates 34 tools (33 servicing tools plus transfer_to_human_agents) against a deterministic in-process banking engine, consults a written policy and a keyword knowledge base, and is scored on (a) the gold tool calls being made with the right arguments and no unrequested writes, (b) the final database matching a replay of the gold actions, (c) the required facts being communicated to the customer without leaking internal identifiers, and (d) LLM-judged natural-language assertions that never enter the strict gate. Ship 300 synthetic tasks over 50 scenario families (250 train / 50 validation), a synthetic customer database and knowledge base, five example rows/metrics/rollouts, offline tests and a README, all under Apache 2.0.

Design:

  • resources_servers/indian_banking/app.py — IndianBankingResourcesServer (GymnasiumServer): reset() clones the base database per episode under a frozen simulation clock and ID seed (contextvars-bound so concurrent rollouts in one process stay isolated); step() executes tool calls in-process; the terminal step returns the reward breakdown in info.
  • core/banking_tools.py, core/engine.py, core/tool_schemas.py — the 33 tool implementations, product/rate constants, per-episode dispatch, function-calling schemas.
  • core/reward.py — strict = AND of the active binary checks selected by each task's reward_basis; dense = weighted blend (ACTION 0.40 / DB 0.25 / COMMUNICATE 0.15 / judge 0.20); reward = 1 − efficiency_cost on a pass (cost capped at 0.15), else strict + 0.4 · dense, so partial credit stays below the smallest pass increment. Optional SEQ_STRICT constant (off by default, matching tau2-bench's set-based check) makes gold-call order load-bearing.
  • core/action_compare.py, core/state_normalize.py — comparison and normalisation utilities derived from tau2-bench (MIT), notices preserved in-file and recorded in ATTRIBUTIONS.md.
  • core/user_sim.py, core/judge.py, core/prompts/user-sim-guidelines.md — role-swapped LLM customer with progressive disclosure and ###STOP### / ###TRANSFER### / ###OUT-OF-SCOPE### stop tokens; judge that sees only the customer-facing transcript, temperature 0, fails open on endpoint errors. Both served by one openai_model configured from env.yaml.
  • configs/indian_banking.yaml — resources server, gymnasium_agent wiring, model server; domain: agent, verified: false.
  • data/ — db.json, kb.json, policy.md, agent_instruction.txt, example.jsonl (5), example_metrics.json, example_rollouts.jsonl (5); train/validation splits hosted on Hugging Face and fetched by gym dataset collate.
  • tests/test_app.py — offline tests for server sanity, tool dispatch, reward components, state normaliser and prompt construction.
  • README.md in the standard Description / Licensing format; one row in the root ATTRIBUTIONS.md; root README environment table regenerated by the pre-commit hook. No changes to NeMo Gym core.

Out of scope:

  • Any change to NeMo Gym core, the gymnasium_agent, or shared model servers.
  • A benchmark registration under benchmarks/ or a leaderboard; this issue covers the environment and its data only.
  • Vector/embedding retrieval for the knowledge base (keyword search is deliberate).
  • Real bank data, real institution names, or any non-synthetic content.
  • Training recipes, trained checkpoints, or reference model scores (may follow as separate contributions).
  • A larger task set beyond the 300 shipped tasks (can follow as a dataset-only update).

Acceptance Criteria:

  • resources_servers/indian_banking/ added with app.py, core/, configs/indian_banking.yaml (domain: agent), data/, tests/test_app.py, README.md.
  • Every shipped task replays its gold actions through the engine at strict = 1.0 (300/300).
  • gym env test --resources-server indian_banking passes (venv build, unit tests, example-data validation).
  • data/example.jsonl has exactly 5 rows, data/example_metrics.json reports 5 examples, data/example_rollouts.jsonl holds exactly 5 rollouts from gym eval run.
  • pre-commit run --all-files is clean; NVIDIA SPDX headers on every new Python file; verified: false left as injected.
  • tau2-bench-derived files carry their MIT notices and are listed in ATTRIBUTIONS.md; train and validation datasets carry license: Apache 2.0.
  • All data is synthetic: invented bank/brand/merchant/employer names, placeholder contact details, no real customer data.
  • All commits DCO signed-off; PR opened against main from the contributor fork.

Activity

  1. added
    community-request
    on Aug 31, 2026
  2. added
    waiting-on-maintainers
    on Sep 2, 2026
  3. removed
    waiting-on-maintainers
    on Sep 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    community-request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions