SycamoreStart a brief

AI · 12 March 2025

AI Assistants: A Smarter Way to Engage with Your Enterprise System

A
Admin
5 min read · LinxHQ

For decades, Enterprise Resource Planning (ERP) systems have been the backbone of business operations, managing inventory, sales, procurement, HR, and finance.

For decades, Enterprise Resource Planning (ERP) systems have been the backbone of business operations, managing inventory, sales, procurement, HR, and finance. However, interacting with ERP software has remained largely unchanged—users must log in, navigate complex menus, find reports, and manually enter data.

This traditional approach is slow, prone to errors, and often frustrating for end-users.

What if your ERP system could talk back to you? What if instead of navigating through multiple screens, you could simply ask:

What are today’s total sales for the Hanoi branch?

Reorder 50kg of chicken for the central kitchen.

When is my next shift?

With AI-powered assistants like CopilotKit integrated into an ERPNext backend via FastAPI, this vision becomes a reality. In this article, we experiment with CopilotKit’s Python SDK (FastAPI actions) and ChatUI for handling AI-assistant frontend. On the other hand, ERPNext‘s RESTful services are used to access data from the backend.

The Problem with Traditional ERP Interactions

CTOs, IT Managers, and software developers managing ERP implementations often face these challenges:

  • Steep Learning Curve – Users need training to navigate ERP menus effectively.
  • Time-Consuming Manual Tasks – Employees must search for reports, filter data, and submit forms manually.
  • Inefficiency in Multi-Step Workflows – A simple request (e.g., checking stock) requires navigating multiple menus.
  • Limited Accessibility – Accessing ERP data often requires logging into the system, making mobile access cumbersome.

An AI-driven ERP assistant removes these bottlenecks by enabling users to query, update, and analyze ERP data conversationally—without ever touching a UI.

How AI Assistants Transform ERP Workflows

With CopilotKit, we can integrate AI-powered assistants into an ERPNext backend via FastAPI. Let’s explore how this works with real-life ERPNext actions.

Example 1: Checking Stock Levels

Instead of navigating through ERPNext’s stock module, users can simply ask:

How much beef is in stock?

The AI assistant processes this request by calling a FastAPI function that interacts with ERPNext’s REST API:

FastAPI Backend (server.py):

from fastapi import FastAPI
import requests
from copilotkit.integrations.fastapi import add_fastapi_endpoint
from copilotkit import CopilotKitRemoteEndpoint, Action as CopilotAction
# Initialize FastAPI app
app = FastAPI()
# ERPNext API base URL and authentication (update these)
ERP_BASE_URL = "https://your-erp-instance/api/resource"
ERP_HEADERS = {"Authorization": "token your-api-key"}
# ----------------------- ACTIONS -----------------------
# Get Inventory Stock Level
async def get_stock_status(item_name: str):
    response = requests.get(f"{ERP_BASE_URL}/Stock Ledger Entry",
                            headers=ERP_HEADERS,
                            params={"filters": f'[["item_code", "=", "{item_name}"]]'})
    data = response.json()
    total_stock = sum(entry["actual_qty"] for entry in data.get("data", []))
    return {"item": item_name, "stock": total_stock}
# ... other actions
# -------------------- REGISTER ACTIONS WITH COPILOTKIT ---------------
actions = [
    CopilotAction(
        name="get_stock_status",
        description="Fetches current stock level of a specified item.",
        parameters=[{"name": "item_name", "type": "string", "required": True}],
        handler=get_stock_status
    ),...
]
# Initialize CopilotKit SDK
sdk = CopilotKitRemoteEndpoint(actions=actions)
# Add CopilotKit endpoint to FastAPI
add_fastapi_endpoint(app, sdk, "/copilotkit_remote")
# ----------------------- RUN FASTAPI SERVER -----------------------
def main():
    """Run the uvicorn server."""
    import uvicorn
    uvicorn.run("server:app", host="0.0.0.0", port=8000, reload=True)
if __name__ == "__main__":
    main()

You can then run your fastapi server at: http://localhost:8000/copilotkit_remote

