Zixir is a three-tier runtime combining Elixir (orchestrator), Zig (engine), and Python (specialist) for high-success agentic workloads with minimal human intervention. This document aligns fork structure, goals, and production-extension requirements.
| Layer | Technology | Role |
|---|---|---|
| Orchestrator | Elixir / OTP | Failures, concurrency, intent, routing |
| Engine | Zig + Zigler | Memory-critical math, high-speed data (NIFs) |
| Specialist | Python via Port | Library calls only (no Python in BEAM) |
| IR (optional) | Beaver / MLIR | Optimizes hot path (CSE, constant folding, LICM); does not call Python. See docs/MLIR_AND_PYTHON.md. |
- Python library compatibility: Call Python libraries via port protocol from Elixir.
- Minimal human interaction: Supervision and routing handle failures; structured errors and optional alerts.
- High success rate and memory: Intent router + state/memory layer; Zig for hot path; Python for library-only workloads.
- Let it crash: Fail safely under supervision; design to minimize failures (restart limits, circuit breaker, input validation).
- Supervision: All long-lived components under a supervision tree (application, intent router, memory, Python port workers).
- Restart limits: Max restarts (e.g. 3) in a short window (e.g. 5s) so a flapping Python process or NIF doesn't spin forever; supervisor terminates and parent can escalate or replace.
- Zig NIFs: Short (< 1ms when possible); use dirty CPU/threaded only when needed; validate inputs in Elixir to reduce NIF-side crashes.
- Python ports: Supervised port process; circuit breaker records failures and opens after threshold so repeated Python failures don't overwhelm the supervisor.
- Routing: Hot path → Zig; library calls → Python; return structured errors (or retry with backoff) when specialist is down; log for minimal human intervention.
- Root:
project_Analysis_for_fork.md,README.md,mix.exs,config/ - Orchestrator:
lib/zixir/— application, supervisor, intent router, memory, python/, engine/ - Engine: Zigler modules in
lib/zixir/engine/orzig//native/ - Specialist:
priv/python/— single entry script, wire format, adapter for libraries - Optional MLIR:
lib/zixir/mlir.exor mix task - VS Code:
.vscode/— Zixir language extension (syntax, LSP client); install from this folder for “Install Extension from Location”. Seedocs/VSCODE_INTEGRATION.mdandPROJECT_ANALYSIS.mdfor implementation status.
- One entry point for invoking Zixir from the agentic extension.
- No duplicate routing or protocol code.
- Document OS (Windows/macOS/Linux), Elixir/OTP, Zig, and Python versions; test in VS Code (e.g. Ctrl+Shift+P) before rollout.