Hash
🚀 The open-source, multi-tenant platform for self-building knowledge graphs and simulation
Install / Use
/learn @hashintel/HashREADME
HASH
This is HASH's public monorepo which contains our public code, docs, and other key resources.
What is HASH?
HASH is a self-building, open-source database which grows, structures and checks itself. HASH integrates data in (near-)realtime, and provides a powerful set of interfaces so that information can be understood and used in any context. Intelligent, autonomous agents can be deployed to grow, check, and maintain the database, integrating and structuring information from the public internet as well as your own connected private sources. And users, including those who are non-technical, are able to visually browse and manage both entities (data) and types (schemas). HASH acts as a source of truth for critical data, no matter its source, and provides a platform for high-trust, safety-assured decision-making. Read our blog post →
In the future... we plan on growing HASH into an all-in-one workspace, or complete operating system, with AI-generated interfaces known as "blocks" created at the point of need, on top of your strongly-typed data (addressing the data quality and integrity challenges inherent in today's current generation of generative AI interfaces).
Getting started
<details>
<summary> <strong>Option 1.</strong> Use <a href="https://app.hash.ai/?utm_medium=organic&utm_source=github_readme_hash-repo_root">hash.ai</a> — <em>recommended (quick-start: <5 mins)</em> 🚀</summary>
Create an account
Create an account to get started.
Sign in
Sign in to access your account.
Skip the queue
When you first create an account you may be placed on a waitlist. To jump the queue, once signed in, follow the instructions shown in your HASH dashboard. All submissions are reviewed by a member of the team.
</details> <details> <summary> <strong>Option 2.</strong> Run HASH locally</summary>Running HASH locally
Running HASH locally is not yet officially supported. In the meantime, use hash.ai or try the experimental instructions below. These instructions will be replaced with a comprehensive guide to setting up and running your own instance in due course.
Experimental instructions
Running the app
-
Make sure you have, Git, Rust, Docker, and Protobuf. Building the Docker containers requires Docker Buildx. Run each of these version commands and make sure the output is expected:
git --version ## ≥ 2.17 rustup --version ## ≥ 1.27.1 (Required to match the toolchain as specified in `rust-toolchain.toml`, lower versions most likely will work as well) rustc --version ## Should match the toolchain specified in `rust-toolchain.toml`. If this is not the case, you can update the toolchain with rustup toolchain install ## If this still is not the correct toolchain, you may have set `RUSTUP_TOOLCHAIN` somewhere (e.g. in a global `mise` config file) docker --version ## ≥ 20.10 docker compose version ## ≥ 2.17.2 docker buildx version ## ≥ 0.10.4If you have difficulties with
git --versionon macOS you may need to install Xcode Command Line Tools first:xcode-select --install.If you use Docker for macOS or Windows, go to Preferences → Resources and ensure that Docker can use at least 4GB of RAM (8GB is recommended).
-
Clone this repository and navigate to the root of the repository folder in your terminal.
-
We use mise-en-place to manage tool versions consistently across our codebase. We recommend using
miseto automatically install and manage the required development tools:mise installIt's also possible to install them manually, use the correct versions for these tools as specified in
.config/mise.After installing mise you will also need to set it to automatically activate in your shell.
-
Install dependencies:
yarn install -
Ensure Docker is running. If you are on Windows or macOS, you should see app icon in the system tray or the menu bar. Alternatively, you can use this command to check Docker:
docker run hello-world -
You will need to create an
.env.localfile in the repository root with the following values (Note: if you are not using AI-related features, dummy values are sufficient):OPENAI_API_KEY=your-open-ai-api-key # required for most AI features ANTHROPIC_API_KEY=your-anthropic-api-key # required for most AI features HASH_TEMPORAL_WORKER_AI_AWS_ACCESS_KEY_ID=your-aws-access-key-id # required for most AI features HASH_TEMPORAL_WORKER_AI_AWS_SECRET_ACCESS_KEY=your-aws-secret-access-key # required for most AI features E2B_API_KEY=your-e2b-api-key # only required for the question-answering flow actionNote on environment files:
.env.localis not committed to the repo – put any secrets that should remain secret here. The default environment variables are taken from.env, extended by.env.development, and finally by.env.local. If you want to overwrite values specified in.envor.env.development, you can add them to.env.local. Do not change any other.envfiles unless you intend to change the defaults for development or testing. -
Launch external services (Postgres, the graph query layer, Kratos, and Redis) as Docker containers:
yarn external-services up -d-
You can optionally force a rebuild of the Docker containers by adding the
--buildargument(this is necessary if changes have been made to the graph query layer). It's recommended to do this whenever updating your branch from upstream. -
You can keep external services running between app restarts by adding the
--detachargument to run the containers in the background. It is possible to tear down the external services withyarn external-services down. -
When using
yarn external-services:offline up, the Graph services does not try to connect tohttps://blockprotocol.orgto fetch required schemas. This is useful for development when the internet connection is slow or unreliable. -
You can also run the Graph API and AI Temporal worker outside of Docker – this is useful if they are changing frequently and you want to avoid rebuilding the Docker containers. To do so, stop them in Docker and then run
yarn dev:graphandyarn workspace @apps/hash-ai-worker-ts devrespectively in separate terminals.
-
-
Launch app services:
yarn startThis will start backend and frontend in a single terminal. Once you see http://localhost:3000, the frontend end is ready to visit there. The API is online once you see
localhost:5001in the terminal. Both must be online for the frontend to function.You can also launch parts of the app in separate terminals, e.g.:
yarn start:graph yarn start:backend yarn start:frontendSee
package.json→scriptsfor details and more options. -
Log in
When the HASH API is started, three users are automatically seeded for development purposes. Their passwords are all
password.alice@example.com,bob@example.com– regular usersadmin@example.com– an admin
Note: seeding only runs when NODE_ENV=development, start the Graph API separately using yarn start:graph then launch the app using yarn dev in a separate terminal to start it in development environment.
Running the browser plugin
If you need to run the browser plugin locally, see the README.md in the apps/plugin-browser directory.
Resetting the local database
If you need to reset the local database, to clear out test data or because it has become
