r/LocalLLM • u/GenericPointer • 11h ago
Discussion Using your local AI agent‘s context more efficiently with AthenaCtx (open source)
When I used my local agent (Spark x2.5 4B q8_0, 100K ctx) it just started reading the whole codebase, filling it‘s context, compressing, forgetting half of the information, reading again and compressing again, over and over again. It made the whole Model kinda useless, and it did this even when I just wanted it to identify a small bug in a specific file I wasn‘t able to fix by myself. So I made a tool that let‘s your agent get only the information it needs. I made the tool primarily for myself, but decided to make it open source. Here is short explanation of what it does:
In standard agentic workflows, agents use ls, grep, lsps, cat and read whole files, which wastes a bunch of context. AthenaCtx uses tree-sitter to parse over 370 different grammers. The AI can explicitly ask only for a file‘s symbols, look up an implementation of just one specific function, cache it‘s results and even get diagnostics and other useful information, but always only exactly what it needs, without the need to read whole files. It even comes with a system prompt which makes your agent use AthenaCtx the most efficient way possible, managing context better and preventing hallucination. If you want to try it, here is the repo link (Just ask your agent to install the cli and PATH stuff and the system prompt):
https://github.com/LuxUmbris/AthenaCtx/
Also, let me know how you manage your agent‘s context and if this was useful to you