cd /news/ai-agents/anahata-asi-an-in-jvm-java-agent-for… · home › topics › ai-agents › article
[ARTICLE · art-175507] src=bytecode.news ↗ pub= topic=ai-agents verified=true sentiment=↑ positive

Anahata ASI: An In-JVM Java Agent for NetBeans with Runtime Compilation and Context GC

Anahata OS released Anahata ASI, an Apache 2.0 pure-Java AI agent container that runs inside the target JVM, primarily as an Apache NetBeans plugin (Plugin Portal #135, NetBeans 28–35+, Java 21+) with a standalone desktop build and early IntelliJ support. The agent compiles Java snippets in memory against the active project classpath, including on-the-fly Maven Central dependency resolution, loads them through a child-first AgiClassLoader, and feeds NetBeans javac diagnostics back into its loop; it manages long sessions with a context-window garbage collector that prunes stale tool outputs and compacts history into "Semantic Ghosts." The full Studio .nbm bundle is about 140 MB and targets NetBeans 30–31+ for the full bundle, and every tool execution stages in a PENDING human-in-the-loop state because in-IDE compilation and OS/WebDriver tools are high-privilege.

key takeaway

Anahata ASI runs the agent inside the IDE JVM, compiling Java snippets in memory against the project classpath and feeding NetBeans javac diagnostics back into the loop until edits build cleanly, with every tool call staged in a PENDING human-in-the-loop state before execution.

by read2 min views1 publishedNov 24, 2026

Most AI coding tools today wrap an external Node or Python CLI around your editor and interact with Java code via regex and raw text diffs. Over the past year we built Anahata ASI (Apache 2.0), a pure-Java agent container that runs directly inside the target JVM—primarily as an Apache NetBeans plugin (Plugin Portal #135, NetBeans 28–35+, Java 21+), with a standalone desktop build and early IntelliJ support.

Instead of bridging out to a separate Python runtime, embedding the agent directly inside the IDE JVM unlocks a few interesting JVM-native patterns:

1. In-JVM Compilation & Child-First Class (NbJava)

Rather than constraining the model strictly to pre-baked JSON tool schemas, the agent can write Java snippets, compile them in memory against the active project classpath (including resolving Maven Central dependencies on the fly), and load them through a child-first AgiClass inside the running JVM.

In practice, this turns the agent loop into a compiler-in-the-loop workflow: it hooks directly into NetBeans javac diagnostics so compilation errors feed back into the loop automatically until edits build cleanly.

2. AST-Guided Refactoring Instead of Line Patches

String-based diff patching routinely mangles formatting and comments in large Java classes. Inside NetBeans, the agent delegates structural edits to NetBeans' own AST and Refactoring APIs so batch refactors preserve exact indentation and inline comments.

3. Context Window Garbage Collection (CwGC)

Long multi-turn sessions normally hit token walls or degrade via naive sliding-window truncation. We modeled context management a bit like generational GC: tracking part-level depth decay across turns, pruning stale tool outputs, and compacting older history into compact "Semantic Ghosts," paired with Kryo session persistence and plain .md history backups.

4. Models, Local Execution & Honest Tradeoffs

It works with Ollama / vLLM on localhost (no tunnels required) as well as Gemini, Claude, OpenAI, DeepSeek, and OpenRouter. Because running dynamic Java compilation and OS/WebDriver tools inside an IDE JVM is inherently high-privilege, every tool execution stages in a PENDING human-in-the-loop state so you inspect and edit arguments or diffs before anything runs.

The biggest practical tradeoff right now is footprint and version coupling: bundling Swing/JavaFX multimodal tooling, browser automation, and provider SDKs makes the full Studio .nbm around 140 MB and targets recent NetBeans releases (NB 30–31+ for the full Studio bundle).

If you want to see what the loop looks like in practice—like building a live 3D JavaFX ADS-B flight tracker inside NetBeans—the full 13-module Maven reactor is on GitHub. Curious how other JVM devs feel about in-IDE agents vs. external CLI harnesses like Claude Code or MCP servers.

── more in #ai-agents 4 stories · sorted by recency
── more on @anahata asi 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
→ Live at https://your-agent.zahid.host ✓
Get free account → Pricing
from €0/mo · no card required
LIVE [news/anahata-asi-an-in-jv…] indexed:0 read:2min 2026-11-24 · —