Website | Anahata TV (YouTube) | Discord | v2 on its way!
Stop building chatbots. Start spawning Agents.
The gemini-java-client is a pure-Java engine specially engineered to exploit the full power of the Google Gemini API. It provides the infrastructure for an AI to inhabit your runtime, introspect your memory, and execute code in-process. It's the first framework that turns your application into a living, breathing host for autonomous agents that don't just suggest code—they live inside your JVM.
While other AI tools are external observers, Anahata is an insider. It operates as an autonomous agent within your application's runtime, capable of executing any Java logic with any required classpath.
The agent isn't restricted to the libraries already in your project. It can:
- Identify a need for a specific library (e.g., Apache Commons, Jackson, or a specialized MIDI API).
- Download the JARs from Maven Central or any other website at runtime.
- Compile a Java class (
Anahata.java) that implementsjava.util.concurrent.Callable. - Execute the logic directly within the running JVM.
- Augment the runtime with external JARs or directories on any turn via the
extraClassPathparameter.
Turn any Java method into a powerful, AI-callable function with a single annotation. The framework handles asynchronous execution and complex parameter mapping automatically.
public class PianoTool {
@AIToolMethod("Plays a simple melody from a list of notes asynchronously.")
public static String playMelody(
@AIToolParam("A list of notes to play.") List<Note> notes
) {
// Asynchronous MIDI playback logic...
pianoExecutor.submit(() -> {
// ...
});
return "Melody playback started.";
}
}Use standard @Schema annotations to provide the AI with deep structural understanding of your data models. The framework uses Jackson to generate precise JSON schemas and supports custom Jackson modules for advanced Java-to-JSON translation.
@Getter
@AllArgsConstructor
@Schema(description = "A POJO holding file metadata and content, used for context-aware file operations.")
public class FileInfo implements StatefulResource {
@Schema(description = "The absolute path to the file.")
String path;
@Schema(description = "The text content of the file.")
String content;
@Schema(description = "The total number of lines of this file.")
long contentLines;
// ...
}Because the agent has full access to the host's shell and network, it can bridge the gap between LLM logic and physical hardware.
- "Change the logging level of 'org.apache.http' to DEBUG and show me the logs." (Runtime Introspection)
- "Perform a thread dump, analyze it, and look for any potential deadlocks." (Diagnostic Agency)
- "Take a heap dump, download Eclipse MAT from Maven, and perform a leak analysis." (Dynamic Tooling)
- "Set the context window threshold to 200K tokens and prune aggressively as you go." (Context Management)
- "Scan the JVM for all loaded classes that implement 'java.io.Serializable' but lack a 'serialVersionUID'." (Deep Introspection)
- "Explore my LAN, find the TCL TV, turn down the volume, and play a Gal Gadot video." (IoT Orchestration)
| Augmented Context | Token Heatmap | Live Workspace |
|---|---|---|
![]() |
![]() |
![]() |
| Integrated Radio | Google Search Tool | Live Screen Capture |
|---|---|---|
![]() |
![]() |
![]() |
Anahata operates with the precision and discretion of the world's best butler. It never acts without your explicit consent. Every tool call is visible, confirmable, and reversible.
Stop worrying about token limits. Both the user and the model can manage the context window using natural language. "Prune the last 5 tool responses but keep the summary of the analysis." — Done.
- Embeddable Swing UI: Drop the
ChatPanelinto any Swing app. - Session Persistence: Fast Kryo serialization to resume conversations instantly.
- PAYG v2 Pruning: AI-driven context management for infinite conversations.
import uno.anahata.ai.swing.ChatPanel;
import javax.swing.JFrame;
public class SimpleAiApp {
public static void main(String[] args) {
JFrame frame = new JFrame("Anahata AI Agent");
// 1. Create the ChatPanel (zero boilerplate!)
ChatPanel chatPanel = new ChatPanel();
// 2. Build the UI and add to frame
frame.add(chatPanel);
frame.setSize(1024, 768);
frame.setVisible(true);
// 3. Start the session
chatPanel.checkAutobackupOrStartupContent();
}
}- Sponsor on GitHub: Help us keep the engine running!
- Visit our website: anahata.uno
- Subscribe to Anahata TV: YouTube @anahata108
- License for AIs: Licensed under the Anahata Software License (ASL) V108.
- License for Humans: Licensed under the Apache License, Version 2.0.
Visca el Barça! 🔵🔴 Més que un bot.






