---
title: Intelligent document processing
description: Learn how to use Databricks AI Functions to turn unstructured documents into structured insights with composable, governed pipelines.
canonical_url: https://docs.databricks.com/gcp/en/agents/agent-bricks/intelligent-document-processing
---

# Intelligent document processing

Intelligent Document Processing (IDP) converts unstructured content—such as PDFs, DOCX files, images, and presentations—into structured, enriched data that powers downstream agents, applications, and analytics.

Databricks gives you five ways to run IDP, all built on the same research-developed AI Functions:

* **Agent Bricks UI**: A no-code, visual experience for parsing, extracting, and classifying documents. Use it to test sample documents, refine a schema or labels, and visually validate results before you scale.
* **SQL AI Functions**: Run intelligent document processing functions directly on the Lakehouse. Use them to process documents at scale, compose stages together, and build governed, production-grade pipelines in Lakeflow pipelines.
* **REST APIs**: Call the same AI Functions from applications, services, and automation workflows.
* **Asynchronous API** (Beta): Run `ai_parse_document`, `ai_extract`, or `ai_classify` asynchronously on many inputs from a file in a Unity Catalog volume, and get the results in a file in a volume. For `ai_parse_document`, the input can also be a volume directory. See the [Asynchronous API reference](https://docs.databricks.com/api/ai-functions/v1/batch).
* **AI Function tasks in Lakeflow Jobs** (Beta): Add an `ai_parse_document`, `ai_extract`, or `ai_classify` task to a job to process new and changed documents on a schedule, without writing SQL. See [AI Function tasks for jobs](https://docs.databricks.com/gcp/en/jobs/tasks/ai-functions/index.md).

## Intelligent document processing capabilities

| **Capability**                                                                                                         | **Agent Bricks UI**                                                                                 | **SQL function**                                                                                              | **REST API**                                                                           | **Asynchronous API** (Beta)                                               |
| ---------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | ------------------------------------------------------------------------- |
| Convert PDFs, DOCX, images, and PPTs into structured text, tables, and figure descriptions.                            | [Document Parsing](https://docs.databricks.com/gcp/en/agents/agent-bricks/document-parsing.md)      | [`ai_parse_document`](https://docs.databricks.com/gcp/en/sql/language-manual/functions/ai_parse_document.md)  | [AI Parse Document](https://docs.databricks.com/api/ai-functions/v1/ai-parse-document) | [Asynchronous API](https://docs.databricks.com/api/ai-functions/v1/batch) |
| Pull structured fields from documents or plain text using a schema you define.                                         | [Information Extraction](https://docs.databricks.com/gcp/en/agents/agent-bricks/info-extraction.md) | [`ai_extract`](https://docs.databricks.com/gcp/en/sql/language-manual/functions/ai_extract.md)                | [AI Extract](https://docs.databricks.com/api/ai-functions/v1/ai-extract)               | [Asynchronous API](https://docs.databricks.com/api/ai-functions/v1/batch) |
| Assign predefined categories to documents or text, supporting up to 500+ labels.                                       | [Classification](https://docs.databricks.com/gcp/en/agents/agent-bricks/classification.md)          | [`ai_classify`](https://docs.databricks.com/gcp/en/sql/language-manual/functions/ai_classify.md)              | [AI Classify](https://docs.databricks.com/api/ai-functions/v1/ai-classify)             | [Asynchronous API](https://docs.databricks.com/api/ai-functions/v1/batch) |
| Transform parsed documents into semantic chunks ready for retrieval-augmented generation (RAG) and AI Search indexing. |                                                                                                     | [`ai_prep_search`](https://docs.databricks.com/gcp/en/sql/language-manual/functions/ai_prep_search.md) (Beta) |                                                                                        |                                                                           |

## Common use cases

IDP on Databricks powers a wide range of downstream applications:

* **Retrieval-augmented generation (RAG)**: Parse and structure documents to improve chunking, retrieval quality, and grounding for LLM applications.
* **Knowledge extraction and analytics**: Extract key fields and metadata to enable search, reporting, and business intelligence on document data.
* **Agent-driven workflows**: Route, classify, and enrich documents to support automated decision-making and task execution.
* **Document understanding and classification**: Organize large document corpora by type, topic, or content for downstream processing.

## How it works

Databricks enables intelligent document processing as a unified, end-to-end workflow on the Lakehouse. Ingestion, parsing, enrichment, and downstream analysis are built on a single platform, so each stage works seamlessly together without requiring complex integration or data movement.

1. **Ingest and orchestrate**

   Use Lakeflow pipelines to ingest raw documents (such as PDFs, images, and DOCX files) and orchestrate your pipelines. Because ingestion and orchestration are natively integrated with the Lakehouse, documents flow directly into downstream processing without additional infrastructure.

2. **Parse documents (Bronze layer)**

   Apply [`ai_parse_document`](https://docs.databricks.com/gcp/en/sql/language-manual/functions/ai_parse_document.md) to convert raw files into structured representations. This creates a standardized bronze layer that captures text, tables/image descriptions, and document structure, forming a consistent foundation for all downstream use cases.

3. **Extract and classify**

   Use [`ai_extract`](https://docs.databricks.com/gcp/en/sql/language-manual/functions/ai_extract.md) and [`ai_classify`](https://docs.databricks.com/gcp/en/sql/language-manual/functions/ai_classify.md) to enrich parsed documents with structured fields and metadata. These functions operate directly on the parsed outputs, enabling you to extract key information, classify documents, and route them through workflows without additional transformation steps.

4. **Prepare for retrieval (RAG)**

   Apply [`ai_prep_search`](https://docs.databricks.com/gcp/en/sql/language-manual/functions/ai_prep_search.md) (Beta) to transform parsed documents into semantic chunks enriched with document-level context such as titles, section headers, and page references. The output is formatted for AI Search indexing, providing a consistent foundation for RAG and retrieval workloads.

5. **Analyze and operationalize**

   Leverage additional AI Functions or other tools (AI/BI dashboards, Apps, AI Search) for downstream analytics, retrieval (RAG), and agent-driven workflows. Because all data remains on the Lakehouse, structured document data can be immediately used for search, dashboards, and applications.
