Built by aigents (Medellin, July 25, 2026).
An AI-powered platform for commissioning, diagnostics, and troubleshooting of Invertek Optidrive E3 variable frequency drives. Designed to assist field technicians and engineers with fault diagnosis, configuration analysis, and technical knowledge retrieval.
The complete platform has three panels:
| Panel | Purpose | Flow |
|---|---|---|
| Issues | Active problem resolution via an AI Troubleshooting Agent | Report → Diagnosis → Root Cause → Recommendation → Approval → .ptb generation → Physical test → Feedback |
| Analysis | Historical intelligence on resolved issues | Issues history → Metrics → Patterns → Trends → Success rates |
| Knowledge | Conversational technical assistant backed by official documentation | User question → Knowledge Base → LLM → Grounded technical answer |
This sprint delivers the Knowledge panel: a Streamlit-based conversational agent that answers technical questions about the Optidrive E3 using only official documentation. Zero hallucinations by design -- every answer is sourced from real files on disk.
┌──────────────────────┐
│ TECHNICIAN/ENGINEER │
└──────────┬───────────┘
│
┌──────────────────────────┼──────────────────────────┐
│ │ │
▼ ▼ ▼
ISSUES ANALYSIS KNOWLEDGE
(next sprints) (next sprints) (this sprint)
AI Troubleshooting Metrics / Trends LLM + Knowledge Base
Agent / Patterns (RAG-like)
│ │
┌──────┼──────┐ ┌──────┴──────┐
▼ ▼ ▼ ▼ ▼
Report Params Scope LLM (DeepSeek) data/
│ │ │ │ (23 files)
└──────┼──────┘ ▼
▼ Grounded Answer
Diagnosis + Source Citations
│
▼
Physical or Parameter
Issue
│
┌──────┴──────┐
▼ ▼
Physical Parameter
Solution Solution
│
▼
Human Approval
│
▼
Generate .ptb
│
▼
OptiTools
│
▼
Drive
│
▼
Feedback
The AI should not simply tell the engineer what a fault means. It should investigate the problem, reason about the available evidence, distinguish physical issues from configuration issues, recommend corrective actions, and produce an actionable configuration proposal that a human can review and approve.
The system behaves as an AI Engineering Troubleshooting Agent rather than a conventional chatbot:
Understand → Investigate → Interpret → Diagnose → Recommend
→ Ask for approval → Generate configuration
→ Human applies → Test → Collect feedback → Learn from history
The Issues panel is the heart of the product. Knowledge and Analysis provide technical intelligence and historical insight around it.
InvertekAgent/
├── .env # API key (DEEPSEEK_API_KEY)
├── agent/
│ ├── config.py # Env loading, API key + model constants
│ ├── client.py # Streamlit UI, agent loop, LLM orchestration
│ ├── tools/
│ │ ├── __init__.py # Aggregates all tool defs and function maps
│ │ └── search_invertek_docs.py # Keyword search across the data/ folder
│ └── data/ # Official documentation (ground truth)
│ ├── fault_codes.json # Fault codes table (JSON structured)
│ ├── parameters.json # Parameters & fault codes (JSON structured)
│ ├── commissioning-basic.md # Quick-start / basic commissioning
│ ├── control-terminals.md # Control terminal wiring & I/O
│ ├── modbus-rtu-setup.md # Modbus RTU communications
│ ├── modbus-register-map.md # Modbus register map & status words
│ ├── power-wiring.md # Power wiring & supply connections
│ ├── rating-tables.md # Input current, fuses, cables
│ ├── model-numbers.md # Drive model number decoding
│ ├── macro-configurations.md # Analog/digital input macros
│ ├── mechanical-installation.md
│ ├── brake-resistor-installation.md
│ ├── emc-filter-disconnect.md
│ ├── environmental-and-ul.md
│ ├── keypad-operation.md
│ ├── motor-thermistor-connection.md
│ ├── parameter-and-fault-reset.md
│ ├── product-overview.md
│ ├── safety-information.md
│ ├── single-phase-operation.md
│ ├── storage-capacitor-reforming.md
│ └── REVIEW_NOTES.md
├── .gitignore
└── README.md
23 data files (20 markdown + 3 JSON) covering the complete Optidrive E3 IP20 User Guide V1.05 plus IP66 variant supplements.
Every technical answer is guaranteed to be sourced from real documentation:
-
LLM calls
search_invertek_docsas a tool -- the system prompt requires it before answering any technical question (client.py:348-364). -
The tool reads ONLY from
data/-- no external API, no vector DB, no model-generated content. Every result comes from files on disk (tools/search_invertek_docs.py:4). -
Keyword scoring across frontmatter (title, topic, keywords) and body text ensures relevant documents surface even with partial queries.
-
Structured JSON parsing --
parameters.json(fault codes withcode,name,description,possible_causes,diagnostic_steps,reset_notes) is searched field-by-field, returning precise entries instead of whole-file dumps. -
No-results guard -- if no document matches, the tool returns an explicit
"found": 0message telling the LLM to direct the user to Invertek support (tools/search_invertek_docs.py:185-193). -
System prompt explicitly forbids invention -- rules 3-5 mandate answering exclusively from tool results and never inventing codes, values, or instructions.
Tested 13 queries across fault codes, parameters, wiring, installation, and Modbus categories -- all returned real documents with 0 blank responses.
| Query | Category | Results |
|---|---|---|
O-I fault |
Fault code | 5 |
P-08 motor current |
Parameter | 5 |
2-wire start stop |
Wiring | 5 |
single phase derating |
Installation | 5 |
modbus register 2001 |
Modbus | 4 |
brake resistor overload |
Fault | 5 |
EMC filter |
Installation | 5 |
U-Volt dc bus |
Fault | 5 |
O-temp over temperature |
Fault | 5 |
mechanical installation IP20 |
Installation | 5 |
control terminals wiring |
Wiring | 5 |
P-Loss input phase |
Fault | 5 |
autotune P-03 |
Parameter | 5 |
pip install streamlit openai python-dotenvEdit .env in the InvertekAgent/ root:
DEEPSEEK_API_KEY="sk-your-key-here"
The key flows through config.py -> client.py automatically. No other file touches .env directly.
cd InvertekAgent/agent
streamlit run client.pyUses DeepSeek V4 Pro as the LLM backend (config.py:12). Swap MODEL in config.py to change providers.
Loads .env via python-dotenv, exposes DEEPSEEK_API_KEY, ANTHROPIC_BASE_URL, and MODEL. Single source of truth for all credentials and model config.
The search engine that grounds the Knowledge panel. Accepts query (required) and category (optional). Searches:
- JSON files: iterates
faults[]andparameters[]arrays, scores each entry individually, returns structured snippets with code/name/causes/steps - Markdown files: parses YAML frontmatter (
title,topic,keywords), scores against frontmatter + body, returns the most relevant text section
Top 5 results by relevance score. Score weights: 60% body text, 40% frontmatter metadata.
Package aggregator. Imports each tool module and exports TOOL_DEFINITIONS (list of OpenAI function schemas) and TOOL_MAP (name -> function). To add a new tool, create a tools/my_tool.py, import it here, done.
Streamlit app with Invertek industrial branding (navy + orange palette). Agent loop:
- User submits query
- First LLM call with
TOOL_DEFINITIONS-- LLM decides whether to invoke the search tool - If tool called: execute
search_invertek_docs, feed results back as tool message - Second LLM call: formulates final answer grounded on tool results
- Display answer with expandable reference documents showing source IDs and relevance
The core troubleshooting experience. Converts a technical fault report into a complete resolution pipeline:
- Report intake: fault codes, warnings, current parameters, motor nameplate data, scope recordings, logs, application context
- AI Troubleshooting Agent: interprets the problem, classifies as physical vs. parameter issue, analyzes configuration against motor/application data, produces a diagnosis with root cause and confidence level
- Classification logic:
- Physical/hardware issue: recommends inspection steps, does NOT attempt to fix via parameters
- Parameter/configuration issue: identifies exact parameters to change, with current value, proposed value, reason, and expected effect
- Human-in-the-loop approval: the agent never directly modifies the drive. It generates a proposed configuration table with
[APPROVE]/[REJECT]controls .ptbgeneration: after approval, exports an OptiTools Studio-compatible parameter file containing only the approved changes, preserving original configuration for unmodified parameters- Post-solution feedback: collects resolution status, new faults, actual parameters used, technician observations -- feeding the Analysis panel
Aggregates historical issue data for operational intelligence:
- Fault type frequency and distribution
- Physical vs. parameter issue ratio
- Most frequently modified parameters
- Resolution success rates
- Drives with recurring problems
- Recommendations with highest success rate
- Technician feedback aggregation
This data eventually feeds back into the AI agent to improve future recommendations.
- Create
agent/tools/my_tool.py:
def my_tool(param: str) -> str:
...
MY_TOOL_DEF = {
"type": "function",
"function": {
"name": "my_tool",
"description": "...",
"parameters": {
"type": "object",
"properties": {
"param": {"type": "string", "description": "..."}
},
"required": ["param"],
},
},
}- Register in
agent/tools/__init__.py:
from .my_tool import MY_TOOL_DEF, my_tool
TOOL_DEFINITIONS = [SEARCH_TOOL_DEF, MY_TOOL_DEF]
TOOL_MAP = {
"search_invertek_docs": search_invertek_docs,
"my_tool": my_tool,
}The LLM will automatically see the new tool in the next call -- no changes to client.py needed.
Drop .md or .json files into agent/data/. They'll be indexed automatically on the next search.
Markdown format (recommended):
---
title: Document Title
drive_model: Optidrive E3
topic: your-topic
keywords: [keyword1, keyword2, keyword3]
source: "User Guide Section X.Y, page Z"
---
## Content here...JSON format for structured data (fault codes, parameters):
{
"faults": [
{
"code": "O-I",
"display_number": "03",
"name": "Output Over Current",
"category": "overcurrent",
"description": "...",
"possible_causes": ["..."],
"diagnostic_steps": ["..."],
"reset_notes": "..."
}
]
}- The old
rag_enginedependency has been removed -- all search runs locally against files on disk with no external vector DB. config.pyis the only module that reads.env. Every other module imports keys fromconfig.py.- macOS binary artifacts (
manifest.json,download) indata/are skipped by the search engine'sSKIP_FILESset. - The architecture is designed for the full three-panel platform:
tools/package can grow with diagnostic,.ptbgeneration, and analytics tools without touchingclient.py.