Thank you for your interest in contributing to Assistant Agent! We welcome contributions from the community.
- Code of Conduct
- Getting Started
- Development Environment
- How to Contribute
- Code Style
- Testing
- Pull Request Process
- Issue Guidelines
Please be respectful and constructive in all interactions. We are committed to providing a welcoming and inclusive environment for everyone.
- Java 17+ (OpenJDK or GraalVM)
- Maven 3.8+
- Git
- IDE: IntelliJ IDEA (recommended) or Eclipse
# Clone the repository
git clone https://github.com/spring-ai-alibaba/AssistantAgent.git
cd AssistantAgent
# Build the project
mvn clean install -DskipTests
# Run tests
mvn test- Import Project: File → Open → Select
pom.xml - Configure JDK: File → Project Structure → SDK → Java 17+
- Enable Annotation Processing: Settings → Build → Compiler → Annotation Processors → Enable
Create a .env file (not committed to Git) or set environment variables:
export DASHSCOPE_API_KEY=your-api-key-herecd assistant-agent-start
mvn spring-boot:run| Type | Description |
|---|---|
| 🐛 Bug Fix | Fix issues in existing code |
| ✨ Feature | Add new functionality |
| 📝 Documentation | Improve docs, README, comments |
| 🧪 Tests | Add or improve tests |
| 🔧 Refactor | Improve code quality without changing behavior |
| 🌐 Translation | Help with i18n |
- Check existing issues - Look for similar issues or discussions
- Open an issue - For significant changes, discuss first
- Fork & Clone - Fork the repo and clone locally
- Create a branch - Branch from
main - Make changes - Follow code style guidelines
- Test - Ensure all tests pass
- Commit - Write clear commit messages
- Push & PR - Open a Pull Request
# Fork on GitHub, then:
git clone https://github.com/YOUR_USERNAME/AssistantAgent.git
cd AssistantAgent
git checkout -b feature/your-feature-name
# Make changes...
mvn test
git add .
git commit -m "feat: add your feature"
git push origin feature/your-feature-name
# Open PR on GitHub- Follow Google Java Style Guide
- Use 4 spaces for indentation (not tabs)
- Maximum line length: 120 characters
- Use meaningful variable and method names
All public APIs must have Javadoc:
/**
* Brief description of the method.
*
* <p>Additional details if needed.
*
* @param paramName Description of the parameter
* @return Description of return value
* @throws ExceptionType When this exception is thrown
* @since 1.0.0
*/
public ReturnType methodName(ParamType paramName) {
// implementation
}Follow the project logging convention:
// Format: ClassName#methodName - reason=description
logger.info("GraalCodeExecutor#execute - 执行函数: functionName={}, args={}", functionName, args);
logger.error("SearchProvider#search - 搜索失败: query={}, error={}", query, e.getMessage());com.alibaba.assistant.agent
├── common # Shared utilities, constants, interfaces
├── core # Core execution engine
├── evaluation # Evaluation framework
├── prompt # Prompt building
├── extension # Extension modules
│ ├── experience # Experience management
│ ├── learning # Learning extraction
│ ├── search # Search providers
│ ├── reply # Reply channels
│ ├── trigger # Trigger mechanism
│ └── dynamic # Dynamic tools (MCP, HTTP)
└── autoconfigure # Spring Boot auto-configuration
All source files must include the Apache 2.0 license header:
/*
* Copyright 2024-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/- Unit tests required for all new features
- Maintain existing tests - Don't break existing functionality
- Target coverage: Aim for > 60% coverage on new code
# Run all tests
mvn test
# Run specific test class
mvn test -Dtest=ClassName
# Run with coverage report
mvn test jacoco:report@Test
void shouldReturnSuccessWhenValidInput() { ... }
@Test
void shouldThrowExceptionWhenInputIsNull() { ... }- Code compiles without errors
- All tests pass
- New code has appropriate tests
- Javadoc added for public APIs
- No sensitive information (API keys, etc.)
- Commit messages are clear
Use Conventional Commits:
feat: add new search provider for Elasticsearch
fix: resolve null pointer in experience retrieval
docs: update README with configuration examples
refactor: simplify prompt builder logic
test: add unit tests for trigger module
## Description
Brief description of changes.
## Related Issue
Fixes #123
## Type of Change
- [ ] Bug fix
- [ ] New feature
- [ ] Breaking change
- [ ] Documentation update
## Checklist
- [ ] Tests added/updated
- [ ] Documentation updated
- [ ] Code follows style guidelines- Maintainers will review your PR
- Address any requested changes
- Once approved, maintainers will merge
- Your contribution will be included in the next release!
Include:
- Clear description of the bug
- Steps to reproduce
- Expected vs actual behavior
- Environment details (OS, Java version)
- Relevant logs/screenshots
Include:
- Clear description of the feature
- Use case / motivation
- Proposed solution (optional)
- Alternatives considered (optional)
- Questions: Open a Discussion on GitHub
- Bugs: Open an Issue with the bug template
- Features: Open an Issue with the feature template
Contributors will be recognized in:
- Release notes
- Contributors list
By contributing, you agree that your contributions will be licensed under the Apache License 2.0.