From 9161f23158c7b61869678d4e1593771a3ceac9c8 Mon Sep 17 00:00:00 2001 From: Bill Hlavacek Date: Thu, 3 Dec 2026 22:35:12 -0700 Subject: [PATCH 1/2] Propose Chatty recipes, a library of agent job guides ADR 0007 adds a chatty-recipes skill and a library of short recipes that tell an agent what to ask the user, which route through the suite usually works, and what to deliver. A recipe must depend on what the suite adds over an agent with web search. The library starts with build-corpus and three featured recipes: census, reference-check and for-and-against. The ADR lists the features those recipes still need. CONTRIBUTING.md explains how to contribute a recipe. Signed-off-by: Bill Hlavacek --- CONTRIBUTING.md | 23 +++++ docs/adr/0007-chatty-recipes-job-library.md | 95 +++++++++++++++++++++ docs/adr/README.md | 1 + docs/recipes/SKILL.md | 17 ++++ docs/recipes/TEMPLATE.md | 29 +++++++ docs/recipes/build-corpus.md | 36 ++++++++ docs/recipes/census.md | 42 +++++++++ docs/recipes/for-and-against.md | 42 +++++++++ docs/recipes/reference-check.md | 54 ++++++++++++ 9 files changed, 339 insertions(+) create mode 100644 docs/adr/0007-chatty-recipes-job-library.md create mode 100644 docs/recipes/SKILL.md create mode 100644 docs/recipes/TEMPLATE.md create mode 100644 docs/recipes/build-corpus.md create mode 100644 docs/recipes/census.md create mode 100644 docs/recipes/for-and-against.md create mode 100644 docs/recipes/reference-check.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 0b982ee..2722715 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -87,6 +87,29 @@ which ones in the PR. for them: you should understand the change, you should have run the tests, and you should be able to answer review questions about it. +## Contributing a recipe + +A recipe is a short guide that helps an AI agent do one kind of job with Chatty, +text-fetch and LitKit, such as finding every published model of a system. Recipes +live in [`docs/recipes/`](docs/recipes/) and are described in +[ADR 0007](docs/adr/0007-chatty-recipes-job-library.md). To add one: + +- **Copy [`docs/recipes/TEMPLATE.md`](docs/recipes/TEMPLATE.md)** to a new file + named after the job, and add a line for it to the table in + [`docs/recipes/SKILL.md`](docs/recipes/SKILL.md). +- **Show that the job needs the suite.** Name the capabilities it depends on. + A job that an agent can do as well without a corpus, such as summarizing one + paper, does not need a recipe. +- **Keep it short and general.** A recipe is guidance, not a script. Put a worked + example in `docs/demos/`, not in the recipe. +- **Test it.** Have an agent follow the recipe on a small public corpus, and say + in the PR what you asked and what it delivered. +- **Use only public documents** in examples. Never include confidential, + export-controlled or personal material. + +Recipe pull requests follow the same rules as code: sign off your commits and add +yourself to `CONTRIBUTORS.md`. + ## Credit Everyone whose code is merged is listed in [`CONTRIBUTORS.md`](CONTRIBUTORS.md), diff --git a/docs/adr/0007-chatty-recipes-job-library.md b/docs/adr/0007-chatty-recipes-job-library.md new file mode 100644 index 0000000..a15bf26 --- /dev/null +++ b/docs/adr/0007-chatty-recipes-job-library.md @@ -0,0 +1,95 @@ +# ADR 0007: Chatty Recipes, a Library of Agent Job Guides + +- **Status:** Proposed +- **Date:** 2026-12-03 +- **Affected Repositories:** `lanl/chatty` (`docs/recipes/`, `src/chatty/cli.py`, `pyproject.toml`, `CONTRIBUTING.md`), `lanl/litkit` (retrieval queries), `lanl/text-fetch` (reference resolution) + +## Context + +ADR 0006 made the suite usable by AI coding agents: JSON commands, named corpora, and the `chatty-corpus` skill, which teaches an agent *how* to call the tools. It does not tell an agent *what to do* for a user who arrives with a goal such as "I'm reviewing this grant" or "find every model of X". + +Users who are not developers do not know what to tell a tool. The agent has to ask the right questions, choose a route through the suite, and know when the job is done. Writing that guidance once, per kind of job, makes common work easy and repeatable. + +Many tasks people bring to an agent do not need this suite. A plain agent can summarize one paper or draft prose. The library must show what the suite adds: the work an agent cannot do with web search alone. + +## Decision + +### 1. One skill, `chatty-recipes`, plus a library of recipes + +- A **recipe** is a short guide for one kind of job. The library lives in `docs/recipes/`, one Markdown file per recipe, with `TEMPLATE.md` for new ones. +- `docs/recipes/SKILL.md` defines the `chatty-recipes` skill. It is a menu: one line per recipe saying when to use it. The agent opens a recipe only when the user's goal matches it, so the library can grow without crowding the agent's context. +- Recipes refer to the `chatty-corpus` skill for command details instead of repeating them. + +### 2. Recipes are guidelines, not scripts + +A recipe tells the agent what to ask, which route usually works, what to deliver, and what goes wrong. The agent adapts it to the user. Every recipe has the same short sections: + +| Section | Content | +|---|---| +| Job | One sentence: what the user wants | +| Ask the user | The few things the agent needs before starting | +| Route | The usual path through the suite | +| Deliverable | What the user gets | +| Done when | Checks the agent can run itself | +| Pitfalls | What usually goes wrong | +| Needs | Suite features the recipe relies on that are not yet released, if any | + +Demos are not part of a recipe. A recipe stays generic; a worked demonstration lives in `docs/demos/`. + +### 3. A recipe must need the suite + +A recipe is admitted when its job depends on at least one of these capabilities: + +1. **Completeness:** exact search over every passage of a corpus, up to all of PMC OA, so the agent can count and can show that something is absent. +2. **Full text:** sections, tables and equations, not only abstracts. +3. **Citation graph:** corpora grown along references and citations, and passages that record which references they cite. +4. **Checkable citations:** a handle for every passage (`pmcid:PMC…#chunk:N`, `file:…#p:N`). +5. **Private and offline use:** local indexing and retrieval with no LLM endpoint, OCR, air-gapped containers, and OSTI technical reports. +6. **Lasting, shared corpora:** named corpora that persist, can be attached read-only by a group, and can be rebuilt or updated from saved plans. + +A few everyday recipes that use only some of these are welcome, to show the range of documents the suite handles, including manuals, policies and procedures. + +### 4. Three featured recipes + +The library starts with three recipes, each with a demonstration. Others can be added later under the rules above. + +They rest on a foundation recipe, **`build-corpus`**, which builds a topic corpus on demand: it asks for the topic, seeds, date range, citation depth and size cap, previews the search before fetching, expands along citations and indexes a named corpus. The featured recipes use it when no suitable corpus exists, and two of their demonstrations start by building one. + +- **`census`** finds every instance of something in a corpus, such as every model of a system or every reported value of a quantity, and tabulates it with a handle in every cell. Demonstration: every within-host viral dynamics model in PMC OA, sorted by virus and formalism, together with every reported estimate of the virion clearance rate constant *c*. +- **`reference-check`** checks a manuscript's reference list before submission: every reference exists, its bibliographic details are correct and verified against authoritative records, and it is relevant to the sentence that cites it. Fabricated or garbled references in a submitted paper or preprint now carry real consequences for authors. Demonstration: a draft preprint on a network simulator, checked against a corpus built on demand from its references and from papers on SBML, BioNetGen, PEtab and other simulators. +- **`for-and-against`** takes a claim and returns the evidence for it and against it as the literature stands, with a handle for each piece of evidence and the conditions under which it was obtained. Demonstration: the claim that follicular dendritic cells, or latently infected cells, are the key viral reservoir preventing a cure for HIV. + +### 5. Recipes ship with Chatty + +The recipes are installed with Chatty, like `chatty-corpus`, so an agent on an air-gapped machine has them. `chatty skill` gains a way to write the `chatty-recipes` skill folder (its `SKILL.md` and recipe files) to a path the user chooses. + +### 6. Outside contributors can add recipes + +`CONTRIBUTING.md` explains how to propose a recipe: copy the template, show that the job needs the suite, test the intake with an agent on a small public corpus, and sign off commits. + +## Feature gaps found by the recipes + +| Gap | Repository | Recipe and reason | +|---|---|---| +| Batch screening: run a model from an OpenAI-compatible endpoint, such as an open-weight model on a GPU node, over a list of candidate papers with written criteria | `chatty` | `census`: screening tens of thousands of abstracts is the costly step. A batch command keeps it out of the agent's own loop and off a commercial model. Decided in its own ADR. | +| Export every match from exact and lexical search, not a capped top list | `chatty`, `litkit` | `census`: a census needs the full candidate list. Current commands return at most `--limit` results with no paging. | +| A "papers that cite X" query over the indexed bibliographies, and a query for every passage that cites a given paper | `litkit`, `chatty` | `census`: finds papers that cite a field's foundational work without using its keywords. `for-and-against`: shows how later papers received a key result. | +| Show each passage's citations in retrieval output, resolved to the cited paper's identifiers and to its handle when that paper is in the corpus | `litkit`, `chatty` | `for-and-against`: tells a passage reporting its own result from one repeating another paper's, and lets the agent follow it. The index stores the markers, but no retrieval command returns them yet. | +| A LitKit release that includes the bibliography and citation-marker index | `litkit` | All three recipes: the index was merged after LitKit 0.4.0. | +| A PMC OA index | infrastructure | `census`: the demonstration runs over all of PMC OA, built with LitKit's multi-node SLURM build (ADR 0005). | +| Resolve a list of references against authoritative records (Crossref, PubMed, Europe PMC), reporting field-by-field differences and retraction status | `text-fetch` | `reference-check`: verifying bibliographic details is the core of the recipe. | +| A query for papers that share references with a given list | `litkit`, `chatty` | `reference-check`: finds closely related papers the manuscript does not cite. | + +## Consequences + +### Positive + +- Users get guided through common jobs without knowing the suite's commands. +- Each recipe states what the suite adds, which keeps the library focused and makes the case for the suite in talks and documentation. +- Recipes expose missing features early, as the `census` recipe did. + +### Trade-offs and follow-up work + +- Recipes can drift from the CLI. Each recipe's commands should be checked in CI the way the `chatty-corpus` examples are. +- Recipe quality depends on review. The template and contribution rules keep recipes short and comparable. +- The gaps above become issues under lanl/chatty#65. diff --git a/docs/adr/README.md b/docs/adr/README.md index 4c12fb2..2735934 100644 --- a/docs/adr/README.md +++ b/docs/adr/README.md @@ -12,3 +12,4 @@ Each ADR lists the affected repositories (`lanl/chatty`, `lanl/text-fetch`, `lan | [0004](0004-single-command-non-developer-indexing-workflow.md) | Single-Command Corpus Indexing and Diagnostics for Non-Developers | Proposed | `chatty` | | [0005](0005-hpc-scalability-distributed-ingestion-and-containers.md) | HPC Scalability, Distributed PDF Ingestion, and Air-Gapped Containers | Proposed | `litkit`, `text-fetch`, `chatty` | | [0006](0006-agent-readiness-named-corpora-cli-and-executors.md) | AI-Agent Readiness, Named Corpora, Structured CLI, and Execution Backends | Proposed | `chatty`, `litkit`, `text-fetch` | +| [0007](0007-chatty-recipes-job-library.md) | Chatty Recipes, a Library of Agent Job Guides | Proposed | `chatty`, `litkit`, `text-fetch` | diff --git a/docs/recipes/SKILL.md b/docs/recipes/SKILL.md new file mode 100644 index 0000000..03fc564 --- /dev/null +++ b/docs/recipes/SKILL.md @@ -0,0 +1,17 @@ +--- +name: chatty-recipes +description: Guides for common jobs done with Chatty, text-fetch and LitKit, such as finding every model or measurement of something in the literature. Use when a user describes a goal rather than a command. Each recipe says what to ask the user, which route usually works, and what to deliver. +--- + +# Chatty recipes + +A recipe is a guide for one kind of job, not a script. Read the matching recipe, ask the user what it lists, then adapt the route to their goal. For command details, use the `chatty-corpus` skill (`chatty skill`). + +| Recipe | Use when the user wants to… | +|---|---| +| [build-corpus](build-corpus.md) | build a topic corpus on demand. Other recipes use it when no suitable corpus exists | +| [census](census.md) | find every instance of something in the literature (every model of a system, every reported value of a quantity) and tabulate it | +| [reference-check](reference-check.md) | check a manuscript's references before submission: they exist, their details are correct, and they support the sentences that cite them | +| [for-and-against](for-and-against.md) | weigh a claim: gather the evidence for it and against it, as the literature stands | + +If no recipe matches, work from the `chatty-corpus` skill directly. diff --git a/docs/recipes/TEMPLATE.md b/docs/recipes/TEMPLATE.md new file mode 100644 index 0000000..d51ca64 --- /dev/null +++ b/docs/recipes/TEMPLATE.md @@ -0,0 +1,29 @@ +# Recipe name + +**Job:** one sentence saying what the user wants. + +**Needs the suite because:** which of its capabilities the job depends on (completeness, full text, citation graph, checkable citations, private and offline use, lasting shared corpora). See ADR 0007. + +## Ask the user + +- The few things you need before starting. Mark anything optional. + +## Route + +1. The usual path through the suite. Guidance, not a script. + +## Deliverable + +What the user gets. + +## Done when + +- Checks you can run yourself. + +## Pitfalls + +- What usually goes wrong. + +## Needs + +Suite features this recipe relies on that are not yet released. Delete this section when there are none. diff --git a/docs/recipes/build-corpus.md b/docs/recipes/build-corpus.md new file mode 100644 index 0000000..3d58698 --- /dev/null +++ b/docs/recipes/build-corpus.md @@ -0,0 +1,36 @@ +# Build a corpus + +**Job:** build a topic corpus on demand, for questions or for another recipe. + +**Needs the suite because:** it requires searching literature sources with previews and caps, growing the corpus along citations, indexing locally, and keeping a named corpus that can be rebuilt or updated later. + +## Ask the user + +- The topic, in a sentence. +- Seed papers, if any. +- Date range. +- How far to follow citations: references, citing papers, or both. +- Size cap. +- Optional: favor reviews; authors to include; sources beyond Europe PMC (arXiv, bioRxiv, OSTI, local PDFs). + +## Route + +1. **Preview** each search with `--dry-run --json`. Report the matches, a sample of titles, and what the caps cut. Agree with the user before fetching. +2. **Fetch** with the agreed caps. +3. **Expand** along citations from the saved plan (`--from-plan`). +4. **Index** into a named corpus. + +## Deliverable + +A named corpus, and a short record of its sources, queries, caps and counts, so it can be rebuilt or updated later. + +## Done when + +- The corpus indexes cleanly. +- A few test questions return relevant passages. + +## Pitfalls + +- Broad queries that grow out of control after citation expansion. +- Author searches that pick up other people with the same name. +- Papers without open full text, which arrive as abstracts or not at all. diff --git a/docs/recipes/census.md b/docs/recipes/census.md new file mode 100644 index 0000000..0ef0239 --- /dev/null +++ b/docs/recipes/census.md @@ -0,0 +1,42 @@ +# Census + +**Job:** find every instance of something in the literature, such as every model of a system or every reported value of a quantity, and tabulate it. + +**Needs the suite because:** it requires completeness (exact search over every passage), full text and tables, the citation graph, and a checkable citation for every entry. + +## Ask the user + +- What to find, and where the scope ends. +- How to categorize the results. +- What to record for each entry. +- Which corpus: an existing one (such as a PMC OA index) or a new topic corpus. +- Optional: a known list (a review's table, papers the user knows are in scope) to measure recall. + +## Route + +1. **Gather candidates.** For a new corpus, follow [build-corpus](build-corpus.md), expanding along references. Then search with `--mode exact` and several phrasings, including notation and synonyms. Do not rely on the default hybrid mode: it searches only a shortlist of papers. +2. **Screen.** Sort candidates into real instances and papers that only mention one, first by title and abstract, then by full text for the survivors. +3. **Tabulate.** Fill each row from the paper's Methods, Results or tables. Give each cell a handle. Record whether a value was measured or estimated in the paper, or taken from another paper. +4. **Check recall** against the known list, if there is one. + +## Deliverable + +A table with a handle in every cell, sorted into the user's categories, and a short report: the corpus and search terms used, recall, exclusions with reasons, and blind spots. + +## Done when + +- Every row has a handle showing that the paper contains the instance. +- Recall is reported, or the report says why it could not be measured. + +## Pitfalls + +- Look-alike hits: the same word or symbol meaning something else. +- Duplicates: one model or value reported under different names, or repeated by later papers. +- Values copied from another paper counted as new ones. +- What the corpus cannot see: papers outside it, supplements, figures. + +## Needs + +- Batch screening with a model from an OpenAI-compatible endpoint (ADR 0007). +- Export of every match from exact search, not only the top `--limit`. +- A "papers that cite X" query, and a LitKit release with the bibliography index. diff --git a/docs/recipes/for-and-against.md b/docs/recipes/for-and-against.md new file mode 100644 index 0000000..99d81f7 --- /dev/null +++ b/docs/recipes/for-and-against.md @@ -0,0 +1,42 @@ +# For and against + +**Job:** the user gives a claim; return the evidence for it and against it, as the literature stands. + +**Needs the suite because:** it requires full text (Results and Methods, not abstracts), searching a whole corpus rather than the first few web results, the citation graph (how later papers received a result), and a checkable citation for every piece of evidence. + +## Ask the user + +- The claim, in one sentence. +- Scope: which organisms, systems or conditions matter. +- Which corpus: an existing one, or a topic corpus built now (see [build-corpus](build-corpus.md)). +- Optional: key papers the user already knows. + +## Route + +1. **Search** the corpus for experiments that test the claim, using exact and hybrid search over Results and Methods, with several phrasings. Search explicitly for failures, null results and "in contrast" passages, not only for support. +2. **Follow reception:** if key papers are known, read every passage in the corpus that cites them, to see how later work confirmed, qualified or disputed them. +3. **Sort** each piece of evidence into supports, contradicts or qualifies, and record its method and conditions. + +## Deliverable + +- **The claim.** +- **Evidence for:** each piece with a handle, method and conditions. +- **Evidence against:** the same. +- **Verdict:** a short paragraph on where the evidence agrees, where it conflicts, and whether different conditions explain the conflicts. + +## Done when + +- Every piece of evidence has a handle. +- The report names the corpus and search terms, so the user knows what was not searched. + +## Pitfalls + +- Counting one result many times because many papers repeat it. +- Treating a mention as evidence: "X is thought to…" is not an experiment. +- A one-sided search that finds only support. +- A corpus too narrow to contain the counter-evidence. + +## Needs + +- Retrieval output that shows which references each passage cites. +- A query for every passage in the corpus that cites a given paper, and a LitKit release with the citation index. diff --git a/docs/recipes/reference-check.md b/docs/recipes/reference-check.md new file mode 100644 index 0000000..c1875d7 --- /dev/null +++ b/docs/recipes/reference-check.md @@ -0,0 +1,54 @@ +# Reference check + +**Job:** before submission, verify every reference in a manuscript: it exists, its bibliographic details are correct, and it is relevant to the sentence that cites it. + +**Needs the suite because:** it requires the full text of cited papers, a checkable citation for every relevance verdict, the citation graph (for suggestions), and local processing for unpublished manuscripts. + +## Ask the user + +- The manuscript (PDF, LaTeX or Word), and its `.bib` file if there is one. +- The citation style. +- Whether the manuscript may be sent to an external LLM endpoint, or must stay local. +- Optional: whether to suggest references. + +## Route + +1. **Extract** the references and the sentences that cite each one. +2. **Verify** each reference against authoritative records (Crossref, PubMed, Europe PMC). Compare every field: authors, title, year, journal, volume, pages, DOI. Check retraction status. +3. **Fetch** the open-access full text of the cited papers into a corpus. For suggestions, add a topic corpus on the manuscript's subject (see [build-corpus](build-corpus.md)). +4. **Check relevance:** for each citing sentence, find the passage in the cited paper that supports it. +5. **Suggest** (optional): + - **Replacement:** a cited paper does not support its sentence, and another paper in the corpus does. + - **Citation needed:** a sentence makes a factual claim without a citation, and a paper in the corpus supports it. + - **Possibly missed:** a paper shares many references with the manuscript but is not cited. It is often closely related work a reviewer will ask about. + +## Deliverable + +One row per reference: + +- **Status:** verified, corrected (with each wrong field shown), or not found. +- **Relevance:** supported (with a handle), not supported, or abstract only when the full text is not open access. + +Suggestions, if requested, follow in a separate section, each with a handle and its own verification status. + +## Done when + +- Every reference marked verified cites an authoritative record ID. +- Every relevance verdict has a handle or a stated reason why there is none. +- Every suggested reference has passed the same verification as the author's references. + +## Pitfalls + +- Legitimate variants in bibliographic details: online-first year and issue year, article numbers instead of pages, abbreviated and full journal names, name spellings and initials. Flag a difference as an error only when no authoritative record supports the author's version. +- One reference cited in several places for different reasons. Judge each citing sentence on its own, and accept every legitimate purpose: support for a claim, a method or software used, a data source, background or a review, an example ("e.g."), a contrasting view ("in contrast to"), or credit for an idea. A group citation ("[3–7]") can support a sentence together, without each paper supporting all of it. +- Preprint and published versions of the same paper. +- Books, software and datasets without DOIs. +- Different papers with the same title. +- Treating "not found" as fabricated. The reference may just be obscure; flag it for the author. +- Suggesting a reference from memory instead of from the corpus. Never do this: it is how fabricated references get into papers. +- Mixing suggestions into the check. Keep the verification result separate so the author can act on it alone. + +## Needs + +- A text-fetch command that resolves a list of references against authoritative records and reports field-by-field differences and retraction status. +- A LitKit query for papers that share references with a given list, and a LitKit release with the bibliography index. From 5ccfb9a959686907e788ba244e83e5a807990970 Mon Sep 17 00:00:00 2001 From: Bill Hlavacek Date: Thu, 3 Dec 2026 22:41:09 -0700 Subject: [PATCH 2/2] Renumber the recipes ADR and correct it against open work ADR numbers 0007 and 0008 are taken by open pull requests, so the recipes ADR becomes 0009. The gap table now records which gaps open pull requests already address (#108, #113). build-corpus previews a citation expansion and then fetches its saved plan, as text-fetch requires. Smaller fixes: the batch-screening reference, the recipe section table, the container claim, the missing demos folder and the contributor-credit wording. Signed-off-by: Bill Hlavacek --- CONTRIBUTING.md | 10 +++--- ....md => 0009-chatty-recipes-job-library.md} | 34 +++++++++++-------- docs/adr/README.md | 2 +- docs/recipes/TEMPLATE.md | 2 +- docs/recipes/build-corpus.md | 6 ++-- docs/recipes/census.md | 2 +- 6 files changed, 30 insertions(+), 26 deletions(-) rename docs/adr/{0007-chatty-recipes-job-library.md => 0009-chatty-recipes-job-library.md} (76%) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 2722715..908b7d6 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -92,7 +92,7 @@ which ones in the PR. A recipe is a short guide that helps an AI agent do one kind of job with Chatty, text-fetch and LitKit, such as finding every published model of a system. Recipes live in [`docs/recipes/`](docs/recipes/) and are described in -[ADR 0007](docs/adr/0007-chatty-recipes-job-library.md). To add one: +[ADR 0009](docs/adr/0009-chatty-recipes-job-library.md). To add one: - **Copy [`docs/recipes/TEMPLATE.md`](docs/recipes/TEMPLATE.md)** to a new file named after the job, and add a line for it to the table in @@ -100,15 +100,15 @@ live in [`docs/recipes/`](docs/recipes/) and are described in - **Show that the job needs the suite.** Name the capabilities it depends on. A job that an agent can do as well without a corpus, such as summarizing one paper, does not need a recipe. -- **Keep it short and general.** A recipe is guidance, not a script. Put a worked - example in `docs/demos/`, not in the recipe. +- **Keep it short and general.** A recipe is guidance, not a script. Keep worked + examples out of the recipe; they belong with the demonstrations. - **Test it.** Have an agent follow the recipe on a small public corpus, and say in the PR what you asked and what it delivered. - **Use only public documents** in examples. Never include confidential, export-controlled or personal material. -Recipe pull requests follow the same rules as code: sign off your commits and add -yourself to `CONTRIBUTORS.md`. +Recipe pull requests follow the same rules as code: sign off your commits, and +see [Credit](#credit) for how contributors are listed. ## Credit diff --git a/docs/adr/0007-chatty-recipes-job-library.md b/docs/adr/0009-chatty-recipes-job-library.md similarity index 76% rename from docs/adr/0007-chatty-recipes-job-library.md rename to docs/adr/0009-chatty-recipes-job-library.md index a15bf26..3dcbc72 100644 --- a/docs/adr/0007-chatty-recipes-job-library.md +++ b/docs/adr/0009-chatty-recipes-job-library.md @@ -1,4 +1,4 @@ -# ADR 0007: Chatty Recipes, a Library of Agent Job Guides +# ADR 0009: Chatty Recipes, a Library of Agent Job Guides - **Status:** Proposed - **Date:** 2026-12-03 @@ -27,6 +27,7 @@ A recipe tells the agent what to ask, which route usually works, what to deliver | Section | Content | |---|---| | Job | One sentence: what the user wants | +| Needs the suite because | The suite capabilities the job depends on (section 3) | | Ask the user | The few things the agent needs before starting | | Route | The usual path through the suite | | Deliverable | What the user gets | @@ -34,7 +35,7 @@ A recipe tells the agent what to ask, which route usually works, what to deliver | Pitfalls | What usually goes wrong | | Needs | Suite features the recipe relies on that are not yet released, if any | -Demos are not part of a recipe. A recipe stays generic; a worked demonstration lives in `docs/demos/`. +Demos are not part of a recipe. A recipe stays generic; a worked demonstration lives in `docs/demos/`, which is created with the first demonstration. ### 3. A recipe must need the suite @@ -44,14 +45,14 @@ A recipe is admitted when its job depends on at least one of these capabilities: 2. **Full text:** sections, tables and equations, not only abstracts. 3. **Citation graph:** corpora grown along references and citations, and passages that record which references they cite. 4. **Checkable citations:** a handle for every passage (`pmcid:PMC…#chunk:N`, `file:…#p:N`). -5. **Private and offline use:** local indexing and retrieval with no LLM endpoint, OCR, air-gapped containers, and OSTI technical reports. +5. **Private and offline use:** local indexing and retrieval with no LLM endpoint, OCR, offline operation on air-gapped systems (LitKit's Charliecloud container today; a suite container is proposed in ADR 0005), and OSTI technical reports. 6. **Lasting, shared corpora:** named corpora that persist, can be attached read-only by a group, and can be rebuilt or updated from saved plans. A few everyday recipes that use only some of these are welcome, to show the range of documents the suite handles, including manuals, policies and procedures. ### 4. Three featured recipes -The library starts with three recipes, each with a demonstration. Others can be added later under the rules above. +The library starts with three recipes, each with a planned demonstration. Others can be added later under the rules above. They rest on a foundation recipe, **`build-corpus`**, which builds a topic corpus on demand: it asks for the topic, seeds, date range, citation depth and size cap, previews the search before fetching, expands along citations and indexes a named corpus. The featured recipes use it when no suitable corpus exists, and two of their demonstrations start by building one. @@ -69,16 +70,19 @@ The recipes are installed with Chatty, like `chatty-corpus`, so an agent on an a ## Feature gaps found by the recipes -| Gap | Repository | Recipe and reason | -|---|---|---| -| Batch screening: run a model from an OpenAI-compatible endpoint, such as an open-weight model on a GPU node, over a list of candidate papers with written criteria | `chatty` | `census`: screening tens of thousands of abstracts is the costly step. A batch command keeps it out of the agent's own loop and off a commercial model. Decided in its own ADR. | -| Export every match from exact and lexical search, not a capped top list | `chatty`, `litkit` | `census`: a census needs the full candidate list. Current commands return at most `--limit` results with no paging. | -| A "papers that cite X" query over the indexed bibliographies, and a query for every passage that cites a given paper | `litkit`, `chatty` | `census`: finds papers that cite a field's foundational work without using its keywords. `for-and-against`: shows how later papers received a key result. | -| Show each passage's citations in retrieval output, resolved to the cited paper's identifiers and to its handle when that paper is in the corpus | `litkit`, `chatty` | `for-and-against`: tells a passage reporting its own result from one repeating another paper's, and lets the agent follow it. The index stores the markers, but no retrieval command returns them yet. | -| A LitKit release that includes the bibliography and citation-marker index | `litkit` | All three recipes: the index was merged after LitKit 0.4.0. | -| A PMC OA index | infrastructure | `census`: the demonstration runs over all of PMC OA, built with LitKit's multi-node SLURM build (ADR 0005). | -| Resolve a list of references against authoritative records (Crossref, PubMed, Europe PMC), reporting field-by-field differences and retraction status | `text-fetch` | `reference-check`: verifying bibliographic details is the core of the recipe. | -| A query for papers that share references with a given list | `litkit`, `chatty` | `reference-check`: finds closely related papers the manuscript does not cite. | +Several of these are already in open pull requests. Recipes name only commands available on `main`, and are updated as the pull requests merge. + +| Gap | Repository | Recipe and reason | Status | +|---|---|---|---| +| Batch screening: run a model from an OpenAI-compatible endpoint, such as an open-weight model on a GPU node, over a list of candidate papers with written criteria | `chatty` | `census`: screening tens of thousands of abstracts is the costly step. A batch command keeps it out of the agent's own loop and off a commercial model. | Open; to be decided in its own ADR | +| Export every match from exact and lexical search, not a capped top list | `chatty`, `litkit` | `census`: a census needs the full candidate list. Current commands return at most `--limit` results with no paging. | Open | +| Find the papers that cite a given paper, and every passage that cites it | `chatty`, `litkit` | `census`: finds papers that cite a field's foundational work without using its keywords. `for-and-against`: shows how later papers received a key result. | In progress: `chatty cited-by` in #113 | +| Show each passage's citations, resolved to the cited paper's identifiers and to its handle when that paper is in the corpus | `chatty`, `litkit` | `for-and-against`: tells a passage reporting its own result from one repeating another paper's, and lets the agent follow it. | Partly in progress: `chatty refs` for a passage in #113; `retrieve` output does not include citations | +| Find papers that share many references with a given list | `chatty`, `litkit` | `reference-check`: finds closely related papers the manuscript does not cite. | Partly in progress: computable from `chatty corpus graph` in #113 | +| Resolve a list of references against authoritative records (Crossref, PubMed, Europe PMC), reporting field-by-field differences and retraction status | `text-fetch` | `reference-check`: verifying bibliographic details is the core of the recipe. | Open | +| Build a topic corpus with one Chatty command | `chatty`, `text-fetch` | `build-corpus`: one budget across sources and citation expansion, with a preview. | In progress: `chatty corpus create --topic` in #108 | +| A LitKit release that includes the bibliography and citation-marker index | `litkit` | All three recipes: the index was merged after LitKit 0.4.0. | Open | +| A PMC OA index | infrastructure | `census`: the demonstration runs over all of PMC OA, built with LitKit's multi-node SLURM build (ADR 0005). | Open | ## Consequences @@ -92,4 +96,4 @@ The recipes are installed with Chatty, like `chatty-corpus`, so an agent on an a - Recipes can drift from the CLI. Each recipe's commands should be checked in CI the way the `chatty-corpus` examples are. - Recipe quality depends on review. The template and contribution rules keep recipes short and comparable. -- The gaps above become issues under lanl/chatty#65. +- Gaps marked open become issues under lanl/chatty#65; the others are tracked by their pull requests. diff --git a/docs/adr/README.md b/docs/adr/README.md index 2735934..35f98b3 100644 --- a/docs/adr/README.md +++ b/docs/adr/README.md @@ -12,4 +12,4 @@ Each ADR lists the affected repositories (`lanl/chatty`, `lanl/text-fetch`, `lan | [0004](0004-single-command-non-developer-indexing-workflow.md) | Single-Command Corpus Indexing and Diagnostics for Non-Developers | Proposed | `chatty` | | [0005](0005-hpc-scalability-distributed-ingestion-and-containers.md) | HPC Scalability, Distributed PDF Ingestion, and Air-Gapped Containers | Proposed | `litkit`, `text-fetch`, `chatty` | | [0006](0006-agent-readiness-named-corpora-cli-and-executors.md) | AI-Agent Readiness, Named Corpora, Structured CLI, and Execution Backends | Proposed | `chatty`, `litkit`, `text-fetch` | -| [0007](0007-chatty-recipes-job-library.md) | Chatty Recipes, a Library of Agent Job Guides | Proposed | `chatty`, `litkit`, `text-fetch` | +| [0009](0009-chatty-recipes-job-library.md) | Chatty Recipes, a Library of Agent Job Guides | Proposed | `chatty`, `litkit`, `text-fetch` | diff --git a/docs/recipes/TEMPLATE.md b/docs/recipes/TEMPLATE.md index d51ca64..bc57515 100644 --- a/docs/recipes/TEMPLATE.md +++ b/docs/recipes/TEMPLATE.md @@ -2,7 +2,7 @@ **Job:** one sentence saying what the user wants. -**Needs the suite because:** which of its capabilities the job depends on (completeness, full text, citation graph, checkable citations, private and offline use, lasting shared corpora). See ADR 0007. +**Needs the suite because:** which of its capabilities the job depends on (completeness, full text, citation graph, checkable citations, private and offline use, lasting shared corpora). See ADR 0009. ## Ask the user diff --git a/docs/recipes/build-corpus.md b/docs/recipes/build-corpus.md index 3d58698..d8f3a6d 100644 --- a/docs/recipes/build-corpus.md +++ b/docs/recipes/build-corpus.md @@ -15,9 +15,9 @@ ## Route -1. **Preview** each search with `--dry-run --json`. Report the matches, a sample of titles, and what the caps cut. Agree with the user before fetching. -2. **Fetch** with the agreed caps. -3. **Expand** along citations from the saved plan (`--from-plan`). +1. **Preview** each search with `--dry-run --json`, including the citation expansion options (`--expand`, `--expand-references`, `--expand-citations`) and `--max-expansion`. Expansion works on Europe PMC results only. Report the matches, a sample of titles, and what the caps cut. A preview with expansion saves its plan. +2. **Agree** the caps and expansion with the user before fetching. +3. **Fetch** exactly what was previewed: pass the saved plan to `--from-plan` with `--yes --json`. A search without expansion is fetched by repeating it without `--dry-run`, with `--yes --json`. 4. **Index** into a named corpus. ## Deliverable diff --git a/docs/recipes/census.md b/docs/recipes/census.md index 0ef0239..7e00639 100644 --- a/docs/recipes/census.md +++ b/docs/recipes/census.md @@ -37,6 +37,6 @@ A table with a handle in every cell, sorted into the user's categories, and a sh ## Needs -- Batch screening with a model from an OpenAI-compatible endpoint (ADR 0007). +- Batch screening with a model from an OpenAI-compatible endpoint (a future ADR). - Export of every match from exact search, not only the top `--limit`. - A "papers that cite X" query, and a LitKit release with the bibliography index.