# Pull key facts into a table: prompt chain

Pull the facts you name out of a text into a table, one row for each item, copying every value as written, quoting where each came from, and marking every fact the text does not give as Not stated.

**Made for:** Anyone who has to turn a pile of text into something they can sort, compare or paste into a spreadsheet, such as a coordinator, an assistant or an analyst.

## Before you start

Have these ready:

- **The text to read** (required): Paste the text as it stands. Every value in the table will come from these words and no others.
- **The facts to pull out** (required): List them in the order you want the columns, separated by commas.
- **What each row is** (required): Name the thing the facts are about. There will be one row for each.

**How to use this chain**

1. Open a new chat in any AI assistant.
2. Copy the Step 1 prompt, replace every [PASTE HERE: ...] slot with your material, and send it.
3. Keep each answer: later steps ask you to paste it in. Run each step in the same chat or a new one; a new chat keeps steps from blurring together.
4. After a step that has a check, run the check before you move on.

## Step 1: List every item

Find each item the text is about and quote the words that introduce it, before any fact is pulled out.

Copy this prompt:

````text
You are a careful reader who finds each thing a text is about.

Your task is to list every item the text mentions, where one item is: [PASTE HERE: What each row is]

The text:
[PASTE HERE: The text to read]

Rules:
- One row for each item, in the order the text gives them. Do not merge two items into one row and do not add an item the text does not mention.
- In "Item", use the name the text gives it. In "Passage (quote)", quote the words from the text that first name it, word for word, as short as you can. Do not reword.
- Use only the text. Do not pull out any facts yet.

Return one markdown table and nothing else:
| Item | Passage (quote) |
````

**You get back:** A table with one row for each item and the passage that names it.

**Check after Step 1: Every passage is quoted word for word from the text**

Check by eye: Every quote in the Passage (quote) column appears word for word in the text to read.

If it does not pass: Run the step once more, and add what was wrong to the end of the prompt. If it still does not pass, fix it by hand and make a note of it.

## Step 2: Pull each fact for each item

For every item and every fact the reader named, copy the value as written and quote the words it came from.

Copy this prompt:

````text
You are a careful clerk who copies facts out of a text exactly as written.

Your task is to find, for each item below, each of the facts the reader named.

The items:
[PASTE HERE: the answer from Step 1 (List every item)]

The facts to pull out, in this order: [PASTE HERE: The facts to pull out]

The text:
[PASTE HERE: The text to read]

Rules:
- Write one row for each item and each fact, with the items in the order above and each item's facts in the order the reader named them.
- In "Value", copy the answer as the text writes it: the same digits, units and wording. Do not convert, round, reformat or add up anything.
- In "Quote", give the words from the text that state the value, word for word, as short as you can.
- If the text changes a fact later, such as a correction, use the latest version and quote it.
- If the text does not give the fact for that item, write exactly Not stated in "Value" and exactly None found in "Quote". Do not fill a gap from another item, do not guess, and do not use anything from outside the text.
- Do not put one item's fact in another item's row.

Return one markdown table and nothing else:
| Item | Fact | Value | Quote |
````

**You get back:** A table with one row for each item and fact, a value copied as written and the quote it came from, or Not stated.

**Check after Step 2: Every quote is word for word from the text**

Check by eye: Every quote in the Quote column appears word for word in the text to read.

If it does not pass: Run the step once more, and add what was wrong to the end of the prompt. If it still does not pass, fix it by hand and make a note of it.

## Step 3: Lay out the table

Turn the rows into one table with a row for each item and a column for each fact, without changing a value.

Copy this prompt:

````text
You are a tidy analyst who lays facts out in a table without changing them.

Your task is to lay the facts below out as one table for the reader.

The facts:
[PASTE HERE: the answer from Step 2 (Pull each fact for each item)]

The columns the reader wants, in this order: [PASTE HERE: The facts to pull out]

Rules:
- The first column is "Item". After it, add one column for each fact the reader named, in that order, headed by the fact's name with a capital letter.
- One row for each item, in the order of the facts above. Do not add a row, a column or a total, and do not number the rows.
- Copy each value from the facts above exactly. Do not change a digit, unit or word, and do not add a unit that is not there.
- Where the facts above say Not stated, write Not stated in that cell.
- After the table, write one line that starts "Not stated:" and lists each item and fact that is Not stated, or write "Not stated: none." if there are none.
- Do not add a number, name or fact that is not in the facts above.

