Six generators that each infer a brand's voice from scratch produce six slightly different brands. Studio's central design choice was to read the brand once, store what was read as data, and give every generator the same data. This page covers the two halves: how a brand is extracted from its own pages, and how one loader makes sure there is a single way to use it.

Reading a brand

Two bands. Extraction: references, up to six pages or social accounts at once; fetch, a rendered page or a social profile; vision, one reading per reference of colours, type, tone and tags; aggregate, colour clustering in HSL and a majority vote for tags; and enrich and commit, where a small model adds values and audience and the brand is saved. Use: one loader, taking brand and channel in and giving snapshot and block out; snapshot, with voice, visual, principles, audience, product and forbidden; products, which inherit their parent brand when read; generators, for article, card news, detail page, slides, banner and video; and rubric, the same data rendered as criteria for judging. A note: with no brand id the loader returns an empty block and no snapshot, so a generator's prompt is what it was before the brand layer, and tests assert the loader's exact return values.
Figure 1. Extraction above, use below. Models read each reference separately. Colours and tags are combined by clustering and voting. A small model then adds the brand's values, proposition and audience. One loader turns the stored brand into the snapshot every generator receives.

A user gives Studio references: pages from the brand’s site, or its social accounts. Up to six are processed at once, concurrently.

StepWhat does itOutput
FetchA headless browser for pages, a profile reader for social accountsA rendered view of each reference
ReadA vision model, once per referenceColours, descriptive tags and other attributes of that reference
AggregatePlain codeOne set of brand attributes from the separate readings
EnrichA small modelA written rationale, and the fields a vote cannot produce: brand values, value proposition, target audience, suggestions
CommitPlain codeThe brand record in the database

The aggregate is arithmetic

Six references give six readings, and they do not agree exactly. One page shows a slightly different shade of the brand colour. One reading describes the tone with one word and another with a near synonym. Something has to reconcile them.

Asking a model to merge the readings would add one more step whose output changes from call to call. The aggregate is arithmetic instead.

  • Colours are clustered in HSL space with a distance threshold of 0.15, so near-identical colours from different pages count as one colour.
  • Tags are decided by majority vote across the readings.

The same references give the same palette and tags. A flag switches colours to a second path, in which a model assigns each colour its role. The flag’s default in the code is off.

The shape of the idea, written for this page:

aggregate(readings):
    palette = cluster the colours from all readings
                  two colours are one cluster when their HSL distance <= 0.15
    tags    = for each tag category, the value most readings agree on
    return { palette, tags, ... }       # no model call in this function

A small model then reads the aggregate before it is committed. It writes a rationale and fills the semantic fields: brand values, value proposition, target audience and suggestions. Without an API key, or when the call fails, those fields stay empty and the arithmetic result is saved alone.

One loader

A stored brand is useless if each generator reads it in its own way. There is one function that every generator calls, and it returns a snapshot.

Part of the snapshotUsed for
VoiceHow sentences sound
VisualHow things look
PrinciplesWhat the brand stands for
AudienceWho it speaks to
ProductWhat it sells, when the subject is a product
MarketThe category and its context
ForbiddenWords, claims and styles the brand does not use
Reference directivesDirectives drawn from the references
Prompt blockThe above, rendered as text for a model
Evaluation rubricThe above, rendered as criteria for scoring an output

Three properties of the loader matter more than its fields.

It takes a channel. The caller says whether it is writing a blog article, a card, a video or a detail page, and the block is rendered for that task. The mapping from channel to task is a small table in one place.

Products inherit. A product belongs to a brand. When a product is loaded, the parent brand’s attributes are merged in at read time, so a change to the brand reaches every product without copying.

The snapshot carries a rubric. The same data is rendered a second way, as criteria for judging an output. What a generator is told and what its output can be judged against come from one object.

The brand knowledge pipeline in TRAIL Search is a separate, later system. It has its own extraction method and its own loader.

Who uses it

GeneratorWhere the block goes
ArticlesThe writer node, together with a per-workspace writing memory. In strict mode a separate node also gathers verified brand facts for the article
Card newsThe deck author
Detail pagesThe strategy, narrative and authoring passes
SlidesThe author
BannersThe layout author and the scene composer’s brand assets
Short videoThe script writer
StoryboardsThe generator

The product-photo generator is the exception. It works on the product image with segmentation and image models and does not read the brand.

In the article pipeline the block arrived behind a flag. With the flag on, the writer receives the brand block and the workspace’s writing memory. With it off, the writer falls back to a persona, loaded through the same function.

Adding it without changing anything

The brand layer was added to generators that already existed. The rule for adding it was that a request with no brand must see no change at all.

The loader makes that simple to state. With no brand id it returns an empty block and no snapshot. Each generator’s prompt is built so that an empty block contributes nothing. Tests in the brand package pin the loader’s side of that. For a missing, empty or unresolvable brand id the loader returns exactly an empty string and no snapshot, and the tests assert those exact values. They do not run a generator.

The exact-value assertion is there because a stray newline in a prompt would change a model’s output and be invisible in a functional test.

Failure modes

What happensWhat the system does
Two pages show near-identical coloursThey fall into one cluster
The readings disagree on a tagThe majority value is taken
No brand is selectedThe loader returns an empty block and no snapshot
A product has no attributes of its ownIt inherits its parent brand’s
A generator is added laterIt calls the same loader with its channel

Limits

  • A vote needs voters. With one or two references there is nothing to outvote, and the brand is whatever those pages show.
  • Colour is easier than voice. Clustering colours is well defined. Tone is reduced to tags and a vote, which loses nuance a person would keep.
  • The semantic fields are a model’s reading. Brand values, value proposition and audience are written by a model from the aggregate and are not checked against a rule.
  • The brandless rule is tested at the loader. No test runs a generator with and without a brand and compares the two outputs.
  • Not every generator reads it. Product photos do not.