Skip to content
Guide
Extract
Guides

Metadata Extensions

Advanced extraction features including citations and confidence scores for enhanced data extraction workflows.

LlamaExtract offers several advanced features that provide additional metadata and insights alongside your extracted data. These extensions are available under Advanced Settings in the UI and return schema-level metadata in the extract_metadata field of the response.

Citations provide the source information for every extracted field, allowing you to trace back exactly where each piece of data came from in the original document.

How it works: For every leaf-level field in your schema, citations return:

  • The page number where the information was found
  • The verbatim text that was used to extract the field value
  • Bounding box coordinates (x, y, w, h) indicating the exact location of the cited text on the page
  • Page dimensions (width, height) to help you render the bounding boxes accurately

The citation information appears both in the API response (extract_metadata.field_metadata) and is visualized in the LlamaCloud UI.

Example API response structure (scalar fields):

"extract_metadata": {
"field_metadata": {
"phone": {
"citation": [
{
"page": 1,
"matching_text": "(555) 123-4567",
"bounding_boxes": [
{
"x": 177,
"y": 82,
"w": 318,
"h": 43
}
],
"page_dimensions": {
"width": 612,
"height": 792
}
}
]
}
}
}

Array fields: Citations attach at the leaf sub-field level, not the array item level. The field_metadata tree mirrors the structure of your extracted data, with each leaf value replaced by its citation metadata.

For a schema like key_facts: list[KeyFact] where KeyFact has a fact: str field, the metadata structure is:

"extract_metadata": {
"field_metadata": {
"key_facts": [
{
"fact": {
"citation": [
{
"page": 3,
"matching_text": "Revenue grew 114% year-over-year",
"bounding_boxes": [{ "x": 50, "y": 200, "w": 400, "h": 20 }],
"page_dimensions": { "width": 612, "height": 792 }
}
]
}
},
{
"fact": {
"citation": [
{
"page": 7,
"matching_text": "Operating expenses increased to $3.2B",
"bounding_boxes": [{ "x": 50, "y": 310, "w": 380, "h": 20 }],
"page_dimensions": { "width": 612, "height": 792 }
}
]
}
}
]
}
}

Note: the citation path is field_metadata.key_facts[i].fact.citation, not field_metadata.key_facts[i].citation. Each array element in the metadata corresponds positionally to the same element in the extracted data.

Usage: Set cite_sources: true in the configuration to enable this feature.

Use cases:

  • Compliance and audit requirements
  • Fact-checking and verification workflows
  • Understanding extraction quality and accuracy
  • Building custom highlighting/annotation features using bounding box coordinates

Confidence scores provide quantitative measures of how confident the system is in the extracted values, helping you identify potentially unreliable extractions.

How it works: This feature adds three confidence-related fields to the extraction metadata:

  • parsing_confidence: Confidence score indicating how well the relevant context was parsed from the source document.
  • extraction_confidence: Confidence score indicating the relevance of the extraction based on the JSON schema field.
  • confidence: Combined confidence score that incorporates both parsing and extraction confidence.

Usage: Set confidence_scores: true in the configuration to enable confidence scores.

Reading the scores. confidence is the value to threshold on; the other two explain where a low score came from.

  • Calibrated on Cost Effective, Agentic, and Agentic Plus. On those tiers a score approximates a real probability of correctness, so you can set a threshold directly rather than only ranking fields against each other. At a 0.8 threshold roughly 75% of extraction errors fall below the line.
  • Agentic Max and Turbo return scores from an earlier model. They are still useful for ranking fields, but the calibration above does not apply to them.
  • Validate the threshold on your own documents. The right cutoff depends on your document mix and on how costly a missed error is. Start at 0.8, score a sample you have ground truth for, and move it until review volume and escape rate sit where you want them.
  • Longer text fields score lower. Summaries and descriptions typically score below short factual fields, because there are many valid ways to word the same answer. That does not by itself indicate lower accuracy, so consider a separate threshold for free-text fields.

Limitations: enabling confidence scores adds processing time to a job.

Use cases:

  • Routing low-confidence fields to human review while the rest pass straight through
  • Ranking extraction reliability across fields within a document
  • Flagging documents that need a second look before they enter a downstream system

Reasoning metadata is available for Extract versions through 2026-03-31. Newer versions do not return per-field reasoning strings.

If your application depends on reasoning strings in extract_metadata.field_metadata, pin configuration.version to 2026-03-31. For newer versions, use citations and confidence scores when you need provenance or review signals.

⚠️ Important: Citations and confidence scores will significantly slow down extraction processing time. Enable these features only when the additional metadata is essential for your use case.

For complete examples of how to configure and use these extensions with both the Python SDK and REST API, see the Configuring Extract page.

The configuration section includes:

  • Complete Python SDK examples with extension settings
  • REST API curl command examples
  • Configuration reference table with all available options

Quick reference for extensions:

import time
from llama_cloud import LlamaCloud
client = LlamaCloud(api_key="your_api_key")
file_obj = client.files.create(file="path/to/your/document.pdf", purpose="extract")
file_id = file_obj.id
job = client.extract.create(
file_input=file_id,
configuration={
"data_schema": {"type": "object", "properties": {}}, # your extraction schema
"tier": "agentic",
"cite_sources": True,
"confidence_scores": True,
},
)
# Poll for completion
while job.status not in ("COMPLETED", "FAILED", "CANCELLED"):
time.sleep(2)
job = client.extract.get(job.id)
Note for AI agents: this documentation is built for programmatic access. - Overview of all docs: https://developers.llamaindex.ai/llms.txt - Any page is available as raw Markdown by appending index.md to its URL — e.g. https://developers.llamaindex.ai/llamaparse/parse/getting_started/index.md - Agent-friendly REST search APIs live under https://developers.llamaindex.ai/api/ — search (BM25 full-text), grep (regex), read (fetch a page), and list (browse the doc tree). See https://developers.llamaindex.ai/llms.txt for parameters. - A hosted documentation MCP server is available at https://developers.llamaindex.ai/mcp. If you support MCP, you can ask the user to install it for browsing these docs directly (an alternative to the REST API). Setup: https://developers.llamaindex.ai/for-agents/mcp/ - Other LlamaIndex tooling for agents — the LlamaParse Platform MCP server, agent skills and plugins, and the n8n node — is mapped at https://developers.llamaindex.ai/for-agents/