Building Your Own: A Guide to Creating Custom Agents
Extend our platform by building custom agents tailored to your team's unique workflows.
At Odin Labs, we provide a powerful roster of pre-built agents like **RepoQC** and **Autopilot Fixer** designed to solve common development challenges. However, we know that every engineering team has its own unique set of tools, standards, and workflows. A one-size-fits-all approach isn’t enough. That’s why our platform is built to be extensible, allowing you to create your own custom agents that are perfectly tailored to your needs.
Why Build a Custom Agent?
You might build a custom agent to:
- **Integrate with Proprietary Tools:** Create an agent that can interact with your company’s internal APIs, databases, or deployment scripts.
- **Enforce Domain-Specific Rules:** Build a quality agent that understands your specific business logic and enforces rules that go beyond standard linters (e.g., "A user in the 'EU' region must never have their data processed outside of our Frankfurt data center").
- **Automate Niche Workflows:** Automate a repetitive task unique to your team, such as generating weekly performance reports from a specific set of microservices or updating a legacy system after a new feature is merged.
The Anatomy of an Agent
Building an agent on the Odin Labs platform involves defining three core components:
1. **Triggers:** What event initiates the agent's run? This could be a webhook from a GitHub pull request, a schedule (e.g., every Monday at 9 AM), or a manual invocation from our CLI.
2. **Sensors (Input):** What information does the agent need to perform its task? This is where the agent gathers context. It might read files from a Git repository, fetch data from an API, or query a database.
3. **Actuators (Output):** What action does the agent take? This could be writing a file, posting a comment on a PR, calling an API, or passing data to another agent in a workflow.
Example: A "Release Notes" Agent
Let’s imagine you want to automate the creation of release notes. A custom agent could be built with the following logic:
- **Trigger:** A new tag is pushed to your Git repository.
- **Sensors:**
- Fetch all commit messages between the new tag and the previous tag.
- Filter for commits that follow your team’s conventional commit format (e.g., `feat:`, `fix:`, `chore:`).
- Call the Jira API to get the titles of the tickets associated with those commits.
- **Actuators:**
- Use a generative text model to summarize the commits and ticket titles into human-readable release notes.
- Create a new page in your Confluence space with the generated notes.
- Post a notification to your team's Slack channel with a link to the new release notes page.
An SDK Built for Developers
Our Agent SDK provides a simple, declarative way to define these components in TypeScript. You focus on the logic of your workflow, and the platform handles the boilerplate of running, scaling, and monitoring your agents securely.
// Simplified example of an agent definition
import { defineAgent, triggers, sensors, actuators } from '@odin-labs/sdk';
export const releaseNotesAgent = defineAgent({
name: 'release-notes-generator',
trigger: triggers.onGitTag({
repository: 'my-org/my-repo',
}),
run: async (context) => {
const commits = await sensors.git.getCommits({
from: context.trigger.previousTag,
to: context.trigger.newTag,
});
const releaseSummary = await actuators.ai.summarize({
content: commits,
prompt: 'Create a "What's New" section from these commits.',
});
await actuators.confluence.createPage({
space: 'PROD',
title: `Release Notes - ${context.trigger.newTag}`,
content: releaseSummary,
});
}
});By empowering you to build your own agents, we ensure that the Odin Labs platform can grow and adapt to solve any challenge your team faces. You're not just using a tool; you're building an automated extension of your own team.