aaa.data¶
Items and codecs¶
Item ¶
Bases: BaseModel, Generic[T]
Envelope around user data. Algorithms see Items; users own the payload type T.
Provenance ¶
Bases: BaseModel
Codec ¶
Bases: Protocol[T]
Teaches AAA how to render, persist and describe a user type. One per kind.
TypeAdapterCodec ¶
Bases: Generic[T]
Covers Pydantic models, dataclasses, TypedDicts, dict/list/str — anything Pydantic can validate. This is the default path for 'arbitrary data'.
FunctionCodec ¶
Bases: Generic[T]
Escape hatch: wrap your own render/serialize functions (DataFrame rows, images, ...).
Capabilities¶
Embedder ¶
Bases: Protocol
Scorer ¶
Bases: Protocol
Utility / heuristic / quality score for an item (higher is better).
Keyer ¶
Bases: Protocol
Stable identity for dedup and search closed-sets.
preflight ¶
Fail fast at startup, listing everything an algorithm needs but wasn't given.
Blob storage¶
BlobStore ¶
Bases: Protocol
Content-addressed (sha256) storage for payloads too large to live in an event.
FileBlobStore ¶
Local-disk store, sharded by hash prefix, atomic writes, verified reads.
Retrieval¶
Index ¶
Bases: Protocol
InMemoryIndex ¶
BM25 keyword search; if an Embedder is supplied, fused with cosine similarity via reciprocal-rank fusion (hybrid). Brute force: fine to ~1e5 docs; swap in pgvector/Qdrant behind the same protocol for more.
Doc ¶
Bases: BaseModel
Hit ¶
Bases: BaseModel