liveBook · Manning

Consistency

As explained in Building Reliable AI Systems

The degree to which a language model produces stable and coherent outputs across responses.

Consistency means producing predictable behavior across varied inputs and repeated interactions. In production, prompts act as quality contracts: they specify expected behavior and reduce ambiguity. Predictability supports reliability, but does not by itself ensure answers are correct or current. section 10.5.2 section 3.3.3

Choose the mechanism according to what must stay consistent:

  • Use explicit prompts to specify expected behavior and escalation paths when a request exceeds the model’s capabilities. section 10.5.2
  • Use RAG when answers should draw on one shared, updateable knowledge base; different phrasings can then draw on the same source. section 3.3.3
  • Consider fine-tuning when detailed prompts fail to maintain a required style or format, or when specialized domain knowledge is needed. section 5.1.1
  • For complex requests, specialized agents coordinated by an orchestrator can prevent one model from juggling unrelated responsibilities and producing inconsistent responses. section 8.0

A changing return policy

A support system can use RAG to answer differently worded questions from the same policy source. When the documents change, its answers can change too; consistency means sharing a source of truth, not freezing outdated answers. section 3.3.3

A required citation format

For a legal assistant that must use Bluebook citations, fine-tuning on correct examples is presented as a way to maintain the format in long conversations and respond cautiously when a case cannot be found. section 5.1.1

PROMPT_VERSIONS = {                                        #1
    "customer_support_v1.0": "You are a helpful customer support agent...",
    "customer_support_v1.1": "You are a helpful customer support agent.
        Always be empathetic...",
    "customer_support_v2.0": "You are a customer support agent for AcmeSoft..."
}

def get_prompt(version="latest"):                          #2
    if version == "latest":
        version = max(PROMPT_VERSIONS.keys())
    return PROMPT_VERSIONS[version]

Compare versioned customer-support prompts and see how a prompt can be retrieved by version. section 10.5.2

How Building Reliable AI Systems covers it

How deep it goes
Compares prompt contracts, shared-source RAG, fine-tuning, and multi-agent coordination as approaches to inconsistent outputs.
Examples
Uses a return-policy knowledge base and a legal assistant requiring Bluebook citations as concrete cases.
What you can do after
Apply prompt contracts, RAG, or fine-tuning according to whether the need is predictable behavior, fresh facts, or stable formats.
How it connects
Connects consistency to prompt engineering, retrieval-augmented generation, fine-tuning, and multi-agent systems.

Also explained in

Compare how 20 books explain consistency →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Building Reliable AI Systems. The section links point to the parts of the book it draws on.