Oracle AI Agent Studio allows you to create custom AI agents capable of reading unstructured documents and extracting relevant data directly into a structured format.
This article explains how to enable file attachments, configure the necessary tools, and format the extracted data into JSON.
Before an agent can process a document, you must provide a way for users to upload files.
A well-defined role ensures the agent extracts data accurately and consistently.
To seamlessly integrate the extracted data with downstream applications or databases, the output must be structured.
{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"purchase_orders": {
"type": "array",
"items": {
"type": "object",
"properties": {
"purchase_order_number": { "type": ["string", "null"] },
"date": { "type": ["string", "null"], "format": "date" },
"customer_number": { "type": ["string", "null"] },
"supplier": {
"type": ["object", "null"],
"properties": {
"name": { "type": ["string", "null"] },
"address_box": { "type": ["string", "null"] },
"city": { "type": ["string", "null"] },
"province": { "type": ["string", "null"] },
"postal_code": { "type": ["string", "null"] }
},
"required": ["name", "address_box", "city", "province", "postal_code"]
},
"ship_to": {
"type": ["object", "null"],
"properties": {
"organization_name": { "type": ["string", "null"] },
"branch_name": { "type": ["string", "null"] },
"address_line": { "type": ["string", "null"] },
"city": { "type": ["string", "null"] },
"postal_code": { "type": ["string", "null"] }
},
"required": ["organization_name", "branch_name", "address_line", "city", "postal_code"]
},
"line_items": {
"type": "array",
"items": {
"type": "object",
"properties": {
"item_code": { "type": ["string", "null"] },
"quantity": { "type": ["integer", "null"] },
"price": { "type": ["number", "null"] }
},
"required": ["item_code", "quantity", "price"]
}
},
"total_quantity": { "type": ["integer", "null"] },
"total_price": { "type": ["number", "null"] }
},
"required": [
"purchase_order_number", "date", "customer_number",
"supplier", "ship_to", "line_items", "total_quantity", "total_price"
]
}
}
}
}