Dataset Viewer

The dataset viewer is not available because its heuristics could not detect any supported data files. You can try uploading some data files, or configuring the data files location manually.

YAML Metadata Warning:empty or missing yaml metadata in repo card

Check out the documentation for more information.

Beyond Chunking: Node Integrity and Field Structure in Bengali Retrieval-Augmented Agent Memory

License: MIT License: CC BY 4.0 Python: 3.9+ Double-Blind: Review Copy

Official anonymized reproduction suite for the paper:

"Beyond Chunking: Node Integrity and Field Structure in Bengali Retrieval-Augmented Agent Memory"


Overview

This repository provides complete, self-contained artifacts, datasets, experimental code, and evaluation oracles to independently verify all empirical claims, tables, and mechanistic analyses presented in the paper.

The suite evaluates a three-level representation ladder across three Bengali domains:

  1. $L_1$ (Chunked Unstructured): Source documents split into fixed 500-character windows.
  2. $L_2$ (Full-Node Unstructured): Coherent records kept intact as single documents without field demarcation.
  3. $L_3$ (Structured BM25F): Intact records indexed into distinct functional field slots (uniform unit weighting $M_3^u$ and benchmark-fitted ceiling $M_3^t$).

Repository Structure

reproducibility/
β”œβ”€β”€ README.md                      # This master reproduction guide
β”œβ”€β”€ requirements.txt               # Pinned Python package dependencies
β”œβ”€β”€ LICENSE-CODE                   # MIT License for source code
β”œβ”€β”€ LICENSE-DATA.md                # CC-BY-4.0 licensing declaration for benchmark data
β”œβ”€β”€ verify_paper_numbers.py        # Automated paper-number oracle audit gate (< 2s execution)
β”œβ”€β”€ reproduce_all.py               # Master end-to-end headless CLI reproduction runner
β”‚
β”œβ”€β”€ dataset/                       # Benchmark data & cryptographic checksums
β”‚   β”œβ”€β”€ manifest.json              # SHA-256 hashes and census for all 20 benchmark files
β”‚   β”œβ”€β”€ DATA_SOURCES.md            # Detailed provenance, licenses, and collection protocols
β”‚   β”œβ”€β”€ processed/                 # Fully processed benchmark partitions (Agri, Legal, Edu)
β”‚   β”‚   β”œβ”€β”€ agriculture/           # 1,028 nodes, 4,526 chunks, 2,000 queries, gold mappings
β”‚   β”‚   β”œβ”€β”€ legal/                 # 735 acts, 4,202 chunks, 1,100 queries, gold mappings
β”‚   β”‚   └── education/             # 190 experiments, 892 chunks, 570 queries, gold mappings
β”‚   └── derived/                   # Standardized evaluation subsets
β”‚       β”œβ”€β”€ agent_subsets/         # 872 common subset + 28 documented network timeouts
β”‚       └── perturbation_subsets/  # 300-query counterfactual perturbation sample
β”‚
β”œβ”€β”€ notebooks/                     # Interactive Jupyter Notebooks with cached cell outputs
β”‚   β”œβ”€β”€ 01_agriculture_experiments.ipynb  # Full agricultural advisory pipeline
β”‚   β”œβ”€β”€ 02_legal_experiments.ipynb        # Bangladesh statutory law experiments
β”‚   β”œβ”€β”€ 03_education_experiments.ipynb    # Secondary science procedural experiments
β”‚   └── 04_agent_memory_experiments.ipynb # ReAct agent memory & perturbation evaluations
β”‚
β”œβ”€β”€ scripts/                       # Modular headless CLI execution pipeline
β”‚   β”œβ”€β”€ 03_validate_data.py        # Cryptographic hash and referential integrity audit gate
β”‚   β”œβ”€β”€ 07_run_core_bm25.py        # Reproduces Table 2 (L1 vs L2 vs L3 flat)
β”‚   β”œβ”€β”€ 08_run_uniform_bm25f.py    # Reproduces Table 2 (L3 uniform BM25F)
β”‚   β”œβ”€β”€ 09_tune_bm25f_ceiling.py   # Reproduces Table 10 & Table 11 (Tuned ceiling)
β”‚   β”œβ”€β”€ 10_diagnose_fragmentation.py # Reproduces Table 3 (Diagnostic failure attribution)
β”‚   β”œβ”€β”€ 13_field_shuffle.py        # Reproduces Table 4 (Counterfactual field shuffles)
β”‚   β”œβ”€β”€ 14_run_agent.py            # Reproduces Table 5 (Agent memory benchmark)
β”‚   β”œβ”€β”€ 15_agent_anchor_shuffle.py # Reproduces Table 6 (Counterfactual agent grounding)
β”‚   β”œβ”€β”€ 20_evaluate_all.py         # Executes all evaluation scripts sequentially
β”‚   └── 23_verify_paper_numbers.py # Top-level CLI entrypoint for the verification oracle
β”‚
β”œβ”€β”€ src/                           # Modular core library
β”‚   β”œβ”€β”€ memory_backends.py         # Unified memory backends (BM25Okapi, FullNode, BM25F)
β”‚   └── agent_runner.py            # ReAct agent runtime with token accounting and logging
β”‚
└── outputs/                       # Precompiled empirical results matching paper tables
    β”œβ”€β”€ retrieval/                 # Standalone sparse retrieval metrics (Tables 2, 8, 10)
    β”œβ”€β”€ failure_diagnosis/         # Diagnostic attribution partitions (Table 3)
    β”œβ”€β”€ counterfactuals/           # Field shuffle results (Table 4)
    └── agent_memory/              # Agent recall, citation grounding, and traces (Tables 5, 6)

