Skip to content

Development Setup ​

Get your development environment ready for NornicDB.

Prerequisites ​

  • The Go toolchain in go.mod (currently 1.27.3)
  • Node.js 24 and npm for UI/documentation builds
  • Git
  • Make (optional, for build shortcuts)
  • Docker (optional, for containerized testing)
  • curl (for downloading models)
  • CGO-compatible compiler (for local LLM builds)

For contribution and validation policy, use the contribution guide. For an application using the Go library, start with embedding.

Clone Repository ​

bash
git clone https://github.com/orneryd/nornicdb.git
cd nornicdb

Build from Source ​

Native Binary ​

bash
# Basic build (with UI)
make build

# Or without make:
go build -o bin/nornicdb ./cmd/nornicdb

# Headless build (no UI, smaller binary)
make build-headless

# With local LLM support
make build-localllm

# Headless with local LLM
make build-localllm-headless

Docker Images ​

Model Downloads (Heimdall only) ​

Heimdall images require BGE-M3 embedding model (~400MB) and qwen3-0.6b LLM (~350MB):

bash
# Download both models automatically
make download-models

# Or download individually
make download-bge    # BGE-M3 embedding model
make download-qwen   # qwen3-0.6b-Instruct LLM

# Check which models are present
make check-models

Models are downloaded from HuggingFace and saved to models/ directory.

Build Docker Images ​

bash
# ARM64 (Apple Silicon)
make build-arm64-metal                    # Base (BYOM)
make build-arm64-metal-bge                # With BGE embeddings
make build-arm64-metal-bge-heimdall       # With BGE + Heimdall AI (auto-downloads models)
make build-arm64-metal-headless           # Headless (no UI)

# AMD64 CUDA (NVIDIA GPU)
make build-amd64-cuda                     # Base (BYOM)
make build-amd64-cuda-bge                 # With BGE embeddings
make build-amd64-cuda-bge-heimdall        # With BGE + Heimdall AI (auto-downloads models)
make build-amd64-cuda-headless            # Headless (no UI)

# AMD64 CPU-only (no GPU, embeddings disabled)
make build-amd64-cpu                      # Minimal
make build-amd64-cpu-headless             # Minimal headless

# Build all variants for current architecture
make build-all

Deploy to Registry ​

bash
# Deploy specific image (build + push)
make deploy-arm64-metal-bge-heimdall

# Deploy all variants for current architecture
make deploy-all

Cross-Compilation ​

Build native binaries for other platforms from macOS:

bash
# Linux servers
make cross-linux-amd64        # x86_64 (VPS, cloud)
make cross-linux-arm64        # ARM64 (Graviton, Jetson)

# Raspberry Pi
make cross-rpi                # Pi 4/5 (64-bit)
make cross-rpi32              # Pi 2/3 (32-bit)
make cross-rpi-zero           # Pi Zero (ARMv6)

# Windows
make cross-windows            # CPU-only build

# Build all platforms
make cross-all

Note: Cross-compiled binaries are pure Go (no CGO), so Metal/CUDA acceleration and local LLM support are not available.

Run Tests ​

bash
# All tests
go test ./...

# With coverage
go test -cover ./...

# Specific package
go test ./pkg/nornicdb/...

Start Development Server ​

bash
# Default settings (localhost:7474)
./bin/nornicdb serve --data-dir=./dev-data

# With auth disabled for easier development
./bin/nornicdb serve --data-dir=./dev-data --no-auth

# Custom ports
./bin/nornicdb serve --http-port=8080 --bolt-port=8687

Environment Variables ​

Core Settings ​

VariableDescriptionDefault
NORNICDB_DATA_DIRData directory./data
NORNICDB_HTTP_PORTHTTP API port7474
NORNICDB_BOLT_PORTBolt port7687
NORNICDB_AUTHSet to none to disable, or user/pass to enablenone (auth off)
NORNICDB_AUTH_JWT_SECRETJWT secret (min 32 characters)Required for auth
NORNICDB_HEADLESSDisable embedded UI routes and browser IDEs; core APIs remain availablefalse

Embedding & AI Features ​

VariableDescriptionDefault
NORNICDB_EMBEDDING_PROVIDEREmbedding providerlocal
NORNICDB_EMBEDDING_MODELModel path/namemodels/bge-m3.gguf
NORNICDB_HEIMDALL_ENABLEDEnable Heimdall AIfalse
NORNICDB_HEIMDALL_MODELHeimdall LLM modelmodels/qwen3-0.6b-instruct-q4_k_m.gguf
NORNICDB_SEARCH_RERANK_ENABLEDEnable Stage-2 search rerankingfalse
NORNICDB_SEARCH_RERANK_PROVIDERReranker backend: local, ollama, openai, httplocal
NORNICDB_SEARCH_RERANK_MAX_DOCUMENT_CHARSMaximum characters per rerank candidate (title/name + matched chunk with neighbours); …_BYTES deprecated2048
NORNICDB_PLUGINS_DIRAPOC plugins directoryapoc/built-plugins

IDE Setup ​

VS Code ​

Recommended extensions:

  • Go (official)
  • Go Test Explorer
  • GitLens
json
// .vscode/settings.json
{
  "go.lintTool": "golangci-lint",
  "go.testFlags": ["-v"],
  "editor.formatOnSave": true
}

Git Hooks ​

Install the repository's tracked Git hooks after cloning:

bash
make install-hooks

The pre-commit hook auto-formats staged Go files with gofmt -w -s before the commit is written, so formatting fixes are included in the commit instead of being left behind as dangling working tree changes.

GoLand ​

  1. Open project root
  2. Set GOPATH to project directory
  3. Enable "Go Modules" in Preferences

Project Structure ​

nornicdb/
├── cmd/nornicdb/     # CLI application
├── pkg/
│   ├── nornicdb/     # Core database
│   ├── server/       # HTTP server
│   ├── storage/      # Storage engines
│   ├── auth/         # Authentication
│   ├── audit/        # Audit logging
│   ├── gpu/          # GPU acceleration
│   └── heimdall/     # AI assistant
├── apoc/
│   ├── plugin-src/   # Plugin source code
│   └── built-plugins/ # Compiled plugins (.so)
├── docker/           # Docker files
├── models/           # LLM/embedding models
├── ui/               # Web UI (Svelte)
└── docs/             # Documentation

APOC Plugin Development ​

NornicDB supports dynamic Go plugins (Linux/macOS only):

bash
# Build APOC plugin
make plugins

# Run with plugins
NORNICDB_PLUGINS_DIR=apoc/built-plugins ./bin/nornicdb serve

# Clean plugins
make plugins-clean

See APOC Plugin Guide for creating custom functions.

Heimdall AI Assistant ​

Enable the built-in AI assistant for natural language database interactions:

bash
# Ensure models are present
make check-models

# Download if missing
make download-models

# Run with Heimdall enabled
NORNICDB_HEIMDALL_ENABLED=true \
NORNICDB_HEIMDALL_MODEL=models/qwen3-0.6b-instruct-q4_k_m.gguf \
./bin/nornicdb serve

Access Bifrost (Heimdall UI) at http://localhost:7474/bifrost

See Heimdall AI Assistant Guide for details.

Next Steps ​

Analytics privacy