Skip to content

About

AI-powered ERPNext assistant — query ERP data, perform actions, generate charts, and automate reports using natural language.

Topics

Resources

Contributing

Security policy

Stars

13 stars

Watchers

1 watching

Forks

Latest commit

 

History

5 Commits

Folders and files

Repository files navigation

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 <site> install-app erpnext_copilot
bench --site <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 <site> run-tests --app erpnext_copilot

License

MIT — see license.txt.

Security

See docs/SECURITY.md.

About

AI-powered ERPNext assistant — query ERP data, perform actions, generate charts, and automate reports using natural language.

Topics

Resources

Contributing

Security policy

Stars

13 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages