Skip to content

Sources

Agents often need live data — the current Slack thread, an open Jira ticket, a webhook payload. Sources define where that data comes from and how to fetch it.

This is separate from context (which is compiled-in static docs) and tools (which the model calls during reasoning). Sources are fetched as their own workflow node, before the downstream agent that reads them runs.

Sources are workflow nodes

A source is fetched as a node in a workflow's edges:, wired directly ahead of the agent that needs its payload. A prompts/*.md node between the source and the agent reads it with {{ upstream('name') }} — upstream() is rejected at compile time inside an agent body, and agents have no sources: frontmatter field.

A workflow like this, where standup_notes is a source under sources/, digest_task a prompt under prompts/, and daily-digest an agent under agents/:

# workflows/daily_digest.yaml
edges:
  - [START, standup_notes]
  - [standup_notes, digest_task]
  - [digest_task, daily-digest]
  - [daily-digest, END]

Save this as prompts/digest_task.md:

Summarize yesterday's standup notes into a short, upbeat digest:

{{ upstream('standup_notes') }}

The source reads the last day of a Slack channel:

# sources/standup_notes.yaml
name: standup_notes
type: slack_channel_digest
credentials: slack
config:
  channel_id: C0EXAMPLE01
  lookback_hours: 24

Save this as agents/daily-digest.md:

---
description: Writes the daily standup digest
---
Write a short, upbeat digest of the notes you are given.

abt compile and abt graph daily_digest run without Slack credentials. abt dispatch -s daily_digest fetches the channel, so it needs a slack entry in profiles.yaml (see the Slack connection checklist).

Directory and schema

