Erpnext Copilot

Install Erpnext Copilot

bench get-app https://github.com/ameenmari/erpnext_copilot

Add the Frappe Gems badge to your README

Maintain Erpnext Copilot? Paste this into your README:

[![Listed on Frappe Gems](https://frappegems.com/api/method/frappe_gems.seo.badge?app=ameenmari%2Ferpnext_copilot)](https://frappegems.com/gems/apps/ameenmari/erpnext_copilot)

About Erpnext Copilot

ERPNext Copilot

Ask ERPNext in plain English, safely.

Features

  • Desk page to ask natural-language questions about your ERP data
  • Schema-aware planning (real DocType metadata, not guessed fields)
  • Structured JSON query plans validated before execution
  • Permission-safe reads via frappe.get_list / frappe.get_doc as the current user
  • OpenAI-compatible providers (OpenAI, Azure, Groq, Ollama, …)
  • Demo prompts for quick screenshots / community demos
  • Optional draft create with explicit Approve / Cancel

2-minute installation

cd frappe-bench

# Folder name must match the app: erpnext_copilot
git clone https://github.com/ameenmari/erpnext_copilot.git apps/erpnext_copilot

bench setup requirements
bench --site  install-app erpnext_copilot
bench --site  migrate
bench build --app erpnext_copilot
bench restart

Requires a working Frappe bench with ERPNext installed for invoice/stock demo questions.

Configure AI

  1. Open ERPNext Copilot Settings (or Workspace → ERPNext Copilot → Settings)
  2. Check Enabled
  3. Set Provider = OpenAI (OpenAI-compatible)
  4. Set Model (e.g. gpt-4o-mini)
  5. Paste API Key
  6. Optional Base URL for compatible endpoints (http://127.0.0.1:11434/v1 for Ollama)
  7. Save

Assign role ERPNext Copilot User to people who should ask questions (Administrator gets it on install).

Ask your first question

Desk → ERPNext Copilot → type a question → Ask.

Example questions

  • Show unpaid invoices older than 30 days
  • Show unpaid invoices
  • Show low-stock items
  • Show this month's sales invoices
  • How many sales orders were created this week?
  • Show customers with overdue payments
  • Show purchase orders waiting for approval
  • Show today's deliveries
  • Find customer ABC

How safety works

AI proposes a structured query → validator checks it → ERPNext executes it using the current user's permissions.

  • No raw SQL by default (not implemented)
  • No generated Python execution
  • No ignore_permissions
  • Mutations (create) require on-screen Approve

Privacy

Sent to the LLM by default:

  • your question
  • relevant DocType field metadata
  • today's date / capabilities

ERP business records are queried locally inside ERPNext and are not sent to the model for planning.

Current limitations

  • Read-focused MVP (list, count, get); create is draft + approval only
  • No delete / cancel / submit / payment / refund
  • Stock “low stock” quality depends on Item fields available on your site
  • Requires an external LLM (or local OpenAI-compatible server)
  • Best with ERPNext DocTypes installed (Sales Invoice, Item, …)

Development

# Pure unit tests (no bench required)
cd apps/erpnext_copilot   # or this repo root
python -m unittest erpnext_copilot.tests.test_json_plan -v

# Full app tests (Frappe site required)
bench --site  run-tests --app erpnext_copilot

License

MIT — see license.txt.

Security

See docs/SECURITY.md.

Related Accounting apps for Frappe & ERPNext

  • Books — Free Accounting Software
  • Lending — Open Source Lending software
  • Payments — A payments app for frappe
  • Banking — Load your bank transactions into ERPNext and reconcile them with your vouchers.
  • Erpnext Quota — App to manage ERPNext Site, User, Company and Space limitations
  • Utility Billing — The Utility Billing & Property Management App is a powerful addition to ERPNext, designed to streamline utility billing, property leasing, and tenant management. Ideal for municipal utilities, real estate managers, and property developers.
  • Expense Request — ERPNext Expense Requests
  • Vendor Payments — A frappe app that has workflows and reports to make payments to vendors by a company and track them