Quickstart (Under 2 Minutes)

1. Environment Setup

# Clone the repository
git clone <anonymous-github-repo-url>
cd reproducibility

# Create and activate a virtual environment
python -m venv venv
source venv/bin/activate        # On Linux/macOS
# .\venv\Scripts\activate       # On Windows

# Install dependencies
pip install -r requirements.txt

2. Run the 10-Second Paper Verification Oracle

To verify that all empirical numbers reported in the paper's tables and prose match the experimental codebase exactly, run:

python verify_paper_numbers.py

This script asserts every metric in the paper against saved evaluation outputs, verifying:

  • Table 1: Benchmark node, chunk, and query census (1,953 nodes, 9,620 chunks, 3,670 queries).
  • Table 2: Representation ladder Recall@10 across all 3 domains ($L_1 \to L_2 \to L_3$).
  • Table 3: Fragmentation failure recovery categorization ($n=731$ recovered queries).
  • Table 4: Counterfactual perturbation controls (Unshuffled reference, Full, Content, Identity).
  • Table 5: Agent memory performance on the 872-query common subset ($M_1, M_2, M_3^u, M_3^t$).
  • Table 6: Counterfactual agent memory grounding ($N=300$).
  • Tables 8, 10, 12: Standalone ablations, tuned BM25F ceilings, and dense model baselines.

3. Run the Cryptographic Data Integrity Gate

To independently audit the integrity of the corpus, referential query-to-node mappings, and SHA-256 hashes of all 20 registered files:

python scripts/03_validate_data.py

