Source Control
Version control for AI artifacts with built-in Git integration, enabling collaborative development and audit trails for workflows, prompts, and configurations.
Why Source Control for AI Systems?
Traditional software has long benefited from version control, but AI systems present unique challenges:
- Prompts and workflows evolve rapidly during experimentation
- Multiple team members iterate on the same AI pipelines
- Production deployments require stable, tested versions
- Compliance and auditing demand change history and authorship tracking
- Rollback capability when a deployed workflow underperforms
M3 Forge embeds source control directly into the platform, treating AI artifacts as first-class versioned assets.

Git Integration
M3 Forge integrates with Gitea, a self-hosted Git service that runs alongside the platform. This provides:
- Full Git workflow — branches, commits, merges, pull requests
- Web-based code editor — no local Git client required
- Change visualization — side-by-side diffs for workflow JSON and prompt YAML
- Access control — repository-level permissions and team collaboration
- Audit trail — complete history of who changed what and when
Gitea runs as a separate service. See Gitea Integration for setup instructions.
Versioned Artifacts
M3 Forge stores the following artifacts in Git repositories:
| Artifact Type | Storage Format | Location |
|---|---|---|
| Workflows | DAG JSON | workflows/<name>.json |
| Prompts | YAML with frontmatter | prompts/<name>.yaml |
| Query Plans | DAG JSON with prefabs | query-plans/<name>.json |
| Agents | Configuration YAML | agents/<name>.yaml |
| Configurations | Environment-specific JSON | config/<env>/<name>.json |
All files are human-readable and diff-friendly, enabling meaningful code reviews and change tracking.
Git Workflow
M3 Forge follows a branch-based development workflow:
- Create a branch for new features or changes
- Commit changes incrementally as you iterate
- Open a pull request when ready for review
- Review and approve — team members provide feedback
- Merge to main — approved changes become the new baseline
- Deploy via Release Pipeline — promote stable versions to production
This workflow integrates with the Release Pipeline to ensure only reviewed, tested changes reach production.
Key Concepts
Repository
A Git repository containing versioned AI artifacts. Each repository can hold workflows, prompts, agents, and configurations. Repositories support:
- Branching for isolated development
- Commit history with full authorship tracking
- Pull requests for peer review
- Tags for release marking
Commit
A snapshot of changes with a descriptive message. Commits track:
- What changed — file diffs showing added, modified, deleted content
- Who changed it — author name and email
- When it changed — timestamp
- Why it changed — commit message describing intent
Branch
An isolated line of development. Branches enable:
- Parallel work — multiple team members working simultaneously
- Safe experimentation — try new approaches without affecting production
- Feature isolation — keep unrelated changes separate
Pull Request
A request to merge changes from one branch to another. Pull requests provide:
- Code review — team members inspect changes before merge
- Discussion — comments and feedback on specific lines
- Approval workflow — require sign-off before merge
- CI integration — automated testing of proposed changes
Change Set
A logical grouping of related changes across multiple commits. Change sets:
- Track related edits — e.g., “Add fraud detection workflow”
- Enable bulk review — evaluate all changes together
- Support promotion — move a set of changes through environments
See Change Sets for details.
Integration with Release Pipeline
Source control is tightly integrated with the Release Pipeline:
- Development happens in Git branches
- Pull requests are reviewed and merged to main
- Change sets group related commits
- Versions are created from change sets
- Deployments promote versions to environments
This ensures every production deployment is traceable back to specific commits and authors.
When to Use Source Control
| Use Case | Example |
|---|---|
| Team collaboration | Multiple engineers iterating on a complex workflow |
| Production stability | Maintain stable main branch while experimenting in feature branches |
| Compliance | Audit trail showing who approved changes to sensitive prompts |
| Rollback | Revert to previous workflow version when performance degrades |
| Change review | Require peer review before deploying new LLM prompts |
For solo prototyping or throwaway experiments, you can work directly without source control and commit later when ready.
Getting Started
Repositories
Create and manage Git repositories for your AI artifacts.
Pull Requests
Review and merge changes through collaborative PRs.
Change Sets
Group related changes and track them through deployment.
Architecture
M3 Forge uses Gitea for Git hosting and provides a custom UI for repository browsing, editing, and commit management. The integration architecture:
The repository browser, code editor, and PR views are built into M3 Forge, while Gitea handles Git operations and repository storage.
Gitea provides a standalone web UI accessible at the configured Gitea endpoint. Use it for advanced Git operations not yet supported in M3 Forge.
Next Steps
- Set up Gitea integration for your deployment
- Learn how to manage repositories
- Create your first pull request
- Integrate source control with the Release Pipeline