CopilotKit Chat Assistant Frontend

We’ll use Nextjs for our front-end.

app/page.tsx – Next.js Frontend for CopilotKit

"use client";
import { useState } from "react";
import { CopilotSidebar, CopilotProvider, useCopilotChat } from "@copilotkit/react";
export default function Home() {
  return (
    <CopilotProvider url="http://localhost:8000/copilotkit_remote">
      <div className="h-screen flex flex-col items-center justify-center bg-gray-100">
        <h1 className="text-2xl font-bold mb-4">AI Assistant for Restaurant Operations</h1>
        <ChatBox />
        <CopilotSidebar />
      </div>
    </CopilotProvider>
  );
}
function ChatBox() {
  const { messages, input, setInput, sendMessage } = useCopilotChat();
  return (
  <div className="w-full max-w-md bg-white rounded-lg shadow p-4">
    <div className="h-60 overflow-y-auto border-b pb-2">
    {messages.map((msg, index) => (
      <div key={index} className={`my-2 p-2 rounded ${msg.role === "user" ? "bg-blue-200" : "bg-gray-200"}`}>
        <strong>{msg.role === "user" ? "You:" : "AI:"}</strong> {msg.content}
      </div>
    ))}
    </div>
    <div className="mt-2 flex">
      <input
        type="text"
        className="flex-1 border p-2 rounded-l"
        placeholder="Ask AI Assistant..."
        value={input}
        onChange={(e) => setInput(e.target.value)}
        onKeyDown={(e) => e.key === "Enter" && sendMessage(input)}
      />
    <button className="bg-blue-500 text-white px-4 rounded-r" onClick={() => sendMessage(input)}>Send</button>
    </div>
  </div>
  );
}

A response from our Chat Agent could look something like this:

Stock for beef: 15 kg. It’s running low, do you want to reorder?

Example 2: Placing a Purchase Order

A restaurant manager no longer needs to manually create a purchase order in ERPNext. Instead, they simply say:

Reorder 20kg of salmon.

Instead of navigating multiple ERP screens, the AI assistant automatically creates the order, reducing processing time from 5 minutes to seconds.

The backend end action may look something like this:

async def create_purchase_order(item_code: str, quantity: int):
    payload = {
        "doctype": "Purchase Order",
        "supplier": "Preferred Supplier",
        "items": [{"item_code": item_code, "qty": quantity}]
    }
    response = requests.post(f"{ERP_BASE_URL}/Purchase Order", json=payload, headers=ERP_HEADERS)
    return {"status": "Order Placed", "po": response.json().get("data", {}).get("name")}

Example 3: Price-Adjustment

Likewise, you may implement for the following scenario:

Price-adjustment based on demand

Suggest a new price for Wagyu Steak.

Response from assistant:

Wagyu Steak is popular! Suggested price increase: $55 → $60.

Why AI Assistants Are the Future of ERP Interaction?

Faster Decision-Making

🚀 AI-driven ERP queries enable instant access to critical business data. Instead of navigating dashboards, filtering data, and running reports, managers get real-time insights in seconds.

Increased Employee Productivity

Routine ERP tasks (inventory checks, order creation, report generation, etc.) are automated, allowing employees to focus on high-value work.

Lower Training Costs

ERPNext like any other ERP systems out there, has a learning curve, requiring training for non-technical employees. AI chat interfaces eliminate complexity by allowing users to speak naturally to the system.

Enhanced Accessibility (Mobile & Voice)

AI assistants can work via mobile, voice commands, or even chat apps—allowing business owners and managers to interact with ERP data on the go.

🚀 Bringing AI-Powered ERP Automation to Your Business

At LinxHQ, we can help you build AI-driven ERP solutions that enhance efficiency, reduce operational costs, and improve business agility.

How We Can Help

  • Custom AI-powered ERP integrations
  • Automation of sales, inventory, procurement, and HR workflows
  • Chatbot-driven ERP navigation to improve employee productivity
  • Deployment of AI assistants on-premise or in the cloud

Would you like to see how AI-driven ERP automation can streamline your operations?

👉 Contact us today for a consultation.