Expand description
A9 — Semantic Skills: Vectors, Embeddings & Scratchpads.
First-class vector cosine distance, in-process text embedding, semantic search, and ephemeral scratchpad memory for agent workflows.
§Design
- Vector: Fixed-size f32 vector with cosine distance.
- VectorStore: A bounded collection of vectors with semantic search (k-nearest neighbors by cosine similarity).
- TextEmbedder: In-process text embedding using FNV-1a hashing into a fixed-dimensional vector. This is a lightweight embedding suitable for semantic deduplication and approximate search — not a replacement for neural embeddings.
- Scratchpad: Ephemeral key-value memory for agent workflows. Bounded, with TTL-based expiry.
§Integration
- Uses A5 (
blackboard) for observable state channels. - Designed for zero-heap on hot paths (search uses caller-supplied buffers).
Structs§
- Scratchpad
- An ephemeral key-value scratchpad with TTL-based expiry. Designed for agent workflows that need temporary memory between steps.
- Scratchpad
Entry - An ephemeral scratchpad entry with TTL.
- Search
Result - A search result from the vector store.
- Stored
Vector - A stored vector with an associated key and optional metadata.
- Text
Embedder - A lightweight in-process text embedder using FNV-1a hashing. Maps text into a fixed-dimensional vector by hashing character n-grams into vector dimensions. This is suitable for semantic deduplication and approximate search, not as a replacement for neural embeddings.
- Vector
- A fixed-size vector.
- Vector
Store - A bounded vector store with semantic search.
Enums§
- Scratchpad
Error - Errors from the scratchpad.
Constants§
- DEFAULT_
SCRATCHPAD_ TTL - Default scratchpad TTL (in ticks).
- EMBED_
DIM - Default embedding dimensionality.
- MAX_
SCRATCHPAD_ ENTRIES - Maximum scratchpad entries.
- MAX_
VECTORS - Maximum vectors in a store.