Overview

An SRE agent is a strong cross-product scenario because incidents require live reasoning, operational guardrails, tool usage, and grounded answers from runbooks. The agent should not answer only from the model. It should read operational knowledge, search incident history, and update the ticketing system with structured findings.

This pattern combines Agent SDK for runtime control with Console for RAG, vector search, config, and tool connectivity.

When to reach for this recipe

If your team needs the capabilities described above and you'd rather build on proven primitives than wire one from scratch — this is the shape to start from.

Architecture

Console stores the Confluence-derived knowledge in RAG and vector indexes, hosts config and tools, and can expose Jira or internal APIs through OpenAPI and MCP. Agent SDK runs the SRE agent with handoff and guardrail support.

The result is an incident agent that can pull runbook context from Confluence, search vector knowledge during analysis, and post a summary back to Jira through a tool call.

1. Ingest Confluence Runbooks Into Console RAG

A sync job can pull pages from Confluence, normalize them, and write them into a Console RAG module so the agent does not rely on stale prompts alone.

1import { ConsoleClient } from '@cognipeer/console-sdk';
2 
3const client = new ConsoleClient({
4 apiKey: process.env.COGNIPEER_API_KEY!,
5 baseURL: 'https://console.example.com',
6});
7 
8const pages = await fetchConfluenceRunbooks();
9 
10for (const page of pages) {
11 await client.rag.ingest('sre-runbooks', {
12 documents: [
13 {
14 id: page.id,
15 content: page.markdown,
16 metadata: {
17 source: 'confluence',
18 title: page.title,
19 space: page.spaceKey,
20 },
21 },
22 ],
23 });
24}

2. Bind Jira And Confluence Access As Tools

The agent uses tools for live systems and Console RAG for grounded knowledge. Jira can come from Console tools or MCP-backed actions; Confluence can be a sync tool or refresh tool depending on your workflow.

1import { createTool, createSmartAgent } from '@cognipeer/agent-sdk';
2import { z } from 'zod';
3 
4const jiraCommentTool = createTool({
5 name: 'jira_comment',
6 description: 'Post an incident update comment to a Jira issue',
7 schema: z.object({
8 issueKey: z.string(),
9 comment: z.string(),
10 }),
11 func: async ({ issueKey, comment }) => {
12 return jiraApi.addComment(issueKey, comment);
13 },
14});
15 
16const searchRunbooks = createTool({
17 name: 'search_runbooks',
18 description: 'Search SRE runbooks through Console vector and RAG infrastructure',
19 schema: z.object({
20 query: z.string(),
21 }),
22 func: async ({ query }) => {
23 return client.rag.query('sre-runbooks', {
24 query,
25 topK: 5,
26 });
27 },
28});
29 
30const refreshConfluencePage = createTool({
31 name: 'refresh_confluence_page',
32 description: 'Pull the latest Confluence page content when the runbook may be outdated',
33 schema: z.object({
34 pageId: z.string(),
35 }),
36 func: async ({ pageId }) => fetchConfluencePage(pageId),
37});

3. Build The SRE Agent With Guardrails

The agent should be grounded, concise, and policy-aware. It should never recommend destructive actions without explicit approval or verified runbook support.

1const sreAgent = createSmartAgent({
2 name: 'SREAgent',
3 model,
4 tools: [searchRunbooks, refreshConfluencePage, jiraCommentTool],
5 systemPrompt: 'You are an SRE incident response agent. Use runbook evidence before making recommendations and produce clear incident updates.',
6 guardrails: [
7 createRegexGuardrail(/drop\s+database|delete\s+cluster/i, {
8 guardrailTitle: 'Destructive Action Guardrail',
9 }),
10 ],
11 useTodoList: true,
12 tracing: { enabled: true },
13});

4. Search Vector Knowledge And Update Jira

During the incident, the agent searches the runbook corpus, produces a grounded diagnosis, and posts a structured comment back to the Jira ticket.

1const result = await sreAgent.invoke({
2 messages: [
3 {
4 role: 'user',
5 content: 'Investigate elevated API latency for checkout-service, use the runbooks, and post an update to JIRA-1842.',
6 },
7 ],
8});
9 
10console.log(result.content);
11 
12// Typical flow:
13// 1. search_runbooks -> Console RAG / vector search
14// 2. refresh_confluence_page if the runbook seems stale
15// 3. jira_comment -> post a grounded incident update

Result

You get an SRE incident workflow that:

- Pulls operational knowledge from Confluence into Console RAG - Searches vector knowledge during live incident handling - Uses Agent SDK tools for Jira comments and refresh actions - Applies guardrails before dangerous or unsupported recommendations - Fits incident triage, runbook automation, and ops assistant scenarios

All recipesSuggest a change