Ask ALYF adds an assistant to ERPNext so users can ask questions, find information, and get help working with documents without leaving the Desk.
It is built for teams that already use ERPNext and want a practical assistant inside their existing system, not a separate chat product with a separate permission model.
Use Ask ALYF to:
- ask questions about records, reports, configuration, and installed apps
- summarize documents and data that the current user is allowed to see
- create charts from ERPNext data
- generate PDFs from existing documents
- upload files and extract information from PDFs or images, when file upload is enabled
- navigate around Desk, open new forms, and jump to relevant fields
- create or update ERPNext documents in Agent mode, after explicit confirmation
Answers are shown in the chat bubble and can include formatted text, tables, code blocks, file links, and charts.
Ask mode is for questions and research. The assistant can read permitted data, explain records, look up configuration, search documentation, and help users understand what is already in the system.
Agent mode is for taking action. The assistant can prepare changes such as creating, updating, submitting, cancelling, amending, renaming, or deleting documents. Before anything is changed, the user sees a proposal and must approve it.
Ask ALYF can also add a small sparkles button next to long text fields on Desk forms. Users can describe what they want written, and the assistant fills the field in place.
This is useful for descriptions, emails, internal notes, terms, and other longer text fields. After text is inserted, an Undo action is available for a few seconds.
The field assistant is available only to users with the Ask ALYF User role and when Allow Field Agent is enabled in Ask ALYF Settings.
Ask ALYF stays close to the Frappe Framework. It uses the existing Desk, the standard file uploader, Frappe Charts, and the same role-based permissions users already have in ERPNext.
The assistant does not become an all-powerful back door. If a user cannot read or change something through Frappe permissions, Ask ALYF should not be able to do it for them either.
Users can type messages. In browsers that support the Web Speech API, the chat bubble also offers microphone input that turns speech into text.
Access is granted through the Ask ALYF User role.
The assistant works with the permissions of the logged-in user. A user with limited access only gets limited answers and limited actions; an Administrator can do more because the Administrator can already do more in ERPNext.
Agent mode has additional guardrails:
- Every write operation requires explicit user confirmation before execution.
- Bulk writes are intentionally limited.
batch_insertcan create multiple records of the same DocType, but each row still goes through framework validation. - Framework rules are respected. For example, submitted documents must be cancelled before they can be deleted.
- Administrators can exclude selected DocTypes from Agent mode in Ask ALYF Settings.
Read-only SQL is available only to Administrator and System Manager users.
Configure Ask ALYF in Ask ALYF Settings.
Common settings include:
- Enabled
- LLM Provider
- Base URL for OpenAI-compatible providers
- API Key
- Chat Model
- Allow Agent Mode
- Allow Code Search
- Allow File Upload
- Allow Field Agent
- Excluded DocTypes
- separate vision model settings, if document and image extraction should use a different model
Conversations are stored in the Ask ALYF Conversation DocType. This keeps conversations available across page reloads and provides an audit trail for Agent mode proposals and actions.
Old conversations are deleted after 90 days by default. The retention period can be configured per site through Log Settings.
Ask ALYF uses tool calls to read data, inspect metadata, navigate the Desk, render charts, and prepare document changes. Data-access tools wrap Frappe APIs such as frappe.client, so normal framework permissions and validations continue to apply.
Data retrieval:
get_listlists records with filters, fields, ordering, pagination, andgroup_byaggregationget_countcounts matching recordsgetreads one permitted documentget_valuereads selected field valuesget_single_valuereads a field from a Single DocType
Schema, permissions, and UI:
get_metareads DocType metadatahas_permissionchecks whether the current user has a permission on a documentget_doc_permissionsreturns the evaluated permissions for a documentlist_accessible_doctypeslists DocTypes the current user can read or writelist_accessible_reportslists reports the current user can accesstranslate_ui_labelstranslates UI labels so answers match the user's language
Files, printing, charts, and navigation:
get_printgenerates a PDF print for a permitted documentget_file_idresolves a File ID from an attachment referenceread_file_recordreads content from File recordsextract_document_dataextracts structured data from PDF or image File recordsshow_chartrenders one or more Frappe Charts below an assistant messageset_routenavigates to a Desk routenew_docopens a new document form with optional defaultsscroll_to_fieldscrolls to a field on the active form
Optional tools:
source_code_analyzersearches installed app files when Allow Code Search is enabledrun_read_only_sqlruns read-only SQL for Administrator and System Manager usersget_app_version,read_github_releases, andread_documentation_pagehelp answer app and documentation questions
Agent mode includes the Ask mode tools plus tools that prepare confirmed actions:
document_plannerprepares safeinsert,save, orset_valuepayloads before a proposal is showninsertcreates a documentbatch_insertcreates multiple documents of the same DocTypesaveupdates a documentset_valueupdates selected fieldssubmitsubmits a submittable documentcancelcancels a submitted documentamendcreates an amended copy of a cancelled documentdeletedeletes a document when framework rules allow itrename_docrenames a documentattach_fileattaches a File to a documentrun_whitelisted_methodcalls an accessible@frappe.whitelist()methodfrm_set_valuesets a field on the active form in the browserfrm_add_childadds a child table row on the active form in the browser
Each request can include the current Desk route, active document doctype and name, list view filters, user language, user defaults, and user roles.
Permission errors, validation errors, missing records, and LLM provider failures are shown as user-facing messages instead of raw tracebacks. If the assistant refers to a missing DocType or field, it can re-check metadata before retrying.
- any-agent for agent orchestration
- any-llm-sdk for LLM provider access
- PyMuPDF for PDF handling
Install this app with the bench CLI:
cd $PATH_TO_YOUR_BENCH
bench get-app $URL_OF_THIS_REPO --branch develop
bench install-app ask_alyfThis repository includes a Cursor cloud-agent setup in .cursor/ for bootstrapping a self-contained Frappe bench on the remote machine.
To use it:
- Open the
ask_alyfrepository itself in Cursor, not your local bench root. - Rebuild the cloud-agent environment so Cursor picks up
.cursor/environment.json. - Let the agent finish the initial install. It creates a bench in
$HOME/frappe-bench, starts MariaDB and Redis, creates a default site, and soft-links the checked-out repo into the bench.
Useful variables in .cursor/install.sh:
REPO_NAMEdefaults toask_alyfand is used for the bench app path and default site name.SITE_NAMEoverrides the default site, which otherwise becomes<repo-name>.localhost.BENCH_ROOToverrides the bench location.FRAPPE_BRANCHlets you pin a different Frappe branch.
Troubleshooting:
- If you change
.cursor/Dockerfile,.cursor/install.sh, or dependency versions, rebuild the environment so Cursor refreshes the cached setup. - If the standalone
starthook is skipped by Cursor, thebenchterminal still runs.cursor/start.shbeforebench start. - If setup fails during
bench initorbench build, check the environment build logs first, then thebenchterminal output.
This app uses pre-commit for code formatting and linting. Please install pre-commit and enable it for this repository:
cd apps/ask_alyf
pre-commit installPre-commit is configured to use:
- ruff
- eslint
- prettier
- pyupgrade
This app can use GitHub Actions for CI. The configured workflows are:
- CI installs this app and runs unit tests on every push to the
developbranch. - Linters run Frappe Semgrep Rules and pip-audit on every pull request.
Ask ALYF is self-hosted. The published source code does not send usage data, analytics, or chat contents to the maintainers of this project.
The app calls the LLM and related providers you configure. Text, context, and uploaded documents may be processed by those providers under their privacy policies and terms. See PRIVACY.md.
This project is licensed under the GNU Affero General Public License v3.0 (AGPL-3.0).
If you want to use Ask ALYF under different terms, for example to whitelabel or rebrand it without the AGPL's copyleft requirements, commercial licenses are available. Contact hallo@alyf.de for details.
