I spent 3.8 million tokens finding which service to change
Описание и применение
В крупном монорепозитории с сотней микросервисов поиск сервисов, затронутых новой спецификацией, изначально требовал огромных токенов из-за больших графов. Используя два слоя: лёгкие маркдаун‑описания сервисов и Graphify для глубокого анализа, удалось сократить токены до 61 000 и сделать процесс практичным.
Задача
Determining which microservices in a large monorepo are affected by a new spec is costly and inefficient when relying on a single tool.
Результат
The two-layer approach cuts token usage from millions to tens of thousands, enabling practical agent-driven routing in large monorepos.
Рабочий процесс
- 1. Run Graphify on a single service to generate a structural graph (graph.json).
- 2. Generate a lightweight markdown descriptor per service containing typed frontmatter and links to neighbors.
- 3. For a spec, first query the markdown descriptors to identify candidate services (≈676 tokens per service).
- 4. For each candidate, run Graphify locally on that service to compute precise impact radius (few hundred tokens).
- 5. Aggregate results to determine affected services and detailed changes.
- 6. Use the catalogified data for agent-driven routing and impact analysis.
Доказательства
Graphify is superb at the second one. graphify affected "UpdateApiUsageCount" --depth 2 gives you a precise impact radius in a few hundred tokens.
One service entry 2.6 KB, 676 tokens. Ninety of those is 61,000 tokens.
- Дата записи: 2026-09-10T11:31:49.969Z