ControlAI is an open-source, domain-specific AI assistant engineered specifically for Control Systems Engineering, Dynamical Systems, Robotics, and Applied Mathematics.
ControlAI runs entirely on your own machine. Requires Apple Silicon (inference is MLX) with at least 16 GB of unified memory; the default model needs about 8 GB on disk and is downloaded on first run.
git clone https://github.com/atakankahya/controlai-agent.git
cd controlai-agent
pip install -r requirements.txt
./run.sh # web console, opens http://127.0.0.1:8000
./run.sh --cli # interactive terminal chat
./run.sh --cli "design an LQR for A=[[0,1],[-2,-3]], B=[[0],[1]], Q=eye(2), R=1"
./run.sh --build-index # build the dense retrieval index from data/user_docs/ (~45 min)
| Variable | Default | Purpose |
|---|---|---|
CONTROLAI_MODEL | mlx-community/Qwen3-14B-4bit | any MLX model id or local path |
CONTROLAI_ADAPTER | (none) | optional LoRA adapter |
CONTROLAI_THINKING | auto | off, auto (conceptual questions only), or on |
CONTROLAI_THINK_BUDGET | 512 | ceiling on tokens spent reasoning |
Standard large language models (LLMs) operate probabilistically without deterministic verification. When applied to physical systems—such as autonomous aerial vehicles, industrial manipulators, or power grids—general-purpose models present severe reliability challenges:
ControlAI addresses these limitations through a hybrid architecture:
--build-index builds one from whatever you put in data/user_docs/.
Lexical and dense rankings are fused and gated on cosine similarity, so an unrelated passage is
dropped rather than cited — the retriever returning nothing is a normal outcome.graph TD
User([Engineering Query]) --> Frontend[Web Console / CLI]
Frontend --> Agent[ControlAgent streaming tool loop]
subgraph Local[Runs entirely on-device]
Engine[LocalEngine - MLX, cached KV prefix]
Model[Qwen3-14B-4bit]
Retriever[Hybrid Retriever - BM25 + dense]
Tools[Deterministic Tool Registry]
end
Agent --> Engine --> Model
Agent --> Retriever
Agent --> Tools
Tools --> SciPy[SciPy / LAPACK / BLAS]
Tools --> PythonControl[python-control]
Tools --> PyExecutor[Sandboxed Python]
Tools --> Verifier[Residual Verifier]
Verifier --> Answer[Verified answer, plots, citations]
Answer --> Frontend
web/)controlai_agent/tools/)python_executor.py)numpy, scipy.signal, scipy.linalg, control, and matplotlib.outputs/plots/ and renders them in chat.These figures were measured against the previous architecture — the fine-tuned Qwen3-4B LoRA served through the old orchestrator. That serving path has been replaced (base Qwen3-14B, no adapter, rewritten agent loop and retriever), and the suite has not yet been re-run against it, so treat the table as historical rather than as a description of the current build.
Evaluated across 50 multi-pillar benchmark problems:
| Benchmark Pillar | Qwen3-4B Base (Text-Only) | ControlAI Agent (Ours) | Verification Mechanism |
|---|---|---|---|
| Numerical Synthesis (CARE, DARE, ZOH, Kalman) | 0.0% | 100.0% | Deterministic SciPy/LAPACK solver with $10^{-10}$ residual verification. |
| Theory & Proofs (PBH, Doyle 1978, Waterbed) | 83.3% | 86.7% - 95.0% | 4-Stage CoT Proof Standard with literature grounding. |
| Code & Simulation (SciPy ODE, Matplotlib) | 29.0% | 90.0%+ | Dynamic execution sandbox with automated plot capture. |
| Safety & Traps (Uncontrollable / Ill-conditioned modes) | 60.0% | 80.0% | Pre-computation PBH rank verification. |
| Real-World Case Studies (Aerospace, Drone, Automotive) | 80.0% | 80.0% | CBF-QP safety filtering and nonlinear inversion. |
| Overall Score | 47.3% | 87.3% | Deterministic tool execution and mathematical grounding. |
ControlAI is an open-source project developed for control engineering researchers, robotics practitioners, and applied mathematicians.
Contributions from the community are welcome across several areas:
benchmarks/controlbench_v1.jsonl.This project is licensed under the MIT License.
71 commits
Python
92.8%
JavaScript
3.2%
CSS
2.1%
HTML
1.6%
ControlAI is an open-source, domain-specific AI assistant engineered specifically for Control Systems Engineering, Dynamical Systems, Robotics, and Applied Mathematics.
ControlAI runs entirely on your own machine. Requires Apple Silicon (inference is MLX) with at least 16 GB of unified memory; the default model needs about 8 GB on disk and is downloaded on first run.
git clone https://github.com/atakankahya/controlai-agent.git
cd controlai-agent
pip install -r requirements.txt
./run.sh # web console, opens http://127.0.0.1:8000
./run.sh --cli # interactive terminal chat
./run.sh --cli "design an LQR for A=[[0,1],[-2,-3]], B=[[0],[1]], Q=eye(2), R=1"
./run.sh --build-index # build the dense retrieval index from data/user_docs/ (~45 min)
| Variable | Default | Purpose |
|---|---|---|
CONTROLAI_MODEL | mlx-community/Qwen3-14B-4bit | any MLX model id or local path |
CONTROLAI_ADAPTER | (none) | optional LoRA adapter |
CONTROLAI_THINKING | auto | off, auto (conceptual questions only), or on |
CONTROLAI_THINK_BUDGET | 512 | ceiling on tokens spent reasoning |
Standard large language models (LLMs) operate probabilistically without deterministic verification. When applied to physical systems—such as autonomous aerial vehicles, industrial manipulators, or power grids—general-purpose models present severe reliability challenges:
ControlAI addresses these limitations through a hybrid architecture:
--build-index builds one from whatever you put in data/user_docs/.
Lexical and dense rankings are fused and gated on cosine similarity, so an unrelated passage is
dropped rather than cited — the retriever returning nothing is a normal outcome.graph TD
User([Engineering Query]) --> Frontend[Web Console / CLI]
Frontend --> Agent[ControlAgent streaming tool loop]
subgraph Local[Runs entirely on-device]
Engine[LocalEngine - MLX, cached KV prefix]
Model[Qwen3-14B-4bit]
Retriever[Hybrid Retriever - BM25 + dense]
Tools[Deterministic Tool Registry]
end
Agent --> Engine --> Model
Agent --> Retriever
Agent --> Tools
Tools --> SciPy[SciPy / LAPACK / BLAS]
Tools --> PythonControl[python-control]
Tools --> PyExecutor[Sandboxed Python]
Tools --> Verifier[Residual Verifier]
Verifier --> Answer[Verified answer, plots, citations]
Answer --> Frontend
web/)controlai_agent/tools/)python_executor.py)numpy, scipy.signal, scipy.linalg, control, and matplotlib.outputs/plots/ and renders them in chat.These figures were measured against the previous architecture — the fine-tuned Qwen3-4B LoRA served through the old orchestrator. That serving path has been replaced (base Qwen3-14B, no adapter, rewritten agent loop and retriever), and the suite has not yet been re-run against it, so treat the table as historical rather than as a description of the current build.
Evaluated across 50 multi-pillar benchmark problems:
| Benchmark Pillar | Qwen3-4B Base (Text-Only) | ControlAI Agent (Ours) | Verification Mechanism |
|---|---|---|---|
| Numerical Synthesis (CARE, DARE, ZOH, Kalman) | 0.0% | 100.0% | Deterministic SciPy/LAPACK solver with $10^{-10}$ residual verification. |
| Theory & Proofs (PBH, Doyle 1978, Waterbed) | 83.3% | 86.7% - 95.0% | 4-Stage CoT Proof Standard with literature grounding. |
| Code & Simulation (SciPy ODE, Matplotlib) | 29.0% | 90.0%+ | Dynamic execution sandbox with automated plot capture. |
| Safety & Traps (Uncontrollable / Ill-conditioned modes) | 60.0% | 80.0% | Pre-computation PBH rank verification. |
| Real-World Case Studies (Aerospace, Drone, Automotive) | 80.0% | 80.0% | CBF-QP safety filtering and nonlinear inversion. |
| Overall Score | 47.3% | 87.3% | Deterministic tool execution and mathematical grounding. |
ControlAI is an open-source project developed for control engineering researchers, robotics practitioners, and applied mathematicians.
Contributions from the community are welcome across several areas:
benchmarks/controlbench_v1.jsonl.This project is licensed under the MIT License.
71 commits
Python
92.8%
JavaScript
3.2%
CSS
2.1%
HTML
1.6%