This document is the single source of truth for the V2 refactoring of the anahata-ai framework (formerly gemini-java-client). It consolidates the strategic vision, architectural plans, UI/UX goals, and technical debt from all project documentation.
The project follows a "flywheel" business model:
- The "Engine" (
anahata-ai): This is the core commercial product, a pure-Java, enterprise-grade AI framework. It is monetized via a dual AGPLv3/Commercial license. - The "Car" (
anahata-netbeans-ai): This is the free, open-source flagship application that showcases the engine's power and drives adoption.
Our key competitive differentiator is deep, interactive, and visual integration into desktop/IDE environments.
The primary technical goal is to decouple the framework from any specific AI provider.
- Action: Split the project into three modules:
anahata-ai-core,anahata-ai-gemini, andanahata-ai-swing. - Action: Implement a model-agnostic domain in
anahata-ai-corefor all conversation elements. - Action: Create a
ContentProducerinterface to abstract away all provider-specific object creation.
This is the new paradigm for state management.
- Concept: A client-side
ActiveWorkspaceManagerwill hold the definitive state of allStatefulResources. - Action: All tool calls will become ephemeral and aggressively pruned.
- Action: Before each API call, the state from the
ActiveWorkspaceManagerwill be injected into the prompt.
- Concept: Migrate from static tool methods to an instance-based model.
- Action: Create a
BaseToolclass that tools can extend to get access to the currentChatinstance and theActiveWorkspaceManager.
- Goal: Replace the custom
GeminiSchemaGeneratorwith a mature, industry-standard library likejackson-module-jsonSchema. - Benefit: This will provide full, compliant JSON Schema generation and make the framework easily adaptable to other LLMs.
- Goal: A
Chatinstance will have the ability to spawn and manage childChatinstances for complex, parallel workflows.
- Action: Replace the disruptive modal dialog with interactive components rendered directly within the chat stream.
- Features: Each component will have its own controls for individual approval, denial, and setting session-level preferences (Always/Never).
- Action: Create a new
AnahataInstancesTopComponentthat displays a live list of all active chat sessions with real-time status.
- Goal: Evolve the
listDirectorytool to return a rich, polymorphicList<FileSystemEntry>instead of a simpleList<String>. - Benefit: This provides structured, unambiguous metadata about files, directories, and symlinks, eliminating the need for inefficient and fragile shell calls (
ls -ld) to determine entry types. - Action: Implement a new
findFiles(path, recursive, glob)method to provide a structured, superior alternative to shellfindandgrepcommands.