Multi-Agent Sales Consultant, Product Comparison, Inventory Tracker, Sale Order & Purchase Order Automation
Systemic Multi Agent is an enterprise-grade autonomous ERP Sales & Inventory Chatbot system built with LangGraph, Gemini Flash, Odoo 17 ERP (XML-RPC), Slack Block Kit Integration, SQLite Observability, and Streamlit.
The chatbot acts as an intelligent virtual sales consultant and inventory manager. It dynamically routes user intents in any language (Vietnamese, English, etc.), maps natural language product descriptions to Odoo database items via Multilingual LLM Semantic Entity Mapping, creates Draft Sale Orders (sale.order) for customer purchases, and automatically signals the procurement agent to generate Draft Purchase Orders (purchase.order) directly on Odoo ERP + notifies staff on Slack when items are out of stock.
User Chat Message (Vietnamese / English)
│
▼
┌────────────────┐
│ Router Agent │ ← Structured Intent & Semantic Keyword Mapping (Gemini Flash)
└───────┬────────┘
│
┌──────────────────────────────┼──────────────────────────────┬──────────────────────────────┐
│ │ │ │
intent: "customer_buy" intent: "product_inquiry" intent: "product_comparison" intent: "stock_check" / "off_topic"
│ │ │ │
▼ ▼ ▼ ▼
┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐ ┌──────────────────┐
│ Sale Agent │ │ Product Advisor │ │ Product Advisor │ │ Inventory / │
│ (ProductAdvisor)│ │ (Catalog Query) │ │ (Markdown Table)│ │ Guardrail Node │
└───────┬─────────┘ └─────────────────┘ └─────────────────┘ └────────┬─────────┘
│ │
├─ In Stock: Creates Draft Sale Order (`sale.order`) + Slack Notice │
│ │
└─ Out of Stock: Needs Restock Signal = True ─────────────────────────────────────────────────┘
│
▼
┌───────────────────┐
│ Procurement Agent │ ← Creates Draft Purchase Order (`purchase.order`)
│ (Restock Agent) │ on Odoo + Sends Slack Card Notification
└─────────┬─────────┘
│
▼
SQLite Observability Log &
Streamlit Chat Workspace UI
- Zero-Hardcode Intent Router Agent (
agents/router.py): Classifies user messages into 6 distinct intents (customer_buy,product_inquiry,product_comparison,stock_check,restock_request,off_topic), extracting quantities and candidate product terms via Gemini Flash Structured Output. - Multilingual Semantic Entity Mapping: Translates natural language queries (e.g. Vietnamese "ghế văn phòng", "bàn làm việc lớn", "tủ đen") into candidate English Odoo catalog search keywords (
['Office Chair', 'Chair'],['Large Desk', 'Desk'],['Drawer Black', 'Cabinet']), ensuring 100% database search accuracy across languages. - Product Advisor & Sale Agent (
agents/product_advisor.py):- In-Stock Orders: Creates Draft Sale Orders (
sale.order) in Odoo + triggers Slack notifications to the Sales team. Generates warm, natural closing responses without system jargon. - Out-of-Stock Orders: Generates polite, professional out-of-stock customer notices while setting
needs_restock_signal = Trueto trigger procurement in the background. - Catalog & Comparison: Builds structured Markdown comparison tables across metrics (Price, Stock, Specs).
- In-Stock Orders: Creates Draft Sale Orders (
- Restock & Procurement Agent (
agents/restock_agent.py): Automatically creates Draft Purchase Orders (purchase.order) in Odoo ERP and posts rich Block Kit cards to Slack (#warehouse-procurement) for warehouse staff review. - Slack Webhook Integration (
integrations/slack.py): Sends rich Slack Block Kit notifications for both Customer Sale Orders and Procurement Purchase Orders, supporting@mentionstaff tags. - Customer-Facing UX & Clean Response Isolation: All internal technical debug logs (
PO00028 created,Slack notice sent) run silently in the backend and are recorded in SQLite observability logs, keeping the customer chat interface 100% clean and human-like. - Guardrail Protection (
guardrails/limits.py): Intercepts off-topic queries (weather, sports, general chitchat) and politely redirects users back to ERP sales assistance. - SQLite Observability Layer (
observability/logger.py): Logs step-by-step agent trajectories, latencies, tool calls, and intent classifications. - Streamlit UI (
observability/dashboard.py): Dual-tab web UI featuring an interactive chat workspace and live observability analytics dashboard. - Benchmark Evaluation Suite (
eval/): Automated evaluation suite running scenarios to measure intent accuracy and latency (eval/run_eval.py).
Systemic Multi Agent/
├── agents/
│ ├── __init__.py
│ ├── router.py # Intent classification & Multilingual Semantic Entity Mapping
│ ├── product_advisor.py # Sale Agent: Sale Orders (sale.order), catalog advice & comparison
│ ├── inventory_checker.py # Real-time stock checker & restock trigger
│ └── restock_agent.py # Procurement Agent: Draft Purchase Order (purchase.order) creator
├── assets/
│ ├── demo1.png # Chat Workspace screenshot
│ ├── demo2.png # Product comparison & inventory screenshot
│ └── demo3.png # Observability Dashboard screenshot
├── integrations/
│ ├── __init__.py
│ └── slack.py # Slack Incoming Webhook & Block Kit notification engine
├── mcp_server/
│ ├── __init__.py
│ ├── search_tools.py # Web search tools
│ └── odoo_tools.py # Odoo 17 XML-RPC API client (sale.order, purchase.order, product.template)
├── graph/
│ ├── __init__.py
│ ├── state.py # ChatState TypedDict (intents, search_keywords, restock signals)
│ └── workflow.py # LangGraph state machine & conditional edge chaining
├── eval/
│ ├── __init__.py
│ ├── benchmark_questions.json # Chat evaluation scenarios
│ ├── metrics.py # Intent accuracy & latency metrics
│ └── run_eval.py # Benchmark execution runner
├── observability/
│ ├── __init__.py
│ ├── logger.py # SQLite logging engine
│ └── dashboard.py # Streamlit Chat App & Observability Dashboard
├── guardrails/
│ ├── __init__.py
│ └── limits.py # GuardrailConfig & limits
├── scripts/
│ └── seed_odoo_data.py # Odoo ERP product & vendor seed script
├── utils/
│ ├── __init__.py
│ └── text.py # Text formatting & LLM cleaning utilities
├── Dockerfile
├── docker-compose.yml
├── docker-compose.odoo.yml
├── .env.example
├── requirements.txt
└── README.md
Clone repository and install dependencies:
python -m venv venv
# Windows:
venv\Scripts\activate
# Linux/macOS:
source venv/bin/activate
pip install -r requirements.txtCreate .env file from template:
cp .env.example .envFill in your configuration variables in .env:
GOOGLE_API_KEY: Get a free key from Google AI Studio.- Odoo Connection:
ODOO_URL,ODOO_DB,ODOO_USER,ODOO_PASSWORD. - Slack Integration (Optional):
SLACK_WEBHOOK_URL,SLACK_CHANNEL,SLACK_STAFF_MEMBER_ID.
python scripts/seed_odoo_data.pypython -m streamlit run observability/dashboard.pyOpen your browser at http://localhost:8501.
python eval/run_eval.py --limit 5| Metric | Description | Target |
|---|---|---|
| Intent Accuracy Rate | Percentage of user turns correctly routed to target node | ≥ 85% |
| Multilingual Mapping Accuracy | Percentage of Vietnamese queries mapped to valid Odoo English products | ≥ 90% |
| Guardrail Effectiveness | Percentage of off-topic messages correctly intercepted | 100% |
| Average Turn Latency | Mean response time per chat turn | < 2.0s |
| Order Creation Accuracy | Percentage of draft Sale Orders (sale.order) and Purchase Orders (purchase.order) created with valid line items |
100% |