Expected output: ```text

DATA VALIDATION AUDIT: PASS All experimental datasets, hashes, subsets, and mappings are verified.


---

## Paper Table to Code Mapping

Every table in the paper corresponds directly to an automated CLI script, a precomputed JSON artifact, and an interactive notebook:

| Paper Table | Description | Headless CLI Script | Interactive Notebook | Saved Artifact |
|:---|:---|:---|:---|:---|
| **Table 1** | Corpus and Query Census | `scripts/03_validate_data.py` | `01_agriculture`, `02_legal`, `03_education` | `dataset/manifest.json` |
| **Table 2** | Representation Ladder (R@10) | `scripts/07_run_core_bm25.py`<br>`scripts/08_run_uniform_bm25f.py` | `01_agriculture`, `02_legal`, `03_education` | `outputs/retrieval/core_bm25_results.json`<br>`outputs/retrieval/uniform_bm25f_results.json` |
| **Table 3** | Fragmentation Failure Diagnosis | `scripts/10_diagnose_fragmentation.py` | `01_agriculture`, `02_legal`, `03_education` | `outputs/failure_diagnosis/l1_l2_diagnosis_summary.json` |
| **Table 4** | Counterfactual Field Shuffles | `scripts/13_field_shuffle.py` | `01_agriculture`, `02_legal`, `03_education` | `outputs/counterfactuals/table4_field_shuffle_results.json` |
| **Table 5** | Agent Memory Performance ($n=872$) | `scripts/14_run_agent.py` | `04_agent_memory_experiments.ipynb` | `outputs/agent_memory/table5_agent_results.json` |
| **Table 6** | Agent Memory Permutations ($N=300$) | `scripts/15_agent_anchor_shuffle.py` | `04_agent_memory_experiments.ipynb` | `outputs/agent_memory/table6_agent_perturbation_results.json` |
| **Table 8** | Standalone Field-Group Ablations | Notebook cell executions | `01_agriculture`, `02_legal`, `03_education` | `outputs/retrieval/ablation_group_metrics.json` |
| **Table 10** | Tuned BM25F Ceilings ($L_3^t$) | `scripts/09_tune_bm25f_ceiling.py` | `01_agriculture`, `02_legal`, `03_education` | `outputs/retrieval/tuned_ceiling_results.json` |
| **Table 12** | Dense & Hybrid Robustness Checks | Notebook cell executions | `01_agriculture`, `02_legal`, `03_education` | `outputs/retrieval/dense_hybrid_results.json` |

---

## Interactive Notebooks

All four notebooks in `notebooks/` are pre-executed with cell outputs retained, enabling reviewers to inspect results immediately without re-running long dense model or LLM inference loops:

* **`notebooks/01_agriculture_experiments.ipynb`:** Evaluates 1,028 agricultural nodes across Dhaka standard and 16 regional dialects; reproduces Tables 2, 3, 4, 8, 10, and 12.
* **`notebooks/02_legal_experiments.ipynb`:** Evaluates 735 statutory acts and 1,100 citizen legal inquiries; demonstrates the legal counterexample where uniform fielding trails intact full nodes ($77.82\%$ vs. $79.55\%$).
* **`notebooks/03_education_experiments.ipynb`:** Evaluates 190 secondary science lab experiments; isolates the $+52.46$pp anti-fragmentation recovery.
* **`notebooks/04_agent_memory_experiments.ipynb`:** Evaluates the ReAct agent (`gemini-2.5-flash-lite`, 1 tool, at most 2 calls) across memory conditions $M_1, M_2, M_3^u, M_3^t$ and counterfactual anchor shuffles.

Each notebook features automatic environment detection: works seamlessly locally, on Google Colab, or in Kaggle notebook environments.

---

## Data Provenance and Licensing

* **Source Materials:**
  * **Agriculture:** Derived from the Agricultural Information Service (AIS) and Directorate of Agricultural Extension (DAE), Ministry of Agriculture, Bangladesh.
  * **Legal:** Derived from official statutory enactments published under the Bangladesh Code, Legislative and Parliamentary Affairs Division, Ministry of Law.
  * **Education:** Derived from secondary school science laboratory curricula published by the National Curriculum and Textbook Board (NCTB).
* **Licenses:**
  * Source code is released under the **MIT License** ([LICENSE-CODE](LICENSE-CODE)).
  * Curated benchmark records, queries, and evaluation splits are licensed under **Creative Commons Attribution 4.0 International (CC-BY-4.0)** ([LICENSE-DATA.md](LICENSE-DATA.md)).
  * For full provenance and reconstruction instructions, see [`dataset/DATA_SOURCES.md`](dataset/DATA_SOURCES.md).

---

## Anonymity and Compliance

This repository is submitted in full compliance with the double-blind review policy:
* All author identities, personal emails, institutional affiliations, and local development paths have been scrubbed.
* All evaluation numbers in the paper correspond strictly to frozen benchmark configurations without post-hoc data alterations.
Downloads last month
80