v0.1.10 Latest #1 Top Story (The Daily Diff) FASM AVX2+FMA / SSE2 MCP: agentjit-mcp

AgentJIT — Compile Slow AI Agent Loops into Sub-Millisecond Code

Traces repetitive multi-turn LLM workflows (think -> tool -> observe), builds a DAG data-flow graph, synthesizes type-safe Python pipelines with speculative guards, and seamlessly bails out to the dynamic LLM only when inputs diverge.

📦 1. Installation & Compatibility Matrix

pip install agentjit
Runtime / OSVersionsStatus & Mode
CPython3.8 – 3.16Full AST synthesizer & guard runtime
Free-Threaded No-GIL3.13t – 3.16t (PEP 703)Thread-safe multi-core tracing (3.13t–3.16t)
PyPy JIT3.8 – 3.12100% supported on PyPy 3.8–3.12
Operating SystemsWindows / Linux / macOSWindows / Linux / macOS + FASM AVX2+FMA / SSE2 DLLs

⚡ 2. Trajectory Tracing, Compilation & Inspection

agentjit_quickstart.py
import agentjit
from agentjit import jit, trace_tool, compile_trajectory, get_fasm_engine

@trace_tool()
def search_product(name: str) -> dict:
    return {"name": name, "price": 49.99, "stock": 120}

@trace_tool()
def apply_tax(price: float, tax_rate: float) -> float:
    return round(price * (1.0 + tax_rate), 2)

@jit
def checkout_agent(product_name: str, tax_rate: float) -> dict:
    item = search_product(name=product_name)
    total = apply_tax(price=item["price"], tax_rate=tax_rate)
    return {"item": item["name"], "total": total}

# Run 1: Traces calls & compiles deterministic Python pipeline
order1 = checkout_agent("Mechanical Keyboard", 0.19)

# Run 2+: Sub-millisecond compiled execution (0 LLM tokens!)
order2 = checkout_agent("Wireless Mouse", 0.19)

# Inspect synthesized Python pipeline & hit/bailout stats
print(checkout_agent.source_code)
print(checkout_agent.stats)

# Hardware FASM SIMD engine (trajectory hash + vectorized range guards)
print("SIMD backend:", agentjit.simd_backend())
engine = get_fasm_engine()
h_val = engine.fast_hash("Process order 1042")
valid = engine.eval_range_guards([25.0, 150.0], [0.0, 100.0], [50.0, 500.0])

🔌 3. CLI Subcommands & MCP Server (agentjit-mcp)

MCP ToolPurpose
agentjit_compileSynthesize deterministic Python pipeline with input type guards from recorded tool trace steps
agentjit_analyzeAnalyze DAG data-flow dependencies, distinguishing constant literals from dynamic inputs
agentjit_simulate_savingsCalculate latency and dollar cost savings for N agent runs vs uncompiled LLM loops
agentjit_infoReport AgentJIT version, FASM SIMD backend, No-GIL PEP 703, and PyPy status
mcp_config.json & CLI
# CLI commands:
# agentjit info
# agentjit mcp   (or agentjit-mcp)

{
  "mcpServers": {
    "agentjit": {
      "command": "uvx",
      "args": ["agentjit", "mcp"]
    }
  }
}
Copied!