Skip to content

Quick Start

This guide gets IndentiaDB running and walks through your first queries across all supported data models. Estimated time: 5 minutes.


Step 1: Start IndentiaDB

docker run -d \
  --name indentiadb \
  -p 7001:7001 \
  -p 9200:9200 \
  ghcr.io/indentiaplatform/indentiadb-trial:latest

IndentiaDB starts with:

  • Port 7001 — SPARQL, SurrealQL, GraphQL, WebSocket, REST
  • Port 9200 — Elasticsearch-compatible API

See Step 7 for a full Docker Compose configuration with persistent volumes and resource limits.

See Step 8 for pre-built binary installation.


Step 2: Verify Health

curl http://localhost:7001/health

Expected response:

{
  "status": "healthy",
  "role": "standalone",
  "node_id": 1,
  "snapshot_index": 0,
  "current_term": 0,
  "cluster_members": [
    { "node_id": 1, "address": "0.0.0.0:7001", "role": "standalone", "reachable": true }
  ],
  "replication_lag": null,
  "index_loaded": true,
  "uptime_seconds": 3,
  "embedded_surreal": {
    "url": "surrealkv:///data/surrealdb",
    "namespace": "indentiagraph",
    "database": "alerting",
    "ready": true
  }
}

Wait a moment if you get connection refused

The server takes 2–3 seconds to initialize the storage backend on first start.


Step 3: First SPARQL Query

SPARQL is the W3C standard query language for RDF graphs. IndentiaDB supports SPARQL 1.2 including RDF-star.

Insert RDF Triples

curl -X POST http://localhost:7001/update \
  -H "Content-Type: application/sparql-update" \
  -d '
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
PREFIX ex:   <http://example.org/>

INSERT DATA {
  GRAPH <http://example.org/people> {
    ex:alice a foaf:Person ;
             foaf:name "Alice" ;
             foaf:age 30 ;
             foaf:knows ex:bob .

    ex:bob   a foaf:Person ;
             foaf:name "Bob" ;
             foaf:age 28 .
  }
}'

Query RDF Triples

curl -X POST http://localhost:7001/sparql \
  -H "Content-Type: application/sparql-query" \
  -H "Accept: application/sparql-results+json" \
  -d '
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
PREFIX ex:   <http://example.org/>

SELECT ?name ?age
FROM <http://example.org/people>
WHERE {
  ?person a foaf:Person ;
          foaf:name ?name ;
          foaf:age  ?age .
}
ORDER BY ?age'

Expected response:

{
  "results": {
    "bindings": [
      { "name": { "type": "literal", "value": "Bob" },   "age": { "type": "literal", "value": "28" } },
      { "name": { "type": "literal", "value": "Alice" }, "age": { "type": "literal", "value": "30" } }
    ]
  }
}

SPARQL with RDF-star (SPARQL 1.2)

curl -X POST http://localhost:7001/update \
  -H "Content-Type: application/sparql-update" \
  -d '
PREFIX ex:  <http://example.org/>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>

INSERT DATA {
  GRAPH <http://example.org/provenance> {
    << ex:alice ex:knows ex:bob >> ex:since "2020-01-15"^^xsd:date ;
                                   ex:confidence "0.95"^^xsd:decimal .
  }
}'

Step 4: First SurrealQL Query

SurrealQL is the SQL-like multi-model query language for document, relational, and graph data.

SurrealQL HTTP endpoint — planned feature

The POST /sql HTTP endpoint is not yet available in IndentiaDB. SurrealDB is used internally for alerting, licensing, and RDF projection. A user-facing SurrealQL endpoint is planned for a future release. See the SurrealQL reference for the full language guide.


IndentiaDB exposes a drop-in Elasticsearch-compatible REST API on port 9200.

Create an Index and Index Documents

# Create index with mappings
curl -X PUT http://localhost:9200/articles \
  -H "Content-Type: application/json" \
  -d '{
    "mappings": {
      "properties": {
        "title":   { "type": "text" },
        "content": { "type": "text" },
        "author":  { "type": "keyword" },
        "tags":    { "type": "keyword" }
      }
    }
  }'

# Index documents
curl -X POST http://localhost:9200/articles/_doc \
  -H "Content-Type: application/json" \
  -d '{
    "title":   "Introduction to Knowledge Graphs",
    "content": "Knowledge graphs use RDF triples to represent entities and relationships. SPARQL is the standard query language.",
    "author":  "alice",
    "tags":    ["rdf", "sparql", "knowledge-graph"]
  }'

