We welcome community contributions of examples to showcase the capabilities of AIGNE Framework! Examples help other developers understand how to implement various AI workflows and integrations.
All examples are located in the examples/ directory and fall into these categories:
- Basic Examples: Simple demonstrations (e.g.,
chat-bot) - MCP Integration Examples: Model Context Protocol server integrations (e.g.,
mcp-github,mcp-sqlite) - Memory Examples: Demonstrations of memory systems (e.g.,
memory,memory-did-spaces) - Workflow Examples: Multi-agent workflow patterns (e.g.,
workflow-handoff,workflow-sequential)
Each example is listed in the main examples/README.md using relative paths like:
- [@aigne/example-your-name: Description](./your-example-name/README.md)Your example package must follow this standard structure:
examples/your-example-name/
├── README.md # Required: Comprehensive documentation
├── package.json # Required: Package configuration
├── CHANGELOG.md # Required: Version history
├── index.ts # Required: Main entry point (for TypeScript examples)
├── index.test.ts # Required: Test file
├── tsconfig.json # Required for TypeScript examples
├── .env.local.example # Optional: Environment variable template
Your README must include comprehensive documentation following the standard format used by existing examples. See any example in the examples/ directory for the expected structure and style.
- Use TypeScript for all examples
- Include proper type definitions
- Include
tsconfig.jsonconfiguration
- Implement command-line argument parsing
- Support
--interactiveflag for interactive mode - Support
--modelfor different AI providers - Support pipeline input (stdin)
- Include comprehensive tests in
*.test.tsfiles - Use
@aigne/test-utilsfor testing utilities - Tests should be runnable with
bun test
- Implement proper error handling
- Provide helpful error messages
- Validate environment variables and configuration
- Add meaningful comments to complex logic
- Document function parameters and return types
- Include JSDoc comments for public APIs
- Provide
.env.local.examplewith all required variables - Document each environment variable in README
- Support multiple AI model providers
- Include practical usage examples
- Show different configuration options
- Demonstrate error scenarios and handling
Based on review of community contributions, avoid these common problems:
- ❌ Missing required files (README.md, package.json, CHANGELOG.md)
- ❌ Incorrect naming conventions
- ❌ Missing or incomplete TypeScript configuration
- ❌ Insufficient or unclear README documentation
- ❌ Missing prerequisites section
- ❌ No quick start instructions
- ❌ Missing environment variable documentation
- ❌ Hardcoded API keys or sensitive data
- ❌ Missing error handling
- ❌ No CLI argument support
- ❌ Inconsistent code style
- ❌ Missing test files
- ❌ Tests that don't run properly
- ❌ No integration with framework test utilities
After creating your example, you must add it to the main examples index:
-
Update
examples/README.md: Add your example to the "Example List" section using relative path:- [@aigne/example-your-name: Brief description](./your-example-name/README.md)
-
Maintain Alphabetical Order: Insert your example in the appropriate category, maintaining alphabetical order within each section.
-
Automated Checks: Your PR will be automatically checked for:
- Package structure compliance
- Code style and linting
- Test execution
- Build success
-
Manual Review: Maintainers will review:
- Code quality and best practices
- Documentation completeness
- Example usefulness and clarity
- Integration with existing examples
- Proper addition to examples index
-
Testing: Examples will be tested to ensure:
- They run successfully
- Documentation is accurate
- All features work as described
- Check existing examples for patterns and best practices
- Open an issue for questions before starting large contributions
- Join the AIGNE Community for discussions
- Reference the main Contributing Guidelines for general contribution rules
Before submitting your example, verify:
- Package follows standard structure
- README includes all required sections with proper logo format
- Code includes proper error handling
- Tests are included and pass
- Environment variables are documented
- CLI arguments are supported
- Example is well-documented with comments
- CHANGELOG.md is included
- No sensitive data is committed
- Example added to main
examples/README.mdindex with relative path - Entry maintains alphabetical order within appropriate category
Following these guidelines ensures your example will be valuable to the community and can be reviewed efficiently by maintainers.