Cut 90% of Tokens for Coding Agents with AST Context Graphs
Remarkable-One9371 · reddit · 2026-07-05
The author experimented with a local-first coding agent context service that builds a code repository graph based on AST/LSP-style facts: indexing files, symbols, imports, calls, definitions, containment relationships, and dependency edges. This allows the agent to query relevant subgraphs first, falling back to raw files, search, or LSP only when evidence is insufficient.
In benchmarks, graph context reduced input tokens by about 90% compared to broad snippets, while answers remained solid. The author emphasizes that "graph-first" does not mean "graph-only"; when retrieval is too narrow, the agent still needs to fall back to reading and verifying source code. They also welcome discussions on the trade-offs between LSP-first, embeddings/RAG, graph retrieval, or hybrid approaches.
More from coding & agent
- Tweaked orchestration skill turns agents into self-policing workflow — pvncher · 2026-07-27
- A practical map of 11 protocols in the modern AI agent stack — TheTuringPost · 2026-07-27
- Qwen Code nightly adds Goal v3 orchestration and workspace channel controls — qwen-code-ci-bot · 2026-07-27
- NVIDIA says Nemotron 3 Ultra hit 97.1% on agentic RTL chip-design tasks — NVIDIAAI · 2026-07-27
- Tokyo Agent Forge hackathon shipped production-ready AI agents in one day — DavidBennett__ · 2026-07-27
- Long-running agents will need immutable event logs, this thread argues — sebpaquet · 2026-07-27