curl -X POST http://localhost:9200/articles/_doc \
  -H "Content-Type: application/json" \
  -d '{
    "title":   "Vector Search with HNSW",
    "content": "Hierarchical Navigable Small World graphs enable approximate nearest neighbor search at scale.",
    "author":  "bob",
    "tags":    ["vector", "hnsw", "search"]
  }'
curl -X POST http://localhost:9200/articles/_search \
  -H "Content-Type: application/json" \
  -d '{
    "query": {
      "match": {
        "content": "knowledge graph SPARQL"
      }
    },
    "highlight": {
      "fields": { "content": {} }
    }
  }'
curl -X POST http://localhost:9200/articles/_search \
  -H "Content-Type: application/json" \
  -d '{
    "query": {
      "multi_match": {
        "query": "RDF triples",
        "fields": ["title^2", "content"]
      }
    }
  }'

Step 6: First Hybrid Search (BM25 + Vector)

Hybrid search combines BM25 keyword scoring with dense vector similarity. IndentiaDB uses Bayesian probability calibration to fuse the scores — no manual weight tuning needed.

Create a Vector-Enabled Index

curl -X PUT http://localhost:9200/knowledge-base \
  -H "Content-Type: application/json" \
  -d '{
    "mappings": {
      "properties": {
        "content":   { "type": "text" },
        "embedding": {
          "type": "dense_vector",
          "dims": 384,
          "index": true,
          "similarity": "cosine"
        }
      }
    }
  }'

Index Documents with Embeddings

curl -X POST http://localhost:9200/knowledge-base/_doc \
  -H "Content-Type: application/json" \
  -d '{
    "content": "SPARQL is a query language and protocol for RDF triple stores.",
    "embedding": [0.12, 0.84, -0.33, 0.07, ...]
  }'

Hybrid Search Query

curl -X POST http://localhost:9200/knowledge-base/_search \
  -H "Content-Type: application/json" \
  -d '{
    "query": {
      "match": { "content": "graph query language" }
    },
    "knn": {
      "field":        "embedding",
      "query_vector": [0.11, 0.82, -0.35, 0.09, ...],
      "k":            10,
      "num_candidates": 100
    },
    "hybrid": {
      "scorer": "bayesian"
    },
    "size": 5
  }'

Scorer options

Set "scorer" to "rrf" (Reciprocal Rank Fusion), "bayesian" (recommended, NDCG@10: 0.9149), or "linear" (weighted sum with manual alpha parameter).


Step 7: Docker Compose (Full Setup)

For local development with persistent data, resource limits, and health checks:

# docker-compose.yml
version: "3.9"

services:
  indentiadb:
    image: ghcr.io/indentiaplatform/indentiadb-trial:latest
    container_name: indentiadb
    ports:
      - "7001:7001"   # SPARQL / REST / GraphQL / WebSocket
      - "9200:9200"   # Elasticsearch-compatible API
    volumes:
      - indentiadb-data:/data
      - ./config/indentiagraph.toml:/config/indentiagraph.toml:ro
    environment:
      SURREAL_USER: root
      SURREAL_PASS: changeme
      LOG_LEVEL: info
    healthcheck:
      test: ["CMD", "curl", "-f", "http://localhost:7001/health"]
      interval: 10s
      timeout: 5s
      retries: 5
      start_period: 15s
    restart: unless-stopped
    deploy:
      resources:
        limits:
          memory: 4G
          cpus: "4"

volumes:
  indentiadb-data:
    driver: local
# Start
docker compose up -d

# Stream logs
docker compose logs -f indentiadb

# Stop
docker compose down

# Stop and remove data
docker compose down -v

Step 8: Binary Install

# Detect your platform
OS=$(uname -s | tr '[:upper:]' '[:lower:]')   # linux or darwin
ARCH=$(uname -m)                               # x86_64 or aarch64

# Download latest release
curl -L "https://github.com/Indentia/indentiagraph/releases/latest/download/indentiagraph-${OS}-${ARCH}" \
  -o indentiagraph
chmod +x indentiagraph

# Verify the binary
./indentiagraph --version

# Start with a config file
./indentiagraph serve --config config.toml

# Or use environment variables only
INDENTIADB_PORT=7001 \
SURREAL_ENDPOINT=ws://localhost:8000 \
ES_ENABLED=true \
ES_PORT=9200 \
  ./indentiagraph serve

SurrealDB backend

The binary requires a SurrealDB instance. Start one with:

docker run -d -p 8000:8000 surrealdb/surrealdb:latest start --log info memory


What's Next?