I. Overview
Alibaba Cloud Bailian (Tongyi Qianwen) AI Integration Module is an intelligent extension component for Odoo ERP, seamlessly integrating the Alibaba Cloud Tongyi Qianwen large language model into Odoo business processes, providing intelligent dialogue, knowledge Q&A, content generation, and business automation capabilities to help enterprises achieve digital transformation.
Core Advantages:
- Technology Leadership: Tongyi Qianwen has improved the accuracy of Chinese semantic understanding by 30%, focusing on localized scenarios.
- Reliable Performance: Leveraging Alibaba Cloud's global architecture, with millisecond-level response and 99.95% service availability.
- Cost Advantage: Pay-as-you-go billing, costs 50%-60% lower than comparable international services.
- Security Compliance: Fully processed domestically, compliant with laws and regulations, encrypted data communication.
2. Architecture and Models
2.1 Technical Architecture
The module adopts a layered architecture:
- Interface Layer: Compatible with OpenAI standards, adapted to DashScope API.
- AI Engine Layer: Supports multi-turn dialogue, context maintenance, function calling, and streaming output.
- Knowledge Enhancement Layer (RAG): Vectorize text (1536 dimensions), implement semantic retrieval based on pgvector.
- Business Integration Layer: Connects modules such as CRM, sales, finance, and human resources, allowing AI to directly execute queries or create records.
2.2 Model Matrix
| Model Series | Features and Scenarios |
|---|---|
| Qwen Max | High-precision reasoning and professional Q&A |
| Qwen Plus | Balanced performance, suitable for office and customer service (recommended) |
| Qwen Turbo | Fast response, high-concurrency scenarios |
| Qwen Long | Long document processing |
| QwQ-32B | Logical Reasoning and Decision Analysis |
| Qwen Math | Financial Calculation and Analysis |
| Qwen Coder | Programming and Technical Support |
3. Core Features
3.1 Intelligent Dialogue
- Supports over 50 rounds of continuous conversation, understanding context and references.
- Customizable roles (customer service, sales consultant, technical expert, etc.).
-
Three response modes:
- Analytical (0.2) Precise
- Balanced (0.5) General
- Creative (0.8) Flexible
- Supports real-time streaming output (SSE).
3.2 Knowledge-Enhanced Q&A (RAG)
- Supports automatic indexing of documents in multiple formats (PDF, Office, TXT, web pages, etc.).
- Vectorized storage + semantic retrieval (cosine similarity >90%).
- Manage knowledge sources: upload files, add URLs, attach files, batch import.
- Supports enabling/disabling, re-indexing, citation annotation, and other operations.
3.3 Tool Invocation (Function Calling)
- Empower AI with the ability to perform business operations (such as creating orders, sending emails, querying CRM).
- Customizable tools (JSON Schema + Python logic + permission control).
- Parameter validation and security control are complete.
3.4 Content Generation
- Automatically generate proposals, contracts, reports, meeting minutes, marketing copy, etc.
- Support email smart reply and multilingual translation.
- Automatic summarization, keyword extraction, information extraction, and table generation.
4. Typical Scenarios
- Smart Customer Service: qwen-plus-latest model, FAQ document knowledge base + tools (order inquiry, after-sales, etc.). Automatic resolution rate reaches 70%.
- Sales Assistant: qwen-max-latest model, analyzes customer needs, generates solutions and quotes, improving conversion rate by 30%.
- Knowledge Management: The qwen-long model builds enterprise knowledge bases, reducing information retrieval time to 30 seconds.
- Financial Analysis: The qwen-math-plus model automatically analyzes reports and budgets, providing optimization suggestions.
- Human Resources: Intelligent resume screening, employee consultation, training content generation.
- Technical Support: Fault diagnosis and code assistance, integrated work orders and device queries.
5. Installation and Configuration
5.1 System Requirements
- Odoo: 19.0+ (depends on ai, ai_app modules)
- PostgreSQL: 12.0+ (with pgvector enabled)
- Python: 3.10+
- The network must be able to access https://dashscope.aliyuncs.com
5.2 Deployment Steps
- Install the pgvector extension.
- Install dependency libraries: pip install pdfminer.six python-docx openpyxl
- Place the module into Odoo addons and install it.
- Configure the API Key (obtained from the Bailian console) in "Settings → AI → Providers".
- Test the connection and view available models.
5.3 Create AI Agent
- Path: Application → AI → Agents → Create
- Fill in the name, description, select the model and response mode.
- Configure system prompt (define role and code of conduct).
- Add knowledge source (file/URL/attachment).
- Configure tools and permissions.
- Test the response effect and tool invocation.
Example Character:
- Customer service assistant: friendly and professional, answering product and order questions.
- Sales Consultant: Recommend solutions based on needs, focusing on trust and value.
- Technical expert: clear logic, providing technical solutions and examples.
6. Billing and Costs
Billing formula:
Cost = (Input Tokens × Unit Price) + (Output Tokens × Unit Price)
| Model | Input Price (RMB/Thousand Tokens) | Output price | Scene |
|---|---|---|---|
| qwen-turbo | 0.0003 | 0.0006 | Quick Response |
| qwen-plus | 0.0004 | 0.0012 | Daily Office Work |
| qwen-max | 0.012 | 0.012 | Professional Analysis |
| qwen-long | 0.0005 | 0.002 | Long document |
| qwen-math-plus | 0.004 | 0.012 | Financial Analysis |
| qwen-coder-plus | 0.004 | 0.012 | Code Assistance |
Example:
The customer service system handles an average of 1,000 conversations per day, with an average input of 100 tokens and output of 200 tokens, costing approximately 0.28 yuan per day.
Optimization Suggestions:
- Task tier selection model (Turbo→Plus→Max).
- Simplify prompts and context.
- Limit output length.
- Common caching issues.
- Set budget and alerts.
7. Technical Support
Resources:
-
Quick Start, Feature Manual, API Reference, Video Tutorials, FAQ
Support Channels: - Odoo Chinese Community, Alibaba Cloud Developer Community
-
Email:info@zodioo.com(Working days 9:00–18:00)
Enterprise Support: Custom development and implementation guidance available.
Frequently Asked Questions:
- API connection failed → Check Key, network, firewall.
- Document indexing failed → Check format, dependency libraries, and file size.
- No results for vector retrieval → Confirm index status and relevance.
- Slow response → Optimize model or network.
- Tool call failed → Check permissions and parameters.
8. Safety and Compliance
- 传输加密:TLS 1.3 全程加密。
- Storage Security: API Key AES-256 encryption.
- Access Control: Based on the Odoo permission system.
- Audit Log: Records AI calls and operations.
- Privacy Protection: Data localization and desensitization support.
- Compliance: Adhere to the Cybersecurity Law, Data Security Law, and Personal Information Protection Law.
- Best Practices: Least privilege, regular backups, security training, and monitoring alerts.
IX. Appendix
Quick Glossary:
LLM (Large Language Model) | RAG (Retrieval-Augmented Generation) | Embedding (Vector Embedding) | Token | Temperature (Output Randomness) | System Prompt | Function Calling
Model Quick Reference:
- Customer service → qwen-plus
- Analysis → qwen-max
- Concurrent → qwen-turbo
- Long document → qwen-long
- Finance → qwen-math-plus
- Programming → qwen-coder-plus
Critical Path:
- API Key: Settings → AI → Providers
- Create Agent: AI → Agents
- Knowledge Source: Agent → Knowledge Source Tag
- Tool Configuration: Agent → Tool Tab
