# Recipe for summarising a document into a digest ## When to use it Use it last in the order of `working-by-recipe`, when documents are long enough that a search should find a description before it finds a paragraph. A digest (the house calls it a `Verdichtung`) says what a document is and what is in it, so that someone searching the house finds the volume that answers the question. It never replaces the original. Use this recipe on documents that arrive with structure (Markdown, or HTML from a web capture). For documents that arrive as raw text or from PDF and still need outlining, wait for guided outlining, which is planned and not yet available: an outline creates a new version of the document, and work done on the old version will be offered again. ## What you need first Documents with text. Nothing else. ## Fetch the context The house keeps the worklist itself: ``` digest_coverage {"limit": 200, "with_size": true} export_document {"doc_id": "", "offset": 0, "max_chars": 30000} ``` `digest_coverage` counts the documents and lists as `entries` those that are open, each with a `state`: `missing` (no digest), `stale` (a digest of an older version, with the share of changed blocks as `divergence`), `unbound` (a digest that does not say which version it read). Digests themselves are not listed. With `with_size` each entry carries its length in characters as `chars`. Read each document whole: call `export_document` again with a higher `offset` while `truncated` is true. Keep the `version_root_id` of the first page. It names the version you read, and you bind the digest to it. A document is never split. Several small ones may go into one judgment, up to about 60,000 characters together; one that is larger goes alone. Build the input so, marker and name on separate lines: ``` === D0001 === Name: Budget note, second quarter === D0002 === Name: Minutes, supplier meeting in Lindholm ``` ## Judge ``` You write digests: short, factual descriptions of the documents of this memory — notes, reports, letters, minutes, diaries, manuscripts. A digest exists so that someone searching this memory finds the volume that answers their question, and knows what is in it before opening it. The input holds one or more documents. Each begins with a line "=== D#### ===", followed by a line "Name: ..."; everything until the next "===" line belongs to that document. Return one entry per document. The "document" field is the bare marker and nothing else: "D0001", never the name, never both. Never merge two documents into one entry. Write in the language of the document. Rules that matter more than style: - Say only what the document says. Never infer, never round out, never guess a year that is not there. A memory is evidence; a digest that embellishes it is worse than none. - Name names. The vocabulary someone will later search for — people, places, events, recurring subjects — is exactly what the original often does not spell out. A chronicle of a year never says "daily routine at the practice" or "marriage crisis"; it just tells them. Name them. - Where the document is unreadable, garbled, empty or plainly broken, say that in gaps instead of inventing content. The fields: - overview 3–6 sentences: what this document is, what it covers, what it is for. - topics the recurring subjects, most important first, a handful of words each. At most 10. - period the time the document covers, as concretely as it says it ("1974", "May 2003 – February 2004", ""). Empty when it says nothing. - people at most 12 — the ones who carry this document, most prominent first, names as written. This is NOT an index: every single mention is already extracted and searchable elsewhere, so listing everyone adds nothing and buries the few who matter. Someone who appears once is not one of them. - places likewise for places, at most 10. - notable what stands out: a break in the tone, an unusual passage, a recurring form. - gaps what is missing, damaged, unclear — including your own uncertainty. ``` The prompt was written for volumes of many pages. In a document of a few paragraphs, read "appears once" as "is incidental": name those the document is about. There is no field for organizations; they belong in the overview and the topics. The sentence about mentions being extracted elsewhere holds only where `recipe-resolve-names` has run. ## The answer form ```json {"digests": [{"document": "D0001", "overview": "…", "topics": ["…"], "period": "…", "people": ["…"], "places": ["…"], "notable": "…", "gaps": "…"}]} ``` All eight fields are required; an empty string or list says "nothing". ## Check your own verdict - `document` must be one of your markers. If it begins with a marker and carries more, read it as that marker. An entry for a marker you did not send is discarded: a digest at the wrong document is worse than none. - One entry per marker. Of two for the same marker, keep the first. - A marker without an entry stays open. That is no damage; it is on the worklist again. - An answer that was cut off is discarded as a whole. - Read each digest against its document once more for the first rule of the prompt: it says only what the document says. ## Apply Write each digest as a Markdown document in this fixed form. The headings are the same in every digest of a house, in the language of the digest; a section whose field is empty is left out. ``` # Digest: Budget note, second quarter ## Overview ## What it is about ## Period ## Who appears ## Where it takes place ## What stands out ## What is missing or unclear ``` Topics, people and places are bulleted lists. Then four calls per digest: ``` create_document {"name": "Digest: Budget note, second quarter"} import_document {"doc_id": "", "markdown": ""} adopt_digest {"doc_id": "", "subject_id": "", "described_version_id": ""} assert_supports {"digest_id": "", "version_root_ids": [""]} ``` `adopt_digest` makes the document a digest of its subject and binds it to the version you read. `assert_supports` names that version as its evidence. Afterwards `digest_coverage` no longer lists the subject. When the original changes, it lists it again as `stale`. A stale entry names the existing digest as `digest.id`: import the new text into that document instead of creating a second one, then call `adopt_digest` and `assert_supports` again with the new version. ## Say who judged One note at the digest, as `working-by-recipe` shows. ## What this recipe does not do - The house does not check a digest against its document. - It covers single documents. The house software also writes dossiers about series and whole holdings from the digests of their parts; there is no recipe for that yet. - Two agents at once write two digests of one document. Ask `digest_coverage` again right before you write. - A digest is a document: `list_documents` returns it, and the other recipes must skip it, as `working-by-recipe` says. ## Origin Atlantis, `Intelligence/World/Digest/DigestModel.cs` (prompt, answer form, input, checks) and `Program.cs` (bundles, apply), commit a3f3b8e, read at `main` 966157b. **Adapted:** the prompt named a German private estate, fixed German as the language and called the digest by its German name; the headings of the written digest are German there. Rules and fields are unchanged. ## Go deeper - [working-by-recipe](working-by-recipe.md) - [documents-and-versions](documents-and-versions.md) - [finding-things](finding-things.md) - [recipe-merge-name-forms](recipe-merge-name-forms.md)