Skip to main content

How can AI use both documents and database data?

Summary

  • AI can work across both when documents and tables live under one governed platform. On Databricks, Unity Catalog governs files in volumes and structured tables together, so an agent can draw on both without stitching separate systems.
  • Turn documents into queryable data. ai_parse_document extracts text, tables, and figures from PDFs, DOCX, and images, and ai_extract pulls the fields you define, both callable in SQL. Both are generally available.
  • Retrieve unstructured content by meaning. Databricks AI Search indexes document chunks for semantic and hybrid search, so agents can combine the right passages with database queries in one workflow.
  • Answer over structured data in natural language. Genie Agents translate questions into governed SQL over your tables using consistent metric definitions.
  • Genie Ontology adds shared business context across these surfaces, and Genie Code can extract business terms from documents into governed Pages. Genie Ontology is in Public Preview.

How can AI use both documents and database data?

AI can use both when unstructured documents and structured tables sit under one governed platform, so an agent retrieves from each and combines the results. On Databricks, that platform is the lakehouse, with Unity Catalog governing files in volumes and Delta tables under a single model. You convert documents into structured, queryable data with AI functions, index their content for retrieval with Databricks AI Search, and answer questions over structured tables with Genie Agents, all governed the same way. Genie Ontology, in Public Preview, gives those answers a shared layer of business context.

Two kinds of data, one platform

Most real questions need both. 'Which contracts are up for renewal, and what are their termination clauses?' pulls dates and amounts from a database and clauses from PDFs. Documents are unstructured (PDFs, DOCX, images, email), while database data is structured (rows, columns, keys). These have historically lived in separate stacks with separate tools and separate governance. Bringing them together starts with one place to store and govern both, then a way to make the unstructured side queryable.

Capabilities to combine documents and database data

The evaluation is whether both kinds of data can be governed, made queryable, and reasoned over together.

Capability Why it matters
Unified governance for files and tables One permission, lineage, and audit model so document and database access follow the same rules.
Document parsing and extraction Turn PDFs, DOCX, and images into structured fields your queries and agents can use.
Semantic and hybrid retrieval Find the right passages by meaning, not just keywords, for retrieval-augmented answers.
Natural-language access to tables Let non-technical users ask questions of structured data without writing SQL.
Shared business context Consistent definitions so an answer means the same thing whether it came from a document or a table.

How Databricks approaches it

Unity Catalog governs documents in volumes and structured data in Delta tables under one model, with lineage and access control across both. To make documents usable, ai_parse_document extracts text, tables, and figures from PDFs, DOCX, and images directly in SQL, and ai_extract pulls the specific fields you define into columns; both are generally available. Parsed content can be chunked and indexed by Databricks AI Search for semantic or hybrid retrieval, the backbone of retrieval-augmented generation. On the structured side, Genie Agents answer natural-language questions as governed SQL over your tables. A single agent can call a retrieval tool over documents and a query tool over tables in one workflow, so an answer can cite a clause from a contract alongside a figure from a table. Genie Ontology (Public Preview) supplies the shared business context so those answers use consistent, governed definitions, and Genie Code can extract business terms from your documents into governed Pages for review. For the document side in depth, see Intelligent document processing. Because Genie Ontology is in Public Preview, confirm its current behavior in the documentation.

Use cases

  • Contract review: extract parties, dates, and clauses from agreements, then join them to account and revenue tables.
  • Customer support: retrieve policy passages from documents and combine them with a customer's account history for a grounded answer.
  • Finance operations: parse invoices into structured fields and reconcile them against transactions held in the warehouse.

FAQs

How do documents become usable alongside database data?

ai_parse_document turns PDFs, DOCX, and images into structured content in SQL, and ai_extract pulls the fields you define into columns. The results land in tables you can join and query like any other data.

Do documents and tables share the same governance?

Yes. Unity Catalog governs files in volumes and structured tables under one permission, lineage, and audit model, so access rules apply consistently to both.

How does AI find the right document passage?

Databricks AI Search indexes document chunks for semantic and hybrid search, so an agent can retrieve the most relevant passages and combine them with a database query.

Where does Genie Ontology fit?

It provides a shared business-context layer so answers over structured data use consistent definitions, and Genie Code can pull business terms from documents into governed Pages. Genie Ontology is in Public Preview.

The information provided herein is for general informational purposes only and may not reflect the most current product capabilities or configurations.