This file provides guidance to AI agents when working with code in this repository.
DevoxxGenie is a Java-based LLM Code Assistant plugin for IntelliJ IDEA that integrates with both local LLM providers (Ollama, LMStudio, GPT4All, Llama.cpp, Exo) and cloud-based LLMs (OpenAI, Anthropic, Mistral, Groq, Gemini, DeepInfra, DeepSeek, OpenRouter, Azure OpenAI, Amazon Bedrock). The plugin supports advanced features like RAG (Retrieval-Augmented Generation), MCP (Model Context Protocol) servers, web search, and agentic programming capabilities.
./gradlew buildPlugin # Build plugin (creates ZIP in build/distributions/)
./gradlew clean # Clean build artifacts
./gradlew shadowJar # Create shadow JAR with dependencies./gradlew test # Run all tests
./gradlew test --tests ClassName # Run specific test class
./gradlew test --tests ClassName.methodName # Run single test method
./gradlew verifyPlugin # Verify plugin (includes tests)./gradlew runIde # Run IntelliJ IDEA with plugin for testing
./gradlew publishPlugin # Publish to JetBrains Marketplace (requires PUBLISH_TOKEN env var)task build # Build the plugin
task test # Run tests
task run-ide # Run IDE with plugin
task generate-changelog VERSION=0.8.0 # Generate changelog from merged PRs
task preview-changes VERSION=0.8.0 # Preview changelog without committing- Root module: Main IntelliJ plugin code (
src/main/java/com/devoxx/genie/) - Core module: Shared utilities being refactored (see
core/README.md- issue #564) - Docusaurus: Documentation website (
docusaurus/)
The plugin processes user prompts through a layered architecture:
Entry Point:
UserPromptPanel→PromptSubmissionListener.onPromptSubmitted()→PromptExecutionController.handlePromptSubmission()
Processing Layer:
PromptExecutionService.executeQuery()- Handles token calculations, RAG, and GitDiff settingsChatPromptExecutor.executePrompt()- Dispatches to appropriate LLM providerLLMProviderService.getAvailableModelProviders()- Retrieves model from ChatModelFactory
Execution Strategies:
StreamingPromptExecutor- Token-by-token streaming responsesNonStreamingPromptExecutionService- Full response modeWebSearchPromptExecutionService- Web search augmented prompts
Response Rendering:
ChatStreamingResponsePanel- Real-time streaming UI updatesChatResponsePanel- Final response display with code highlightingResponseHeaderPanel,ResponseDocumentPanel,MetricExecutionInfoPanel- Modular response components
Factory Pattern Implementation:
ChatModelFactory(interface) - Base factory for all providersChatModelFactoryProvider- Provider registry and lookup- Provider-specific factories under:
chatmodel/cloud/- Cloud providers (OpenAI, Anthropic, Gemini, etc.)chatmodel/local/- Local providers (Ollama, GPT4All, LMStudio, etc.)
Cloud Providers: anthropic, azureopenai, bedrock, deepinfra, deepseek, google, grok, groq, mistral, openai, openrouter
Local Providers: ollama, gpt4all, lmstudio, llamacpp, jan, customopenai
Adding New Providers:
- Create factory class implementing
ChatModelFactoryunderchatmodel/cloud/orchatmodel/local/ - Implement
createChatModel()andcreateStreamingChatModel()methods - Register in
ChatModelFactoryProvider - Add provider to
ModelProviderenum inmodel/enumarations/
Components:
ProjectIndexerService- Indexes project files for semantic searchChromaEmbeddingService- Stores embeddings in ChromaDB (Docker-based, v0.6.2)SemanticSearchService- Retrieves relevant code based on similarity- Uses Ollama with Nomic Text embeddings for vector generation
RAGValidatorService- Validates Docker, ChromaDB, and Ollama setup
Validators:
DockerValidator- Checks Docker availabilityChromeDBValidator- Validates ChromaDB connectionOllamaValidator- Verifies Ollama and embedding modelNomicEmbedTextValidator- Checks nomic-embed-text model
Key Services:
MCPService- Core MCP server managementMCPExecutionService- Executes MCP tool callsMCPListenerService- Implements ChatModelListener for MCP integrationMCPCallbackLogger- Logs MCP requests/responses for debugging
Configuration:
- MCP servers configured in Settings UI (
ui/settings/mcp/) - Supports stdio and HTTP SSE transports
- Tools are automatically exposed to LLM conversations when MCP is enabled
Key services under service/:
ChatService- Manages chat conversationsMessageCreationService- Constructs LLM messages with contextTokenCalculationService- Calculates token usage and costsProjectContentService- Extracts project content for contextFileListManager- Manages files added to prompt contextConversationStorageService- Persists chat history locally (SQLite)
Main Panels:
DevoxxGenieToolWindowContent- Main plugin windowConversationPanel- Chat conversation displayUserPromptPanel- User input area with image/file DnD supportActionButtonsPanel- Control buttons (submit, stop, clear, etc.)PromptOutputPanel- Response output with streaming support
Settings UI (ui/settings/):
LLMProvidersComponent- Configure LLM providers and API keysRAGSettingsComponent- RAG feature configurationMCPSettingsComponent- MCP server managementPromptSettingsComponent- Custom prompts and shortcutsWebSearchProvidersComponent- Google/Tavily search setup
Language-Specific Scanners (service/analyzer/languages/):
- Each language has a
ProjectScannerExtensionimplementation - Supports: Java, Kotlin, Python, JavaScript, Go, Rust, C++, PHP
- Extracts AST context (parent classes, field references) for better code analysis
ProjectAnalyzercoordinates language-specific scanningCachedProjectScanner- Caches scan results for performance
Experimental Feature (service/tdg/):
CodeGeneratorService- Generates implementation from unit tests- Allows writing tests first, then generating implementation
- Variables/Methods: camelCase
- Classes/Interfaces: PascalCase
- Constants: SCREAMING_SNAKE_CASE
- Service Classes: Suffix with "Service" (e.g.,
ChatService) - Factory Classes: Suffix with "Factory" (e.g.,
ChatModelFactory) - Panel Classes: Suffix with "Panel" (e.g.,
UserPromptPanel)
- Java minimum: JDK 17
- IntelliJ minimum: 2023.3.4
- Langchain4J version: 1.10.0 (beta: 1.10.0-beta18 for MCP/Chroma/web search)
- Uses Lombok for boilerplate reduction
- Shadow plugin for fat JAR creation with dependency merging
- Tests located in
src/test/java/mirroring main structure - Uses JUnit 5 (Jupiter) for testing
- Mockito for mocking
- AssertJ for fluent assertions
- Integration tests suffixed with
IT(e.g.,PromptExecutionServiceIT) - Platform tests extend
AbstractLightPlatformTestCase
- Projects can include a
DEVOXXGENIE.mdfile at root - This file is automatically added to the system prompt for better LLM context
- Can be generated via Settings UI or
/initcommand in prompt input - Provides project-specific guidance to the LLM
- Configurable chat memory size (default: 10 messages)
ChatMemoryManagerhandles memory lifecycle per conversation- Conversations stored locally using SQLite
- Each conversation maintains independent memory context
- Real-time token counting using JTokkit library
- Cost calculation for cloud providers
- Context window tracking and warnings
- Supports adding full project to context for large context models (e.g., Gemini 1M tokens)
- Google Custom Search and Tavily supported
WebSearchPromptExecutionServiceaugments prompts with search results- Configured via Settings UI with API keys
GitMergeService- Git diff integration- Can include uncommitted changes in prompt context
- Useful for explaining changes or generating commit messages
src/main/resources/META-INF/plugin.xml- Main plugin descriptor- Language-specific features:
java-features.xml,kotlin-features.xml,python-features.xml, etc. src/main/resources/application.properties- Application properties (version auto-updated by build)gradle.properties- Gradle configuration.env- Local environment variables (not committed)
- Update
model/CustomPrompt.javaif new model properties needed - Modify
ui/settings/prompt/PromptSettingsComponent.javafor UI - Update
service/prompt/command/CustomPromptCommand.javafor execution - Add entry in Settings → Prompts panel
- Enable MCP logging in Settings → MCP
- View logs in MCP Log Tool Window (
MCPLogPanel) - Check
MCPCallbackLoggerfor request/response details - Verify transport configuration (stdio vs HTTP SSE)
- Ensure Docker is running
- ChromaDB container must be started (docker-java integration)
- Ollama with nomic-embed-text model required
- Use
RAGValidatorServiceto check prerequisites - Index project via
ProjectIndexerService.indexFiles()
- Update version in
build.gradle.kts - Generate changelog:
task generate-changelog VERSION=x.y.z - Review and commit changes to
CHANGELOG.mdandplugin.xml - Build:
./gradlew buildPlugin - Test:
./gradlew testand./gradlew verifyPlugin - Publish: Set
PUBLISH_TOKENenv var and run./gradlew publishPlugin
- Langchain4J: LLM integration framework (core abstraction)
- Docker Java: Docker integration for ChromaDB
- JTokkit: Token counting
- SQLite JDBC: Local conversation storage
- CommonMark: Markdown parsing and rendering
- Netty: Async networking
- Logback: Logging framework
- Retrofit: HTTP client for external APIs
- AWS SDK: Amazon Bedrock integration
<CRITICAL_INSTRUCTION>
This project uses Backlog.md MCP for all task and project management activities.
CRITICAL GUIDANCE
-
If your client supports MCP resources, read
backlog://workflow/overviewto understand when and how to use Backlog for this project. -
If your client only supports tools or the above request fails, call
backlog.get_workflow_overview()tool to load the tool-oriented overview (it lists the matching guide tools). -
First time working here? Read the overview resource IMMEDIATELY to learn the workflow
-
Already familiar? You should have the overview cached ("## Backlog.md Overview (MCP)")
-
When to read it: BEFORE creating tasks, or when you're unsure whether to track work
These guides cover:
- Decision framework for when to create tasks
- Search-first workflow to avoid duplicates
- Links to detailed guides for task creation, execution, and finalization
- MCP tools reference
You MUST read the overview resource to understand the complete workflow. The information is NOT summarized here.
</CRITICAL_INSTRUCTION>