Skip to content

Commit c113d99

Browse files
committed
website refinements
1 parent 1917fe2 commit c113d99

2 files changed

Lines changed: 82 additions & 44 deletions

File tree

README.md

Lines changed: 80 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -2,34 +2,87 @@
22
[![Maven Central](https://img.shields.io/maven-central/v/uno.anahata/gemini-java-client)](https://central.sonatype.com/artifact/uno.anahata/gemini-java-client)
33
[![Javadoc](https://img.shields.io/badge/Javadoc-Reference-blue)](https://anahata-os.github.io/gemini-java-client/apidocs/)
44

5-
# gemini-java-client
5+
# gemini-java-client: The Autonomous AI Agent Engine for the JVM
66

77
**[Website](https://anahata-os.github.io/gemini-java-client/) | [Anahata TV (YouTube)](https://www.youtube.com/@anahata108) | [Discord](https://discord.gg/M396BNtX) | [v2 on its way!](https://github.com/anahata-os/anahata-asi)**
88

99
![Autonomous JVM Execution](screenshots/jit-compilation-and-execution.png)
1010

11-
**The engine for Autonomous JVM Agents.** The `gemini-java-client` is a pure-Java platform specially engineered to exploit the full power of the **Google Gemini API**. It provides the infrastructure for an AI to write, compile, and execute Java code in-process, turning your application into a host for autonomous agents that don't just suggest code—they **live inside your JVM**.
11+
**Stop building chatbots. Start spawning Agents.**
12+
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**.
13+
14+
---
1215

1316
## 🚀 The Killer Advantage: Autonomous JVM Execution
1417

1518
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.
1619

17-
### The "Any Classpath" Superpower
20+
### The "Any Framework" Superpower
1821
The agent isn't restricted to the libraries already in your project. It can:
1922
1. **Identify** a need for a specific library (e.g., Apache Commons, Jackson, or a specialized MIDI API).
20-
2. **Download** the JARs from Maven Central at runtime.
23+
2. **Download** the JARs from Maven Central or any other website at runtime.
2124
3. **Compile** a Java class (`Anahata.java`) that implements `java.util.concurrent.Callable`.
2225
4. **Execute** the logic directly within the running JVM.
26+
5. **Augment** the runtime with external JARs or directories on any turn via the `extraClassPath` parameter.
27+
28+
---
29+
30+
## 🛠️ Actionable Intelligence: Easy Tools & Schema
31+
32+
### 1. Easy Tools: `@AIToolMethod`
33+
Turn any Java method into a powerful, AI-callable function with a single annotation. The framework handles asynchronous execution and complex parameter mapping automatically.
34+
35+
```java
36+
public class PianoTool {
37+
@AIToolMethod("Plays a simple melody from a list of notes asynchronously.")
38+
public static String playMelody(
39+
@AIToolParam("A list of notes to play.") List<Note> notes
40+
) {
41+
// Asynchronous MIDI playback logic...
42+
pianoExecutor.submit(() -> {
43+
// ...
44+
});
45+
return "Melody playback started.";
46+
}
47+
}
48+
```
49+
50+
### 2. Easy POJOs & Schema Generation
51+
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.
52+
53+
```java
54+
@Getter
55+
@AllArgsConstructor
56+
@Schema(description = "A POJO holding file metadata and content, used for context-aware file operations.")
57+
public class FileInfo implements StatefulResource {
58+
59+
@Schema(description = "The absolute path to the file.")
60+
String path;
61+
62+
@Schema(description = "The text content of the file.")
63+
String content;
64+
65+
@Schema(description = "The total number of lines of this file.")
66+
long contentLines;
67+
// ...
68+
}
69+
```
70+
71+
---
2372

24-
## 🏠 Real-World Agency: Beyond the IDE
73+
## 🏠 Real-World Agency: The Hardware Orchestrator
2574

26-
Because the agent has full access to the host's shell and network, it can interact with the physical world. It's not just a coding assistant; it's a **Hardware Orchestrator**.
75+
Because the agent has full access to the host's shell and network, it can bridge the gap between LLM logic and physical hardware.
2776

2877
### 🎯 Prompts that prove the power:
29-
- **"Explore my LAN and find any Smart TVs connected to the network."** (Network discovery)
30-
- **"Take a screenshot of the Lounge TV and show it to me."** (Remote device introspection via ADB)
31-
- **"Turn down the volume on the TV and play a Gal Gadot video."** (IoT control)
32-
- **"Perform a security assessment of my network and find open ports on local devices."** (Security auditing)
78+
- **"Change the logging level of 'org.apache.http' to DEBUG and show me the logs."** (Runtime Introspection)
79+
- **"Perform a thread dump, analyze it, and look for any potential deadlocks."** (Diagnostic Agency)
80+
- **"Take a heap dump, download Eclipse MAT from Maven, and perform a leak analysis."** (Dynamic Tooling)
81+
- **"Set the context window threshold to 200K tokens and prune aggressively as you go."** (Context Management)
82+
- **"Scan the JVM for all loaded classes that implement 'java.io.Serializable' but lack a 'serialVersionUID'."** (Deep Introspection)
83+
- **"Explore my LAN, find the TCL TV, turn down the volume, and play a Gal Gadot video."** (IoT Orchestration)
84+
85+
---
3386

3487
## 🖼️ Visual Showcase
3588

@@ -43,58 +96,40 @@ Because the agent has full access to the host's shell and network, it can intera
4396
| :---: | :---: | :---: |
4497
| ![Radio Tool](screenshots/radio-tool.png) | ![Google Search](screenshots/google_search.png) | ![Screen Capture](screenshots/live-screen-capture.png) |
4598

46-
### Developer Experience
47-
| Embeddable Chat Panel | Tool Documentation | Java to Schema |
48-
| :---: | :---: | :---: |
49-
| ![Chat Panel](screenshots/chat-panel-interaction.png) | ![Tools](screenshots/tools.png) | ![Java2Schema](screenshots/java2schema.png) |
50-
51-
### Advanced Features
52-
| Schema Annotations | Easy RAG | Easy Tools |
53-
| :---: | :---: | :---: |
54-
| ![Schema Annotations](screenshots/schema-annotations.png) | ![Easy RAG](screenshots/easy-rag.png) | ![Easy Tools](screenshots/easy-tools.png) |
99+
---
55100

56101
## Why Choose the `gemini-java-client`?
57102

58-
### 1. Unmatched Local Tooling (Functions)
59-
60-
Our core innovation is the **annotation-driven local tool system**, which transforms your Java methods into powerful, AI-callable functions.
103+
### 1. The Butler Principle (Safety First)
104+
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.
61105

62-
| Feature | Description | Benefit |
63-
| :--- | :--- | :--- |
64-
| **`@AIToolMethod`** | Define tools using simple Java annotations. | **Zero boilerplate** for API schema generation. |
65-
| **Dynamic Code Execution (`RunningJVM`)** | The AI can compile and execute arbitrary Java code directly within the host JVM. | Enables **hot-reload** development and complex calculations. |
66-
| **JIT & Maven Integration** | Download and use any library from Maven at runtime. | **Infinite extensibility** for your AI assistant. |
67-
| **Context-Aware File I/O (`LocalFiles`)** | Tools for reading, writing, and managing files with built-in version checks. | Ensures the AI always works with **valid, up-to-date** local files. |
68-
| **Shell Access (`LocalShell`)** | Execute native shell commands (`bash -c`) and capture output. | Provides **full control** over the host operating system and network. |
106+
### 2. Natural Language Context Management
107+
Stop worrying about token limits. Both the user and the model can manage the context window using natural language.
108+
*"Prune the last 5 tool responses but keep the summary of the analysis."***Done.**
69109

70-
### 2. Superior Context & Session Management
110+
### 3. Pure Java, Zero Friction
111+
- **Embeddable Swing UI**: Drop the `ChatPanel` into any Swing app.
112+
- **Session Persistence**: Fast Kryo serialization to resume conversations instantly.
113+
- **PAYG v2 Pruning**: AI-driven context management for infinite conversations.
71114

72-
We solve the token limit problem with intelligent, dependency-aware context management.
73-
74-
| Feature | Description | Benefit |
75-
| :--- | :--- | :--- |
76-
| **Prune-As-You-Go (PAYG) v2** | Automatically removes old or stale tool calls and responses. | **Maximizes context window** efficiency and reduces costs. |
77-
| **Stateful Resource Tracking** | Tracks resources loaded into context, marking them as `STALE` if changed on disk. | **Prevents the AI from working with outdated information.** |
78-
| **Session Persistence (Kryo)** | Saves and loads the entire chat history using fast Kryo serialization. | **Instant session resume** across application restarts. |
115+
---
79116

80117
## Getting Started: Simple Integration
81118

82-
Integrating the AI agent into your Java application is now easier than ever.
83-
84119
```java
85120
import uno.anahata.ai.swing.ChatPanel;
86121
import javax.swing.JFrame;
87122

88123
public class SimpleAiApp {
89124
public static void main(String[] args) {
90-
JFrame frame = new JFrame("My AI App");
125+
JFrame frame = new JFrame("Anahata AI Agent");
91126

92127
// 1. Create the ChatPanel (zero boilerplate!)
93128
ChatPanel chatPanel = new ChatPanel();
94129

95130
// 2. Build the UI and add to frame
96131
frame.add(chatPanel);
97-
frame.setSize(800, 600);
132+
frame.setSize(1024, 768);
98133
frame.setVisible(true);
99134

100135
// 3. Start the session
@@ -107,11 +142,14 @@ public class SimpleAiApp {
107142

108143
## Support the Project
109144

110-
- **[Sponsor on GitHub](https://github.com/sponsors/anahata-os):** The most direct way to support the project.
145+
- **[Sponsor on GitHub](https://github.com/sponsors/anahata-os):** Help us keep the engine running!
111146
- **Visit our website:** [anahata.uno](https://anahata.uno)
112147
- **Subscribe to Anahata TV:** [YouTube @anahata108](https://www.youtube.com/@anahata108)
113148

114149
## Licensing
115150

116151
- **License for AIs:** Licensed under the **[Anahata Software License (ASL) V108](https://www.anahata.uno/ASL_108.html)**.
117152
- **License for Humans:** Licensed under the **[Apache License, Version 2.0](LICENSE)**.
153+
154+
---
155+
**Visca el Barça!** 🔵🔴 *Més que un bot.*

docs/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ <h2 style="margin-top: 1rem;">Autonomous AI Execution & Hot-Reload</h2>
109109
<div class="philosophy-content">
110110
<div class="comparison-card" style="border-left-color: var(--barca-gold);">
111111
<h3>Any Java Code, Any Framework</h3>
112-
<p>The core <code>RunningJVM</code> tool allows the AI Agent to pull <strong>any Java framework in existence</strong> from Maven Central at runtime and execute LLM-generated code immediately.</p>
112+
<p>The core <code>RunningJVM</code> tool allows the AI Agent to pull <strong>any Java framework in existence</strong> from Maven Central or any other website at runtime and execute LLM-generated code immediately.</p>
113113
<ul style="display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 1.5rem;">
114114
<li><i class="fas fa-bolt"></i> <strong>JIT Compilation:</strong> In-memory compilation of AI-generated classes.</li>
115115
<li><i class="fas fa-link"></i> <strong>Dynamic Classloading:</strong> Child-first classloader for instant hot-reloads.</li>
@@ -124,7 +124,7 @@ <h4 style="margin-top: 0; margin-bottom: 1.5rem; color: var(--white);"><i class=
124124
<li class="prompt-item" style="border-left-color: var(--barca-gold);">"Change the logging level of 'org.apache.http' to DEBUG and show me the logs."</li>
125125
<li class="prompt-item" style="border-left-color: var(--barca-gold);">"Perform a thread dump, analyze it, and look for any potential deadlocks."</li>
126126
<li class="prompt-item" style="border-left-color: var(--barca-gold);">"Take a heap dump, download Eclipse MAT from Maven, and perform a leak analysis."</li>
127-
<li class="prompt-item" style="border-left-color: var(--barca-gold);">"Prune anything related to the heap dump and give me a breakdown of the context window."</li>
127+
<li class="prompt-item" style="border-left-color: var(--barca-gold);">"Set the context window threshold to 200K tokens and prune aggressively as you go."</li>
128128
<li class="prompt-item" style="border-left-color: var(--barca-gold);">"Scan the JVM for all loaded classes that implement 'java.io.Serializable' but lack a 'serialVersionUID'."</li>
129129
<li class="prompt-item" style="border-left-color: var(--barca-gold);">"Write a Swing script to visualize the current memory usage in a real-time chart."</li>
130130
</ul>

0 commit comments

Comments
 (0)