Sourcebot is an open-source (GitHub), self-hosted code search tool that is purpose built to help teams find and navigate code quickly, at scale.

Features


Find an overview of all Sourcebot features below. For details, see the individual documentation pages.

Search across millions of lines of code in seconds using Sourcebot’s blazingly fast indexed search. Find exactly what you are looking for with regular expressions, search filters, boolean logic, and more.

Code Navigation

Code navigation helps you jump between symbol definitions and references quickly when browsing source code in Sourcebot.

Cross code-host support

Connect your code from multiple code-host platforms and search across all of them from a single interface.

Authentication

Sourcebot comes with built-in support for authentication via email/password, email codes, and various SSO providers.

Self-hosted

Sourcebot is designed to be easily self-hosted, allowing you to deploy it onto your own infrastructure, keeping your code private and secure.

Get started


Architecture


Sourcebot is shipped as a single docker container that runs a collection of services using supervisord:

architecture diagram

Sourcebot consists of the following components:

  • Web Server : main Next.js web application serving the Sourcebot UI.
  • Backend Worker : Node.js process that incrementally syncs with code hosts (e.g., GitHub, GitLab etc.) and asynchronously indexes configured repositories.
  • Zoekt : the open-source, trigram indexing code search engine that powers Sourcebot under the hood.
  • Postgres : transactional database for storing business-logic data.
  • Redis Job Queue : fast in-memory store. Used with BullMQ for queuing asynchronous work.
  • .sourcebot/ cache : file-system cache where persistent data is written.

You can use managed Redis / Postgres services that run outside of the Sourcebot container by providing the REDIS_URL and DATABASE_URL environment variables, respectively. See the environment variables doc for more configuration options.

Scalability


One of our design philosophies for Sourcebot is to keep our infrastructure radically simple while balancing scalability concerns. Depending on the number of repositories you have indexed and the instance you are running Sourcebot on, you may experience slow search times or other performance degradations. Our recommendation is to vertically scale your instance by increasing the number of CPU cores and memory.

Sourcebot does not support horizontal scaling at this time, but it is on our roadmap. If this is something your team would be interested in, please contact us at team@sourcebot.dev.

License key


Sourcebot’s core features are available under an MIT license without any limits. Some additional features such as SSO and code navigation require a license key.

Telemetry


By default, Sourcebot collects anonymized usage data through PostHog to help us improve the performance and reliability of our tool. We don’t collect or transmit any information related to your codebase. In addition, all events are sanitized to ensure that no sensitive details (ex. ip address, query info) leave your machine.

The data we collect includes general usage statistics and metadata such as query performance (e.g., search duration, error rates) to monitor the application’s health and functionality. This information helps us better understand how Sourcebot is used and where improvements can be made.

If you’d like to disable all telemetry, you can do so by setting the environment variable SOURCEBOT_TELEMETRY_DISABLED to true:

docker run \
  -e SOURCEBOT_TELEMETRY_DISABLED=true \
  /* additional args */ \
  ghcr.io/sourcebot-dev/sourcebot:latest

If you disabled telemetry correctly, you’ll see the following log when starting Sourcebot:

Disabling telemetry since SOURCEBOT_TELEMETRY_DISABLED was set.