jaytoone/CTX
6 stars · Last commit 2026-05-21
Trigger-Driven Dynamic Context Loading for Code-Aware LLM Agents
README preview
# CTX: Trigger-Driven Dynamic Context Loading for Code-Aware LLM Agents [](https://pypi.org/project/ctx-retriever/) [](https://pypi.org/project/ctx-retriever/) [](https://pypi.org/project/ctx-retriever/) [](LICENSE) [](https://github.com/jaytoone/CTX/actions/workflows/publish.yml)  CTX classifies developer queries into four trigger types and routes each to a specialized retrieval pipeline. For dependency-sensitive queries, CTX traverses the codebase import graph to resolve transitive relationships that keyword and embedding methods miss. It achieves **1.9x higher Token-Efficiency Score** than BM25 while using only **5.2% of tokens**, and **outperforms BM25 on held-out external codebases** (Flask, FastAPI, Requests — mean R@5 +0.163). > **Key insight**: code import graphs encode structural dependency information that text-based RAG cannot capture. CTX achieves Recall@5 = 1.0 on implicit dependency queries vs 0.4 for BM25. ## Install ```bash pip install ctx-retriever ```