Fast search, fewer tokens
Agents connected over MCP read only the lines that answer their question, with up
to 50× fewer tokens than cloning and grepping (token usage).
Sourcegull uses a trigram index of its own. After a push, only the changed paths are written to a
delta shard, so new commits are searchable within seconds without rebuilding the repository's
index. Small repositories are packed together into compound shards, which keeps instances with
thousands of repositories fast. Revisions that are not indexed (any branch, tag or commit) are
searched straight from git. Results stream as they are found.
How it compares with the alternatives on the same GitLab:
Benchmark.
Everything is free
Every feature is in this repository under Apache-2.0. There is no enterprise edition, no licence
key and no paid tier, and the project will not add one. That includes the features that other
code search products usually sell separately:
- Single sign-on with GitLab, GitHub or Gitea OAuth, OpenID Connect or an authenticating proxy
(HTTP header), and
SCIM provisioning.
- Roles (RBAC),
repository permissions synced from GitLab and
enforced on every read, and an audit log.
- Precise code navigation from SCIP indexes, across repositories and
package versions, uploaded from GitLab CI or built by auto-indexing, with search-based results
filling in for repositories that are not indexed.
- Bulk changes: one YAML spec changes many repositories, then opens
and tracks the GitLab merge requests.
- Trends, watches
and exhaustive search jobs with CSV/JSONL export.
- Repository storage across several repo nodes,
added or removed without downtime.
- Usage analytics that stay on the instance.
- An MCP server for AI coding agents.
Also included: literal, regexp, keyword (BM25) and structural search; notebooks; code ownership;
saved searches and search contexts; a GraphQL API, the gull CLI and outbound webhooks; Grafana
dashboards and documented alerts. See the documentation.
Ready for production
- One Rust binary, and PostgreSQL (16 or newer) is its only stateful dependency. Nothing is sent to a
vendor cloud.
- No telemetry. Usage analytics stay on the instance.
- Docker Compose for one host, a Helm chart for Kubernetes. Every release is tested by
upgrading from the previous one.
- Repository storage spreads across several repo nodes, which you can add or remove without
downtime.
- Stored secrets are encrypted, and the keys rotate without a restart.
- Grafana dashboards and Prometheus alerts are included.
- Configuration as code: sign-in, code host connections and site admins come from files in git,
and secrets come from the environment.
- GitLab (gitlab.com and self-managed) has every feature. GitHub (github.com and Enterprise
Server) and Gitea support repository sync, permission sync, webhooks and sign-in.
- Several code hosts at once: connect gitlab.com, a self-managed GitLab, GitHub and Gitea side by
side, and one search covers all of them, each with its own permissions.
Quick install
To try Sourcegull or run it for a small team on one host, download the Compose bundle of the
latest release and start PostgreSQL
and Sourcegull with the published image, ghcr.io/sourcegull/sourcegull (linux/amd64):
curl -fsSL https://github.com/sourcegull/sourcegull/releases/latest/download/sourcegull-compose.tar.gz | tar -xz
cd sourcegull-compose
echo "POSTGRES_PASSWORD=$(openssl rand -hex 24)" > .env
docker compose up -d
Open http://localhost:7080. The first user to sign up becomes the site admin. Add a GitLab,
GitHub or Gitea connection under Site admin → Code host connections, and repositories start
cloning and indexing.
Production deployments
docs/install.md is the install guide. For production, use one of these:
- Kubernetes (Helm), for larger installs and several repo nodes:
install.md → Kubernetes, with an external PostgreSQL and
your own secret, size presets and sizing. Every value is
in the chart README.
- Docker Compose, production layout (
compose.production.yaml, one container per role), for
one host: install.md → Production layout.
Running either one is covered by the docs on
upgrades (Compose, Helm),
backups, monitoring and
configuration as code.
AI agents (MCP)
/.api/mcp is a Model Context Protocol server. Coding agents
search code, read files, find symbols, definitions and references, and read history (log,
commits, compare, blame) with the caller's permissions, in output sized for a model's context.
Connect an agent in the sidebar gives copy-paste setup for Codex, Claude Code, Cursor,
VS Code, Gemini CLI, Zed, JetBrains and others. Follow Codex browser sign-in
or see the MCP setup guide for other clients and access-token setup.
For agents working on Sourcegull itself, AGENTS.md contains the repository's
development and testing instructions.
How it works
One binary, sourcegull, runs in roles: web (UI, APIs, search fan-out), repo (git storage,
index shards and search, partitioned across nodes), worker (background jobs) and blob (blob
store); sourcegull supervise runs them all in one process. sourcegull executor runs sandboxed jobs
in Docker or Kubernetes. PostgreSQL holds the data, job queues, leases and caches; there is no Redis.
Each repo node indexes and searches its own repositories; web parses the query, applies
permissions, fans it out to the nodes and merges the result streams. Details in
docs/architecture.md.
Build from source
Everything runs in Docker; nothing to install but Docker with Compose.
docker compose up -d # Postgres, Sourcegull built from this checkout, UI dev server
open http://localhost:5173 # UI with hot reload; API on :7080
scripts/dev test # the test suite against the dev Postgres
scripts/dev check # rustfmt, clippy -D warnings, UI type check and tests
scripts/dev help # e2e tests, benchmarks, a local GitLab with seed data, ...
More in docs/development.md.
Alternatives
|
Sourcegull |
Sourcegraph |
Sourcebot |
Zoekt |
OpenGrok |
Hound |
GitLab code search |
| Licence |
🟢 Apache-2.0 |
💰 proprietary |
💰 proprietary, free to 5 users |
🟢 Apache-2.0 |
🟢 CDDL-1.0 |
🟢 MIT |
💰 GitLab tiers |
| Every feature free |
🟢 |
🔴 |
🔴 |
🟢 |
🟢 |
🟢 |
🔴 |
| Written in |
Rust |
Go, TypeScript |
TypeScript (Zoekt inside) |
Go |
Java |
Go |
Ruby, Go |
| Indexed regex search |
🟢 |
💰 |
🟢 to 5 users |
🟢 |
🟢 |
🟢 |
💰 default branch only |
| Unindexed revisions (any branch, tag, commit) |
🟢 |
💰 |
🔴 |
🔴 |
🔴 |
🔴 |
🟡 any branch, one project at a time |
| Structural and BM25 keyword search |
🟢 |
💰 |
🔴 |
🔴 |
🔴 |
🔴 |
🔴 |
| Code hosts |
🟢 GitLab, GitHub, Gitea |
💰 many |
🟢 many, to 5 users |
🟡 mirror tools |
🟡 local checkouts (many VCS) |
🟢 git and others |
🟢 GitLab only |
| Precise code navigation (SCIP), cross-repository |
🟢 |
💰 |
🔴 |
🔴 |
🔴 |
🔴 |
🟡 within one project |
| Repository permissions synced from the code host |
🟢 |
💰 |
💰 |
🔴 |
🔴 |
🔴 |
🟢 built in |
| SSO, SCIM, RBAC, audit log |
🟢 |
💰 |
💰 SSO free to 5 users, rest paid |
🔴 |
🔴 |
🔴 |
💰 partly paid |
| Bulk changes across repositories |
🟢 |
💰 |
🔴 |
🔴 |
🔴 |
🔴 |
🔴 |
| Trends, watches, search jobs |
🟢 |
💰 |
🔴 |
🔴 |
🔴 |
🔴 |
🔴 |
| MCP server for AI agents |
🟢 |
💰 |
🟢 to 5 users |
🔴 |
🔴 |
🔴 |
🟡 free, cross-project code search paid |
| Hosted AI assistant |
🔴 |
💰 |
🟢 to 5 users |
🔴 |
🔴 |
🔴 |
💰 |
🟢 free · 💰 paid · 🟡 incomplete · 🔴 not available
- Sourcegraph is the most complete code intelligence platform, self-hosted under a commercial licence.
- Sourcebot builds a web UI, an MCP server and an AI assistant on Zoekt. It is closed source
since version 6. The free plan stops at 5 users, permission syncing and analytics are in paid
plans, and SCIM and audit logs are in the Enterprise plan.
- Zoekt is a fast trigram search engine and nothing else. It answers literal queries faster
than Sourcegull; Sourcegull indexes faster, needs less disk and answers regexps faster (below).
Benchmark: the same GitLab, one product at a time
Each product indexed the same 1,007 public projects from one GitLab CE 19.4 instance: 7 large
repositories at pinned releases (Linux, LLVM, Go, Rust, Kubernetes, GitLab, TensorFlow; 4.4 GB of
source) and 1,000 generated repositories with history (0.84 GB). Every product ran alone, from a
fresh install, next to GitLab on one host with 6 CPUs and 24 GB of memory.
|
All repositories searchable |
Peak memory (indexing) |
Memory (idle) |
Disk |
Selective literal |
Common literal |
Regex |
No match |
| Sourcegull |
3 min 21 s |
3.7 GB |
2.2 GB |
3.7 GB |
54 / 69 ms (724) |
48 / 54 ms (1000) |
84 / 88 ms (1000) |
29 / 35 ms (0) |
| Sourcegraph 5.0.6 |
10 min 08 s |
5.2 GB |
3.2 GB |
13.4 GB |
22 / 33 ms (640) |
24 / 30 ms (902) |
121 / 242 ms (883) |
12 / 20 ms (0) |
| Sourcebot 5.1.16 |
5 min 31 s |
8.5 GB |
1.9 GB |
13.9 GB |
77 / 90 ms (660) |
101 / 113 ms (971) |
309 / 332 ms (978) |
18 / 21 ms (0) |
| Zoekt |
9 min 05 s |
3.9 GB |
1.7 GB |
13.9 GB |
16 / 23 ms (724) |
29 / 34 ms (1000) |
361 / 390 ms (1000) |
8 / 10 ms (0) |
| Hound |
3 min 02 s |
6.2 GB |
5.9 GB |
9.4 GB |
336 / 351 ms (724) |
766 / 851 ms (2188) |
788 / 884 ms (2187) |
10 / 13 ms (0) |
| OpenGrok 1.14 |
36 min 38 s |
9.0 GB |
5.1 GB |
18.4 GB |
973 / 998 ms (653) |
84 / 107 ms (1000) |
not supported |
20 / 27 ms (0) |