🚀 Declarative Development
Inject Agent like Service, completely shielding LangChain4j's complex initialization and low-level API calls.
Deeply built on LangChain4j, transforming complex AI workflows into an effortless annotation experience. Providing Java developers with a standardized, production-ready AI integration foundation.
In enterprise-level production environments, the challenge of AI lies not in the "model itself", but in how to stably, safely, and controllably connect to business.
Astrsomn is a complete AI ecosystem: From
astrsomn-coreunderlying abstraction, toastrsomn-starterseamless integration, and then toastrsomn-servercentralized governance, we provide Java developers with an out-of-the-box "AI industrial base".
Astrsomn adopts a layered decoupled architecture to ensure high availability and scalability in high-concurrency business scenarios.
| Layer | Core Components | Technical Features |
|---|---|---|
| Access Layer | @Astro Annotation / Starter | Zero-intrusive Bean injection, supporting multi-Agent instance isolation |
| Orchestration Layer | AstroAssistantFactory | Dynamically build AiServices, supporting LLM/Streaming mode switching |
| Capabilities Layer | DynamicToolProvider / MCP | Cross-protocol tool invocation, supporting real-time conversion of Spring Bean methods to Tool |
| Governance Layer | AssistantCacheManager | In-memory management, Prompt version snapshot, multi-environment configuration distribution |
The simplest way to access. Through @Astro annotation, the framework automatically retrieves parameters from the configuration center and completes the Agent's lifecycle management and model assembly.
@Service
public class OrderService {
// Auto-assembly: The framework automatically retrieves configuration and injects cached instance based on agentKey
@Astro(agentKey = "order-handler", envCode = "prod", temperature = 0.3)
private OrderCreateAssistant orderAssistant;
public String createOrder() {
// Execute AI tasks like calling ordinary methods
return orderAssistant.chat("Help me buy an iPhone17", UUID.randomUUID().toString());
}
}More flexible control method. When your business needs to build Assistant based on runtime context (such as dynamically adjusting the number of historical messages, switching tool strategies), you can use AstroAssistantFactory.
@Service
@RequiredArgsConstructor
public class TaskService {
private final AstroAssistantFactory assistantFactory;
public String createTask() {
// 1. Dynamically build request parameters
var param = AstroChatRequest.of(TaskCreateAssistant.class, "deepseek-sensor");
param.setMaxHistoryMessages(5); // Adjust context length at runtime
param.setToolStrategy(new ToolStrategy()); // Dynamically specify tool strategy
// 2. Get/create Assistant through factory (built-in AssistantCacheManager performance optimization)
TaskCreateAssistant assistant = assistantFactory.createAssistant(param);
return assistant.chat("Help me create a task, assignee is Liu Huipeng", UUID.fastUUID().toString());
}
}