> ## Documentation Index
> Fetch the complete documentation index at: https://docs.galileo.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Completeness

> Measure how thoroughly your model's response covers the relevant information available in the provided context

export const DefinitionCard = ({children}) => {
  return <Card variant="secondary">
    <div style={{
    padding: '0.5rem',
    border: '5px solid var(--primary-light)',
    borderRadius: '0.5rem',
    fontSize: '1.3rem',
    lineHeight: '1.4',
    boxShadow: '0 0 10px 10px var(--primary-light)'
  }}>
        {children}
      </div>

</Card>;
};

<DefinitionCard>
  <strong>Completeness</strong> measures how thoroughly your model's response covered the relevant information available in the context provided.
</DefinitionCard>

Completeness and Context Adherence are closely related, and designed to complement one another:

* **Context Adherence** answers the question, "is the model's response consistent with the information in the context?"
* **Completeness** answers the question, "is the relevant information in the context fully reflected in the model's response?"

In other words, if Context Adherence is "precision," then Completeness is "recall."

## Understanding completeness

<Card>
  <div style={{display: 'flex', alignItems: 'center', gap: '0.5rem', marginBottom: '0.75rem'}}>
    <div style={{fontSize: '1.25rem', color: 'var(--primary-color)'}}>
      <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round">
        <path d="M12 22c5.523 0 10-4.477 10-10S17.523 2 12 2 2 6.477 2 12s4.477 10 10 10z" />

        <path d="m9 12 2 2 4-4" />
      </svg>
    </div>

    <h3 style={{margin: 0, fontSize: '1.25rem', fontWeight: '600'}}>Example Scenario</h3>
  </div>

  Consider this simple, stylized example that illustrates the distinction:

  <div style={{ marginTop: "1rem", paddingTop: "0.75rem", borderTop: "1px solid rgba(209, 213, 219, 0.33)" }}>
    <strong>User query:</strong> "Who was Galileo Galilei?"
  </div>

  <div style={{ marginTop: "0.75rem", paddingTop: "0.75rem", borderTop: "1px solid rgba(209, 213, 219, 0.33)" }}>
    <strong>Context:</strong> "Galileo Galilei was an Italian astronomer."
  </div>

  <div style={{ marginTop: "0.75rem", paddingTop: "0.75rem", borderTop: "1px solid rgba(209, 213, 219, 0.33)" }}>
    <strong>Model response:</strong> "Galileo Galilei was Italian."
  </div>

  <div style={{ marginTop: "1rem", paddingTop: "0.75rem", borderTop: "1px solid rgba(209, 213, 219, 0.33)" }}>
    <strong>Analysis:</strong> This response would receive a perfect Context Adherence score: everything the model said is supported by the context. But this is not an ideal response. The context also specified that Galileo was an astronomer,
    and the user probably wants to know that information as well. Hence, this response would receive a low Completeness score.
  </div>
</Card>

Tracking Completeness alongside Context Adherence allows you to detect cases like this one, where the model is "too reticent" and fails to mention relevant information.

## Improving low completeness

<Card>
  <div style={{display: 'flex', alignItems: 'center', gap: '0.5rem', marginBottom: '0.75rem'}}>
    <div style={{fontSize: '1.25rem', color: 'var(--primary-color)'}}>
      <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round">
        <path d="M12 20h9" />

        <path d="M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4L16.5 3.5z" />
      </svg>
    </div>

    <h3 style={{margin: 0, fontSize: '1.25rem', fontWeight: '600'}}>Recommended Fixes</h3>
  </div>

  To fix low Completeness values, we recommend:

  <div style={{ marginTop: "1rem", paddingTop: "0.75rem", borderTop: "1px solid rgba(209, 213, 219, 0.33)" }}>
    <strong>Adjust your prompt:</strong> Tell the model to include all the relevant information it can find in the provided context.
  </div>

  <div style={{ marginTop: "0.75rem", paddingTop: "0.75rem", borderTop: "1px solid rgba(209, 213, 219, 0.33)" }}>
    <strong>Refine retrieval:</strong> Ensure your retrieval system is bringing back the most relevant context chunks.
  </div>

  <div style={{ marginTop: "0.75rem", paddingTop: "0.75rem", borderTop: "1px solid rgba(209, 213, 219, 0.33)" }}>
    <strong>Balance with conciseness:</strong> While improving completeness, maintain appropriate response length for your use case.
  </div>
</Card>

## Best practices

<CardGroup cols={2}>
  <Card title="Monitor Across Content Types" icon="chart-line">
    Track completeness scores across different types of content and queries to identify patterns where information is consistently omitted.
  </Card>

  <Card title="Balance with Conciseness" icon="scale-balanced">
    Find the right balance between completeness and keeping responses concise and focused for your specific use case.
  </Card>

  <Card title="Combine with Other Metrics" icon="link">
    Use completeness alongside context adherence, correctness, and relevance metrics for a comprehensive view of response quality.
  </Card>

  <Card title="Test with Complex Queries" icon="flask">
    Evaluate completeness with complex, multi-part queries that require synthesizing information from multiple context sections.
  </Card>
</CardGroup>

<Note>
  When optimizing for completeness, be careful not to encourage your model to include irrelevant information just to achieve higher scores. The goal is to include all relevant information while maintaining focus on the user's query.
</Note>
