# Welcome to Datahike Tuts

> **Disclaimer**\
> This guide is not going to be very formal and is being written as I learn so might not all have the best flow. I may circle back at some point and fix the flow. No promises though.

### Why?

I've wanted to use an immutable database powered by datalog for ages. Eventually I decided to do something about [it](https://twitter.com/alekcz/status/1285111415955697664).&#x20;

![How it all began](/files/-MCl9hbBgYCL3HOwjfyI)

### What we'll be using

* Clojure through [leiningen](https://leiningen.org/)&#x20;
* [Datahike](https://github.com/replikativ/datahike) by wonderful folks at [replikativ](https://replikativ.io/)
* The REPL

You can get started by cloning this [repo](https://github.com/alekcz/datahike-starter) I put together. It's nothing special. It just has all the dependencies, nothing special.

The most popular open source datalog engine for clojure is [tonksy/datascript](https://github.com/replikativ/datahike). It's been built from the ground up and is use quite extensively in [datahike](https://github.com/replikativ/datahike).&#x20;

### Understanding datalog

[@pithyless](https://twitter.com/pithyless) has a great video introducing datalog.&#x20;

{% embed url="<https://www.youtube.com/watch?v=oo-7mN9WXTw>" %}

### Now let's add the magic.&#x20;

Datahike is an immutable database powered by an efficient datalog query engine. It started out as as a port of [DataScript](https://github.com/tonsky/DataScript) to the [hitchhiker-tree](https://github.com/datacrypt-project/hitchhiker-tree).  But what is a hitchhiker tree?&#x20;

{% embed url="<https://www.youtube.com/watch?v=jdn617M3-P4>" %}

### Cheers

I think that's enough for today. I'll catch you on the morrow.&#x20;


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://alekcz.gitbook.io/datahike-tuts/master.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
