Documentation

Get Started with Anvil

Everything you need to install, configure, and start querying your graph database and document store in minutes.
Installation

Install Anvil

Download a pre-compiled binary for your platform and start in seconds.

macOS / Linux

terminalbash
# Download and install
curl -fsSL https://anvildb.com/install.sh | sh

# Start the server
anvil start

Windows

powershellpowershell
# Download latest release
irm https://anvildb.com/install.ps1 | iex

# Start the server
anvil start

Docker

terminalbash
# Pull and run
docker run -p 7474:7474 -p 7687:7687 \
  devforge/anvil:latest
Hammer UI

Install the Management UI

Hammer is an open-source (MIT) web UI for managing Anvil DB. Query with Cypher or GraphQL, visualize your graph, manage documents, configure security, and administer users.

npm

terminalbash
# Clone and install
git clone https://github.com/anvildb/hammer.git
cd hammer
npm install

# Start development server
npm run dev

# Open http://localhost:5175

Production Build

terminalbash
# Build for production
npm run build

# Start production server
npm run start

# Or deploy with Docker
docker build -t hammer .
docker run -p 5175:3000 hammer

Cypher & GraphQL

Query editor with table, JSON, graph, and plan result views. GraphQL playground with introspection.

Graph Canvas

Force-directed visualization with focus mode, neighbor orbit, lasso select, minimap, and PNG/SVG export.

Admin & Security

User management, RLS policies, schema isolation, role-gated access. Admin features hidden for non-admin users.

Hammer is MIT licensed and connects to any Anvil DB instance via HTTP on port 7474. Source: github.com/anvildb/hammer

Quick Start

Your first graph in 60 seconds

Generate a config, start the server, and run your first Cypher query.
1

Generate configuration

Create a default anvil.toml configuration file in the current directory.

terminalbash
anvil config init
2

Start the server

Boot Anvil with the generated config. The server forks to background by default (daemon mode), logs to data/anvil.log, and binds to ports 7474 (HTTP) and 7687 (Bolt). Use --foreground for development.

terminalbash
anvil start                  # daemonizes by default
anvil start --foreground     # stay in foreground
anvil status                 # check if running
anvil stop                   # graceful shutdown

# Server ready at http://localhost:7474
# Bolt protocol at anvil://localhost:7687
# Hammer UI at http://localhost:5175
3

Connect to your database

Use the Anvil URI scheme to connect from any supported driver or the built-in Hammer UI.

connectionuri
anvil://localhost:7687
4

Run your first query

Create nodes and relationships, then query them back with Cypher.

create nodescypher
CREATE (alice:Person {name: "Alice", age: 32})
CREATE (bob:Person {name: "Bob", age: 28})
CREATE (alice)-[:KNOWS {since: 2020}]->(bob)
RETURN alice, bob;
query nodescypher
MATCH (p:Person)-[r:KNOWS]->(friend:Person)
WHERE p.name = "Alice"
RETURN p.name, friend.name, r.since;
Document Store

Graph + Documents in one database

Store and query JSON documents alongside your graph — with automatic sync between the two models. Collections are organized into schemas: public for application data and auth for system collections (users, roles, tokens).
create a documentbash
# Upsert a document via REST
curl -X PUT http://localhost:7474/docs/users/alice \
  -H "Content-Type: application/json" \
  -d '{"name": "Alice", "email": "alice@example.com"}'
query from cyphercypher
-- Join graph nodes with documents
MATCH (p:Person)
MATCH DOCUMENT d IN profiles
  WHERE d.id = p.profile_id
RETURN p.name, d.bio, d.avatar_url
Configuration

anvil.toml reference

Key configuration settings for server, storage, and authentication.
anvil.tomltoml
# Server settings
[server]
http_port  = 7474        # REST & Hammer UI
bolt_port  = 7687        # Bolt protocol for drivers
bind_addr  = "0.0.0.0"   # Listen on all interfaces
max_conns  = 256         # Max concurrent connections

# Storage engine
[storage]
data_dir        = "./data"
page_size       = 8192      # 8 KB pages
page_cache_size = "512MB"   # In-memory page cache
wal_enabled     = true      # Write-ahead logging

# Authentication
[auth]
enabled            = true
default_password   = "anvil"           # admin password on first boot
access_token_ttl   = 3600              # 1 hour
refresh_token_ttl  = 604800            # 7 days
# RSA key pair auto-generated and persisted to data/jwt_key.pem
Client Drivers

Connect from any language

Official client drivers with a consistent API across Rust, TypeScript, Python, and Go.
rustrust
let client = AnvilClient::connect("anvil://localhost:7687").await?;
let result = client.query("MATCH (n) RETURN n LIMIT 10").await?;
println!("{:?}", result.records());
typescriptts
const client = await AnvilClient.connect("anvil://localhost:7687");
const result = await client.query("MATCH (n) RETURN n LIMIT 10");
console.log(result.records);
pythonpy
client = AnvilClient.connect("anvil://localhost:7687")
result = client.query("MATCH (n) RETURN n LIMIT 10")
print(result.records)
gogo
client, err := anvil.Connect("anvil://localhost:7687")
result, err := client.Query("MATCH (n) RETURN n LIMIT 10")
fmt.Println(result.Records())
Learn More

Explore the Docs

Deep dive into specific topics across the Anvil documentation.

Cypher Reference

Full reference for the Cypher query language supported by Anvil, including extensions and performance hints.

Read more

GraphQL API

Auto-generated GraphQL endpoint for your graph schema with filtering, pagination, and real-time subscriptions.

Read more

Architecture Guide

Deep dive into Anvil internals: the storage engine, query planner, transaction manager, and cluster consensus.

Read more

Plugin SDK

Extend Anvil with custom procedures, functions, and index providers using the Rust plugin SDK.

Read more

Document Store

Built-in NoSQL document collections with composite keys, TTL, secondary indexes, and bidirectional graph-document sync.

Read more

Row-Level Security

Fine-grained access policies on nodes, relationships, and documents with session variables for multi-tenancy.

Read more

Authentication

Graph-native auth with JWT RS256, JWKS endpoint, Argon2id hashing, refresh tokens, and integration with RLS session variables.

Read more

Functions & Triggers

Stored Cypher functions with typed parameters and CALL...YIELD. Event-driven triggers with BEFORE/AFTER timing, OLD/NEW variables, and sync rule integration.

Read more

Observability

Built-in event log, slow query detection, query analytics with p95/p99 latency, dependency analysis, and configurable alert rules.

Read more

Data Import

Import Neo4j-compatible Cypher scripts via CLI, REST API, or Hammer UI. Supports multi-CREATE, MERGE, and variable binding across statements.

Read more

Edge Functions

Run JavaScript/TypeScript on the server via HTTP endpoints with Deno or Node.js subprocess runtime. Ideal for webhooks and custom APIs.

Read more