Skip to content

Hyperdimensional Computing

advanced

HDC text interface: store, retrieve, similarity, and algebraic operations (bind, bundle, permute, unbind).

Store (HDC)

POST/v1/memory/hdc/store

Store text via HDC encoding (no external embedding model needed).

textstringrequired

Text to store (minLength: 1).

metadataobject | null

Arbitrary metadata to attach.

200Response
{
  "success": true,
  "key_vector": [
    0.12,
    -0.34,
    0.56,
    "..."
  ],
  "pattern_id": 42
}

Retrieve (HDC)

POST/v1/memory/hdc/retrieve

Retrieve from memory using text query (HDC encoding).

querystringrequired

Text query (minLength: 1).

200Response
{
  "result": [
    0.23,
    -0.45,
    0.67,
    "..."
  ],
  "metadata": {
    "source": "user_input"
  },
  "confidence": 0.89
}

Retrieve boosted

POST/v1/memory/hdc/retrieve/boosted

Retrieve with semantic boost using text query.

querystringrequired

Text query (minLength: 1).

top_kintegerDefault: 5

Number of results (1–20).

200Response
{
  "results": [
    {
      "text": "Previously stored text",
      "confidence": 0.92,
      "was_reranked": true,
      "semantic_score": 0.88
    }
  ],
  "info": {},
  "latency_ms": 5.3
}

Similarity (HDC)

POST/v1/memory/hdc/similarity

Compute cosine similarity between two texts in HD space.

text_astringrequired

First text (minLength: 1).

text_bstringrequired

Second text (minLength: 1).

200Response
{
  "similarity": 0.76,
  "encoding_dim": 10000
}

Stats (HDC)

GET/v1/memory/hdc/stats

Get HDC text interface statistics.

200Response
{
  "texts_stored": 234,
  "vocab_size": 1523,
  "encoding_dim": 10000,
  "total_encodes": 892
}

Bind

POST/v1/memory/hdc/bind

HDC binding (Hadamard product): associate a role to a filler.

rolearray[number]required

Role vector.

fillerarray[number]required

Filler vector.

200Response
{
  "result": [
    0.12,
    -0.34,
    0.56,
    "..."
  ]
}

Bundle

POST/v1/memory/hdc/bundle

HDC bundling (weighted superposition): combine a set of vectors.

vectorsarray[array[number]]required

List of vectors to bundle.

weightsarray[number] | null

Optional weights for each vector.

200Response
{
  "result": [
    0.23,
    -0.45,
    0.67,
    "..."
  ]
}

Permute

POST/v1/memory/hdc/permute

HDC permutation (circular shift): encode sequential order.

vectorarray[number]required

Vector to permute.

shiftsintegerDefault: 1

Number of circular shifts.

200Response
{
  "result": [
    0.56,
    0.12,
    -0.34,
    "..."
  ]
}

Unbind

POST/v1/memory/hdc/unbind

HDC unbinding: extract filler from (bound, role) pair (auto-inverse Hadamard).

boundarray[number]required

Bound vector (result of bind).

rolearray[number]required

Role vector used in binding.

200Response
{
  "result": [
    0.34,
    -0.12,
    0.78,
    "..."
  ]
}

Next steps