Codex Pets
Illustrated guide

How Codex Pets works

Two files become an animated coding companion. The same pack also becomes searchable by words, meaning, and visual appearance without adding another public source of truth.

A pet pack's path

A pack starts with pet.json, which describes metadata and animation settings, plus a spritesheet.webp or spritesheet.png atlas. Validation checks the pair, and moderation decides whether the pack can become public.
Flowchart showing pet.json and a spritesheet passing through validation, pending storage in YDB, moderation, public discovery, installation, and Codex
Only an approved two-file pack reaches the public gallery, APIs, MCP tools, and install paths.
YDB stores submitted metadata and binary assets while the card is pending. Moderation changes its status; only an approved pack reaches the gallery, public APIs, read-only MCP tools, and install paths.

How a pet becomes searchable

Name, description, kind, and tags become a canonical text document. Four fixed frames from the atlas become a visual caption. Each branch is embedded separately and stored as versioned derived data.
Flowchart showing metadata and four fixed spritesheet frames becoming versioned text and visual embeddings in YDB
Metadata produces the text profile; four reproducible atlas frames produce the visual profile.
Every stored vector carries its model revision, dimension count, and source hash. When the card or atlas changes, an embedding built from older content is excluded until a fresh one is ready.

Online hybrid search

Example queryan anxious brown bear from an old cartoon
Hard kind, tag, and author filters run first. The remaining pets are ranked lexically and by text and visual similarity. Weighted reciprocal rank fusion combines their positions instead of comparing incompatible raw scores.
Flowchart showing hard filters, lexical ranking, text and visual similarity, weighted rank fusion, and lexical fallback
Three independent ranked lists are fused by position. If the semantic path fails, lexical results still return.
Codex Pets search results showing Winnie first and Foggy Hedgehog second for a descriptive query
The query avoids Winnie’s name while mixing literal traits with mood and story cues; the final ranking can combine lexical, text, and visual signals.
If the embedding model or vector lookup times out, the request returns lexical results instead of failing the gallery.

Related pets without half-published results

Related pets reuse current metadata, text vectors, and visual vectors, but ranking happens in the background. Every approved pet is compared with the catalog and written into a new snapshot generation.
Flowchart showing pairwise related-pet ranking, complete generation validation, atomic activation, heuristic fallback while building or failed, and retained previous snapshot data
A related-pet generation becomes visible only after every row is written and validated.
Related Codex pets shown for Winnie, including Foggy Hedgehog, Ezhik, Krosh, and Cheburashka
The detail page reads one published snapshot instead of ranking the whole catalog on every request.
One transaction activates the generation only after every expected row is current and valid. While the related-pets state is building or failed, the detail page uses the heuristic order. The previous snapshot remains stored and recoverable, but it is not served until the state becomes ready again.

The short version

One data layer

YDB stores source cards, binary assets, versioned embeddings, and published related-pet snapshots.

Traceable derived data

Model revisions and source hashes keep embeddings aligned with the current pet pack.

Two ranking paths

Online search ranks one current query; related pets publish one complete precomputed generation.