--- spec: openflange.org/pipe/v0.1 id: embeddings version: 0.1.0 title: Embeddings (mock embedder) description: Turns the text of each record into a fixed-length unit vector. Ships with a deterministic mock embedder (feature hashing), not a model. license: Apache-2.0 keywords: [llm, ai, embeddings, vector, mock, example] maturity: experimental scope: record cardinality: one-to-one deterministic: true inputs: texts: description: 'Records: {"id", "text"}.' schema: format: json-schema definition: type: object required: [text] properties: text: {type: string} outputs: embeddings: description: 'One record per input, in order: {"id", "embedding": [numbers]}. The vector has `dimensions` components and length 1 (all zeros for text without words).' schema: format: json-schema definition: type: object required: [id, embedding] properties: embedding: type: array items: {type: number, minimum: -1, maximum: 1} parameters: dimensions: type: integer default: 8 minimum: 2 maximum: 1024 description: Number of components of each vector. implementation: type: script language: python path: embed.py permissions: subprocess: true --- # Embeddings (mock embedder) Implements the [OpenFlange](https://openflange.org/) specification. An embedding model is a one-to-one pipe: a record goes in, the same record's vector comes out, in order. See [../README.md](../README.md). The embedder in [`embed.py`](embed.py) is a **mock**: it hashes words into buckets (SHA-256) and normalises. It is deterministic — which is why this pipe may declare `deterministic: true`; a pipe calling a hosted embedding model should not — and it needs no network. Texts that share words get similar vectors; it does not understand meaning. A record without a string `text` fails the run (`E_RUNTIME`). Permissions: `subprocess` (it starts `python3`). No network, no secrets.