[← Home]

####  ##### #   #
#   # #     #   #
#   # ###   #   #
#   # #      # #
####  #####   #

Developer Guide

LastDB is in alpha. The product you install from Homebrew is a headless local daemon — apps talk to it over a Unix socket.

Data is never accessed as a free-for-all dump. Queries and mutations go through the node; first-party apps (Brain, Kanban, …) are the usual interface. Building a new app uses the same socket contract.

[Install LastDB →] — start there if you do not have a node yet.

QUICK START

1. INSTALL

Use the home-page one-liner (Last Stack installs LastDB + apps). Database only:

brew install edgevector/lastdb/lastdb
brew services start lastdb

Full copy-paste path: Home → Install.

2. CONFIRM THE NODE

curl -s --unix-socket ~/.lastdb/data/folddb.sock http://localhost/health
# → {"status":"ok"}

lastdb status
lastdb --version
lastdbd --version

Socket: ~/.lastdb/data/folddb.sock. Health path is /health (not /api/health). TCP :9001 is retired.

3. USE AN APP (OR THE SOCKET)

brain init --grant-consent
brain concept new local-search --title "Local search" --body "Embeddings stay on this machine."
brain ask "what did I note about search?"

# raw status from the daemon
curl -s --unix-socket ~/.lastdb/data/folddb.sock http://localhost/api/status

Apps are the happy path. Building a new app: talk HTTP to the same socket (query / mutation / schemas).

WHAT HOMEBREW SHIPS

INCLUDED

lastdbd — semantic daemon (store, index, app identity, sync when connected).
lastdb — tiny control CLI (status, connect, …).
Socket API for apps over ~/.lastdb/data/folddb.sock.

NOT INCLUDED

No desktop UI, no DMG, no built-in file-ingestion product surface. Older docs that mention lastdb ingest or /api/ingestion/* describe a retired full-node path — not the Homebrew install.

SOCKET API what apps actually call

All examples use the owner Unix socket. Prefer first-party CLIs unless you are building a new app.

HEALTH

curl -s --unix-socket ~/.lastdb/data/folddb.sock \
  http://localhost/health

Expect {"status":"ok"}.

STATUS

curl -s --unix-socket ~/.lastdb/data/folddb.sock \
  http://localhost/api/status

Process / data-dir / sync summary.

SCHEMAS

curl -s --unix-socket ~/.lastdb/data/folddb.sock \
  http://localhost/api/schemas

List schemas known to this node.

QUERY

curl -s --unix-socket ~/.lastdb/data/folddb.sock \
  -X POST http://localhost/api/query \
  -H "Content-Type: application/json" \
  -d '{"schema_name":"concept","limit":5}'

Structured query. Apps also use /api/mutation for writes (POST).

Exact request shapes evolve with the node; treat first-party apps and the TypeScript app SDK as the stable surface when in doubt. See Apps.

ACCESS POLICIES how access is enforced

Each field can carry a value, a security label, a trust-distance policy (Wn Rm), and optional capability constraints. Queries are evaluated under an access context C = (user, τ, keys).


  Query arrives with access context C = (user, τ, keys)
       |
       v
  Check trust distance: τ ≤ m for each field's Wn Rm policy
       |
       v
  Check capabilities: caller holds required key, quota > 0
       |
       v
  Check payment: P(user, field) satisfied
       |
       v
  Check security labels: ℓ_in ⊑ ℓ_out for all transforms
       |
       v
  All pass? → Apply transforms → Return authorized projection
  Any fail? → Return Nothing (no data, no error, no leakage)

TRUST DISTANCE

// Each field has a Wn Rm policy
// W = max write distance, R = max read distance
{
  "fields": {
    "name":        { "policy": "W0 R1" },
    "diagnosis":   { "policy": "W1 R1" },
    "lab_results": { "policy": "W1 R3" }
  }
}
// τ=0: owner · τ=1: doctor · τ=3: researcher

TRANSFORMS

Deterministic functions on structures. Outputs are written back under policies of their own — so derived data is not a side door around access control. Details: the papers below.

CLI SURFACE

LASTDB (Homebrew)

lastdb status              # is the daemon up?
lastdb --version
lastdbd --version
lastdb connect             # optional: multi-device recovery phrase
brew services start lastdb
brew services restart lastdb

The control CLI is intentionally small. App workflows live in app CLIs.

APPS

brain init --grant-consent
brain concept new <slug> --title "…" --body "…"
brain ask "…"
brain mcp

kanban init
kanban list
kanban add <slug> --title "…"
kanban mcp

situations list
situations init

Full catalog: Apps. Daily loop: How to use it.

DOCUMENTATION

THE PAPER

“Fold DB: Compute Without Exposure” — formal model and architecture.
fold_db_paper.pdf

ELI5 PAPER

Plain-language walkthrough of the same ideas.
fold_db_paper_eli5.pdf

GITHUB

github.com/EdgeVector — public apps: brain, fkanban, situations, last-stack, …