Frappe Ai

AI powered Assistant for Frappe with both anthropic and open Ai intergrations

Install Frappe Ai

bench get-app https://github.com/BigPhilsnr/frappe-ai

Add the Frappe Gems badge to your README

Maintain Frappe Ai? Paste this into your README:

[![Listed on Frappe Gems](https://frappegems.com/api/method/frappe_gems.seo.badge?app=BigPhilsnr%2Ffrappe-ai)](https://frappegems.com/gems/apps/BigPhilsnr/frappe-ai)

About Frappe Ai

Frappe Copilot

A powerful AI assistant for Frappe Framework development, providing intelligent guidance and support for ERPNext and custom app development.

Features

  • Intelligent DocType Analysis: Get detailed information about DocTypes, fields, and permissions
  • Code Generation: Generate Python and JavaScript code following Frappe conventions
  • Best Practices: Get recommendations for folder structure, naming conventions, and migrations
  • Interactive Chat: Chat interface integrated into Frappe Desk
  • Customizable AI Models: Support for different AI models and endpoints

Installation

The app is already installed on your site. If you need to reinstall:

bench get-app copilot
bench --site your-site-name install-app copilot

Setup

  1. Configure AI Model: Go to Desk > Copilot > Chat Configuration
  2. Create Configuration:

    • Configuration Name: "My Copilot"
    • AI Model: "gpt-4" (or your preferred model)
    • API Endpoint: "https://api.openai.com/v1/chat/completions"
    • API Key: Your OpenAI API key
    • Enable the configuration
  3. Access Copilot:

    • Click the robot icon in the navbar
    • Or visit /copilot-chat directly
    • Or use keyboard shortcut: Ctrl/Cmd + Shift + C

Usage

Basic Chat

Start a new session and ask questions like: - "Show me all fields on Sales Invoice" - "Create a new DocType for Support Tickets" - "Help me write a client script for Customer form"

Advanced Features

  • DocType Inspection: "Get schema for Purchase Order"
  • Code Generation: "Write a server script to validate employee data"
  • Best Practices: "How should I structure my custom app?"

API Endpoints

The app provides several API endpoints for integration:

  • copilot.api.chat.get_active_configuration - Get active AI configuration
  • copilot.api.chat.create_chat_session - Create new chat session
  • copilot.api.chat.send_message - Send message to AI
  • copilot.api.chat.get_frappe_metadata - Get Frappe metadata

Configuration

System Prompt

The app comes with a comprehensive system prompt that makes the AI: - Understand Frappe Framework conventions - Provide code in proper format - Give step-by-step instructions - Reference official Frappe APIs

API Headers

You can add custom headers for your AI service in the "Additional Headers" field (JSON format):

{
  "X-Custom-Header": "value",
  "Organization": "your-org-id"
}

Troubleshooting

Common Issues

  1. No response from AI: Check your API key and endpoint configuration
  2. Permission errors: Ensure you have System Manager or Desk User role
  3. Chat not loading: Clear browser cache and restart bench

Error Logs

Check the Error Log DocType for detailed error messages.

Security

  • API keys are stored securely using Frappe's Password field type
  • Only authorized users can access chat sessions
  • All API calls are logged for audit purposes

Support

For issues and feature requests, please check the app's repository or contact the development team.

License

MIT License - see LICENSE file for details.Copilot

copilot

License

mit# frappe-ai

Related Developer Tools apps for Frappe & ERPNext

  • Frappe — Low code web framework for real world applications, in Python and Javascript
  • Frappe Docker — Docker environment for developing, deploying, and running Frappe applications (ERPNext and custom apps) in production and development
  • Builder — Craft beautiful websites effortlessly with an intuitive visual builder and publish them instantly
  • Bench — CLI to manage Multi-tenant deployments for Frappe apps
  • Frappe Ui — A set of components and utilities for rapid UI development
  • Press — Full service cloud hosting for the Frappe stack - powers Frappe Cloud
  • Gameplan — Open Source Discussions Platform for Remote Teams
  • Doppio — A Frappe app (CLI) to magically setup single page applications and Vue/React powered desk pages on your custom Frappe apps.