[Open-source] Java AI Intelligent Body Full-scene Application Development Framework Supports Various Capabilities of Known AI Development

Open SourceOpen Source Systems
2026-06-08 22:41 7 次浏览 • 0 次下载 100KB
[Open-source] Java AI Intelligent Body Full-scene Application Development Framework Supports Various Capabilities of Known AI Development

1. Project Overview

Solon-AI

Java AI (intelligent body) Full-scene application development framework (supports various capabilities of known AI development)
[Based on Solon application development framework]

Java AI (Intelligent Entity) Full-scene Application Development Framework (LLM, Function Call, RAG, Embedding, Reranking, Flow, MCP Server, Mcp Client, Mcp Proxy). It is also compatible with java8 ~ java24.

Full-scene Java AI Application Development Framework (Supporting Various Capabilities of Known AI Development). It is part of the Solon project. It can also be embedded in SpringBoot2, jFinal, Vert.x, etc. frameworks for use.

2. Open Source License

Licensed under Apache-2.0

3. Screenshots

Image

 

Image

4. Feature Overview

(v3.1.0 supports)

This series mainly introduces the use of Solon AI plugins (AI 'General' Application Development Framework). Solon-AI is designed with dialect adaptation, which can be compatible with various large language model (LLM) interface calls.

Here, the AI mainly refers to Generative Artificial Intelligence. It is also called 'Large Model', or 'Large Language Model'. By dividing the generation content, there are commonly:

Model

Function

Chat Generation Model (ChatModel)

Used to generate chat dialogues, or text creation, or explanation and answer questions, etc.

Image Generation Model (ImageModel)

Used to generate images

Video Generation Model (VideoModel)

Used to generate videos

Other models will also have (more, not listed):

Model

Function

Embedding Model (EmbeddingModel)

Used to generate vector data, and then implement similar queries

Ranking Model (RankingModel)

Used to sort

Different models will have mutual cooperation. For example, ChatModel generated content can be used for ImageModel and VideoModel. While EmbeddingModel and ChatModel cooperate, they can implement RAG (i.e. local data and large model cooperation, enhance generation effect). It also supports MCP protocol, implements Tool service publication, and Tool service use.

When used, it can be roughly thought of as an http-api interface (more human-friendly). See common terms, which are almost the same meaning:

  • ai
  • Large Model
  • Generative Large Language Model
  • Large Language Model
  • Language Model

Current AI common application construction (solon-flow provides 'Workflow Arrangement' support)

Source: Solon-AI Official Documentation

5. Tech Stack

Main Interface Experience Examples

  • ChatModel (Common Interface, based on dialect adaptation to implement different providers and models extension)
ChatModel chatModel = ChatModel.of("http://127.0.0.1:11434/api/chat")
                .provider("ollama") // Need to specify the supplier, used to identify the interface style (also called dialect)
                .model("qwen2.5:1.5b")
                .build();
// Synchronous call, and print response message
System.out.println(chatModel.prompt("hello").call().getMessage());
// Reactive call
chatModel.prompt("hello").stream(); //Publisher<ChatResponse>
  • Function Calling (or Tool Calling)
// Can add default tools (i.e. all requests have products), or request time tools
chatModel.prompt("What is the weather situation in Hangzhou today?")
    .options(op->op.toolsAdd(new FunctionTools()))
    .call();
  • Vision (Multimedia Perception)
chatModel.prompt(ChatMessage.ofUser("Is there a square in this picture?", Image.ofUrl(imageUrl)))
    .call();
  • RAG(EmbeddingModel,Repository,DocumentLoader,RerankingModel)
// Build knowledge base
EmbeddingModel embeddingModel = EmbeddingModel.of(apiUrl).apiKey(apiKey).provider(provider).model(model).batchSize(10).build();
RerankingModel rerankingModel = RerankingModel.of(apiUrl).apiKey(apiKey).provider(provider).model(model).build();
InMemoryRepository repository = new InMemoryRepository(TestUtils.getEmbeddingModel()); // 3. Initialize knowledge base
repository.insert(new PdfLoader(pdfUri).load());
// Search
List<Document> docs = repository.search(query);
// If needed, can re-arrange
docs = rerankingModel.rerank(query, docs);
// Prompt phrase enhancement is
ChatMessage message = ChatMessage.augment(query, docs);
// Call large model
chatModel.prompt(message)
    .call();
  • Ai Flow (Simulate Dify's Workflow Application)
id: demo1
layout:
  - title: "Start"
    type: start
  - title: "File Extraction"
    meta.input: "file" # Visual interface configuration (through meta information representation)
    meta.output: "fileTxt"
    task: @FileLoaderCom
  - title: "LLM"
    meta.model: "Qwen/Qwen2.5-72B-Instruct" # Visual interface configuration (through meta information representation)
    meta.input: "fileTxt"
    meta.messages:
      - role: system
        content: "#Role
You are a data expert, delete data format and conversion

#Context
${fileTxt}

#Task
Extract csv format string"
    task: @ChatModelCom
  - title: "Parameter Extractor"
    meta.model: "Qwen/Qwen2.5-72B-Instruct" # Visual interface configuration (through meta information representation)
    meta.output: "csvData"
    task: @ParamExtractionCom
  - title: "Execute Code"
    meta.input: "csvData"
    task: |
      import com.demo.DataUtils;

      String json = DataUtils.csvToJson(node.meta().get("meta.input"));  // Convert to json data
      String echatCode = DataUtils.jsonAsEchatCode(json); // Convert to echart chart code
      context.result = echatCode; // As a result return
  - title: "End"
    type: end
# FlowEngine flowEngine = FlowEngine.newInstance();
# ...
# flowEngine.eval("demo1");
  • MCP server (Supports Multi-Endpoint)
// Component way construction
@McpServerEndpoint(name="mcp-case1", sseEndpoint = "/case1/sse")
public class McpServerTool {
    @ToolMapping(description = "Query Weather Forecast")
    public String getWeather(@ToolParam(description = "City Location") String location) {
        return "Sunny, 14 degrees";
    }
}
// Native java way construction
McpServerEndpointProvider serverEndpoint = McpServerEndpointProvider.builder()
        .name("mcp-case2")
        .sseEndpoint("/case2/sse")
        .build();
serverEndpoint.addTool(new MethodToolProvider(new McpServerTool()));
serverEndpoint.postStart();
  • MCP client
McpClientToolProvider clientToolProvider = McpClientToolProvider.builder()
                .apiUrl("http://localhost:8080/case1/sse")
                .build();
String rst = clientToolProvider.callToolAsText("getWeather", Map.of("location", "Hangzhou"));
#1
资源直链https://gitee.com/opensolon/solon-ai?url=eflyos.zip
去下载
星河码客

发现和分享优质开源项目,传承互联网精神,为开发者服务。

关于本站

联系我们

微信/广告合作:ITcloub (备注星河码客)

免责声明:本站资源版权归原作者所有,仅供学习与交流。如有侵权,请通过「关于我们 - 侵权投诉」联系删除。

Powered by Nuxt · Deployed on Cloudflare