Skip to main content

agentgraph-connector-twg

An AgentGraph connector for the Atlassian Teamwork Graph, built on the twg CLI.

Resource Entity Content indexed
Jira work item Task Summary, description, comments, status, assignee, labels
JPD idea Task As a Jira work item, plus its delivery-ticket links
Jira project Folder Container for its work items
Confluence page Document Heading outline plus the page body as markdown
Confluence space Folder Container for its pages
Atlas goal Task Name, description, status, owner, target date, latest update
Atlas project Task The same, plus its linked goals
Loom video Video Title, description, and the transcript; metadata.web_url is the watch link

People become Person entities from reporters, assignees, commenters, authors, editors, video owners, Atlas owners and update authors, and @ mentions. Relationships from twg context jira workitem, Jira issue links, and Atlas goal/project links become references edges, with stub entities for linked resources that have not been fetched yet.

This package is kept outside the AgentGraph repository because twg is internal Atlassian tooling.

Requirements

  • AgentGraph 0.7.0 through 0.7.x (it provides the Task and Video entity types this connector emits).
  • The twg CLI, authenticated. The connector never authenticates on your behalf. It reads through twg jira, twg confluence, twg loom, twg context, and — for Atlas — twg goals get and twg projects get.

Install

uv pip install agentgraph-connector-twg

Releases through 0.2.0 were published privately as atlassian-agentgraph-connector-twg; the Python import package is unchanged.

Confirm registration and configure your site:

agentgraph list-connectors
agentgraph connector twg add-site <site>
agentgraph connector twg status

Authentication

twg owns the Atlassian OAuth session. When it expires, the connector reports it and every fetch returns the same remediation:

twg auth refresh

Run that in a real terminal. twg needs write access to ~/.config/twg, which a sandboxed agent cannot grant. Under the com.agentgraph.server LaunchAgent the server can refresh the session itself.

If twg is not on PATH — likely under launchd — the connector probes ~/.local/bin/twg, /opt/homebrew/bin/twg and /usr/local/bin/twg. Set AGENTGRAPH_TWG_BIN to override.

Configuration

Settings live in <agentgraph-config-dir>/twg.json (usually ~/.agentgraph/twg.json) and are managed through the CLI:

Command Effect
agentgraph connector twg add-site <site> / remove-site Atlassian sites; the first is the default --site
agentgraph connector twg add-jql "<jql>" / remove-jql JQL swept by ingest, then queues an ingest
agentgraph connector twg add-space <KEY> / remove-space Confluence spaces swept by ingest, then queues an ingest
agentgraph connector twg status Binary, version, session, and configured scopes

<site> is the tenant name, and a site URL is accepted in its place. Both host spellings are understood, so hello, hello.atlassian.net and the per-product domain a migrated tenant is served from (hello.jira.atlassian.cloud, hello.confluence.atlassian.cloud) all configure the site hello, and browsing either host is observed. Anything else is rejected rather than stored.

Refresh behaviour

  • Observe / fetch: browsing or fetching a supported URL fetches that resource. Confluence short links (/wiki/x/<tiny>) are resolved through twg resolve.
  • Poll (every 30 minutes): twg work query --scope me covers your own recently touched work items, pages, and videos, hydrating at most poll_item_limit (default 50) resources per run and skipping anything fetched within the last 15 minutes.
  • Ingest: the same sweep over ingest_since (default 90 days), plus every configured JQL query and Confluence space.
  • Atlas goals and projects are indexed on observation or an explicit agentgraph fetch only. They are not part of the poll or the ingest sweep, and there is nothing to configure for them: home.atlassian.com/o/<orgId>/s/<cloudId>/(goal|project)/<KEY> carries everything a fetch needs. Because that host is not site-scoped, Atlas observation is not narrowed to the configured sites.
  • JPD ideas are Jira work items, so they ride the Jira paths above with no extra configuration.

Only your own activity and explicitly configured scopes are indexed.

Data locality

Indexed Jira, Confluence, and Loom content — including transcripts — is stored in the local AgentGraph SQLite database and becomes readable by any MCP client you connect. This is internal work data; choose your polled scopes deliberately.

Development

uv sync

That installs the dev dependency group and resolves AgentGraph from PyPI per uv.lock. Run the same gates CI does (.github/workflows/ci.yml):

.venv/bin/python -m pytest -q
.venv/bin/python -m ruff check .
.venv/bin/python -m pyright

Tests never invoke the real twg: the subprocess layer is patched and payload fixtures live in tests/conftest.py. Those fixtures follow the field paths reported by twg help describe "<command>". Re-record them from live output when a twg upgrade changes a payload, and keep parsing tolerant — payloads.py reads the documented field first and falls back to known aliases.

Against a local AgentGraph checkout

To develop this connector against an unreleased AgentGraph — a new entity type or a change to BaseConnector — install that checkout editable over the resolved one:

uv pip install -e ../agentgraph --config-setting editable_mode=compat

editable_mode=compat is what keeps pyright working. A default editable install writes a runtime import hook that pyright cannot follow statically, so every agentgraph import resolves to nothing and cascades into roughly a thousand unknown-type errors. compat writes a plain path entry instead, and the committed [tool.pyright] config then resolves the checkout unchanged.

uv.lock still pins agentgraph-server to a published release, and uv run/uv sync sync exactly against it — either will silently revert this install. Run the gates through .venv/bin/python as above, not uv run. If ModuleNotFoundError: No module named 'agentgraph' appears, or pyright suddenly reports hundreds of unknown types, the install was reverted: run the command again. To go back to the released AgentGraph deliberately, uv sync.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

agentgraph_connector_twg-0.2.0.tar.gz (57.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

agentgraph_connector_twg-0.2.0-py3-none-any.whl (44.3 kB view details)

Uploaded Python 3

File details

Details for the file agentgraph_connector_twg-0.2.0.tar.gz.

File metadata

  • Download URL: agentgraph_connector_twg-0.2.0.tar.gz
  • Upload date:
  • Size: 57.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for agentgraph_connector_twg-0.2.0.tar.gz
Algorithm Hash digest
SHA256 9daf800d3a77b36bbec1d36282b25f101a2da2f6a99f659d3a6d8c8492456c4c
MD5 f123cca9344ffb563c3f0f91b50df2c0
BLAKE2b-256 bf147c72fada33f04a7e63a2e23fb5dae4ed6c2acae38821b7f806a361f2749d

See more details on using hashes here.

Provenance

The following attestation bundles were made for agentgraph_connector_twg-0.2.0.tar.gz:

Publisher: pypi-release.yml on simonexmachina/agentgraph-connector-twg

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file agentgraph_connector_twg-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for agentgraph_connector_twg-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 84b1a077a0fb813f9ae8c515f96b79bd29f1841b3321a17ae51ca0d13cd6f9a1
MD5 f512f047f0caec126811d90e8a46dd1f
BLAKE2b-256 f1d33e53f9917dad9bffe09596695cf96e586aec82c170dc246aadd86e5aac76

See more details on using hashes here.

Provenance

The following attestation bundles were made for agentgraph_connector_twg-0.2.0-py3-none-any.whl:

Publisher: pypi-release.yml on simonexmachina/agentgraph-connector-twg

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

0.2.2

2 files

0.2.1

2 files

This release

0.2.0 This release

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page