Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

501 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

com.cloudempiere.ai

Local build setup: see iDempiereCLDE/LOCAL_BUILD.md for the one-time ~/.m2/settings.xml configuration that lets mvn verify resolve P2 artifacts from sibling local builds instead of S3.

Modular AI Plugin Suite for iDempiere ERP

Version iDempiere License


⚠️ Important: iDempiere Dependency

This plugin depends on the iDempiereCLDE project:

  • Repository: cloudempiere/iDempiereCLDE
  • Version: iDempiere v10 (10.0.0-SNAPSHOT)
  • Java: Amazon Corretto 11
  • Location: ../iDempiereCLDE/

Before building this plugin:

# Set Java 11
export JAVA_HOME=/Library/Java/JavaVirtualMachines/amazon-corretto-11.jdk/Contents/Home

# Build iDempiere dependencies
cd ../iDempiereCLDE/org.idempiere.parent && mvn clean install -DskipTests
cd ../iDempiereCLDE/org.idempiere.p2.targetplatform && mvn clean install -DskipTests

# Return to plugin directory
cd ../com.cloudempiere.ai

Overview

Modular AI plugin suite for Cloudempiere that integrates advanced AI capabilities into iDempiere ERP. The project has been refactored from a monolithic plugin into domain-specific modules for better maintainability and flexibility.

Module Architecture

The plugin suite consists of:

  • com.cloudempiere.ai.deps (v0.35.0) - Shared dependencies (LangChain4j, Jackson, AWS SDK)
  • com.cloudempiere.ai.core (v0.32.0) - Core infrastructure and provider framework
  • com.cloudempiere.ai.sales (v0.32.0) - Sales domain AI capabilities
  • com.cloudempiere.ai.inventory (v0.32.0) - Inventory domain AI capabilities
  • com.cloudempiere.ai.purchasing (v0.32.0) - Purchasing domain AI capabilities
  • com.cloudempiere.ai.support (v0.32.0) - Support ticket domain AI capabilities
  • com.cloudempiere.ai.kb (v0.32.0) - Knowledge base domain AI capabilities
  • com.cloudempiere.ai.theme (v10.0.2) - ZK UI theme customizations
  • com.cloudempiere.ai.feature (v10.0.2) - Eclipse feature definition
  • com.cloudempiere.ai.p2 (v10.0.2) - P2 update site repository

Key Features

  • Multi-Provider Architecture: Support for Anthropic, AWS Bedrock, Ollama, OpenAI
  • LangChain4j Integration: Agent framework for complex AI workflows
  • Secure Database Access: AI queries respect user roles and permissions
  • AI Chat Widget: Interactive chat component for ZK UI
  • Context-Aware: Extracts business context from iDempiere windows/charts
  • ERP Tools: @Tool-annotated methods for database operations
  • Audit Trail: Complete logging of AI-initiated actions

Quick Start

Installation

  1. Clone and setup iDempiere dependency:

    cd ~/github
    git clone https://github.com/cloudempiere/iDempiere.git iDempiereCLDE
    cd iDempiereCLDE
    git checkout iDempiereCLDE
    
    # Build parent and target platform
    cd org.idempiere.parent && mvn clean install -DskipTests
    cd ../org.idempiere.p2.targetplatform && mvn clean install -DskipTests
  2. Clone this plugin:

    cd ~/github
    git clone https://github.com/cloudempiere/com.cloudempiere.ai.git
    cd com.cloudempiere.ai
  3. Build the plugin:

    export JAVA_HOME=/Library/Java/JavaVirtualMachines/amazon-corretto-11.jdk/Contents/Home
    mvn clean install -DskipTests
  4. Configure AI Provider:

    • Deploy plugin to iDempiere server
    • Configure AI Provider in System Configurator
    • Add API credentials (Anthropic, AWS, etc.)

Configuration

Configure an AI provider in iDempiere:

  1. Navigate to System Configurator → AI Providers
  2. Create new AIG_Provider record:
    • Name: "Production Claude"
    • Type: Anthropic (ANT)
    • Model: claude-3-5-sonnet-20241022
    • API Key: Your Anthropic API key
    • AI User: Select user account for AI operations
    • Active: Yes

Usage

// Get AI service
IDempiereAIService aiService = IDempiereAIService.getInstance();

// Generate text
String response = aiService.chat(providerConfig, "Explain sales order 12345");

// Query database with AI
String result = aiService.queryDatabase("Show me top 10 customers by revenue");

// Get business partner info
String bpInfo = aiService.getBusinessPartner("BP001");

Architecture

Provider Layer

  • IAIProvider: Provider abstraction interface (deprecated, use ChatLanguageModel)
  • LangChain4jProviderFactory: Creates ChatLanguageModel from configuration
  • Implementations: AnthropicProvider, AWSBedrockProvider, OllamaProvider, OpenAIProvider

Agent Framework

  • IDempiereAgent: AiServices interface with system prompt
  • IDempiereAIService: Main facade for AI interactions
  • ERPTools: @Tool-annotated methods for ERP operations

Security Layer

  • SecureDatabaseQueryExecutor: Role-based query execution
  • AI User Model: Queries execute as configured AI user + caller's role
  • Audit Trail: Complete logging in AIG_QueryAudit table

Documentation

Architecture & Design

Project Management

Development


Development

Build Commands

# Clean build
mvn clean install

# Build without tests
mvn clean install -DskipTests

# Run tests (requires Eclipse environment)
mvn test

# Package plugin
mvn package

Project Structure

com.cloudempiere.ai/
├── com.cloudempiere.ai.parent/       # Maven parent POM
├── com.cloudempiere.ai.deps/         # Shared dependencies (LangChain4j 0.35.0)
│   └── lib/                          # 49 embedded JARs
├── com.cloudempiere.ai.core/         # Core infrastructure
│   ├── src/com/cloudempiere/ai/
│   │   ├── provider/                 # AI provider implementations
│   │   ├── boundary/                 # API boundary interfaces
│   │   ├── model/                    # Data models (MAIProvider)
│   │   ├── component/                # UI components (chat widget)
│   │   ├── context/                  # Context providers
│   │   ├── database/                 # Secure query executor
│   │   ├── rag/                      # RAG implementation
│   │   ├── guardrails/               # Security guardrails
│   │   └── observability/            # Monitoring & logging
│   └── lib/                          # AWS Bedrock & Netty (14 JARs)
├── com.cloudempiere.ai.sales/        # Sales domain plugin
├── com.cloudempiere.ai.inventory/    # Inventory domain plugin
├── com.cloudempiere.ai.purchasing/   # Purchasing domain plugin
├── com.cloudempiere.ai.support/      # Support domain plugin
├── com.cloudempiere.ai.kb/           # Knowledge base domain plugin
├── com.cloudempiere.ai.theme/        # ZK UI theme fragment
├── com.cloudempiere.ai.feature/      # Eclipse feature
├── com.cloudempiere.ai.p2/           # P2 update site
├── com.cloudempiere.ai.test/         # Test bundle (JUnit 5)
├── docs/                             # Documentation
├── .claude/                          # Claude Code configuration
└── pom.xml                           # Root aggregator POM

Contributing

This is a proprietary plugin for Cloudempiere. For feature requests or bug reports, please contact the Cloudempiere team.


License

Proprietary - Cloudempiere


Support

  • Documentation: See docs/ directory
  • Issues: Internal tracking
  • Contact: Cloudempiere Development Team

About

AI integrations for iDempiere - LLM integration, predictive analytics, and document processing

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages