docs/decisions/0002-java-folder-structure.md
A port of the Semantic Kernel to Java is under development in the experimental-java branch. The folder structure being used has diverged from the .Net implementation.
The purpose of this ADR is to document the folder structure that will be used by the Java port to make it clear to developers how to navigate between the .Net and Java implementations.
Below is a comparison of .Net and Java Folder structures
dotnet/src
Connectors
Extensions
IntegrationTests
InternalUtilities
SemanticKernel.Abstractions
SemanticKernel.MetaPackage
SemanticKernel.UnitTests
SemanticKernel
Skills
| Folder | Description |
|---|---|
| Connectors | Parent folder for various Connector implementations e.g., AI or Memory services |
| Extensions | Parent folder for SK extensions e.g., planner implementations |
| IntegrationTests | Integration tests |
| InternalUtilities | Internal utilities i.e., shared code |
| SemanticKernel.Abstractions | SK API definitions |
| SemanticKernel.MetaPackage | SK common package collection |
| SemanticKernel.UnitTests | Unit tests |
| SemanticKernel | SK implementation |
| Skills | Parent folder for various Skills implementations e.g., Core, MS Graph, GRPC, OpenAI, ... |
Some observations:
src folder is at the very start of the folder structure, which reduces flexibilitySkills term is due to changejava
api-test
samples
semantickernel-api
semantickernel-bom
semantickernel-connectors-parent
semantickernel-core-skills
semantickernel-core
semantickernel-extensions-parent
| Folder | Description |
|---|---|
api-test | Integration tests and API usage example |
samples | SK samples |
semantickernel-api | SK API definitions |
semantickernel-bom | SK Bill Of Materials |
semantickernel-connectors-parent | Parent folder for various Connector implementations |
semantickernel-core-skills | SK core skills (in .Net these are part of the core implementation) |
semantickernel-core | SK core implementation |
semantickernel-extensions-parent | Parent folder for SK extensions e.g., planner implementation |
Some observations:
- delimiter is idiomatic Javasrc folders are located as close as possible to the source files e.g., semantickernel-api/src/main/java, this is idiomatic Javajava folder and each sample runs standaloneFollow these guidelines:
bom instead of MetaPackage as the latter is .Net centricapi instead of Abstractions as the latter is .Net centricsemantickernel-core-skills to a new plugins folder and rename to plugins-coreplugins instead of skills and avoid introducing technical debt| Folder | Description |
|---|---|
connectors | Containing: semantickernel-connectors-ai-openai, semantickernel-connectors-ai-huggingface, semantickernel-connectors-memory-qadrant, ... |
extensions | Containing: semantickernel-planning-action-planner, semantickernel-planning-sequential-planner |
integration-tests | Integration tests |
semantickernel-api | SK API definitions |
semantickernel-bom | SK common package collection |
semantickernel-core | SK core implementation |
plugins | Containing: semantickernel-plugins-core, semantickernel-plugins-document, semantickernel-plugins-msgraph, ... |