TellWorldAI World Archive
Ask中文

Home›Practice›Practice

Practice

A fact-checked AI writing pipeline

How to build an AI writing process that does not invent facts: separate gathering from writing, attach a source to every claim, ask the model to cite, and run checks before publishing. Covers citations, retrieval limits and evaluation.

Who this is for and what you will be able to do

This article is for anyone building a process where an AI model writes text that must be accurate: encyclopedia entries, reports, product documentation. After reading it you should understand why we separate gathering from writing, how Anthropic's Citations feature and OpenAI's file search attach sources to answers, what checks to run before anything is published, and where each method stops working.

What the approach is

Hallucination means a model producing statements that are not supported by anything it was given. No single technique removes it. Anthropic's guide on reducing hallucinations lists several strategies that work together. One is to give the model explicit permission to say it does not know, which the guide says can drastically reduce false information. Another is to have the model extract word-for-word quotes before it works on a long document, which the guide recommends for documents over 20k tokens.[2] The guide's "verify with citations" strategy makes each answer auditable: the model cites a quote for each claim, and if it cannot find a supporting quote for a claim, it must retract that claim.[2] The guide closes with a caveat that these techniques significantly reduce hallucinations but do not eliminate them, so critical information should always be validated, especially for high-stakes decisions.[2]

TellWorld's approach relies on structure more than on the model being careful. We separate the work into gathering and writing. Gatherers record facts with sources, and the writer may use nothing but those facts.[1] The writer may use only the recorded facts, so a claim that nobody recorded does not enter the text.

Preparation

For Anthropic's Citations feature, you need a request that supplies documents. A document content block is enabled for citations by adding "citations": {"enabled": true}. The source is given with "type": "text" and "media_type": "text/plain", and optional title and context fields can be added. The guide says to set citations.enabled=true on each document, because citations must be enabled on all or none of the documents in a request.[3] The guide states that all active models support citations. It also says only text citations are supported for now, with no image citations, and that a PDF made of scans without extractable text cannot be cited.[3]

Citations cannot be combined with structured outputs. If you enable citations on a user-provided document and also include the output_config.format parameter, or the deprecated output_format parameter, the API returns a 400 error.[3]

For OpenAI's retrieval tools, a vector store search returns up to 10 results by default. You can set up to 50 with the max_num_results parameter.[6]

Step by step

  1. Separate gathering from writing. Gatherers only write what they saw on a page they opened. They write no figures from memory, no estimates read off charts or videos, and no calculations of their own.[1] Each fact is one English sentence that ends with its source number, written as [1] in the fact file.[1]
  1. Give every source a stable identifier. The citation formatting guide says the model cannot cite material it has not been shown clearly, so each citable item should have a stable source ID such as file1 or block1, readable text, and optional metadata like a URL, timestamp or title.[4] The guide also says block-level citations are the best default for most systems.[4]
  1. Ask for a citation on every line. The official citations guide gives this prompt for extracting fields with a citation for each value:[3]
Extract these fields from the document: grass_color, sky_color.
Answer with one line per field in the form "field: value", and cite the document for each line. After the colon, write only the value, with no explanation or quotation.

The guide's recommended prompt instructions place citations at the end of a paragraph, or inline when the paragraph is long. Citations go after punctuation, must not be grouped together at the end of the response, and must not sit inside markdown bold, italics or code fences.[4]

  1. Write each fact into the fact file with a source number, and check it before writing. The pipeline runs intake.mjs, which merges volumes and fixes channels, tags and broken relations. Then check-facts.mjs runs.[1]
  1. Let a writer sub-agent turn the fact files into text, then run build.mjs. It validates the output and flags English summaries longer than 50 words, Chinese summaries longer than 100 characters, and bodies shorter than 300 English words or 600 Chinese characters.[1] Short bodies are accepted when an entry has few facts. Writers are told not to pad, not to mention any year that the fact file does not contain, and not to describe the state of the sources.[1]
  1. Import and index only after the checks pass. The last steps are atlas import and atlas embed.[1]

Our practice

Source priority is set in advance. Official announcements and documentation come first, then Epoch AI, the Stanford AI Index and Wikipedia, and then mainstream media.[1] User-editable Chinese encyclopedias, company database aggregators, Zhihu, self-media platforms and video sites are banned as sources, and the program drops any fact that cites them.[1] Entries supported only by Wikipedia go into a manual review queue instead of being published.[1]

Claims that a company makes about itself, such as being the first or the strongest, are written as what the company says, not as established fact.[1]

The last check before publication is a direct one. On 13 November 2026 the main agent opened the sources of the three most important entries and found that all the key numbers and dates matched, so none were deleted.[1]

Limits and common problems

  • A model can still make mistakes with citations present. The Anthropic guide recommends validating critical information, especially for high-stakes decisions.[2]
  • Citations cannot be used with structured outputs, as noted above.[3] The cited text does not count toward output tokens. When it is passed back in later turns, it does not count toward input tokens either.[3]
  • Custom citation markers can cause problems. The citation formatting guide warns that custom or unfamiliar formats increase the load on the model and can cause citation errors, especially at low reasoning effort on complex tasks. If you write your own prompt, specify the exact marker syntax, where citations go, when to cite and when not to, and what to do when support is missing.[4]
  • Retrieval can make things worse when it is careless. The OpenAI guide warns that too much irrelevant context drowns out the real information and causes hallucinations. Its fixes are to tune the search so it returns the right results, to reduce noise, and to give each result more information.[5]
  • The retrieval guide offers a score_threshold between 0.0 and 1.0. A higher value limits results to more relevant chunks, and rewrite_query=true enables automatic query rewriting.[6]
  • For evaluation, the guide says to combine metrics with human judgment. It lists anti-patterns including relying solely on academic metrics like perplexity or BLEU score, and vibe-based evals in which "it seems like it's working" is the strategy.[7]
  • When an LLM judges output, the guide warns about position bias and verbosity bias. It recommends pairwise comparison or pass/fail for more reliability.[7]
  • The best-of-N method runs the same prompt several times and compares the outputs, since inconsistencies across outputs could indicate hallucinations.[2]

Next steps

Read Anthropic's guide on reducing hallucinations[2] and its Citations documentation.[3] Then read OpenAI's citation formatting guide[4] and the evaluation best practices.[7] Start by adding one check to your own pipeline, and make it fail loudly.

Sources

  1. 1
  2. 2
  3. 3
    CitationsAnthropic
  4. 4
  5. 5
  6. 6
    RetrievalOpenAI
  7. 7

Cite this page: A fact-checked AI writing pipeline. TellWorld, https://www.tellworld.net/practice/practice-fact-checked-pipeline. Updated 2026-11-14

Related news

View all