ERPNext + Frappe + private AI
AI for ERPNext, Built on the Frappe Framework You Already Run
Short answer
AI for ERPNext connects a private LLM directly to Frappe's REST API and DocType model, so manufacturing, purchasing, and finance staff can ask plain-English questions about Work Orders, BOMs, and Job Cards and get answers grounded in live Frappe data. It runs beside your self-hosted bench or Frappe Cloud instance, keeping business data inside infrastructure you control.
- ERP
- ERPNext, Frappe Framework
- Industries
- Manufacturing, Distribution
- Written for
- IT Director
ERPNext is unusual among ERPs in that its data model is genuinely transparent: everything is a DocType, every DocType has a REST endpoint, and the Frappe framework was built from day one to be queried and extended by developers. That openness is exactly why ERPNext has spread so widely among cost-conscious manufacturers and distributors, especially in India and other price-sensitive markets, and why so many companies run it self-hosted rather than on Frappe Cloud.
The same openness creates a different problem: because customization is so easy (a Server Script here, a Client Script there, a new DocType added in an afternoon), instances diverge quickly, and the people who understand the resulting structure are usually one or two developers who built it, not the operations or finance staff who need answers from it. Query Reports and the Frappe Insights module help, but both still require someone who can write SQL or configure a report definition.
ERPNext ships its own AI assistant features in recent versions, but like most vendor AI additions, they are tuned for general assistance rather than deep, auditable grounding in your specific Work Order, BOM, and Job Card data, and they are not built with an air-gapped or fully self-hosted deployment in mind. Manufacturers who chose ERPNext partly to avoid vendor lock-in and cloud dependency want the same independence from their AI layer.
This page covers how a private AI layer sits on top of ERPNext's Frappe REST API, what DocTypes and manufacturing objects it typically touches first, and the questions worth asking before connecting any AI tool, ours or anyone else's, to a production Frappe site.
What usually gets in the way
The problems we hear most from it director teams running ERPNext.
Every customization is a DocType, and DocTypes multiply fast
Because adding a new DocType or field takes minutes in the Frappe Desk, instances accumulate custom fields and child tables quickly, and there is rarely documentation describing what each one is for six months later.
Query Reports require someone who can write SQL
ERPNext's built-in reporting is powerful for anyone comfortable writing a SQL query or a Frappe Query Report, but that excludes most operations and finance staff who just want an answer to a specific question.
Self-hosted bench upgrades carry real customization risk
Running your own bench (rather than Frappe Cloud) gives control over hosting cost and data residency, but every version upgrade risks breaking a Server Script or Client Script nobody has looked at since it was written.
REST API integration needs careful key management
The Frappe REST API is straightforward to call, but a poorly scoped API key and secret can expose far more than intended; most instances have at least one integration with broader access than it actually needs.
Talent familiar with both manufacturing operations and Frappe is uneven
ERPNext's community is strong for developers, but functional consultants who understand discrete manufacturing (routings, BOM explosion, capacity) as well as the Frappe framework are harder to find outside a handful of specialist partners.
Where AI earns its place in ERPNext
Each use case names the ERP objects it reads or writes, so your ERP team can judge the integration effort before anyone commits budget.
Natural-language Work Order and BOM queries
Production planners ask questions like "which Work Orders are behind schedule because of a missing raw material" and get an answer built from a live query against the relevant DocTypes.
Touches: Work Order, BOM, Stock Entry, Item
Outcome: Replaces a daily manual scan of the Work Order list with a direct answer in seconds.
Job Card shop-floor assistant
Operators ask a floor terminal for the next operation, time logged so far, or linked Quality Inspection status without navigating the full Frappe Desk interface.
Touches: Job Card, Workstation, Quality Inspection
Outcome: Cuts the number of supervisor interruptions for routine status questions on the floor.
Purchase Order follow-up agent
The agent reviews open Purchase Order items against promised delivery dates and drafts a follow-up communication to the supplier for a buyer to review before sending.
Touches: Purchase Order, Purchase Order Item, Supplier
Outcome: Turns a manual morning review of overdue POs into a queue of drafted follow-ups ready for approval.
Stock reconciliation exception review
When a Stock Reconciliation shows a variance, the assistant summarizes recent Stock Entries and Job Card consumption against the affected Item to suggest a likely cause.
Touches: Stock Reconciliation, Stock Entry, Job Card
Outcome: Shortens investigation time on recurring inventory variances that otherwise get written off without a real cause.
Quality Inspection drafting
When a Quality Inspection fails, the assistant drafts the non-conformance narrative with the relevant Job Card, Item, and prior similar failures already referenced.
Touches: Quality Inspection, Job Card, Item
Outcome: Cuts the time to produce a usable non-conformance record and keeps the wording consistent across shifts.
Multi-company consolidated reporting
A single natural-language question resolves across every company in a Frappe multi-company setup that the requesting user has access to, instead of a separate Query Report per entity.
Touches: Company, Work Order, Sales Order
Outcome: Gives group-level visibility without maintaining a custom consolidated Query Report by hand.
DocType and Server Script documentation
The assistant reads DocType definitions, Server Scripts, and Client Scripts to answer "what does this custom field actually do," turning undocumented customization into a searchable answer.
Touches: DocType, Server Script, Client Script, Custom Field
Outcome: Reduces onboarding time for a new developer or administrator inheriting an under-documented instance.
Reference architecture
The AI layer connects through Frappe's own REST API and respects Frappe's role-based permission system, so an answer only ever includes data the requesting user's role already permits inside ERPNext.
- 1
Frappe connector
Connects via the /api/resource REST endpoints or the Frappe Client Python library using a scoped API key and secret tied to a dedicated read-focused user.
- 2
Semantic layer
Maps Work Order, BOM, Job Card, Stock Entry, and finance DocTypes, including custom fields and child tables, to the business terms planners and buyers actually use.
- 3
Model serving
An open-weight model served with vLLM or Ollama on customer-owned or customer-controlled GPUs, sized to typical ERPNext transaction volumes for small and mid-sized manufacturers.
- 4
Retrieval and agents
Retrieval-augmented generation grounds answers in live Frappe API queries; agents that draft purchase follow-ups or non-conformance records require human approval before any write.
- 5
Governance and audit
Queries and answers are logged against the requesting Frappe user and role, giving an audit trail consistent with what Frappe's own activity log would show.
Integration notes for your ERP team
- Connects through Frappe's REST API (/api/resource/<doctype>) or the Frappe Client Python library using a scoped API key and secret, not the Administrator account.
- Generated queries respect Frappe's role-based permission system and user permissions, so results match what the requesting user could already see in the Desk.
- Custom DocTypes, custom fields, and child tables are indexed automatically so the semantic layer stays current as developers extend the schema.
- Optional direct read-replica MariaDB connection for heavier analytical questions that would be slow through the REST API alone.
- Write-back actions (draft POs, non-conformance records, follow-up emails) route through a queued Frappe document a human reviews and submits, never a direct database write.
- Server Scripts and Client Scripts are read (not executed) by the documentation use case, avoiding any risk of triggering unintended automation.
- Compatible with self-hosted bench, Docker-based, and Frappe Cloud deployments; version differences across recent ERPNext releases are handled in the connector, not assumed away.
Deployment options
Air-gapped on-prem
Manufacturers running their own bench behind a firewall, especially those with export-controlled or customer-restricted data that cannot reach a public API.
The model and connector run on customer-owned hardware with no outbound path; MariaDB access stays entirely on the local network.
Private or sovereign cloud
Companies on Frappe Cloud, or a self-managed VPS, who want AI capability without operating GPU infrastructure themselves.
Deployed in a dedicated tenant or VPC under the customer's own cloud account, separate from Frappe Cloud's own infrastructure and from any shared AI service.
Hybrid
Groups running one bench per subsidiary or region after growth or acquisition.
A central retrieval and governance layer connects to each Frappe site through its own scoped API key, preserving per-site data residency rather than merging into a single database.
Compliance and data control
How the architecture supports your obligations. Certification and accountability stay with your organisation; the design keeps the evidence straightforward.
GDPR / regional data protection
Because the model runs inside customer-controlled infrastructure, personal data in HR or CRM DocTypes never transits a third-party AI API, simplifying data-transfer and lawful-basis questions.
India DPDP Act and similar regional regimes
For the large share of ERPNext deployments in India and other markets with emerging data-protection law, on-prem or in-country private cloud deployment keeps data residency straightforward to demonstrate.
Customer flow-down and NDA terms
Manufacturers supplying OEMs with contractual restrictions on cloud AI use can point to an architecture where the model never leaves infrastructure they control.
SOC 2 expectations from downstream customers
Role-based access logging tied to existing Frappe permissions and no external data egress give concrete answers for a customer vendor-security review.
Where Netray fits
ERPray
ERPNext's transparent DocType model, once mapped to a semantic layer, fits ERPray's grounded natural-language question answering well, particularly for planners and buyers who do not write SQL.
Custom build
Instances with significant custom DocTypes or unusual Server Script logic often need a bespoke connector and agent set built around the specific customization rather than a generic template.
How an engagement runs
Phase 1 . 2-3 weeks
Discovery
- -Inventory of custom DocTypes, fields, and relevant manufacturing/finance objects
- -Review of existing roles and user permissions
- -Priority use cases ranked by planner, buyer, and finance pain
- -Deployment recommendation (self-hosted on-prem, private cloud, hybrid)
Phase 2 . 6-8 weeks
Pilot
- -Working connector against a non-production Frappe site
- -3-5 use cases live for a pilot group
- -Accuracy review against known correct answers
- -Governance and logging validated against existing Frappe roles
Phase 3 . 4-6 weeks
Production
- -Cutover to the production bench or Frappe Cloud site with a scoped API user
- -Full audit logging in place
- -Runbook for adding new use cases without a full redeploy
- -Handoff documentation for your internal Frappe developer
Phase 4 . Ongoing
Scale
- -Expansion to additional companies in a multi-company setup
- -Additional agent use cases with approval workflows
- -Model refresh as open-weight options improve
- -Quarterly review of usage and accuracy against real questions asked
Questions to ask any vendor, including us
A short list that separates real ERPNext AI work from a chatbot demo.
- Does the AI layer respect Frappe's role-based permissions, or does it use a broader credential than a normal user would have?
- Where does the model run, and can the network path be confirmed to show no data leaving our environment?
- How are custom DocTypes and fields kept current in the semantic layer as our developers add more of them?
- What happens when a bench upgrade changes a DocType schema the AI relies on?
- Is every generated query and answer logged against the requesting Frappe user?
- What GPU hardware is actually required, and can it run on infrastructure we already have?
- Can we start with read-only question answering before considering agents that draft or submit documents?
- If we stop the engagement, do we retain the connector code, prompts, and logs?
Frequently asked questions
Does this work with a fully self-hosted ERPNext bench?
Yes. Self-hosted bench deployments are the most common setup for manufacturers who want AI on-prem, since the model, connector, and Frappe site can all run inside the same network boundary with no outbound dependency on a third-party API.
How is this different from ERPNext's own built-in AI features?
ERPNext's native AI assistant is tuned for general help across the Desk interface and typically depends on an external API. A private AI layer is built specifically to ground answers in your DocTypes and to run entirely on infrastructure you control, with a full audit trail.
Can it handle heavily customized DocTypes?
Yes, but the semantic layer needs to be mapped to your actual custom fields and child tables during discovery. Because Frappe makes customization so easy, this mapping step matters more for ERPNext than for less customizable ERPs.
Does it require changes to our Frappe permission model?
No. The connector uses a scoped API key tied to a dedicated user and generates queries that respect the role-based permissions already configured. It works within your existing permission model rather than requiring changes to it.
What happens if a bench upgrade breaks a Server Script the AI depends on?
Upgrades are treated as a planned, tested step, the same way any other integration or customization is retested. The connector and semantic layer are validated against the new version before cutover.
Can the AI create or submit ERPNext documents directly?
It can draft a document, such as a follow-up email or a Quality Inspection note, but submission requires a human to review and approve through a queued workflow. Nothing writes directly to the database without that step.
Is this affordable for a smaller ERPNext deployment?
ERPNext's cost-conscious user base is exactly why a right-sized deployment matters: a smaller model on modest GPU hardware, focused on two or three high-value use cases, keeps both the software and infrastructure cost proportionate to a smaller manufacturer's budget.
Related guides
Natural Language Query for ERP Data: Ask SAP, Infor, or Oracle a Question in Plain English
See how natural language query over SAP, Infor, Oracle, and NetSuite data works: grounded text-to-SQL, role-based permissions, and a visible audit trail.
RAG + SQL + permissionsA Private LLM Grounded on Your ERP Data
How a private LLM answers questions on your ERP data: RAG plus text-to-SQL, role-based permissions inherited from the ERP, and where each fits.
Agents + approval gatesAI Agents for ERP, Running On-Prem
A practical guide to on-prem AI agents for ERP: what they can safely automate, where human approval belongs, and how to design the guardrails.
ERP AI Buyer GuideHow to Choose an ERP AI Implementation Partner
A CIO checklist for picking an ERP AI implementation partner: the architecture questions to ask, red flags, pricing models, and what to demand in the SOW.
ERP AI readinessIs Your ERP Ready for AI? A Readiness Assessment Checklist
Is your ERP actually ready for AI? A practical checklist covering master data quality, access and permissions, GPU sizing, and governance before you fund a pilot.
ERP AI Cost GuideWhat ERP AI Actually Costs: A CFO's Guide
A CFO's guide to what ERP AI actually costs: GPU hardware, model licensing, integration and connector work, and realistic ongoing run-rate ranges.
Plan it with numbers
ERP AI Maturity Assessment
Benchmark how deeply AI and automation are embedded in your ERP operations, from data foundations to autonomous agents, across four maturity levels.
Free ToolAI Build vs Buy Assessment
Score your AI initiative across differentiation, internal capacity, vendor maturity, data sensitivity, and budget to get a clear build, buy, or hybrid recommendation.
Free ToolERP Implementation Timeline Estimator
Estimate a realistic ERP implementation duration from your user count, sites, module scope, customization level, and team availability, with contingency included.
GuideAI Agents for ERP: The Complete Guide
Everything you need to know about AI agents for ERP systems. How they work, ROI expectations, implementation approaches, and real-world results.
GuideNatural Language ERP Query Interface
Query your ERP using natural language. Transform plain English questions into SQL/API calls with LLM-powered interfaces that democratize ERP data access.
GuideERP Vendor Selection & Evaluation Scoring Matrix
Use a weighted scoring matrix to evaluate ERP vendors objectively. Compare functionality, TCO, implementation risk, and vendor viability across platforms.
Talk it through with an engineer who knows ERPNext
Bring one real question your team cannot answer from the ERP today. We will map the data path, the model, and where it runs, and tell you honestly if AI is the wrong tool for it.