Records and archives
Scan, classify and search service archives by question, in Bangla and English, with access decided by clearance.
A service archive is paper, microfilm and a generation of unmarked PDFs. The index, where it exists, is a spreadsheet of box numbers. A researcher who does not know the box does not find the file, and a researcher who does find it may not be cleared for the next file in the same box.
This lab turns that archive into a collection you can ask questions of, in Bangla and English, with clearance enforced at retrieval. It is the staff work assistant scaled from a shelf of manuals to a repository, plus the scanning and classification the repository needs first. Classification here means cataloguing a record, not marking a military target.
Scan
Work in batches, from a box list, not from a pile.
- Scan to PDF at a resolution the OCR model can read. Photograph pages only when the document cannot go through a scanner, and say so in the metadata.
- Store the original image unchanged. OCR text is a derivative. When the OCR is wrong, the image is how a person checks it.
- Run OCR for Bangla and for English, including mixed pages. Bangla OCR has to be tested on your own typewriters and stamps, not on a clean digital font. The RAG lab calls this out because it is where quality is won or lost.
- Record
box,file,page,language,scan_dateand the identifier of the batch operator.
Keep originals and text on the sovereign platform. A sealed archive does not upload images to a public OCR API.
Classify
A classifier proposes catalog fields. An archivist confirms them. The model does not invent a clearance.
| Field | Who sets it |
|---|---|
title, date, language, doc_type |
Model proposes, archivist confirms |
clearance, caveats, unit |
Taken from the existing register or set by the archivist. Never guessed from the prose |
retention |
The records schedule, applied by rule from doc_type |
Write the confirmed record back to the catalog. Unconfirmed batches stay in a review queue and are excluded from search. That single rule prevents a mis-filed secret from being retrieved as if it were unclassified, and it prevents an unclassified draft from being hidden because the model was unsure.
Search by question
Indexing and answering are the RAG pipelines: chunk on headings and paragraphs, embed with one multilingual model for both languages, store vectors and metadata together. Questions in Bangla must retrieve English passages when the meaning matches, and the reverse. Test that pair with a small set of questions written by an archivist, not with translated duplicates of the same sentence only.
The clearance filter is applied in the query, from the user's token:
allowed = user.clearances # from the identity token, not the question
hits = collection.search(
query_vector,
limit=20,
filter="clearance in {allowed} and status == 'confirmed'",
)
Hybrid search matters in archives. File numbers, dates and proper names are exact strings, and embeddings miss them. Combine keyword search with the vector search, then rerank. A user who lacks the clearance does not receive the chunk, the citation or a hint that the record exists. The audit log still records that a hit was filtered, so a security officer can review probing.
The answer cites box, file and page. The interface opens the page image next to the text, because the OCR line is not the record. The record is the scan.
Access by clearance
Identity comes from the force directory, through the Identity Server or the cluster identity provider, with group claims for clearance and unit. The retrieval service checks the claim on every call. There is no "archive admin" mode that bypasses the filter inside the application; an archivist who must see a closed file is granted the clearance, and the grant is itself logged.
Test the negative path on every release: a user cleared to restricted asks a question whose only answer is in a confidential file, and the answer is that the collection does not contain it. Then confirm the audit event lists the filtered identifier and the user.
A box, end to end
Pick one unclassified box and take it through the whole path before you scan the next hundred.
- Scan to PDF. Keep the images. Run Bangla and English OCR. Open five pages at random and read the OCR beside the image.
- The model proposes title, date and language. You set clearance from the register. Leave one file unconfirmed on purpose.
- Index only the confirmed files. Ask a question whose answer is on a page you have open.
- Ask as a user who lacks the clearance of one confirmed file. The file is missing from the answer, and the audit row names it.
- Confirm the unconfirmed file is not searchable. Confirm it, re-index, and show that it now is.
| Failure on the box | What it means |
|---|---|
| OCR drops a Bangla paragraph | The parser is not ready. Do not scale the batch |
| A guessed clearance appears | The propose step is writing a field it must not write |
| The unconfirmed file is searchable | The status filter is not in the query |
| The page image will not open from the citation | The store path was not kept with the chunk |
The archive is ready to grow when this box passes and the archivist will use the citations. Growth is more boxes through the same job, not a new index per cupboard.
Scale only after the box passes
- OCR checked by a person on a sample of pages, Bangla included.
- Clearance taken from the register, never from the model.
- Unconfirmed files absent from search.
- A user below clearance sees neither text nor a hint.
- The page image opens from the citation.
- The audit row names filtered hits.
Then the next box is the same job with a new box number. A new index, a new model and a new bucket per cupboard is how an archive becomes unsearchable again.
What's next
- Intelligence analysis: transcription and translation on top of the same index.
- Security and multi-tenancy: how access labels follow bytes into a Dell search index when the archive outgrows the lab store.
- Principles and safeguards: the logging and human-confirmation rules this page relies on.