A RAG-based code compiler that uses deterministic assembly instead of probabilistic generation. It guarantees zero hallucination by only generating code using functions that actually exist in your codebase.
- 🔍 Auto-indexes your Python codebase
- 🧠 Understands function signatures (parameters, return types)
- 🔒 Zero Hallucination - only uses existing functions
- ⚡ MLX-optimized for Apple Silicon (with fallback for any Python)
- 🖥️ Interactive TUI built with Ratatui
# 1. Clone this repo
git clone https://github.com/YOUR_USERNAME/assembly-engine.git
cd assembly-engine
# 2. Build the Rust binary
cd rust_compiler && cargo build --release && cd ..
# 3. Install Python dependencies (optional, for LLM mode)
pip install mlx-lm
# 4. Run it!
./rust_compiler/target/release/rust_compiler- Drop the binary in any Python project folder
- Run it - it will auto-index all
.pyfiles - Query using function names:
rocket_add 100 50 - Generated code uses only existing functions
User Query → Retrieval (Set Intersection) → Assembly → Verified Code
↓ ↓
Only matches if Uses actual function
function EXISTS signatures
├── rust_compiler/ # Rust TUI binary
│ └── src/
│ ├── main.rs # TUI application
│ ├── indexer.rs # AST-based code indexer
│ ├── retriever.rs # Set intersection search
│ └── assembler.rs # MLX bridge
├── src/
│ ├── assembler_bridge.py # Python MLX integration
│ ├── indexer.py # Python indexer
│ └── retriever.py # Python retriever
└── emoji_lib.py # Example library
- Rust (for building)
- Python 3.8+
- Optional:
mlx-lmfor LLM-powered assembly (Apple Silicon only)
MIT