# sourcegraph/artifacts architecture

> Architecture diagram of the GitHub repository sourcegraph/artifacts, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-05). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/sourcegraph/artifacts
- Repository: https://github.com/sourcegraph/artifacts

## Overview

This repository is a collection of public Sourcegraph artifacts, not the exporter implementation. Its visible product is GraphQL schema artifacts; the README says schemas are published to a public GCS bucket on every release and database migrations on major and minor releases. The tree contains no migration files, so migrations are documented as an artifact capability but have no repository source node. Schema files define independent API domains; no runtime calls between them are evidenced.

Main entry points: [`gql/schema.graphql`](https://github.com/sourcegraph/artifacts/blob/main/gql/schema.graphql) (Base schema)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_core["Core API"]
  node_schema_base["Base schema<br/>[schema.graphql]"]
  node_prompts["Prompts<br/>[prompts.graphql]"]
end

subgraph group_search["Search and insights"]
  node_search_contexts["Search contexts"]
  node_search_jobs["Search jobs"]
  node_saved_searches["Saved searches"]
  node_insights["Code insights<br/>[insights.graphql]"]
  node_insight_aggregations["Insight aggregations"]
  node_notebooks["Notebooks<br/>[notebooks.graphql]"]
  node_cody_context["Cody context"]
end

subgraph group_code["Code workflows"]
  node_batch_changes["Batch changes<br/>[batches.graphql]"]
  node_batch_agents["Batch agents"]
  node_agentic_batches["Agentic batch changes"]
  node_code_monitors["Code monitors"]
  node_codeintel_auto["Auto indexing"]
  node_codeintel_nav["Code navigation"]
  node_codeintel_policy["Code intelligence policies"]
  node_diff_review["Diff review"]
end

subgraph group_platform["Platform and identity"]
  node_authz["Authorization<br/>[authz.graphql]"]
  node_entitlements["Entitlements"]
  node_idp["Identity providers<br/>[idp.graphql]"]
  node_multitenant["Multitenancy"]
  node_outbound_webhooks["Outbound webhooks"]
end

node_release(("Release finalization"))
node_bucket[("Public GCS bucket")]
node_migration_artifacts["Database migrations"]

node_release -->|"publishes artifacts"| node_bucket
node_release -->|"exports migrations"| node_migration_artifacts
node_release -->|"exports schemas"| node_schema_base

click node_schema_base "https://github.com/sourcegraph/artifacts/blob/main/gql/schema.graphql"
click node_authz "https://github.com/sourcegraph/artifacts/blob/main/gql/authz.graphql"
click node_entitlements "https://github.com/sourcegraph/artifacts/blob/main/gql/entitlements.graphql"
click node_idp "https://github.com/sourcegraph/artifacts/blob/main/gql/idp.graphql"
click node_multitenant "https://github.com/sourcegraph/artifacts/blob/main/gql/multitenant.graphql"
click node_batch_changes "https://github.com/sourcegraph/artifacts/blob/main/gql/batches.graphql"
click node_batch_agents "https://github.com/sourcegraph/artifacts/blob/main/gql/batch_change_agents.graphql"
click node_agentic_batches "https://github.com/sourcegraph/artifacts/blob/main/gql/agentic_batch_changes.graphql"
click node_code_monitors "https://github.com/sourcegraph/artifacts/blob/main/gql/code_monitors.graphql"
click node_codeintel_auto "https://github.com/sourcegraph/artifacts/blob/main/gql/codeintel.autoindexing.graphql"
click node_codeintel_nav "https://github.com/sourcegraph/artifacts/blob/main/gql/codeintel.codenav.graphql"
click node_codeintel_policy "https://github.com/sourcegraph/artifacts/blob/main/gql/codeintel.policies.graphql"
click node_search_contexts "https://github.com/sourcegraph/artifacts/blob/main/gql/search_contexts.graphql"
click node_search_jobs "https://github.com/sourcegraph/artifacts/blob/main/gql/search_jobs.graphql"
click node_saved_searches "https://github.com/sourcegraph/artifacts/blob/main/gql/saved_searches.graphql"
click node_insights "https://github.com/sourcegraph/artifacts/blob/main/gql/insights.graphql"
click node_insight_aggregations "https://github.com/sourcegraph/artifacts/blob/main/gql/insights_aggregations.graphql"
click node_notebooks "https://github.com/sourcegraph/artifacts/blob/main/gql/notebooks.graphql"
click node_prompts "https://github.com/sourcegraph/artifacts/blob/main/gql/prompts.graphql"
click node_outbound_webhooks "https://github.com/sourcegraph/artifacts/blob/main/gql/outbound_webhooks.graphql"
click node_cody_context "https://github.com/sourcegraph/artifacts/blob/main/gql/cody_context.graphql"
click node_diff_review "https://github.com/sourcegraph/artifacts/blob/main/gql/diff_review.graphql"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_schema_base,node_prompts toneBlue
class node_search_contexts,node_search_jobs,node_saved_searches,node_insights,node_insight_aggregations,node_notebooks,node_cody_context,node_bucket,node_migration_artifacts toneAmber
class node_batch_changes,node_batch_agents,node_agentic_batches,node_code_monitors,node_codeintel_auto,node_codeintel_nav,node_codeintel_policy,node_diff_review toneMint
class node_authz,node_entitlements,node_idp,node_multitenant,node_outbound_webhooks toneRose
class node_release toneIndigo
```

## Components

### Core API

- [Base schema](https://github.com/sourcegraph/artifacts/blob/main/gql/schema.graphql): `gql/schema.graphql`
- [Prompts](https://github.com/sourcegraph/artifacts/blob/main/gql/prompts.graphql): `gql/prompts.graphql`

### Search and insights

- [Search contexts](https://github.com/sourcegraph/artifacts/blob/main/gql/search_contexts.graphql): `gql/search_contexts.graphql`
- [Search jobs](https://github.com/sourcegraph/artifacts/blob/main/gql/search_jobs.graphql): `gql/search_jobs.graphql`
- [Saved searches](https://github.com/sourcegraph/artifacts/blob/main/gql/saved_searches.graphql): `gql/saved_searches.graphql`
- [Code insights](https://github.com/sourcegraph/artifacts/blob/main/gql/insights.graphql): `gql/insights.graphql`
- [Insight aggregations](https://github.com/sourcegraph/artifacts/blob/main/gql/insights_aggregations.graphql): `gql/insights_aggregations.graphql`
- [Notebooks](https://github.com/sourcegraph/artifacts/blob/main/gql/notebooks.graphql): `gql/notebooks.graphql`
- [Cody context](https://github.com/sourcegraph/artifacts/blob/main/gql/cody_context.graphql): `gql/cody_context.graphql`

### Code workflows

- [Batch changes](https://github.com/sourcegraph/artifacts/blob/main/gql/batches.graphql): `gql/batches.graphql`
- [Batch agents](https://github.com/sourcegraph/artifacts/blob/main/gql/batch_change_agents.graphql): `gql/batch_change_agents.graphql`
- [Agentic batch changes](https://github.com/sourcegraph/artifacts/blob/main/gql/agentic_batch_changes.graphql): `gql/agentic_batch_changes.graphql`
- [Code monitors](https://github.com/sourcegraph/artifacts/blob/main/gql/code_monitors.graphql): `gql/code_monitors.graphql`
- [Auto indexing](https://github.com/sourcegraph/artifacts/blob/main/gql/codeintel.autoindexing.graphql): `gql/codeintel.autoindexing.graphql`
- [Code navigation](https://github.com/sourcegraph/artifacts/blob/main/gql/codeintel.codenav.graphql): `gql/codeintel.codenav.graphql`
- [Code intelligence policies](https://github.com/sourcegraph/artifacts/blob/main/gql/codeintel.policies.graphql): `gql/codeintel.policies.graphql`
- [Diff review](https://github.com/sourcegraph/artifacts/blob/main/gql/diff_review.graphql): `gql/diff_review.graphql`

### Platform and identity

- [Authorization](https://github.com/sourcegraph/artifacts/blob/main/gql/authz.graphql): `gql/authz.graphql`
- [Entitlements](https://github.com/sourcegraph/artifacts/blob/main/gql/entitlements.graphql): `gql/entitlements.graphql`
- [Identity providers](https://github.com/sourcegraph/artifacts/blob/main/gql/idp.graphql): `gql/idp.graphql`
- [Multitenancy](https://github.com/sourcegraph/artifacts/blob/main/gql/multitenant.graphql): `gql/multitenant.graphql`
- [Outbound webhooks](https://github.com/sourcegraph/artifacts/blob/main/gql/outbound_webhooks.graphql): `gql/outbound_webhooks.graphql`

### Other components

- **Release finalization**
- **Public GCS bucket**
- **Database migrations**

## Connections

- Release finalization → Public GCS bucket: publishes artifacts
- Release finalization → Database migrations: exports migrations
- Release finalization → Base schema: exports schemas
