HeatherDB

Search documentation

Loading the documentation index…

Download
HeatherDB documentation
DocumentationHTTP API

Vector endpoints

Stateless vector math: no collection, no database, no persistence. These are the only routes with no /db/{db} mirror, because they never touch storage.

Auth for all of them: Basic or Bearer, root scope only. The scope classifier admits a default-scoped user to /collections, /algebra and /compose but not to /vec (users::is_authorized), so a database-scoped user gets 403.

All five answer with a single field:

{ "result": [ … ] }

See Overview, Vector algebra, and Algebra for the collection-level equivalents.

POST /vec/bind

Circular-convolution bind of two vectors.

FieldTypeDefault
a, barrays of equal lengthrequired
normalizebooleantrue

normalize: false returns the raw convolution, for spiral-plane ops where spectrum magnitude carries growth or decay.

curl -u admin:pw -X POST http://localhost:6380/vec/bind \
  -H 'Content-Type: application/json' \
  -d '{"a":[1.0,0.0,0.0],"b":[0.0,1.0,0.0],"normalize":true}'
StatusCause
400 Bad Requesta and b differ in length
403 Forbiddenthe caller is scoped to a database

POST /vec/unbind

Unbind a from b.

FieldTypeDefault
a, barrays of equal lengthrequired
exactbooleanfalse
epsfloat1e-9

Default is circular correlation — the approximate inverse, exact on unit-spectrum keys. exact: true does spectral division, the true inverse for keys with non-unit spectrum magnitudes; eps zeroes null bins.

curl -u admin:pw -X POST http://localhost:6380/vec/unbind \
  -H 'Content-Type: application/json' \
  -d '{"a":[1.0,0.0,0.0],"b":[0.0,1.0,0.0],"exact":true,"eps":1e-9}'
StatusCause
400 Bad Requesta and b differ in length
403 Forbiddenthe caller is scoped to a database

POST /vec/bundle

Weighted superposition, Σ weightᵢ · vectorᵢ.

FieldTypeDefault
termsarray of {vector, weight}required. weight defaults to 1.0
normalizebooleantrue

Weights may be negative — that is subtraction, not an error.

curl -u admin:pw -X POST http://localhost:6380/vec/bundle \
  -H 'Content-Type: application/json' \
  -d '{"terms":[{"vector":[1.0,0.0,0.0]},
                {"vector":[0.0,1.0,0.0],"weight":-0.5}],
       "normalize":true}'
StatusCause
400 Bad Requestempty terms, zero-length vectors, terms that are not all the same length, or a non-finite component
403 Forbiddenthe caller is scoped to a database

POST /vec/pow

Spectral power a^⊗t for real t. Integer t equals t successive binds; fractional t is fractional power encoding. Never normalised.

FieldTypeNotes
aarrayrequired, non-empty
tfloatrequired. May be negative or fractional
curl -u admin:pw -X POST http://localhost:6380/vec/pow \
  -H 'Content-Type: application/json' \
  -d '{"a":[1.0,0.0,0.0,0.0],"t":2.5}'
StatusCause
400 Bad Requesta is empty
403 Forbiddenthe caller is scoped to a database

POST /vec/rotate

Continuous permutation-cycle rotation ρ^t — the "dimmer dial" generalisation of algebra/permute's integer power. t=0 is the identity, t=1 exactly reproduces the discrete permutation, and integer t reproduces permute_pow.

FieldTypeNotes
aarrayrequired, non-empty
seedintegerMutually exclusive with name
namestringHashed (SHA-256) to a seed. Mutually exclusive with seed
tfloatrequired

Exact isometry on odd-length permutation cycles.

curl -u admin:pw -X POST http://localhost:6380/vec/rotate \
  -H 'Content-Type: application/json' \
  -d '{"a":[1.0,0.0,0.0,0.0,0.0],"name":"sequence","t":0.5}'
StatusCause
400 Bad Requesta is empty; neither or both of seed/name supplied
403 Forbiddenthe caller is scoped to a database