Skip to content
Putting technology to work.
Insights to guide decisions and action.

Search articles

Structuring internal dormant PDFs, emails, and inquiries with LLMs — client work for integration into business systems

Table of contents · 6 items

"We want to aggregate all past quotes to determine average unit prices per product," or "We want to categorize incoming inquiry emails to see which requests are most frequent"—we often receive inquiries like these from small-to-medium business leaders and IT staff. The goal is clear, yet progress stalls. The reason is always the same: data is scattered in unstructured formats like PDFs, email bodies, and free-text fields that humans can read, but machines cannot aggregate. While reading each record by hand and transcribing it into Excel is technically possible, doing so across hundreds or thousands of files is simply not viable.

This is where modern LLMs' standard structured output capabilities (JSON / Function Calling) make a substantial impact. As highlighted in LayerX's Data Infrastructure in the LLM Era: The Importance of ETL Processes Handling Unstructured Data, using LLMs to parse unstructured assets like transcripts, PDFs, and emails into discrete fields for loading into data warehouses and business systems via ETL is rapidly becoming a fundamental prerequisite for enterprise data utilization. LLMs in 2026 do more than just return natural language prose; they support returning JSON that strictly matches specified schemas (field definitions), making them much easier to embed into core business systems. When supporting custom development, we do not view this as a one-off task of pasting text into ChatGPT to reformat it; we treat it as a bona fide systems engineering challenge: how to architect a resilient pipeline that continuously structures scattered unstructured data with automated validation.

Ad-hoc AI Formatting and Continuous Pipelines Are Completely Different

Having an operator manually paste unstructured data into ChatGPT can work when volumes are minimal. However, embedding this into business operations demands an entirely different architecture.

DimensionAd-hoc AI formattingStructuring pipeline (custom development)
Target volumeA few to dozens of itemsContinuous high-volume processing
Output formatVaries each timeStandardized by schema
Error detectionManual human inspectionAutomated validation
ReproducibilityDependent on specific individualsRe-executable through automated pipelines
IntegrationsManual copy-and-pasteAutomated ingestion into databases and enterprise systems

For business operations, having consistent fields, automated detection of anomalies, and the ability to re-run identical workflows at will is essential. Relying on AI without designing these safeguards allows extraction mistakes to corrupt business data directly, leading to massive rework later. For cost considerations when embedding AI into operations, please also consult Establishing AI Budget Governance with Cloudflare AI Gateway (GH Media).

The Core of Structuring: Define the Schema First

A universal trait of successful pipelines is an architectural rule: strictly determine which fields to extract (the schema) upfront, and constrain the LLM to return data only in that format. Below is an illustrative schema definition for extracting required fields from quote PDFs.

// 抽出したい項目を「型」として先に定義する
const QuoteSchema = {
  type: "object",
  properties: {
    customer:  { type: "string" },                 // 宛先企業名
    issuedAt:  { type: "string", format: "date" }, // 発行日 (YYYY-MM-DD)
    items: {
      type: "array",
      items: {
        type: "object",
        properties: {
          name:     { type: "string" },  // 品名
          unit:     { type: "number" },  // 単価
          quantity: { type: "integer" }, // 数量
        },
        required: ["name", "unit", "quantity"],
      },
    },
    total: { type: "number" },           // 合計金額
  },
  required: ["customer", "issuedAt", "items", "total"],
};

// LLM には「このスキーマに従った JSON だけを返す」ことを強制する
// → 返ってきた JSON をバリデーション → 通ればDBへ、落ちれば人手レビューへ

By locking down types in advance, the LLM's output maintains an invariant structure, enabling automated rejection of anomalies such as total failing to parse as a number or missing required fields. Constraining output to structured values rather than prose is what determines whether data is viable for business operations. For an introductory perspective on processing internal documents with AI, refer to our Practical Guide to Business Use of ChatGPT (GH Media).

Key Architectural Principles of Structuring Pipelines in Custom Development

In our custom development engagements, we dedicate the most effort not to the extraction step itself, but to how errors are handled. While versatile, LLMs are not infallible and will occasionally misidentify fields. Because this is for production operations, we architect systems around that reality.

Specifically, extracted JSON must always pass validation; items that deviate from the schema, show anomalous monetary values, or contain line items that do not sum to the total are automatically flagged and routed to a human review queue. Ingesting only high-confidence data into databases or core business applications while routing ambiguous cases to human reviewers—this 80% automated, 20% manual triage—is the linchpin of a pipeline that stays dependable in production. For a wholesale client, we built a system to structure incoming purchase orders arriving in disparate formats and ingest them into their order management system. Designing the workflow around the premise that unreadable or suspect orders are routed to humans allowed the client to rely on automation with complete confidence.

Furthermore, we store links between source files and extraction results so teams can later trace which page of which PDF a given number originated from. Without this traceability, teams cannot locate the root cause when errors occur, undermining trust in the data. For quality assurance principles when handling AI outputs in enterprise contexts, refer to Quality Governance for AI Deliverables (GH Media).

What Kinds of Data Can Be Processed?

Straightforward to structureRequires careful design
Quote, invoice, and purchase order PDFsHandwritten notes and degraded scans
Free-form text in inquiries and applicationsContracts dense with legal jargon
Meeting minutes and call transcriptsHighly confidential documents
Business cards and surveysLegacy ledgers with inconsistent formatting

Semi-structured forms and customer inquiries can be structured relatively straightforwardly. Conversely, handwritten records and highly sensitive documents require tailored architectures addressing OCR fidelity and security policies. The rule of thumb for where to start is selecting datasets with high volume, relatively consistent structure, and strong demand for analytical aggregation.

Conclusion: Turning "Readable but Impossible to Aggregate" into Business Assets

Dormant PDFs, emails, and free-form text across organizations have long been inaccessible for analytics or automation because they were readable by humans but impossible to aggregate. LLM structured outputs provide the key to breaking them down into discrete fields and converting them into operational data. However, making this viable for enterprise operations requires locking schemas upfront, validating extraction results, and routing questionable items to human review—only through this architecture does a pipeline become genuinely dependable. In custom development, building these validated structuring pipelines is one of our flagship services, turning dormant records into actionable assets for automation and decision-making.

If you are looking to aggregate historical business forms or categorize inquiries for clear visibility, please contact us via our contact form. We can start with an initial feasibility validation on a single document type.

Sources

Share this articleXFacebook
Kakeru Suzuki

Fascinated by the possibilities of technology, has had a deep interest in programming and digital art since student days

Turn this article's theme into your company's next step

Concrete steps forward for your organization.

We organize your desired architecture, legacy systems, and operational requirements to formulate your next steps toward execution.

  • Desired architecture
  • Integration with existing environments
  • Operational requirements
Consult on development & operations initiatives

You can consult with us from the initial conceptual stage. Details from this article will be carried over to the inquiry form.

Receive the latest articles by email