A new open-source project called Semantic claims to reduce LLM 'agent loops'—repetitive, inefficient code interactions—by 27.78% through AST Logic Graphs. The system uses a Rust-based API to create deterministic code retrieval via symbol, span, and logic graph analysis. Developers can access tools like `GetLogicNodes` and `GetControlFlowSlice` to map code dependencies and reasoning paths, cutting down on redundant LLM calls.
The tool integrates with IDEs via a semantic-first approach, offering modules for code indexing, retrieval, and safe editing. A project summarizer generates LLM-ready project maps without additional API calls, while a token tracking add-on monitors usage across tasks. Benchmarks show the Enhanced version outperforms baselines, with 27.78% fewer estimated developer steps in a test suite involving 11 tasks.
Key innovations include persisted control-flow and data-flow edges, semantic node labels, and hybrid graph ranking that blends symbol and dependency data. The MCP bridge provides 27 legacy tool aliases routed through two primary endpoints: `/retrieve` for graph operations and `/ide_autoroute` for task routing. A two-tool MCP surface simplifies access to functions like `PlanSafeEdit` and `GetProjectSummary`.
The project emphasizes practical applications, with a test_repo/todo_app demo used in A/B testing. Developers can run benchmarks via `cargo run -p api -- ./test_repo`, monitoring metrics like `retrieval_ms` and `misdirection_risk_pct`. Future phases aim to expand module-aware indexing and safe edit pipelines, though current focus remains on deterministic retrieval and token efficiency.
Source: Hacker News · Summarized by HeadlinesBriefing