Output formats
Every result is written from the job database, with the user’s corrections applied, into the
formats chosen for the job. Each source also gets a provenance.json. In comparison mode, file
names carry the set-up’s label: letter.gemini-3.8-flash.txt. Two sources that would share a
name in one folder (scan.pdf and scan.tif, or two scan.pdf sent to one folder) keep apart:
the later ones in the job are numbered, scan (2).txt, regardless of case. A numbered name is
kept too: a later scan (2).pdf in the same folder becomes scan (2) (2).txt.
Images read as the pages of one document (#52)
give one result, as a PDF does: one .txt, .md, .docx, .json, .xlsx and .csv, its pages
numbered in the document’s order (--- Page 3 ---), named after the document and written in the
folder of its first page (Box 3.txt, Box 3.provenance.json). The images themselves are never
copied, moved or changed.
A page or segment that could not be read after its retries does not keep the rest from disk: it
stands as [Not read: reason] in the text formats and the CSV, with a failed reason in JSON,
and provenance.json lists it under failed. Retrying it writes the files again.
In the CSV files a cell that begins with =, +, -, @, a tab or a carriage return, and is
not simply a number, is written with an apostrophe before it ('- Oui), so a spreadsheet shows
it as text instead of computing it as a formula. The JSON beside it keeps the text exactly. A
table written through an export profile is the exception: its cells are written as they are,
since another tool’s import would take the apostrophe as part of the value
(decision).
Every table written as CSV is also offered as an Excel workbook (.xlsx) with the same
headings, rows and cells, for a spreadsheet: it opens by double-click whatever language the
spreadsheet is set to, where a CSV’s commas may all land in one column. It has one sheet named
Table, the heading row in bold and frozen, columns as wide as their longest line (8 to 60
characters) and long text wrapped. Every cell is text exactly as written, so nothing is guarded
with an apostrophe and nothing is read as a number, a date or a formula; Excel is told not to
flag numbers held as text. A cell longer than the 32,767 characters a workbook’s cell holds is
cut and ends with a note saying so; the CSV and JSON keep the whole text. The workbook’s dates
are fixed, so the same table gives the same file
(decision). The workbooks written beside
a JSON export (descriptions, export profiles, the review manifest, the dictionary, a table of
contents’ items) are named as their CSV, with .xlsx.
Text, Markdown and Word
.txt: the text, with--- Page N ---before each page when there is more than one (as in zmo-ai-pipelines). Transcriptions are written as[hh:mm:ss] Speaker: textturns when the model gave timestamps and speakers..md: a heading with the file name and the model, then## Page Nper page..docx: the same structure as Markdown; line breaks inside paragraphs are kept, since diplomatic transcriptions rely on them.
Searchable PDF (.searchable.pdf)
The original PDF, unchanged, with an invisible text layer so it can be searched and its text
copied. Only models that report where text sits on the page can feed it: Tesseract, which
places every line and word, and Mistral OCR and LightOnOCR-3, whose block boxes are kept with
each page.
Text is set invisibly (render mode 3) in a glyph-less Unicode font, so any script stays
searchable: each of Tesseract’s lines over its own box, and each of Mistral’s or LightOnOCR’s blocks spread
over the lines that fit its box; every line is stretched to its box’s width. A corrected page
keeps its words’ places where the engine placed each word (see ALTO below); otherwise it is set
as one block over the page. Only PDF sources get one, not images, a document of images included; it is written as <name>.searchable.pdf,
never replacing the source. New job says before a job whether it will have one: the format is
offered, and the task’s diagram draws ALTO XML and the searchable PDF as a second result, only when a
chosen model reports where text sits; under any other model, the diagram notes that it gives text only.
ALTO XML (.alto.xml)
ALTO version 4, as digital libraries, eScriptorium and
Transkribus read it: one file per document, a Page per page, then TextBlock, TextLine and
String for each word, with SP between words. Positions are in pixels (MeasurementUnit
pixel): those of the image for an image source, those of the page as it was drawn for a PDF
(as Tesseract reads it: at 300 dpi, or less for a page whose longest side would pass 7,000
pixels, the resolution its result records; a result that records none, read by 1.7.0 or
earlier, is measured at 300), the page’s own WIDTH and HEIGHT given; for a document of images,
each page measured in its own image, the file named after the document. A word carries the engine’s
confidence (WC, 0 to 1) where it gave one. Description names the source file, the date,
Kalamu’s version and, in processingStepSettings, the provider and model, the resolution PDF
pages are measured at (naming the pages drawn at less than 300 dpi), and says when positions
are estimated. A page split into halves is put back together on the whole page.
Offered only from models that report where text sits. Tesseract places every word. Mistral OCR and LightOnOCR-3 place blocks only: a paragraph the model wrote on one line is wrapped into as many lines as its block holds on the page (taking characters about half as wide as they are tall, and lines 1.2 times their height apart), a line the model broke itself is kept, the lines share the block’s height and their words each line’s width by their length, as the review draws them; the file says these positions are estimated. A corrected page keeps its words’ places, as iwac-ai-pipelines’ ALTO correction does: the researcher’s text is matched to the words the engine read, a word kept or changed staying in its box, words added sharing the box before them, words removed leaving theirs; the engine’s confidence is kept only for words left as it read them.
PAGE XML (.pNNNN.page.xml)
PAGE content, the 2019-07-15 schema, as
Transkribus, eScriptorium and Aletheia read it: one file per page, <name>.p0001.page.xml,
<name>.p0002.page.xml and on (four digits at least), beside the ALTO file and from the same
places. Offered when ALTO is, and the same pages are written: every page of a PDF, one read
without text and one that failed included (an empty Page, the failure in Comments), and
each page of images that has regions.
Page gives imageWidth and imageHeight in the pixels ALTO measures in and, for a PDF
page, the resolution it was drawn at (imageXResolution, imageYResolution, in PPI).
imageFilename is the image file’s name; a PDF page has no image file, so it names
<file>.pdf#page=N. ReadingOrder lists the regions in the engine’s order. Each block is a
TextRegion, its lines TextLine, and its words Word only where the engine placed each word
(Tesseract); Coords are rectangles as four points, in whole pixels kept within the page.
TextEquiv/Unicode holds the corrected text at every level, a corrected page keeping its words’
places as in ALTO; a word carries the engine’s confidence (conf, 0 to 1) where it gave one.
No baselines and no region types are written, the engines giving none.
A block Mistral OCR or LightOnOCR-3 placed whole gets the lines ALTO estimates, each saying its position is estimated, and no words: a word’s place would be a guess within a guess. ALTO writes those estimated words; this is the one difference between the two.
Metadata names Kalamu’s version, the provider and model, and in Comments the resolution,
whether lines are estimated and whether the text was corrected. Created is when the page was
read and LastChange when it was last corrected, never when the file was written, so writing
the files again gives the same bytes.
The researcher’s regions in the searchable PDF, ALTO and PAGE XML
These three write the corrected view of where the text sits: the model’s regions with the boxes the researcher gave them in the review, and the regions the researcher drew that have text. A file with none of either is byte for byte what it was.
- Whose box. A box the researcher gave a block, line or word of this set-up’s reading
takes the model’s place. A box given to a reading no set-up shows any more is written as a
region of the researcher’s own; one given to another set-up’s reading is left out, as in
provenance.json, which lists the same regions. - Widened, never scaled. A block moved while its lines were not keeps the lines where the model measured them and is widened just enough to hold them; a line or word moved outside what holds it widens that line, then that block. Each says which it is: the researcher’s box, theirs widened, or the model’s widened.
- A corrected page. The boxes are laid first, then the corrected words on them: a word given a box passes it to the word or words that replace it. Where the corrected text cannot be laid back on the model’s words, the page is one block as before, and the researcher’s boxes are written as regions of their own, without text.
- A region the researcher drew follows the model’s on its page, in the order drawn. With
text it is a block whose lines are estimated within its box and say so; a split spread’s
half is put back on the whole page. Without text, PAGE XML writes a
TextRegionwith itsCoordsalone, and ALTO and the searchable PDF leave it out. - ALTO adds a second
Processingstep,processing_2(contentModification, dated by the last box), and everyTextBlock,TextLineandStringwhose box is or involves the researcher’s refers to it withPROCESSINGREFS. The researcher’s own blocks have the idresearcher_<id>. - PAGE XML says it in each element’s
comments, where an estimated position is already said, naming the region’s id asprovenance.jsonlists it; in aMetadataItem type="processingStep"; and inLastChange, which counts the last box. The researcher’s own regions have the idresearcher_<id>and come last inReadingOrder.customis not used for this, since Transkribus reads tags there. - The searchable PDF places its text by the corrected boxes and sets a drawn region’s text invisibly over its box, so a marginal note is found by a search. A PDF does not say whose a box is.
Both XML formats were checked by hand against the official schemas (ALTO 4.4, PAGE
2019-07-15); no test does it. Not yet in the files: the reading’s own identifier, which
provenance.json gives for each region.
Analyses
Written as <name>.analysis.txt (and .md, .docx, .json, .xlsx, .csv) beside the
source, so an analysis of interview.txt never replaces it. The researcher’s corrected answers
replace the model’s where there are any.
- Text formats set out each field under its name: prose fields as a paragraph after their
label, the others on one line (
Places: Bamako; Ségou), and a field’s reason on the next line (Reason: …). - JSON adds to the part a
fieldsobject with each answer under its field’s key (text for prose and single choices, an array for lists and several choices) and, when any field asked for one, areasonsobject with the reasons by key.provenance.jsonrecords the fields asked for (prompt.schema). - CSV has one row per document:
file, then one column per field named as the researcher named it, a<field> (reason)column after each field that asks for a reason, thencorrectedandreviewed. List items are joined with semicolons.
An analysis that quotes its text
An analysis whose fields include entries that quote the text (the default Interview: themes and quotations) keeps, for each quotation, where Kalamu found it in the text it read. Only quotations found word for word are written; the researcher’s removals are applied.
- Markdown is a memo: each field under a
##heading; an entry with several fields has its first as a###heading and the others below, then its quotations as block quotes that end with> — Speaker, [hh:mm:ss](the turn’s speaker and the time the turn starts, when the text has them), or> — page 3for a passage of a text read from pages. A field from which quotations were left out ends with a line in italics saying how many. Text and Word write each quotation on a line,"…" (Speaker, hh:mm:ss). A quotation the researcher added from the text ends with ` · added by the researcherin the memo, and, added by the researcher` in the brackets of text and Word. - JSON gives such a field as
{ "entries": [{ "answers": [{ "key", "value" }], "evidence": [{ "anchor": { "part", "start", "end" }, "quote", "turn", "speaker", "start_ms", "end_ms", "page" }] }], "left_out", "dropped" },page(the piece, as{ "kind": "page", "number" }) only for a passage of a text read from pages.startandendcount characters (Unicode scalar values, not bytes or UTF-16 units) in the text read, whose identifier and SHA-256 are in a top-level"snapshot": { "id", "sha256" }, written only for these analyses;partis the piece of that text, from 0;turncounts from 1;quoteis the text’s own characters, never the model’s copy.left_outcounts the quotations a model gave that were found nowhere,droppedthe entries left with none. A quotation the researcher added from the text has"added": true; the model’s have noadded. - CSV: the analysis’s own file keeps one row per document, the field’s column holding its
entries’ names joined with semicolons. Beside it,
<name>.analysis.quotations.csvhas one row per quotation:file,field,entry(the entry’s first field),speaker,start,end(hh:mm:ss, or empty),quotation,turn,page(empty but for a text read from pages),added_by(model, orresearcherfor a quotation they added from the text). An entry that is quotations alone (a screened document’s passages) is named in the analysis’s own file by its quotations, each between quotation marks. Cells that a spreadsheet would read as a formula are guarded, as in every CSV Kalamu writes. The workbook does the same, as<name>.analysis.xlsxwith<name>.analysis.quotations.xlsxbeside it. provenance.jsonaddscited: for each such field, the quotations checked, those left out and the entries left out;source.derived_fromnames the text read.- A long text read in parts writes the answer that brought the parts together, and only
it; a part that could not be read stands after it as
[Not read: part 3 (turns 48–71, 01:02:10 to 01:20:00): reason]in text, Markdown and Word (for a document read from pages,part 3 (pages 4–7); for a text file with neither pages nor speakers,part 3 (passages 48–71)), and in JSON as a part whose piece is{ "kind": "turns", "number", "first", "last" }with itsfailedreason.provenance.jsonthen hasmerge, the step that brought the parts together, whoserequestliststurns_readand, when a part could not be read,turns_not_read("1-24, 23-49", turns counted from 1);piecescounts the parts and that step. A text read whole has nomerge.
Records
An analysis whose fields are one repeating group (One row per entry) is read page by page, and its files hold one row per entry, from the corrected rows.
- CSV:
file,page,position(the entry’s place on its page, from 1), then one column per column of the group, named as the researcher named it, with a<column> (reason)after each that asks for a reason, thencorrected(the row’s own: true when the researcher typed into the row or added it),reviewed(the row’s page’s) andnot_read. A page that failed or was cut off is one row with no position and[Not read: reason]undernot_read, so its entries are never taken for none. Cells that begin with=,+,-or@are written as in the other tables. - JSON: the usual envelope, its parts without
fields, and a top-levelrowslist: for each entryfile,page,position, afieldsobject with each cell under its column’s key (text, or an array for a list and several choices),corrected,reviewed(as in the CSV) and, where any column gave one,reasons. A page not read has no rows; its part saysfailed. - Which rows are corrected. A corrected page’s rows are lined up with the model’s rows by
their cells, in order (the longest run of rows the same in both); a row outside that run was
typed into or added, and is
corrected. Two rows are the same when every column holds the same value, a missing cell counting as empty and reasons not counting. So a row removed above marks none below it, a cell typed back as the model wrote it leaves its row the model’s, and a removed row leaves no row to mark. The workbook has the same columns as the CSV. - Text formats (
.txt,.md,.docx) are not yet made for rows: each page shows only its rows’ first column, joined with semicolons. Use the CSV or the JSON.
Tables of contents
Written as <name>.contents.md (and .docx, .xlsx, .csv, .txt, .json) beside the
source. Only the combined entries are written, with the researcher’s corrections; what the first
step read on each page stays in the job, for the review.
- Markdown and Word: a heading per entry, then its pages and fields as a list
(
- **Pages:** 1, 3-4). - Text: the entries numbered, each followed by its pages and fields, indented.
- CSV: one row per entry:
file,Title,Pages, one column per field named as the preset names it, thencorrectedandreviewed. - JSON: the part has an
entriesarray, each entry an object of its fields’ values by key. provenance.jsondescribes the first step as for any job and the second undermerge: itsprovider,model,model_versions,requestandprompt(with its fields), and its share of theusageandcost_usdof both steps.
Items
The items made from a table of contents (#50) are exported, when the researcher selects some
and chooses Export, into a folder they choose, never replacing a file already there (a new
one is numbered, (2)):
- One PDF per item: its pages cut from the source in the item’s order, named after the
source, the item’s place and its title (
an-nasr-12 03 Fatwa.pdf). <source> units.csv: one row per item:id,number,title,pages(as typed,1, 3-5, 8 (left)),file, one column per entry field named as the preset names it, thenoriginalandoriginal_sha256, the file the pages were cut from; and the same table as<source> units.xlsx.<source> units.json:{"units": [...]}, each with itsid(stable across exports),number,title,pages(each{"kind": "page", "number": 3}, with"half"for half of a spread, numbered as the file’s pages, not as printed),pages_text,file,fieldsby key, theentryit was made from (numbered from 1, ornull), itsrevisionand theoriginal’sfile_nameandsha256.
A job that read an item’s pages writes its results beside the source under the item’s name,
and its provenance.json names the item under source.derived_from.unit.
Corrected text
Written as <name>.corrected.txt (and .md, .docx, .json, .xlsx, .csv), so a text file is
never replaced by its correction. Pages keep their --- Page N --- markers; passages of a text
without pages carry none, as the cut means nothing to a reader, and are numbered §1, §2 in
the CSV.
Translated text
Written as <name>.translated.<code>.txt (and .md, .docx, .json, .xlsx, .csv),
<code> being the language translated into (gallica.translated.en.txt), so a text is never
replaced by its translation and translations into two languages do not replace each other.
Pages and passages are kept as for corrected text, and the CSV has the same columns.
A transcript translated with its times (frozen from a transcript whose every part had them) is
also written as .srt and .vtt, cut and timed exactly as a transcript’s, each cue holding the
translation of the line it times, under that line’s speaker. Each part of its JSON result has
segments: the transcript’s lines with their times and speakers, the text translated. Its
provenance.json may carry lines_changed: the passages whose correction no longer has one
paragraph per line, whose times were therefore lost; no subtitles are written while it lists
any. A translation of any other text has no subtitles.
Subtitles and spreadsheets
.srt/.vtt: cues of at most 84 characters and 6 seconds, from timed segments or from[hh:mm:ss]markers in the text. A long line is cut at word boundaries into cues of even length, its time shared out by length and its last cue ending with it; a line too short to show each of its cues for a second is cut into fewer, longer ones, so no cue is a word flashed on screen. The SRT file names the speaker at the start of each line (Speaker 1: …); WebVTT uses voice tags (<v Speaker 1>) on every cue. Both keep the name’s room in the first cue, so they show the same cues at the same times..csv: one row per page (page, text, corrected, reviewed) or per segment (start, end, speaker, text), UTF-8 with a byte-order mark so Excel reads accents correctly..xlsx: the same rows as the CSV, in an Excel workbook (see above).
JSON (kalamu-result, version 1)
{
"schema": "kalamu-result",
"schema_version": 1,
"task": "text_extraction",
"source": { "file_name": "lettre.pdf", "sha256": "…", "size_bytes": 1024 },
"setup": { "label": "gemini-3.8-flash", "provider": "gemini", "model": "gemini-3.8-flash", "prompt": "Printed or typed document" },
"parts": [
{
"piece": { "kind": "page", "number": 1 },
"label": "1",
"text": "Bamako, le 3 mai 1957 …",
"segments": [],
"corrected": false,
"reviewed": true
}
],
"provenance": { "…": "as below" }
}
pieceis{ "kind": "page", "number": n }, with"half": "left" | "right"when a double page was split, or{ "kind": "segment", "index": i, "start_ms": …, "end_ms": … }; a long text’s part not read is{ "kind": "turns", "number": n, "first": f, "last": l }.segmentsare{ "start_ms", "end_ms", "speaker", "text" }, timed from the start of the recording.textis the corrected text whencorrectedis true; the model’s own output stays in the job database.
provenance.json (schema version 1)
Modelled on zmo-ai-pipelines’ provenance record:
| Field | Meaning |
|---|---|
generator |
{ "name": "Kalamu", "version": "…" } |
created_at |
Milliseconds since 1970, UTC |
task, engine |
text_extraction, audio_transcription, analysis, contents, text_correction or translation; cloud or offline |
source |
File name, SHA-256 and size of the original; for a YouTube video, its title with the id (<title> [<id>], or youtube-<id> when the title could not be read), the SHA-256 of its id, its url, title and read_at, when the provider first read it; for text frozen from an earlier result (Use this text in a new job, or a workflow step reading an earlier one), the frozen text’s name, SHA-256 and size, and derived_from: that result’s job_id, setup_id, source_id and task, the original_path, when it was frozen (frozen_at), how many pieces it holds and how many were reviewed and corrected, and the pieces missing from it; for an item’s pages cut from a table of contents’ source, the same with task contents, its pages as the pieces (reviewed counting those marked in the table of contents), and unit: the item’s id, title, revision and pages as the original numbers them; for a document of images, the document’s name, the SHA-256 of its pages’ hashes in their order and their total size, and pages: each file in the order read, with page (the document’s page it begins), its id (the same wherever the page is moved), file_name, path, sha256, size_bytes, modified_ms, frames (pages the file holds, more than one for a multi-page TIFF) and the researcher’s label, if any |
documents |
The project documents the source is, in each project whose document it is: project_id, project_name, document_id, title, and description, each part of the source’s description as it stood when the file was written (repository, fonds, series, file, shelfmark, creator, date, url, citation, rights) as { "value", "from" }, from being document or project; parts with no value are left out. Supplied by the researcher, never by a model. Absent for a job tied to no project |
provider, model |
As requested |
model_versions |
The versions the provider reported, when they differ from model (including a fallback model) |
request |
What the requests carried besides the prompt, each as { "name", "value" } named by its path in the request (output_config.effort, generationConfig.maxOutputTokens, beam_size): reasoning effort, output limit, media resolution; for Whisper, vad (whether silences were skipped with the voice-activity model, used when it is downloaded) and vad_model; for Tesseract, engine (Tesseract 5.5.2), language_data (tessdata_best@e12c65a), ocr_engine_mode (lstm), page_segmentation (auto) and, for a PDF, page_resolution (300 dpi: what the page was drawn at). For pages read several at a time, pages names the pages that went in one call (5-8). Recorded with each piece’s result when it was sent, so a later version of Kalamu never rewrites it; a name listed twice means pieces were read with different values. Absent for results stored by 0.4.0 and earlier |
prompt |
Preset id and name, the full instructions and per-page request sent, and their SHA-256 |
merge |
For a table of contents, the model and prompt that combined the pages: provider, model, model_versions, request, prompt, and that step’s usage and cost_usd, its share of the totals below |
languages, detected_languages |
What the user chose, and what the model reported |
options |
Diarization, timestamps, speaker count, and the reasoning level chosen or suggested for the set-up (reasoning, absent for a model that does not reason) |
pieces, corrected, reviewed |
Number of pages or segments, and which were corrected or reviewed |
failed |
Pages or segments that could not be read after their retries, marked in the files. Absent when none was |
truncated |
Pages or segments whose answer stopped before its end, at the model’s output limit or for another reason the provider gave, so their end may be missing; for a table of contents, the pages read and the combined entries alike. Absent when none was |
cut_by_filter |
Those of truncated that a provider’s filter (safety, a blocked term) stopped, rather than the output limit. Absent when none was |
preprocessing |
Fixes applied to working copies (split_spreads, even_out_volume, sample_first_3_pages): only those made, so split_spreads only where a spread was found, and a sample only of a document longer than it |
renamed_speakers |
The model’s speaker labels the researcher gave names, which replace them in every file. The names are in the files, not here, so the record can be shared without them. Absent when none was |
usage, cost_usd |
Tokens, audio seconds or pages billed, the input read from or written to the provider’s prompt cache (cached_input_tokens, cache_write_tokens, parts of input_tokens), whether the calls went through a batch service (batch), and the cost from catalogue prices with those discounts, for the results kept |
refused |
Answers the provider billed but nothing was kept from: analysis answers that broke the fields and were asked for again, or several pages read together whose page marks could not be used (each page then read again alone). answers, their usage and cost_usd, not included above. Absent when none was |
workflow |
For a result read by a workflow step: the run (run_id), the workflow (workflow_id, name) and its version when the run started, this step of steps and its step_name, the step it reads (numbered from 1; absent when it read the files, and source.derived_from names the snapshot), and the researcher’s approval of that step (at, and partial when they went on although some pieces were not read). Absent for a job run on its own |
Added on 18 November 2026 without a new version, both absent when empty: listed_by_hand,
the items of an analysis’s list answers that the researcher wrote (added, or renamed from
the model’s form) and the model’s own answer did not hold, each with its part, field and
items; and passages, the passages a model corrected at the researcher’s request from the
review and that they accepted, each with its piece, provider, model, prompt, request
settings, character counts, whether the proposal was edited, its cost and when it was asked
and accepted. Their cost is not in usage or cost_usd, which count the job’s own pieces.
Added later the same day, also absent when empty: regions, the regions the researcher drew
over the scan or whose box they adjusted, each with its id, page (and half of a split
spread), its box in fractions of the page or half (x, y, width, height), its origin
(manual), what it adjusts (the stored result’s cache key and the region’s id there, such
as r1_l2), whether it has_text (the text itself is not recorded), and when it was created
and updated. A set-up’s file lists those drawn on the source, those adjusting its own
readings and those adjusting a reading no set-up shows any more. ALTO, PAGE XML and the
searchable PDF write the same regions (above). A model’s region is named there as PAGE XML
names it (r1, r1_l2, r1_l2_w3), except on a split spread, whose halves the review
numbers each on its own and PAGE XML across the whole page.
And region_readings, the regions a model read again at the researcher’s request and whose
reading they used, each with its page (and half), the region’s id and box, the
provider, model, prompt and request settings, where it went (went_to: region, the text of
a region the researcher drew, or text, in place of the region’s words in the page’s text),
whether it was edited first, its cost and when it was asked and accepted; never the text.
A reading that went to a drawn region is listed in every set-up’s file, one that went into
the text in that set-up’s alone. Their cost is not in usage or cost_usd.
The search index (search.sqlite)
Not an output: a file in the app’s data folder that project search reads, made only from the
job database (decision). Each passage is one piece of
one result: the text as the review shows it, or an analysis’s answers and reasons as separate
parts, kept as JSON beside the folded text in an FTS5 table (trigram tokenizer, contentless).
A stamp records what the passage was made from, and PRAGMA user_version the layout; a file of
another version, or one that cannot be read, is emptied and made again. Nothing outside Kalamu
should rely on its layout.
The search by meaning’s numbers (vectors.sqlite)
Not an output either: a file in the app’s data folder, made only from the results
(decision).
One row for each stretch of text: the model (provider, id and length), the piece it is of,
its number in that piece, the piece’s stamp and a hash of its text, where the stretch stands
in the text, and its numbers as little-endian 32-bit floats of length 1. Losing the file
loses only what preparing again costs. The job database keeps, for each project, the model
chosen and the consent given (meaning_spaces) and each preparation with its cost
(meaning_runs). Nothing outside Kalamu should rely on its layout.
The review manifest (kalamu-review-manifest, version 1)
Written by Export the list in a project’s What to check, where the researcher chooses: a JSON file with an Excel workbook and a CSV beside it, every item of the list in the scope shown (the project, a collection or a selection), whatever the filters show, the pages drawn at random included. The workbook has the same columns as the CSV.
The JSON holds format, version, project, project_name, scope (project,
collection:<id> or documents:<digest of the selection>), exported_at, the scope’s
counts, the sample (its seed, size, when it was drawn, how many pages it was drawn from,
how many were drawn and how many of them are reviewed; null without one), set_aside and
items. set_aside lists the results the researcher set aside from the list in that scope,
which the items and the sample leave out: each with its job_id, job_name, task,
setup_id, setup_label, model and documents; an empty list when there are none. It was
added on 18 November 2026 without a new version, a reader of version 1 ignoring it.
The CSV has one row per item, in these columns: document_id, document, source_id,
job_id, job_name, task, setup_id, setup_label, model, preferred, piece,
place, position, revision, answered_at, reasons, reason_details, flagged,
processing, sample, sample_seed, reviewed, corrected, decided_at, open,
kept_aside, kept_note, kept_at, listed_for. piece is the piece as Kalamu names it
(result for a whole result), place as exports label it, position counted from 1, and
revision the answer the row is about. reasons joins the kinds with ; and
reason_details what each found. Yes-or-no columns read yes or no, kept_aside also
for an earlier answer; listed_for reads processing, flagged, not_reviewed or
sample. Times are in UTC.
A page is drawn by ranking every page nothing flags by the SHA-256 of <seed>:<identity>, the
identity being <document id>/<task>/<piece>, and taking the lowest: the manifest’s seed and
identities are enough to check a draw.
The screening table
Written by Export the whole table in a project’s table of documents, while the table is filtered by an answer: an Excel workbook and a CSV beside it, with the same columns, one row per document the analysis read, in title order, whatever the filter shows. A question asked again of documents added since is written with every analysis that asked it alike, a document’s newest answer counting; one asked under a prompt edited since is a table of its own (decision).
The columns are document (its title) and file, then one column per field of the analysis
under the label it froze, a <field> (reason) column after each field that asks for a reason
(a field that quotes the text as its quotations, one per line, with where each stands), then:
job_id: the analysis that gave the row’s answer, asprovenance.jsonnames it;prompt_fingerprint: the first twelve characters of the SHA-256 of the prompt that analysis froze (its instructions, the request with the researcher’s question, and its fields). The same on every row of one table; two tables with different values were read under different criteria;tags: the researcher’s tags, joined with;.
Cells a model wrote that a spreadsheet would read as a formula start with an apostrophe in the CSV.
The project file (.kalamu)
Written by Save to a file… in a project, where the researcher chooses, and read by Open a
project file… on the list of projects
(decision, #213).
One SQLite database, the same on Windows and macOS. It has the job database’s own tables, at
the schema its PRAGMA user_version gives (the number of the store’s migrations the saving
Kalamu had), holding one project’s rows only, and three tables of its own.
kalamu_project_file, one row:
format:kalamu-project.version: the version of these three tables,1. A file of a higher version, or of a schema higher than the opening Kalamu knows, is refused as made by a newer Kalamu; a lower schema is brought up to date on a copy, never in the file.manifest: JSON withformat,version,schema,app_version,saved_at(milliseconds since 1970, UTC),project_name,documents,jobs(those that read its documents, as the project’s card counts them: the dictionary’s proposal jobs, carried too, are not counted) andwith_originals(whether the original files were chosen; those that could not be carried are listed as not carried).
kalamu_files, one row for each file the project’s documents and jobs name, each once:
id: the file’s number in this file.role:snapshotfor a text Kalamu froze (from its data folder’ssnapshots/, named<sha256>.txtor.pdf), carried always;originalfor the researcher’s own file, carried only when chosen.path: where it was on the saving computer, written as that system writes paths. Kalamu reads its name and folder by splitting at both\and/, never as this system’s path.file_name: its name as the source records it.sha256: its fingerprint, lowercase hexadecimal; the bytes carried match it.size: its size in bytes when the source was read.carried:1when its bytes are in the file;0for an original not chosen, not found, or changed since it was read. A frozen text is always1: one missing or changed fails the save. A file saved by 1.10.0 may hold a frozen text at0; it opens, and the summary after opening names each such text and the jobs that read it (decision, #239).
kalamu_file_chunks: the bytes of each carried file, in chunks of at most 4 MiB:
file_id (its kalamu_files.id), seq (from 0) and data.
The job database’s tables hold, for the project:
projects,collections,documentsandcollection_documents: the project, its collections, documents (title, file, tags, description) and memberships.jobs,document_linksandpreferred_results: the jobs that read its documents, each with only the sources tied to this project’s documents (the dictionary’s proposal jobs whole), the links to them and the results preferred. Each job is written with the status it reached; one caught running is written as interrupted. A file saved by 1.10.0-rc1 holds every job as waiting to start: on opening, a job so marked whose pieces were recorded is given back as finished when every piece was read or failed, as interrupted otherwise.pieces,results,corrections,speaker_namesandcharges: those sources’ pieces (one held in a batch or running written as not yet read), the models’ answers they name, as stored, the researcher’s corrections and review marks, speakers’ names and what each call cost.units,snapshots,passages,drawn_regionsandregion_readings: a table of contents’ items, the frozen texts the jobs read, the passages and regions read again by a model, and the regions the researcher drew.review_samples,review_keptandreview_set_aside: the samples drawn, the items kept aside with their notes, the results set aside.dictionary_entries,dictionary_apart,dictionary_requestsanddictionary_dismissed: the dictionary’s entries, pairs kept apart, proposal requests and proposals turned down.
Every other table of the schema is there and empty: workflow runs, batches, the files marked
out of date, the search by meaning’s model and costs. No key, setting, prompt library or
derived index is in the file. Opened, every identifier is given a new one and the project
comes in beside the others; the carried originals are written into the data folder’s
originals/<project id>/, a folder for each folder they shared, each under its own name made
safe for this system (one an earlier file of its folder took, regardless of case, numbered:
draft_ (2).pdf), and the paths that named them pointed there; deleting the project removes
that folder, and a folder whose project no longer exists is removed at launch. A file saved by
an older Kalamu is brought up to date on a copy in the data folder’s project-file-scratch/,
deleted when done and emptied at launch. Nothing outside Kalamu should rely on more than the manifest and the files’
tables.