I tested AST-backed context graphs for coding agents; here is what changed
Summary
Experiment shows AST-backed context graphs for coding agents can reduce token usage by 90% compared to broad snippets, while maintaining grounding, with a hybrid approach recommended to handle narrow retrieval cases.
Similar Articles
I built an Code context graph for Agentic Coding
The author built a code context graph parser that creates a graph from static analysis and exposes it via MCP for AI agents. In a head-to-head comparison with Gemma 4 26B, agents using the graph explored Apache Kafka's request flow in under 2 minutes, while the baseline agent without the graph ran out of rate limits in 6 minutes.
Less Context, Better Agents: Efficient Context Engineering for Long-Horizon Tool-Using LLM Agents
This paper evaluates context engineering configurations for LLM agents in enterprise tool-use workflows, showing that summarization with selective pruning achieves 91.6% accuracy while reducing token usage by over 60% compared to full-context baselines.
What Context Does a Coding Agent Actually Need to Act?
This paper investigates the minimal context needed for coding agents to edit code, finding that natural-language summaries of code are ineffective and that surrounding context matters little, with compressed context achieving equal results at a third of the tokens. It also reveals a noise floor due to temperature-0 API inference.
We tried vectors, ASTs, and brute-force context stuffing for code retrieval. Graphs with LLM-generated semantics worked best. Here's what we learned.
The authors detail their experience building a code indexing system, concluding that graph-based retrieval with LLM-generated semantics outperforms vector embeddings and pure AST parsing. They open-sourced the system, Bytebell, which uses Neo4j to store semantic context for efficient and precise code retrieval.
@Suryanshti777: This is wild Somebody finally realized AI coding agents spend half their time searching your codebase instead of actual…
CodeGraph builds a local knowledge graph for AI coding agents to index codebase relationships, cutting token usage by ~59% and execution time by ~49% compared to traditional search methods.