Framework Development
Welcome to the Astrsomn framework development guide! This section will help you extend and customize the framework.
Overview
Astrsomn uses SPI (Service Provider Interface) for plugin extension, supporting three extension types:
| Extension Type | Core Interface | Description |
|---|---|---|
| Model Provider | ModelProviderHandler | Integrate new LLM platforms (Chat / Streaming / Embedding) |
| Vector Store | VecDriver → VecSource → VecStore | Integrate new vector databases |
| MCP Protocol | McpProtocolHandler | Extend MCP transport protocols (SSE / STDIO / custom) |
Extension Mechanism
The framework auto-discovers and loads plugins via Java SPI:
- Define Interface — Implement the framework's extension interfaces
- Register SPI — Register implementation classes in
META-INF/services/ - Create Extension Descriptor — Extend
AstroExtensionDescriptorfor plugin metadata - Package & Deploy — Package as a standalone JAR, drop into
plugins/for auto-loading
Directory Structure
Framework Development
├── Overview (this page)
├── Provider Development
│ ├── Guide ← Implement ModelProviderHandler
│ ├── Interface Guide ← API specifications
│ └── Examples ← Complete code examples
├── Vector Store Development
│ ├── Guide ← Implement VecDriver / VecSource / VecStore
│ ├── Interface Guide ← API specifications
│ └── Examples ← Complete code examples
└── MCP Development
├── Guide ← Implement McpProtocolHandler
├── Interface Guide ← API specifications
└── Examples ← Complete code examplesDevelopment Environment
bash
# Clone the project
git clone https://github.com/Astrsomn/Astrsomn.git
cd Astrsomn
# Compile (skip tests)
mvn clean compile -DskipTests
# Run tests
mvn test
# Package a single module
mvn clean package -pl astrsomn-plugins/astrsomn-providers/astrsomn-provider-deepseek -am -DskipTestsKey Interface Quick Reference
Model Provider
| Interface | Package |
|---|---|
ModelProviderHandler | com.astrsomn.api.runtime.common.langchain.extension.model |
AbstractModelProviderHandler | com.astrsomn.api.runtime.common.langchain.extension.model |
Vector Store
| Interface | Package |
|---|---|
VecDriver | com.astrsomn.api.runtime.common.langchain.extension.vector |
AbstractVecDriver | com.astrsomn.api.runtime.common.langchain.extension.vector |
VecSource | com.astrsomn.api.runtime.common.langchain.extension.vector |
VecStore | com.astrsomn.api.runtime.common.langchain.extension.vector |
MCP Protocol
| Interface | Package |
|---|---|
McpProtocolHandler | com.astrsomn.starter.runtime.langchain.tool.mcp.protocol |
Extension Metadata
| Interface | Package |
|---|---|
AstroExtensionDescriptor | com.astrsomn.starter.system |
Next Steps
- Provider Development — Build a model provider plugin from scratch
- Vector Store Development — Build a vector store plugin from scratch
- MCP Development — Build an MCP protocol plugin from scratch
- Project Architecture — Understand the architecture design