Show HN: Agentic AI for Procurement

4 months ago 3

Procurement is an essential function for any organization, but it has long been plagued by inefficiencies, high costs, and poor visibility into spending.

However, a new wave of technology is transforming the procurement landscape: AI agents.

These intelligent systems are capable of automating complex procurement tasks, providing real-time insights, and driving significant cost savings.

This tutorial will cover everything procurement professionals need to know about AI agents, from how they work and their key benefits to real-world use cases and how to implement them in your organization.

Let’s dive in.

What are AI Agents in Procurement?

AI agents are intelligent systems that can perform tasks on behalf of a user by perceiving their environment, reasoning about what they sense, and calling tools to take action.

To put it simply, AI agents are digital workers that can do anything from answering customer service inquiries to generating software code to processing invoices. They are capable of automating a wide variety of tasks, and they are rapidly evolving.

They differ from traditional automation tools in that they are autonomous and can make decisions without human intervention. Traditional automation, also known as robotic process automation (RPA), is a more simplistic form of automation that simply follows a series of rules to complete a task. RPA can be useful for automating simple, repetitive tasks, but they can break very easily in a dynamic environment where the input data changes constantly.

Agentic AI vs. Traditional LLMs: What’s the Difference?

Before we go further, it’s important to clarify the difference between agentic AI and traditional AI.

Traditional AI models are designed to perform a specific task. For example, a generative AI model like ChatGPT is designed to generate text. It does this by predicting the next word in a sentence based on the words that came before it. ChatGPT does not actually understand the text it produces; it simply predicts what word should come next based on its training.

Agentic AI , on the other hand, is designed to perform a specific action. Agentic AI models use different tools at their disposal and determine which actions will produce the best outcome.

Agentic AI models are capable of solving problems that traditional AI cannot. For example, a traditional AI model designed to generate text cannot be used to generate software code, because the code must actually run in the real world. An agentic AI model, however, can generate code and then run the code to see if it works. If the code produces an error, the AI learns not to generate that code again.

The Benefits of AI Agents in Procurement

AI agents can deliver a wide variety of benefits to procurement teams. Let’s explore the key benefits of using AI agents in procurement.

Cost Savings

AI agents can drive significant cost savings in a variety of ways.

  • Help organizations reduce spending. By streamlining the procurement process and making it easier for employees to follow the correct procedures, AI agents can help reduce the amount of money spent outside of the approved procurement process.
  • Help organizations reduce the costs associated with processing invoices. AI agents can automatically extract data from invoices, verify that the invoice matches the purchase order, and approve the invoice for payment. This eliminates the need for a human to review each invoice and reduces the risk of errors.
  • Help organizations reduce the costs associated with managing supplier risk. AI agents can continuously monitor news articles, social media posts, and other online content for mentions of a supplier. If the AI agent detects a mention of a supplier that indicates a potential risk, such as a labor strike or a natural disaster, it can alert the procurement team so they can take action.

Increased Efficiency

AI agents can drive significant efficiency gains across a variety of procurement tasks.

  • Respond to supplier inquiries more quickly and accurately. They can automatically extract data from contracts, making it easy for procurement teams to answer supplier questions about pricing, payment terms, and other contract details.
  • Approve purchase orders more quickly. They can automatically extract data from purchase orders, verify that the purchase order matches the invoice, and approve the purchase order for payment. This eliminates the need for a human to review each purchase order and reduces the risk of errors.
  • Conduct supplier audits more quickly and accurately. They can automatically extract data from financial statements, making it easy for procurement teams to verify that suppliers are complying with financial covenants.

Improved Compliance

AI agents can help organizations improve compliance with internal policies and external regulations.

  • Automatically extract data from contracts, making it easy for procurement teams to ensure that contracts comply with internal policies.
  • Automatically extract data from financial statements, making it easy for procurement teams to ensure that suppliers are complying with financial covenants.

Enhanced Supply Chain Visibility

AI agents can help organizations improve supply chain visibility.

  • Identify potential supply chain disruptions more quickly and accurately. Continuously monitor news articles, social media posts, and other online content for mentions of a supplier. If the AI agent detects a mention of a supplier that indicates a potential supply chain disruption, such as a labor strike or a natural disaster, it can alert the procurement team so they can take action.
  • Automatically extract data from invoices, making it easy for procurement teams to track on-time delivery rates and other key performance indicators.

