Skip to content

Commit 875707c

Browse files
committed
fix(ux): dev experience audit — dim enforcement, auth, docs, examples
1 parent 6160cfa commit 875707c

28 files changed

Lines changed: 1094 additions & 450 deletions

.env.example

Lines changed: 99 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,100 @@
1-
# Valori Environment Configuration
2-
# Copy this to .env and fill in your values
1+
# Valori node — environment variables
2+
# Copy this file to .env and uncomment what you need.
3+
# All variables are optional unless marked (required).
4+
#
5+
# Start a node: source .env && cargo run -p valori-node
6+
# Full reference: CLAUDE.md § Environment variables
37

4-
# Production Koyeb Deployment URL
5-
VALORI_URL=https://your-deployment.koyeb.app
8+
# ── Core (standalone node) ────────────────────────────────────────────────────
9+
10+
# (required) Vector dimension — immutable after the first insert.
11+
VALORI_DIM=128
12+
13+
# HTTP listen address (default: 0.0.0.0:3000)
14+
#VALORI_BIND=0.0.0.0:3000
15+
16+
# Index type: "brute" (exact, default) or "hnsw" (approximate, faster at scale)
17+
#VALORI_INDEX=brute
18+
19+
# Slab capacity — max records the node can hold in memory (default: 1_000_000)
20+
#VALORI_MAX_RECORDS=1000000
21+
22+
# Graph slab capacities
23+
#VALORI_MAX_NODES=100000
24+
#VALORI_MAX_EDGES=500000
25+
26+
# ── Durability ────────────────────────────────────────────────────────────────
27+
28+
# Append-only BLAKE3-chained event log (omit = in-memory only, no crash recovery)
29+
#VALORI_EVENT_LOG_PATH=./data/events.log
30+
31+
# Snapshot file for fast restart (omit = no snapshot; WAL-only recovery still works)
32+
#VALORI_SNAPSHOT_PATH=./data/snapshot.bin
33+
34+
# ── Security ──────────────────────────────────────────────────────────────────
35+
36+
# Bearer token — all API requests must include "Authorization: Bearer <token>"
37+
# Generate one: openssl rand -hex 32
38+
#VALORI_AUTH_TOKEN=
39+
40+
# ── Recency decay ─────────────────────────────────────────────────────────────
41+
42+
# Default half-life for recency-aware search ranking (seconds).
43+
# 86400 = 1 day. 0 or unset = no decay.
44+
#VALORI_DECAY_HALF_LIFE_SECS=86400
45+
46+
# ── Built-in embedding / ingest pipeline ─────────────────────────────────────
47+
# Enables POST /v1/ingest — send raw text, get chunk+embed+insert in one call.
48+
49+
# Provider: ollama | openai | custom (omit = embedding disabled)
50+
#VALORI_EMBED_PROVIDER=ollama
51+
52+
# Model name (provider-specific default used if unset)
53+
#VALORI_EMBED_MODEL=nomic-embed-text
54+
55+
# Base URL for the embedding provider
56+
#VALORI_EMBED_URL=http://localhost:11434
57+
58+
# API key for OpenAI or custom providers
59+
#VALORI_EMBED_API_KEY=
60+
61+
# ── Object-store offload (Phase 3.1) ─────────────────────────────────────────
62+
# Snapshot archival + WAL rotation to S3, MinIO, or R2.
63+
64+
# s3://bucket/prefix | file:///path (omit = disabled)
65+
#VALORI_OBJECT_STORE_URL=s3://my-bucket/valori
66+
67+
# Snapshots to keep after pruning (default: 7)
68+
#VALORI_OBJECT_STORE_KEEP=7
69+
70+
# S3 region (also reads AWS_DEFAULT_REGION)
71+
#VALORI_OBJECT_STORE_REGION=us-east-1
72+
73+
# Custom S3-compatible endpoint (MinIO / Localstack / R2)
74+
#VALORI_OBJECT_STORE_ENDPOINT=http://localhost:9000
75+
76+
# ── Cluster additions ─────────────────────────────────────────────────────────
77+
# Uncomment all of these when running in cluster mode.
78+
79+
# Integer node ID (1-based, must be unique in the cluster)
80+
#VALORI_NODE_ID=1
81+
82+
# Full cluster topology: id=raft_addr/http_addr,...
83+
#VALORI_CLUSTER_MEMBERS=1=127.0.0.1:3101/127.0.0.1:3001,2=127.0.0.1:3102/127.0.0.1:3002,3=127.0.0.1:3103/127.0.0.1:3003
84+
85+
# Set to 1 on the bootstrap node only, on first boot only. Remove after cluster is formed.
86+
#VALORI_CLUSTER_INIT=1
87+
88+
# gRPC listen address for Raft (default: 0.0.0.0:3100)
89+
#VALORI_RAFT_BIND=0.0.0.0:3101
90+
91+
# Persistent redb file for Raft log + vote + state machine
92+
#VALORI_RAFT_LOG_PATH=./data/raft.redb
93+
94+
# Hash-convergence poll interval in seconds (0 = off, default: 30)
95+
#VALORI_STATE_HASH_CHECK_SECS=30
96+
97+
# mTLS for inter-node Raft traffic (all three required to enable mTLS)
98+
#VALORI_TLS_CA=./certs/ca.crt
99+
#VALORI_TLS_CERT=./certs/node.crt
100+
#VALORI_TLS_KEY=./certs/node.key

CONTRIBUTING.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ This guide gets you from a fresh clone to a running node in under 10 minutes.
77
Run this once after cloning. It installs Rust, the wasm32 target, Python SDK, and UI dependencies, then builds the workspace:
88

99
```bash
10-
bash scripts/dev-setup.sh
10+
bash dev-setup.sh
1111
```
1212

1313
Works on macOS and Linux. If you prefer to install things manually, follow the steps below.
@@ -80,9 +80,9 @@ VALORI_EVENT_LOG_PATH=/tmp/valori-events.log \
8080
VALORI_SNAPSHOT_PATH=/tmp/valori.snap \
8181
cargo run -p valori-node
8282

83-
# Custom port
83+
# Custom port (e.g. 8080 — default is 3000)
8484
VALORI_DIM=128 \
85-
VALORI_BIND=0.0.0.0:8080 \
85+
VALORI_BIND=0.0.0.0:3000 \
8686
cargo run -p valori-node
8787

8888
# With embedding provider (enables POST /v1/ingest — chunk+embed+insert in one call)
@@ -139,7 +139,7 @@ maturin develop # compiles and installs into your active Python env
139139
# Node.js 18+ required
140140
cd ui
141141
npm install
142-
npm run dev # starts at http://localhost:4000
142+
npm run dev # starts at http://localhost:3001
143143
```
144144

145145
The UI reverse-proxies API calls to the node, so **start the node first** (step 2). No extra config needed for local dev.

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ check:
2121
test:
2222
cargo test --workspace --exclude valori-embedded --exclude valori-ffi
2323

24-
## Run a single standalone node as an HTTP server on 0.0.0.0:8080
24+
## Run a single standalone node as an HTTP server on 0.0.0.0:3000
2525
server:
26-
VALORI_BIND=0.0.0.0:8080 cargo run --release -p valori-node
26+
VALORI_BIND=0.0.0.0:3000 cargo run --release -p valori-node
2727

2828
## Bring up a 3-node Raft cluster in Docker
2929
cluster:

0 commit comments

Comments
 (0)