Default location: sources/*.yaml (recursive under paths.sources, default sources).

Quote Jinja in YAML

If you add Jinja in a YAML value (for example in config:), wrap the whole value in double quotes so { is not parsed as a YAML flow mapping. See Exposures — YAML quoting.

Example:

# sources/slack_thread.yaml
name: slack_thread
type: slack_thread
description: Fetch full Slack thread context
credentials: slack
tags: [slack, support]
config:
  channel_id: "{{ var('channel_id') }}"
  thread_ts: "{{ var('thread_ts') }}"
  max_messages: 50
freshness:
  on_missing_vars: error
  on_missing_credentials: error

Put runtime parameters in config: using {{ var('name') }} (required) or {{ var('name', default) }} (optional). Static values such as max_messages: 50 stay typed (int/bool) and are not stringified.

A var('name') with no default needs a value as soon as the project is compiled, not only at dispatch: abt compile, abt list, and abt run -s <agent> or abt dispatch -s <workflow> all fail until you define it in vars.yaml, under vars: in abt.yaml, or with --vars (this applies even when freshness.on_missing_vars is skip):

ERROR: Missing required template variable(s) 'channel_id', 'thread_ts' — define them in vars.yaml, under vars: in abt.yaml, or pass --vars (YAML/JSON dict).
# abt.yaml
vars:
  channel_id: C0123456789
  thread_ts: "1700000000.000100"

Give a variable a default ({{ var('thread_ts', '') }}) when the source should compile without it. The same rule applies to exposure config:.

Overrides in abt.yaml

You can deep-merge extra config: per source name under top-level sources: in abt.yaml (for example raise max_messages in staging without changing sources/*.yaml). See Configuration — Source overrides.

Fields

Field Required Meaning
name Yes Source id used as a workflow node name. A prompt node reads it with {{ upstream('name') }}.
type Yes Provider type to resolve. See Source types.
description No Human-readable description
credentials No Namespace in profiles.yaml (type by default)
requires_credentials No true (default); set false for a provider that needs no credentials (for example a custom provider that calls no API) to skip the credentials check
config No Provider-specific options; use {{ var('x') }} / {{ var('x', '') }} for runtime template vars
tags No Tags for docs/catalog filtering (not CLI -s selectors)
freshness.on_missing_vars No error (default), warn, skip
freshness.on_missing_credentials No error (default), warn, skip
thread_key_override No Template for the checkpoint thread key. Rendered at dispatch. See Source thread keys.

Source types

type Extra Usual credentials: What it fetches
slack_thread abt-core[slack] slack One Slack thread as Markdown. Needs channel_id and thread_ts.
slack_channel_digest abt-core[slack] slack Recent channel messages. Each item keeps the message (the problem) apart from its thread replies (the answers).
jira_issue abt-core[jira] atlassian One Jira issue as Markdown: summary, status, description, and optionally comments. Needs issue_key.
github_pr none github One GitHub pull request as Markdown: metadata and description, and optionally changed files and comments. Needs repo and pr_number.

Other types come from a provider you register with @source_provider("<type>") (see Provider implementation).

Freshness behavior

In abt, source freshness means: is this invocation complete enough to fetch the source?

  • required template vars inferred from config: (calls to var('name') without a default) missing -> handled by on_missing_vars
  • missing credentials namespace/value -> handled by on_missing_credentials

Defaults are strict (error) to fail fast on broken invocations.

A provider that needs no credentials at all should set requires_credentials: false — otherwise profiles.yaml will never have a matching namespace, and on_missing_credentials fires (as skip, silently) on every fetch.

For an optional enrichment, give the variable a default so the source compiles and dispatches without it:

config:
  thread_ts: "{{ var('thread_ts', '') }}"

on_missing_vars: skip is checked at dispatch, when a required variable is absent. Compile still fails for a variable without a default, so optional variables need one.

Using sources in prompts

A prompts/*.md node placed between the source and the agent reads the source with {{ upstream('name') }} (an agent body may not):

Save this as prompts/investigate.md:

User request:
{{ var('user_message', 'Please investigate this issue.') }}

Thread context:
{{ upstream('slack_thread') }}

Runtime flow:

  1. Compile validates the workflow's node names and edges (the source must be a real sources/*.yaml file and an upstream node of the prompt) and rejects any upstream() call found in an agent body. Inside a prompt node, an upstream('name') whose name is not a predecessor is left as literal text rather than raising.
  2. abt dispatch resolves required vars and credentials for the source node.
  3. The source node's provider fetches the payload.
  4. The prompt node renders with var(), context.*(), and upstream(), substituting each upstream('name') call with that node's output text; the rendered text becomes the downstream agent's turn.

Slack connection checklist

Slack source fetch requires the slack optional extra:

uv pip install 'abt-core[slack]'

Add credentials under the active profile output (default namespace slack):

# profiles.yaml
default:
  target: dev
  outputs:
    dev:
      credentials:
        slack:
          bot_token: xoxb-your-bot-token

Supply channel_id and thread_ts via --vars, vars.yaml, or abt.yaml vars: (compile needs them too — see Directory and schema).

The slack_thread provider flattens each message using top-level text, attachments, and Block Kit blocks, so bot posts that leave text empty (many alerting integrations) still appear in the thread payload.

slack_channel_digest scans a whole channel, instead of one known thread — each matched message is rendered with its problem (the message) separate from its thread replies (the answers). Every filter is optional and independent; omit all of them to digest the whole scanned window unfiltered. Example source YAML:

# sources/slack_channel_digest.yaml
name: slack_channel_digest
type: slack_channel_digest
credentials: slack
config:
  channel_id: "{{ var('channel_id') }}"
  reaction: "{{ var('reaction', '') }}"      # optional — omit/empty to include every message, not just reacted ones
  lookback_hours: 24   # optional — bounds the scan for repeated/cron runs
  max_messages: 20     # optional — caps the digest to the N most recent matches
  limit: 200            # optional, default 200 — conversations.history page size (max 200), not a result cap

Jira connection checklist

Jira source fetch requires the jira optional extra:

uv pip install 'abt-core[jira]'

Add credentials under the active profile output (namespace atlassian, shared with Confluence context and Jira/Confluence retrievers).

# profiles.yaml
default:
  target: dev
  outputs:
    dev:
      credentials:
        atlassian:
          url: https://mycompany.atlassian.net
          username: user@company.com
          api_token: your-api-token

You may use server / email instead of url / username if you prefer those key names in the same block.

Supply issue_key (for example MOCK-11771) at runtime via --vars or abt.yaml vars:.

Example source YAML:

# sources/jira_ticket.yaml
name: jira_ticket
type: jira_issue
credentials: atlassian
config:
  issue_key: "{{ var('issue_key') }}"
  include_comments: true   # optional, default false
  max_comments: 50          # optional, default 50

The provider returns a structured Markdown document with the issue summary, status, priority, assignee, description, and — when include_comments: true — up to the last max_comments issue comments (chronological order within the section; Jira's API typically lists oldest-first, so the slice is usually the newest comments).

GitHub PR connection checklist

The GitHub PR source uses stdlib urllib — no optional extra is needed.

Add credentials under the active profile output (namespace github):

# profiles.yaml
default:
  target: dev
  outputs:
    dev:
      credentials:
        github:
          token: ghp-your-personal-access-token

Alternatively, set the GITHUB_TOKEN environment variable.

Supply repo (as owner/name) and pr_number at runtime via --vars or abt.yaml vars:.

Example source YAML:

# sources/github_pr.yaml
name: github_pr
type: github_pr
credentials: github
config:
  repo: "{{ var('repo') }}"
  pr_number: "{{ var('pr_number') }}"
  include_files: false      # optional, default false — adds extra API call
  include_comments: false   # optional, default false
  max_comments: 30          # optional, default 30

The provider returns a structured Markdown document with the PR title, state, author, branch info, labels, reviewers, description, and — when enabled — changed files list and issue comments.

Provider implementation

There are two ways to provide source types:

  1. Built-in/installed extras (for example slack_thread from abt-core[slack], jira_issue from abt-core[jira])
  2. Project-level providers under paths.providers (default providers/)

Custom provider example (plain function):

from abt.sources.registry import source_provider

@source_provider("my_source")
def my_source_provider(*, credentials, config):
    return f"hello from {config.get('id', 'unknown')}"

A class with a fetch(*, credentials, config) method works too. Decorate an instance, as below:

class MySourceProvider:
    def fetch(self, *, credentials, config):
        return f"hello from {config.get('id', 'unknown')}"

my_source_provider = source_provider("my_source")(MySourceProvider())

CLI notes

abt dispatch supports:

  • --skip-sources to skip source fetching for this invocation (source nodes yield an empty payload).
  • --mock-sources '{name: text, …}' — YAML/JSON dict of per-source mock payloads (only named keys are stubbed).
  • --skip-transformers / --skip-retrievers — skip post-agent transformers or retriever enrichment for this invocation.

See CLI reference — abt dispatch for exact flags and examples.