Limitations of traditional AI Agents in Procurement

While AI agents are capable of performing a wide variety of tasks, they are only as good as the underlying tools they are using. Unfortunately, most LLMs fall short when it comes to mission-critical and high-accuracy tasks. This is because generic AI models are trained on a vast amount of data from the internet, which includes a mixture of high-quality and low-quality information. As a result, tools powered by these models can sometimes produce answers that are inaccurate, outdated, or nonsensical. This can be especially problematic in situations where precise and reliable information is essential, such as in the fields of medicine, law, or finance. 

For example, large language models (LLMs) like ChatGPT are not designed to perform highly accurate document extraction tasks. This limitation is particularly problematic for organizations that want to use AI agents to automate business processes. Most business processes involve a series of tasks that must be performed in a specific order. For example, to process an invoice, an employee must extract data from the invoice, verify that the invoice matches the purchase order, and approve the invoice for payment. LLMs may struggle to understand complex layouts, such as tables in invoices, potentially mixing up which amount is the total versus a line item. They can also miss key information or provide it in the wrong format, like a narrative paragraph instead of a concise list. Furthermore, LLMs may “hallucinate” or fabricate data, inventing invoice numbers or due dates, which is unacceptable for structured data pipelines.

The Importance of Fine-Tuned AI for Agentic Extraction

The typical procurement process has the following steps:

Purchase Order Creation: First the the PO is created then sent to a vendor.

Invoice Receipt and Verification: Once the goods/services are delivered, the vendor sends an invoice to the buyer. The AI agent receives and verifies this invoice, checking for errors, inconsistencies, or missing information.

Matching Process: The core of the automation lies in matching the invoice with the corresponding PO. This can be done through:

  • Two-Way Matching: Comparing the PO and the invoice to ensure the details align, such as supplier name, vendor code, quantity, purchase amount, and PO number.
  • Three-Way Matching: Comparing the PO, the invoice, and the goods receipt or packing slip to verify that the goods/services were delivered as ordered and that all three documents match.
  • Discrepancy Resolution: If discrepancies are identified during the matching process (e.g., incorrect quantities, pricing errors), the AI agent flags these and initiates a resolution workflow. This may involve contacting the supplier for clarification or adjustments.
  • Approval and Payment: Once the invoice is verified and any discrepancies are resolved, the AI agent forwards the invoice for approval based on predefined authorization policies. Upon approval, the payment is processed according to the agreed-upon terms.
    ment.

In this tutorial, we are going to show how to integrate fine-tuned AI models as tools for the AI agent to use in order to automate the 2-way matching procurement process. First, we will set up the following tools:

  • Invoice Extraction Model
  • PO Extraction Model

The AI agent will use the invoice and PO extraction tools to analyze the invoices and POs accurately to find any discrepancies. Next, it will then match this information to a receipt received by a vendor and determine if there is any discrepancy or if it can be routed for approval.

The image above shows the process flow of the AI agent. The AI agent will first analyze the invoice and extract relevant information from it. The AI agent will then analyze the purchase order and extract relevant information from it. The AI agent will then compare the two data sets and generate a report that summarizes the differences between the two data sets. The AI agent will then send the report to the user for review.

Fine-tuned smaller AI models for agentic use

Fine-tuned smaller AI models provide the best accuracy, efficiency, and cost effectiveness when used for agentic AI: https://arxiv.org/pdf/2506.02153

Fine-tuned smaller models, when compared to bigger generic models, often demonstrate improved accuracy and relevance within specific tasks, as they specialize in those tasks, leading to better user experience and outcomes. A recent study from predibase found that smaller fine-tuned open-source models beat GPT-4 on almost all tasks except coding: https://predibase.com/fine-tuning-index

This specialization arises because fine-tuning involves training a pre-trained model on a smaller, task-specific dataset, honing its capabilities for that specific purpose. While bigger, generic models are trained on vast amounts of data to perform well across a broad range of tasks, smaller, fine-tuned models can sometimes outperform them in specific domains due to their efficient representation of domain knowledge. Fine-tuning also offers advantages such as reduced development costs, enhanced data efficiency, and customization options. Furthermore, smaller models can be run on a single machine, which means that they can be deployed in more places and don’t require expensive cloud compute to operate. This makes them ideal for agentic AI, where the goal is to create autonomous agents that can operate independently in the world.

