Agents

Patterns for composing production agents from Rightbrain's primitives.

An agent is Rightbrain’s top-level unit: a goal-directed reasoner you point at a job. You make the four primitives available to it, then run it against your triggers. The agent reasons over the request, decides which of the tools available to it to call and in what order, and returns a structured result.

  • Tasks — structured AI functions the agent calls as tools.
  • Skills — reusable abilities that carry their own instructions and auto-provision the connections they need.
  • Collections — document knowledge bases, reached through a task’s retrieval (RAG) configuration.
  • Connections — integrations (HubSpot, Slack, Gmail, Google Sheets…) and MCP servers that give the agent external reach.

This page shows common ways to combine those primitives. Each pattern is a starting point, not a fixed recipe.

Specialist agent

Give one agent a small, focused toolkit and a clear job. A specialist agent composes three to five tasks and any skills that match its domain. Because tasks return schema-validated output, the agent reasons over reliable data rather than parsing free text.

A code-aware agent that answers “why is payment processing slow?”

1

Locate the code

The agent calls a codebase search task for “payment processing” and identifies the payment service and its queries.

2

Pull performance data

It calls a metrics task and sees P95 latency jumped from 200ms to 2000ms three days ago.

3

Check recent changes

A git history task surfaces a query change from three days ago.

4

Diagnose

A query analyser task finds a missing index causing a full table scan. The agent recommends the index and estimates the improvement.

Each task is a reliable specialist. The agent connects the dots across code, metrics, and history.

Knowledge agent

When an agent needs to answer from your documents, back one of its tasks with a collection. Collections attach through a task’s RAG configuration, not directly onto the agent: the task retrieves the relevant passages from the collection and the agent reasons over the grounded result.

1

Build the collection

Ingest your knowledge base into a collection — upload files or connect a datasource.

2

Wire it into a task

Configure a task’s RAG to query that collection, so every call retrieves supporting passages before the model answers.

3

Attach the task to the agent

The agent now has a grounded lookup tool. It calls the task when a question needs your documents and cites the retrieved context in its answer.

Use this for support agents that answer from product docs, internal assistants that draw on policy manuals, or research agents that reason over a corpus you control.

The knowledge does not have to be a static collection. When the source is a live workspace, connect it over MCP instead: one briefing agent searched a Notion workspace, fetched 24,200 characters across the matching pages, and synthesized a 5,200-character weekly briefing in 107.8 seconds from a single call, a 4.7x compression, with Rightbrain handling the OAuth token throughout.

Approval-gated ops agent

When an agent can take real actions — issue a refund, send an email, update a record — gate the risky tools behind human approval. Set a tool’s action mode to require approval: when the agent calls it, the run pauses with status waiting_for_human and raises an approval request. A person approves or rejects, and the run resumes. See Approvals.

1

Investigate

A customer says an order never arrived. The agent calls a customer lookup task and an order tracking task, and finds the package was marked delivered.

2

Check policy

A refund policy task confirms the order is eligible for a refund.

3

Pause for approval

The agent calls the refund processing task, which is gated. The run pauses; an agent on the support team reviews the request and approves it.

4

Resolve and log

The refund runs, and a ticket task records the full history for audit.

Auto-run the safe, read-only tools; gate only the ones that change state. That keeps the agent fast where it is safe and supervised where it matters.

Scheduled reporting agent

Not every agent waits for a person. Point a schedule trigger at an agent to run it on a cron cadence — a Monday-morning account review, a nightly anomaly sweep, an end-of-quarter summary.

1

Gather

On schedule, the agent calls a customer data task, a revenue trend task, and a support ticket task for the reporting window.

2

Synthesise

It correlates the results — flagging accounts where declining usage meets negative support sentiment as churn risks, and expanding accounts as upsell candidates.

3

Deliver

A connection posts the summary to Slack or writes it to a Google Sheet, with no one in the loop.

The agent produces the same structured, auditable output every run, so downstream systems and dashboards can depend on it. Because the gather step runs its tasks in parallel rather than one after another, a report that touches several data sources finishes markedly faster; on one reporting agent, parallel dispatch cut total run time by about 48% versus running the same steps sequentially.

Next steps