terminusdb

TerminusDB is a Knowledge Graph Database with Version Control. Time-travel, reason, collaborate, branch, merge, diff, and query your data with Datalog.

Automatically checked · GitHub checked 2026-11-12

terminusdb

Overview

TerminusDB Logo


Native Build Docker Build

Issues License

TerminusDB is a Knowledge Graph Database with Version Control

TerminusDB is the open-source knowledge graph database with git-like version control for graphs and vectors. Branch, merge, diff and hybrid search any commit.

TerminusDB allows you to link JSON and JSON-LD documents in a semantic knowledge graph through a powerful document API. It's designed as a system of record, making data management collaborative, versioned, and queryable.

Key Features

  • Revision Control: Commits for every update — track changes over time
  • JSON Diff and Patch: Differences between commits can be applied as patches
  • Push/Pull/Clone: Communicate diffs between nodes using familiar git-like operations
  • Time-Travel Queries: Query any state of the database at any historical commit
  • Document + Knowledge Graph: Link JSON documents in a knowledge graph using JSON-LD
  • Multimodal: Support for REST API, GraphQL, WOQL and using RDF semantics
  • Goal seeking: Built in unification, path queries, and a datalog logic engine

Join the community

If TerminusDB looks useful to you, please star the repo ⭐ so you can find it again. Questions or ideas? Talk with us and other graph builders on Discord.

Getting Started

The easiest way to install TerminusDB as a developer is by following the 10-minutes docker getting started manual with the latest Docker TerminusDB Image. It can be installed locally using Snap as both git-for-data client and server to perform push and pull. Docker brings the server component, and snap the ability to try TerminusDB on the command line, for example for ML/Ops and AI use cases requiring deterministic symbolic AI processing.

For deployments, copy the docker-compose.yml file from the repository.

Try the 12.1 release candidate: the vectorsearch/ folder has a docker compose setup for 12.1-rc with built-in vector search and local embeddings (no API key needed). It is a release candidate, not a final release. See vectorsearch/README.md.

  1. Add the following to a .env file in the source directory:
# Database administrator's password (required)
TERMINUSDB_ADMIN_PASS=

Notes:

  • TERMINUSDB_ADMIN_PASS is mandatory and must be set.
  1. docker compose up

You should be able to view TerminusDB running by default at localhost:6363

If you're installing TerminusDB on Windows with Docker, follow the comprehensive guide for TerminusDB on Windows with Docker.

You can also install TerminusDB from Source Code.

Usage

Quick Start with CLI

Once installed, you can start using TerminusDB immediately. Here's a simple example creating a person with friends (or use the Manual and more in-depth 15-minutes Getting Started Guide):

terminusdb db create admin/example1
terminusdb doc insert --graph_type=schema admin/example1 <<EOF
{ "@id" : "Person",
  "@type" : "Class",
  "name" : "xsd:string",
  "occupation" : "xsd:string",
  "friends" : { "@type" : "Set",
                "@class" : "Person" }}
EOF
terminusdb doc insert admin/example1 --message='adding Gavin' <<EOF
{ "@type" : "Person","name" : "Gavin", "occupation" : "Coder"}
EOF

Key Resources

  • What is TerminusDB: Why TerminusDB is a unique Graph Database
  • Getting Started Guide: Complete onboarding tutorial
  • Document API: Working with JSON documents
  • GraphQL Guide: Query your knowledge graph with GraphQL
  • WOQL: Web Object Query Language fundamentals
  • Release Notes: Latest changes and version history
  • TerminusDB Enterprise: Full JSON-LD, Turtle, and RDF/XML documents, enterprise features, very fast commit history queries, higher write performance, clustering, API for data product backup and restore (beyond command line tools)

Found an issue in the docs? Please open an issue or pull request in our documentation repo or here.

Community

Come visit us on Discord to:

  • Ask questions and get help
  • Share your projects and use cases
  • Contribute to discussions
  • Stay updated on the latest developments

Client Libraries

TerminusDB provides official client libraries for multiple languages:

What's New in Version 12

TerminusDB 12 is maintained by the Gettier team and used in production today by many organizations. Now engineered for financial and industrial use cases with high precision math, temporal reasoning, and enterprise support. Version 12 additions by the Gettier team include:

  • Allen Integer Algebra and Temporal Reasoning: Support for temporal reasoning and storage of XSD time datatypes including temporal interval classification, storage and life cycle management with datalog reasoning
  • Range Queries over Succinct Data: Extremely fast range queries with constant time retrieval over arbitrary size ordered data, which is great for knowledge graph processing over timestamp, numeric, and interval ranges; with strong temporal reasoning and classification
  • Raw JSON support: Raw JSON support for documents where each object is only stored once (deduplicated) with unlimited size (seen up to 100mb JSON document loads)
  • JSON Git-for-Data (Linked Data): Git for data for JSON, JSON-LD, XML and Turtle documents with schema control (and also for deduplicated raw JSON documents)
  • REST API: Use REST API as a proper graph query language with deep link discovery, path queries and linked data
  • Arbitrary Precision xsd:decimal: Arbitrary rational precision xsd:decimal mathematics, including high precision JSON decimals over the wire for JSON, GraphQL and WOQL, see ISO/IEC 21778:2017
  • GraphQL Support: Use GraphQL as a proper graph query language with deep link discovery and path queries
  • WOQL Datalog: Use WOQL as a goal-seeking problem-solving toolbox, complete with triples across and within documents, path queries and variables unification
  • Schema Constraints: Use schema constraints to enforce data quality and consistency, including for advanced typing
  • @unfoldable Documents: Unfold subdocuments within a frame to add all relevant data in one place
  • @shared Documents with arbitrary IRI: Load documents with arbitrary IRIs with cascading delete graph semantics
  • @metadata Support: Include additional metadata in document frames, including Markdown-formatted data

Documentation

Full documentation is available at https://terminusdb.com/docs.

Contributing

We welcome contributions from the community! Whether you're fixing bugs, adding features, or improving documentation, your help is appreciated.

How to Contribute

  1. Fork the repository and create your feature branch
  2. Run tests to ensure everything works: make dev && ./terminusdb test
  3. Write clear commit messages with descriptive titles
  4. Submit a Pull Request to the main branch

Development Setup

Quick start for contributors:

# Clone your fork
git clone [email protected]:[your_username]/terminusdb.git
cd terminusdb

# Build the project
make dev

# Start test server
./tests/terminusdb-test-server.sh start

# Run tests
npx mocha tests/test/*.js

For detailed development instructions, coding conventions, and testing guidelines, see CONTRIBUTING.md.

Reporting Issues

Found a bug? Have a feature request? Please open an issue using the bug template, with:

  • Clear description of the problem or suggestion
  • Steps to reproduce (for bugs)
  • Expected vs. actual behavior
  • Your environment details (OS, TerminusDB version)

Recognition

terminusdb/terminusdb | #1 Prolog Repository Of The Month on Trendshift

Community

  • ⭐ Star the repo so you can find it again.
  • 💬 Join us on Discord to ask questions and share what you build.

License and copyright

Copyright (c) 2026 Gettier. TerminusDB is licensed under the Apache License 2.0.

You may obtain a copy of the license at: http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.