AI-powered assistant for interacting with the IDO system. This assistant helps users query data, generate reports, and interact with IDO DocTypes through natural language.
- 🤖 Natural language interaction with IDO system
- 📊 High-accuracy report generation
- 💬 Conversation memory and context awareness
- 🔍 Intelligent DocType search and filtering
- 🛠️ RESTful API and CLI interfaces
pip install -r requirements.txtCreate a .env file in the project root (same directory as requirements.txt):
# Copy the example template (if available) or create manually
cp .env.example .envOr create .env manually with the following variables:
# OpenAI API Configuration
OPENAI_API_KEY=your_openai_api_key_here
# IDO System API Configuration
# Note: Environment variable names use ERPNEXT_ prefix for backward compatibility
# but the system now refers to IDO
ERPNEXT_BASE_URL=https://your-ido-instance.com
ERPNEXT_API_KEY=your_ido_api_key_here
ERPNEXT_API_SECRET=your_ido_api_secret_hereImportant: The .env file should be placed in the project root directory:
erp-assistant/
├── .env ← Place your .env file here
├── app/
├── requirements.txt
└── README.md
uvicorn app.api.main:app --reloadThe API will be available at http://localhost:8000
- API Documentation:
http://localhost:8000/docs - Health Check:
http://localhost:8000/health - Chat Endpoint:
POST http://localhost:8000/chat
python -m app.presentation.cliPOST /chat
Content-Type: application/json
{
"message": "Show me all customers",
"conversation_id": "optional-conversation-id",
"include_history": true
}Response:
{
"reply": "Here are all the customers...",
"conversation_id": "conv_1234567890"
}The API supports conversation memory by using the conversation_id parameter:
- Include the same
conversation_idin subsequent requests to maintain context - Conversations are stored in memory for 24 hours
- Last 20 messages are kept for context
| Variable | Description | Required |
|---|---|---|
OPENAI_API_KEY |
Your OpenAI API key | Yes |
ERPNEXT_BASE_URL |
Base URL of your IDO instance | Yes |
ERPNEXT_API_KEY |
IDO API key | Yes |
ERPNEXT_API_SECRET |
IDO API secret | Yes |
erp-assistant/
├── app/
│ ├── api/ # FastAPI application
│ ├── application/ # Business logic (services)
│ ├── config/ # Configuration and settings
│ ├── infrastructure/ # External clients (IDO API)
│ └── presentation/ # Agent, tools, and CLI
├── .env # Environment variables (create this)
├── .gitignore
├── requirements.txt
└── README.md
The assistant can generate comprehensive reports when users request:
- Sales reports
- Inventory reports
- Financial reports
- Custom data analysis
- Maintains context across multiple messages
- Understands references like "it", "that", "the previous one"
- Remembers previous queries and responses
- Handles typos and misspellings
- Suggests correct DocType names
- Intelligent field filtering
# Add your test commands hereThe project follows Python best practices and uses type hints throughout.
[Add your license here]