Return markdown in this form and nothing else:
| Item | (one column for each fact) |
Not stated: (the list)
````

**You get back:** One table with a row for each item and a column for each fact, and a line listing what the text does not say.

**Check after Step 3: Every number in the table is in the text**

Check by eye: Every number in the answer also appears in the text to read.

If it does not pass: Run the step once more, and add what was wrong to the end of the prompt. If it still does not pass, fix it by hand and make a note of it.

## Final checks

Run these on the finished result.

**Final check 1: Every value is exactly as the text writes it**

Open a new chat (so the check is not swayed by the work) and paste this check prompt:

````text
You are a careful reviewer. You do not fix or rewrite the work; you only decide whether it passes one check.

The check: Every value is exactly as the text writes it
Compare each Value in the answer with the text below. Is every value written exactly as the text writes it, with no change to a digit, unit or word, is the latest version used where the text corrects itself, and does every row marked Not stated really have no answer in the text? Answer FAIL and quote each row that is wrong.

The text:
[PASTE HERE: The text to read]

The work to check (the answer from Step 2 (Pull each fact for each item)):
[PASTE HERE: the answer from Step 2 (Pull each fact for each item)]

Reply with exactly PASS or FAIL on the first line. On the second line, say in one sentence why. If it fails, name the exact item or line that fails. Do not add anything else.
````

If it does not pass: Run the step once more, and add what was wrong to the end of the prompt. If it still does not pass, fix it by hand and make a note of it.

**Final check 2: The table ends with a Not stated line**

Check by eye: The answer includes the words "Not stated:".

If it does not pass: Run the step once more, and add what was wrong to the end of the prompt. If it still does not pass, fix it by hand and make a note of it.

**Final check 3: The table matches the items and the facts**

Open a new chat (so the check is not swayed by the work) and paste this check prompt:

````text
You are a careful reviewer. You do not fix or rewrite the work; you only decide whether it passes one check.

The check: The table matches the items and the facts
Check the table in the answer against the lists below. Does it have exactly one row for each item in the item list and no other rows, one column for each fact the reader named in that order, and in every cell the same value as the facts table? Answer FAIL and quote any row, column or cell that is wrong.

The items:
[PASTE HERE: the answer from Step 1 (List every item)]

The facts the reader named: [PASTE HERE: The facts to pull out]

The facts table:
[PASTE HERE: the answer from Step 2 (Pull each fact for each item)]

The work to check (the answer from Step 3 (Lay out the table)):
[PASTE HERE: the answer from Step 3 (Lay out the table)]

Reply with exactly PASS or FAIL on the first line. On the second line, say in one sentence why. If it fails, name the exact item or line that fails. Do not add anything else.
````

If it does not pass: Run the step once more, and add what was wrong to the end of the prompt. If it still does not pass, fix it by hand and make a note of it.

**Final check 4: You check the cells against the text**

Ask yourself: Open the text and check three cells against it, starting with any date or amount. For each cell marked Not stated, decide whether to ask the person who wrote the text or leave it open. Only you know which facts the table is for.

If it does not pass: Carry on, but write down the problem so whoever uses the result knows about it.

## What you end up with

- A table with a row for each item and a column for each fact you named.
- A line listing every fact the text does not give.
- The quote behind every value, in the table from the middle step.

## Changing this chain

- The middle step keeps a long table with one row for each item and fact, and a quote beside each value. Keep it if you want to check a cell, or paste it into a spreadsheet and sort it.
- A value is copied as written, so "free" stays "free" and "from 2 pm" stays "from 2 pm". To get one format, such as numbers only, do that as a second pass after you have checked the table.
- If a text gives two versions of one fact, the template uses the latest one. To keep both, say so in the second step's rules and in its check.
- For a long text, run it one section at a time and join the tables, so every item gets a row.
- A cell marked Not stated may still be true; it only means this text does not say.

---

From Logic Lab (logiclabhq.com). Free to use and adapt, with credit.
