Custom agents
What is an agent?
An agent is a callable unit of intelligence that the Cendriix orchestrator can invoke as a step in a workflow. Every agent receives a typed context from the Cortex knowledge graph, executes a task, and writes structured output back to the graph.
Agents are stateless. They do not hold memory between calls — all persistent state lives in the Cortex knowledge graph. This makes agents individually testable and composable into arbitrarily complex A2A workflows.
Built-in agents
The following agents are available out of the box on all plans:
| Agent | Input | Output |
|---|---|---|
cortex-reader | Entity query | Entity data |
code-writer | Implementation plan | PR diff |
test-runner | PR diff, repo | Test result |
github-pr-opener | PR diff, title, ticket | PR URL |
deploy-canary | PR URL, environment | Deploy event |
jira-updater | Ticket ID, status, comment | Updated ticket |
slack-notifier | Channel, message | Message ID |
blast-radius-scorer | Service IDs | Score, affected services |
Custom agents
You can register your own agents using the Cendriix agent SDK (TypeScript and Python). A custom agent is a function that accepts a typed AgentContext and returns a typed AgentOutput.
import { Agent, AgentContext, AgentOutput } from '@cendriix/sdk';
export const myAgent: Agent = {
id: 'my-custom-agent',
description: 'Analyses a diff against internal coding standards.',
async execute(ctx: AgentContext): Promise<AgentOutput> {
const diff = ctx.get('pr_diff');
const standards = ctx.cortex.query({
entity: 'coding_standard',
team: ctx.workspace.teamId,
});
// Your logic here
const violations = await analyseAgainstStandards(diff, standards);
return ctx.output({
violations,
passed: violations.length === 0,
});
},
};Agent context & Cortex
The AgentContext object provides access to:
ctx.get(key)— read a named input bound in the workflow stepctx.cortex.query(selector)— query the Cortex knowledge graphctx.cortex.write(entity, data)— write an entity back to the graphctx.workspace— workspace metadata (team ID, cost cap remaining, etc.)ctx.model— the model selected by the Model Router for this step
A2A handoffs
Agents can hand off to other agents using ctx.handoff(agentId, context). Handoffs are recorded as A2A events in the audit trail. The receiving agent inherits the caller's Cortex context plus any additional bindings passed in the handoff call.
// In a custom agent
const planResult = await ctx.handoff('code-writer', {
implementation_plan: myPlan,
repo: ctx.get('repo'),
});Registering an agent
Agents are registered in the Cendriix agent catalog using the CLI or API. Once registered, your agent is available as a step type in any workflow.
# Register via CLI (when available)
cendriix agent register ./my-agent.ts
# Or via API
curl -X POST https://api.cendriix.ai/v1/agents \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"id": "my-custom-agent",
"description": "Analyses a diff against internal coding standards.",
"runtime": "typescript",
"entry": "dist/my-agent.js"
}'