Overview
Agents are autonomous analysers that produce insights from document feeds. Each agent is assigned to one or more feeds and, when triggered, processes the documents within those feeds to generate inferences and signals. Agents can be triggered manually, on document upload, or on a cron schedule.
The platform supports multiple agent types — from single-feed analysts to cross-feed synthesisers and compliance checkers. Agents are defined declaratively (type, focus, sensitivity, schedule) and executed by the data plane's research agent service, producing a traceable history of runs.
Key Concepts
- Agent types —
feed_analyst(analyses a single feed in depth),cross_feed(synthesises across multiple feeds),compliance(checks documents against rules),anomaly(detects outliers and changes). - Feed assignments — Agents are assigned to feeds with a role:
primary(drives analysis) ormonitor(provides background context). - Sensitivity — Controls LLM temperature and threshold decisions.
lowproduces fewer, higher-confidence findings;highcasts a wider net. - Schedule types —
manual(user-triggered),on_document(fires when new documents arrive in assigned feeds),cron(runs on a schedule viacronExpression). - Runs — Each execution is a separate
agent_runrecord with status tracking, timing, and output metrics.
Data Model
agents
| Column | Type | Notes |
|---|---|---|
id | uuid (PK) | |
spaceId | uuid (FK → spaces) | Owning space |
userId | uuid | Creator |
name | text | Display name |
description | text | What this agent does |
agentType | text | One of: feed_analyst, cross_feed, compliance, anomaly |
focus | text | Specific analytical focus or question |
sensitivity | text | Default "medium". One of: low, medium, high |
scheduleType | text | Default "manual". One of: manual, on_document, cron |
cronExpression | text | Cron schedule (when scheduleType = "cron") |
enabled | boolean | Whether the agent is active |
status | text | Default "idle". Current operational status |
lastRunAt | timestamp | Last execution time |
config | jsonb | Additional agent-specific configuration |
createdAt | timestamp | |
updatedAt | timestamp |
agent_feed_assignments
| Column | Type | Notes |
|---|---|---|
agentId | uuid (FK → agents) | |
feedId | uuid (FK → feeds) | |
role | text | Default "primary". One of: primary, monitor |
Primary key: (agentId, feedId)
agent_runs
| Column | Type | Notes |
|---|---|---|
id | uuid (PK) | |
agentId | uuid (FK → agents) | |
triggerType | text | What initiated the run (manual, on_document, cron) |
triggerSource | text | Additional context about the trigger |
startedAt | timestamp | |
completedAt | timestamp | |
status | text | Default "queued". One of: queued, running, completed, failed |
summary | jsonb | Agent-generated summary of findings |
errorMessage | text | Error details (when status = "failed") |
inferencesCreated | integer | Count of inferences produced |
signalsRaised | integer | Count of signals raised |
createdAt | timestamp |
How It Works
- Agent created — A user (or the agent suggestion system) defines an agent with a type, focus, and sensitivity.
- Feeds assigned — The agent is linked to one or more feeds via
agent_feed_assignments, each with a role ofprimaryormonitor. - Trigger fires — The agent is triggered by its schedule type: the user clicks "Run", a new document arrives in an assigned feed, or the cron expression matches.
- Run created — An
agent_runrecord is created with statusqueued. The run transitions torunningwhen the worker picks it up. - Documents analysed — The research agent service loads documents from assigned feeds, prioritising primary feeds over monitor feeds.
- Inferences produced — The agent generates inferences — analytical findings with evidence, confidence scores, and significance levels.
- Signals evaluated — The signal worker checks whether any inferences trigger signal rules, producing signals if conditions are met.
- Run completed — The run record is updated with
completedAt,inferencesCreated,signalsRaised, and a summary.
Why It Works This Way
Feed Assignment Roles
The primary/monitor distinction lets an agent weight its data sources. A "Market Analysis" agent might have a "Competitor Reports" feed as primary and a "News" feed as monitor. The primary feed drives the analysis agenda; the monitor feed provides supplementary context. This avoids the noise problem where too many equally-weighted sources dilute analytical focus.
Sensitivity as a Dial, Not a Prompt
The sensitivity field adjusts LLM temperature and confidence thresholds without changing the agent's prompt text. This means the same agent definition can be tuned to produce fewer high-confidence findings (low) or more exploratory findings (high) without rewriting instructions. It keeps the configuration surface small for users who are not prompt engineers.
Runs as a Separate Entity
Separating agent definitions from run records gives you a traceable history. You can see how the same agent's findings have changed over time, compare runs triggered by different events, and debug failures without losing the agent's configuration. It also enables retry semantics — a failed run can be re-queued without modifying the agent.
Agent Suggestion System
The platform can suggest agents based on the feeds and documents in a space. This uses the same pattern as feed suggestion — the AI analyses the content landscape and proposes agents with appropriate types, focus areas, and feed assignments. The agentsGeneratedAt field on spaces tracks when this last ran.
Code Reference
| File | Description |
|---|---|
packages/db/src/schema/agents.ts | agents, agent_feed_assignments, agent_runs tables |
apps/data-plane/src/services/research-agent.ts | Agent execution logic |
apps/data-plane/src/services/agent-suggestion.ts | AI agent suggestion service |
apps/data-plane/src/workers/agent-signal.ts | Agent signal worker |
apps/data-plane/src/lib/scheduler.ts | Cron scheduling for agents |
Relationships
- Spaces — Every agent belongs to a space;
agentsEnabledmust be true - Feeds — Agents are assigned to feeds via
agent_feed_assignments - Inferences & Signals — Agent runs produce inferences, which may trigger signals
- Surfaces & Experiences — Agent run outputs can be rendered as surfaces