Connect Epicor Kinetic to AI Agents: Automate Supply Chain and BAQs
Give your AI agent Epicor Kinetic tools.
A comprehensive engineering guide to connecting Epicor Kinetic to AI agents. Learn how to fetch Epicor Kinetic tools via Truto, bind them using frameworks like LangChain, and orchestrate complex ERP workflows.
In this guide
- 01Connect Epicor Kinetic to Truto
- 02Fetch AI Tools via API
- 03Bind Tools to the LLM
- 04Implement Rate Limit Handling
- 05Execute ERP Workflows
The guide
Learn how to connect Epicor Kinetic to AI agents using Truto's tools endpoint to automate supply chain ops, BAQs, and ERP workflows natively.
You want to connect Epicor Kinetic to an AI agent so your system can independently execute Business Activity Queries (BAQs), analyze supply chain bottlenecks, and orchestrate manufacturing jobs based on real-time ERP context. Here is exactly how to do it using Truto's /tools endpoint and SDK, bypassing the need to build and maintain a custom Epicor integration from scratch.
Giving a Large Language Model (LLM) read and write access to your Epicor Kinetic instance is an engineering headache. You either spend weeks reading documentation to map out Business Object (BO) methods and OData syntax, or you use a managed infrastructure layer that handles the boilerplate for you. If your team uses ChatGPT, check out our guide on connecting Epicor Kinetic to ChatGPT, or if you are building on Anthropic's models, read our guide on connecting Epicor Kinetic to Claude. For developers building custom autonomous workflows, you need a programmatic way to fetch these tools and bind them to your agent framework.
This guide breaks down exactly how to fetch AI-ready tools for Epicor Kinetic, bind them natively to an LLM using frameworks like LangChain, LangGraph, CrewAI, or the Vercel AI SDK, and execute complex manufacturing and supply chain workflows. For a deeper look at the architecture behind this approach, refer to our research on architecting AI agents and the SaaS integration bottleneck.
Why a Unified Tool Layer Matters for Agent Safety
Before writing a line of integration code, decide what layer your agent talks to. Direct API tools - one tool per raw Epicor endpoint - look convenient on paper, but they push vendor-specific quirks directly into the LLM's context window.
If you dump an OpenAPI spec into an LLM, the model has to remember that Epicor Kinetic requires specific OData $filter syntax, that dates must be formatted precisely, and that relationships span deeply nested schemas. Every one of those quirks is a hallucination waiting to happen. The model will invent query parameters, hallucinate payload structures, and ultimately fail at executing complex ERP operations.
By placing Truto's Proxy API layer between your agent and the ERP, you collapse this complexity. Your agent sees deterministic, schema-bound functions. That gives you three concrete safety wins:
- Smaller attack surface for hallucination. The LLM only ever chooses from stable function names with strict JSON schemas. It never invents OData fragments if it doesn't need to.
- Deterministic input validation. Invalid arguments are rejected before they hit Epicor, meaning a broken tool call fails fast, allowing the agent to correct its mistake immediately.
- Managed pagination. The integration layer pages through all results (100 per page) and hands the agent a clean array, preventing context window bloat from metadata and cursor objects.
The Engineering Reality of the Epicor Kinetic API
Giving an LLM access to external data sounds simple in a prototype. You write a Node.js function that makes a fetch request and wrap it in an @tool decorator. In production against complex ERP systems like Epicor Kinetic, this approach collapses.
Epicor Kinetic's REST v2 API introduces specific integration challenges that break standard REST assumptions. If you hardcode these interactions into your agent, you will spend your sprints writing defensive integration code instead of improving your model's reasoning.
Business Object (BO) Methods vs. Standard CRUD
Epicor is heavily driven by its Business Objects. While you can perform standard GET, POST, and PATCH operations on entities like Customers or Parts, real-world ERP workflows often require executing specific BO methods. For example, creating a new sales order might require calling Erp.BO.SalesOrderSvc GetNewOrderHed before submitting the payload, or utilizing UpdateExt for complex object graphs. Expecting an LLM to orchestrate these multi-step, stateful RPC-style calls autonomously is dangerous. Tool schemas must abstract these or strictly define the method parameters required.
Business Activity Queries (BAQ) Complexity
BAQs are the lifeblood of custom reporting in Epicor. The BaqSvc allows you to execute these pre-defined queries via REST. However, passing parameters to a BAQ requires sending them as plain query parameters matching the exact name defined inside the Epicor instance (e.g., StartDate). An LLM has no way of knowing what parameters a custom BAQ expects unless that schema is dynamically retrieved and bound as a tool. If the agent guesses, the query fails.
OData Syntax and Relational Filtering
Epicor Kinetic leans heavily on OData for filtering collections. To find a specific purchase order line, you cannot simply hit /PODetails/123. You must query the Erp.BO.POSvc/PODetails endpoint and pass an OData filter like POLine eq 123 and PONUM eq 5000. The LLM must be explicitly prompted on OData syntax, or the integration layer must handle the translation. If the agent uses SQL syntax or generic search parameters, Epicor will reject the request.
Rate Limits and State Management
When your agent gets caught in a loop or attempts to process massive bulk updates, it will hit rate limits. Truto does not retry, throttle, or apply backoff on rate limit errors. When the upstream Epicor instance returns an HTTP 429, Truto passes that error directly to the caller. Truto normalizes the upstream rate limit information into standardized headers (ratelimit-limit, ratelimit-remaining, ratelimit-reset) per the IETF specification.
Your agent architecture is responsible for catching these 429s, reading the ratelimit-reset header, and implementing its own retry or backoff logic before continuing the loop. If your framework cannot pause and resume state, a single rate limit will crash the entire autonomous workflow.
Epicor Kinetic Hero Tools for AI Agents
Instead of exposing hundreds of raw endpoints, you can provide your agent with high-leverage tools mapped to Epicor's resources. Here are the hero tools that unlock the most value for autonomous supply chain and operational workflows.
1. Execute Business Activity Queries (BAQs)
Tool Name: list_all_epicor_kinetic_baq_results
This is the most powerful read-tool you can give an agent. It allows the LLM to execute custom queries designed by your internal Epicor admins, returning complex, joined datasets that standard endpoints cannot provide. The agent must provide the baq_id and any required query parameters.
"Run the 'OpenPOs_MissingDates' BAQ. Filter the results for VendorNum 5000 and tell me which purchase orders are missing expected delivery dates."
2. Execute Business Object Methods
Tool Name: epicor_kinetic_business_object_methods_execute
For workflows that cannot be solved by standard CRUD operations, this tool acts as an escape hatch. It allows the agent to POST to /api/v2/odata/<Company>/<service>/<method_name>. The agent constructs the body holding the method's parameters exactly as named in the instance's REST help.
"Execute the 'GetByID' method on the 'Erp.BO.SalesOrderSvc' service for order number 10245. Return the raw payload so I can inspect the custom fields before we attempt an update."
3. List Purchase Orders
Tool Name: list_all_epicor_kinetic_purchase_orders
Essential for procurement and supply chain orchestration. Agents can list POs and apply OData filters to find orders matching specific vendors, statuses, or date ranges.
"Find all open purchase orders for Vendor ID 'V-992' created in the last 30 days. Summarize the total expected spend."
4. Create a Sales Order
Tool Name: create_a_epicor_kinetic_sales_order
Allows the agent to generate new sales orders autonomously. The agent passes the OrderHed columns, and Epicor fills in the defaults and the system-assigned key.
"Create a new sales order for Customer ID 'C-105'. Set the PO number to 'PO-8832' and mark the order as Need By next Friday."
5. List Manufacturing Jobs
Tool Name: list_all_epicor_kinetic_jobs
Crucial for shop floor managers and production tracking. The agent can filter Erp.BO.JobEntrySvc/JobEntries to find active jobs for specific parts or assemblies.
"Look up all active jobs for PartNum 'ASM-500'. Identify any jobs that have a required date of this week but are not yet marked as released."
6. List Parts Inventory
Tool Name: list_all_epicor_kinetic_parts
Enables the agent to inspect the item master. Useful for checking descriptions, classes, and base attributes before orchestrating a procurement or job workflow.
"Search the parts catalog for any part description containing 'Titanium Bracket'. Return the part numbers and their current unit of measure."
For a complete list of available tools, query parameters, and schema requirements, view the full inventory on the Epicor Kinetic integration page.
Workflows in Action
How do these tools translate into actual business value? Here are two concrete examples of autonomous agent loops interacting with Epicor Kinetic.
Scenario 1: The Supply Chain Expediter
A procurement manager asks the agent to investigate delays for a specific vendor and update the system.
"Check our open purchase orders for Vendor 'SteelWorks Inc'. If any orders are past their expected delivery date, lookup the associated parts and tell me what manufacturing jobs are at risk."
Execution Steps:
- The agent calls
list_all_epicor_kinetic_vendorswith a filterName eq 'SteelWorks Inc'to retrieve theVendorNum. - The agent calls
list_all_epicor_kinetic_purchase_ordersfiltering by the retrievedVendorNumand identifying POs where the due date is in the past. - For the delayed POs, it calls
list_all_epicor_kinetic_purchase_order_linesto identify the specificPartNumitems that are delayed. - The agent calls
list_all_epicor_kinetic_jobsfiltering byPartNumto find active shop floor jobs dependent on those delayed materials. - The agent formulates a summary response detailing exactly which jobs will be stalled due to the late POs.
Scenario 2: Custom Reporting Copilot
A finance analyst needs data from a custom BAQ but doesn't want to log into the Epicor desktop client.
"Run the 'MonthlyMargin_ByCustomer' BAQ for the previous month. Group the results by Customer ID and highlight any customer where the margin dropped below 15%."
Execution Steps:
- The agent calls
list_all_epicor_kinetic_baqsto verify the exact ID of the 'MonthlyMargin_ByCustomer' BAQ. - The agent calls
list_all_epicor_kinetic_baq_results, passing thebaq_idand appending the required date parameters for the previous month. - The integration layer handles pagination, returning the full dataset (chunked by 100 rows per page upstream).
- The agent processes the returned JSON array, calculates the groupings in memory, and outputs a formatted markdown table highlighting the low-margin accounts.
Building Multi-Step Workflows
To build these workflows, you need to connect your agent framework to Truto. Because Truto standardizes the tool schemas across all integrations, binding them to an LLM is a single API call.
1. Fetching the Tools
First, retrieve the tool definitions for your connected Epicor Kinetic account using the Truto /tools endpoint. This returns a JSON array of proxy APIs formatted as tool schemas.
// Fetch Epicor tools from Truto
const response = await fetch(
`https://api.truto.one/integrated-account/${INTEGRATED_ACCOUNT_ID}/tools?methods[0]=read&methods[1]=write`,
{
headers: {
Authorization: `Bearer ${TRUTO_API_KEY}`,
},
}
);
const epicorTools = await response.json();2. Binding Tools to the Agent
If you are using LangChain, you can use the @trutohq/truto-langchainjs-toolset SDK to automatically bind these schemas to your LLM. This approach is completely framework agnostic - the underlying JSON schemas work identically in CrewAI, Vercel AI SDK, or custom loops.
import { TrutoToolManager } from "@trutohq/truto-langchainjs-toolset";
import { ChatOpenAI } from "@langchain/openai";
import { AgentExecutor, createOpenAIToolsAgent } from "langchain/agents";
// Initialize the Tool Manager
const toolManager = new TrutoToolManager({
apiKey: process.env.TRUTO_API_KEY,
});
// Load the Epicor Kinetic tools
const tools = await toolManager.getTools(process.env.EPICOR_ACCOUNT_ID);
// Initialize the LLM
const llm = new ChatOpenAI({
modelName: "gpt-4o",
temperature: 0,
});
// Bind the tools to the LLM
const llmWithTools = llm.bindTools(tools);3. Handling Errors and Rate Limits
When the agent orchestrates multiple tools, it will eventually encounter errors - most notably, HTTP 429 Rate Limits from Epicor. Because Truto explicitly passes these errors down to the caller, your agent loop must catch them, inspect the normalized headers, and wait.
sequenceDiagram
participant LLM as Agent Framework
participant Truto as Truto Proxy Layer
participant Epicor as Epicor Kinetic API
LLM->>Truto: Call epicor_kinetic_business_object_methods_execute
Truto->>Epicor: POST /api/v2/odata/Company/Erp.BO.SalesOrderSvc/GetByID
Epicor-->>Truto: 429 Too Many Requests
Truto-->>LLM: 429 Error (ratelimit-reset: 60)
Note over LLM: Agent catches error,<br>sleeps for 60s,<br>then retries.
LLM->>Truto: Call epicor_kinetic_business_object_methods_execute
Truto->>Epicor: POST /api/v2/odata/Company/Erp.BO.SalesOrderSvc/GetByID
Epicor-->>Truto: 200 OK
Truto-->>LLM: Normalized JSON payloadIn LangChain, this means wrapping your tool execution or ensuring your custom agent loop parses the error string, extracts the reset window, and pauses execution.
// Example of custom backoff logic in a tool execution wrapper
async function executeToolSafely(toolCall, args) {
try {
return await toolCall(args);
} catch (error) {
if (error.status === 429) {
// Read the normalized Truto headers
const resetTime = error.headers.get('ratelimit-reset');
const sleepMs = (resetTime ? parseInt(resetTime) * 1000 : 5000);
console.log(`Rate limit hit. Agent sleeping for ${sleepMs}ms...`);
await new Promise(resolve => setTimeout(resolve, sleepMs));
// Retry the call once
return await toolCall(args);
}
throw error;
}
}Getting Started with Autonomous ERP Integrations
Building AI agents that safely and reliably interact with Epicor Kinetic requires a solid abstraction layer. By treating Epicor's resources, Business Objects, and BAQs as standardized tools, you eliminate the integration boilerplate and keep your LLM focused on reasoning, not wrestling with OData syntax.
FAQ
- Can AI agents run custom BAQs in Epicor Kinetic?
- Yes. Truto provides a specific tool (`list_all_epicor_kinetic_baq_results`) that allows the AI agent to execute custom Business Activity Queries and pass the required parameters dynamically.
- How does Truto handle Epicor Kinetic rate limits?
- Truto does not retry or apply backoff automatically. It passes the HTTP 429 error to the caller and normalizes the rate limit headers (ratelimit-limit, ratelimit-remaining, ratelimit-reset). Your agent framework must implement the retry logic.
- Do I have to teach the LLM how to write OData queries?
- While the agent must generate valid OData filters for certain endpoints, using a unified tool layer drastically reduces the complexity. The strict JSON schemas define exactly what fields are filterable, limiting the LLM's chance to hallucinate.
- Which agent frameworks work with Truto's tools endpoint?
- Truto's tools endpoint outputs standard JSON schemas, making it entirely framework agnostic. It works natively with LangChain, LangGraph, CrewAI, Vercel AI SDK, and custom agent loops.