Fine-tuning AI models for Document Extraction

To achieve high accuracy information extraction, we are going to fine-tune small deep learning models for invoice, PO, and receipt extraction using UBIAI for labeling and Kudra.ai for hosting. UBIAI’s annotation tool, enhanced with OCR capabilities, facilitates native labeling by parsing text and bounding boxes, which is essential for training models like LayoutLM. Kudra.ai then provides a platform to host these fine-tuned models, offering ease of use and document workflow capabilities, which automates data extraction in three steps: importing documents, processing them with AI, and exporting structured data. Kudra.ai’s AI-powered services include OCR, extraction models, and generative AI extraction models to streamline document processing tasks efficiently. This integration simplifies the extraction of critical data from various document types, transforming complex files into structured, searchable data.

Here is an example of invoice extraction using kudra.ai:

And PO extraction example:

We are now ready to build our AI agent using the fine-tuned tools.

Building agentic document AI for Procurement:

To build our AI agent, we are going to use the CrewAi framework. To define custom tools in CrewAI, you can subclass the `BaseTool` class. Subclassing `BaseTool` involves inheriting from it and defining attributes like `args_schema` for input validation and the `_run` method for the tool’s logic.

To set up a task, you can use YAML configuration or define it directly in code. The YAML configuration is recommended for cleaner maintainability. A task requires a description, the agent responsible for executing it, and any required tools.

To set up a crew, you need to define agents, assign them roles and goals, and specify the tasks they need to perform. You can then run the crew by calling the `kickoff` method on the crew object.

2-way matching using AI Agent

Two-way matching is an automated process used to check for discrepancies between a purchase order (PO) and the corresponding invoice before the invoice is paid. It involves comparing key figures on both documents, such as the quantity, price, and terms. If the details don’t align within predefined tolerances, the invoice is put on hold until the discrepancies are resolved. Using our agent AI procurement system, this process is automated by extracting information from the invoice and purchase order and matching them against each other. The agent automatically sorts invoices and purchase orders, and if the information matches, the invoice is scheduled for payment. If there are mismatches, the system flags them for review, ensuring accuracy and compliance. This reduces manual verification and frees up the procurement team to focus on strategic decision-making.

Let’s run the agent:

Let’s now perform the analysis on all the data available in the documents instead of just focusing on the items.

We observe a few things:

  1. The agent was able to route the invoice and PO to the appropriate tools for extraction, namely the Invoice Extractor and PO Extractor.
  2. After extraction, the agent aggregated the data in tabular format and performed the two-way matching analysis flawlessly. Notice that I have not explained what 2-way matching is. The agent was able to autonomously use the right tool and perform the analysis without supervision.
  3. Although the Total entity in the PO Extractor was missing, the agent autonomously calculated the sum of all the items and computed the Total. Pretty neat.

In addition to items matching, the agent was able to compare other attributes such as PO number, Invoice date, Invoice Total.

Let’s introduce a small error in the invoice and check if the agent is able to find it. We are going to increase the price of Economy Manilla Enevelopes by $1 and increase the total by $10.

Perfect. The agent was able to find the mismatched item and identify the discrapancy. We can now perform even more complicated 3-way matching by adding a receipt extraction tool and let the agent perform the analysis

Conclusion

AI agents are reshaping the procurement function by transforming tedious, error-prone processes into intelligent, autonomous workflows. From invoice and purchase order analysis to automated two-way and three-way matching, agentic AI brings unprecedented efficiency, accuracy, and cost savings to modern procurement teams.

However, the key to unlocking these benefits lies in using fine-tuned AI models tailored for specific tasks like document extraction. Generic models often fall short in precision and reliability, especially in structured data workflows where mistakes are costly. By leveraging purpose-built models and tools—like those integrated through platforms such as UbiAI and Kudra.ai—organizations can deploy robust, scalable procurement agents that operate with minimal oversight and deliver real ROI.

As this guide has shown, building a production-grade agentic procurement system is now both feasible and cost-effective.

With the right tools, data, and frameworks, any organization can automate their procurement processes end-to-end and free up their teams to focus on strategic decision-making.

Get started today at ubiai.tools.

Read Entire Article