Stage 1 · engines/knowledge_style

Answers in their own words

An answer is written by an LLM (Anthropic's Claude) that searches everything the creator has said in their videos and may only claim what it found there. This stage builds what it searches, and a short note on how the creator talks.

How an answer is made

the question one LLM conversation reads: the rules, the persona note searchwords → numbered passages readfull text of a passage several rounds; each says which words found nothing, so the next search can try other words their archive data/answers/<creator>/ Dr K: 292 passages, 17 videos each ~300 words, with its video and timestamp searched by word overlap: the same words always give the same passages the answer every sentence names its passage [12] a claim with no passage is not allowed; the markers are removed before you see it sent on to the voicewhole sentences, up toabout 75 s, are spoken
Typically 20-80 seconds per question, most of it the LLM thinking. The settings (how many passages, which instructions) are the creator's promoted setup; see below.

What this stage builds

YouTube subtitlesevery word, timed build.pycut into ~300-wordoverlapping passages mapindex.pyan LLM writes a topicmap of each video the archivepassages + topic map the persona note: picked by a person18 passages of their own speech that show how they talkdata/answers/<creator>/creator.md

Commands

./alive build <creator> --stage answers runs both scripts. By hand, from engines/knowledge_style/proto, with any Python that has anthropic:

python3 build.py --takes ../../../data/takes/<folder> --subject <creator>   # seconds, no LLM
python3 mapindex.py --subject <creator>                                   # minutes, one LLM call per video
make status                                                              # per creator: videos, passages, ready?

<creator> here is the answer engine's name for them, set in creators/<id>/build.json under answers: Dr K's is healthygamer, Huberman's is huberman. The LLM key is read from data/answers/.protokey (or ANTHROPIC_API_KEY).

The persona note (a person picks it)

The note is most of what makes an answer sound like them: the search finds what they said, the note sets how they say it. No script writes it. It takes about twenty minutes.

  1. Copy engines/knowledge_style/proto/harness/creators/_template/creator.md to data/answers/<creator>/creator.md. The rules at the top stay as they are.
  2. Pick 18 passages of about 90 seconds each from their transcripts: across as many videos and topics as possible, where they explain something in their normal voice. Never an ad, a sponsor read, an intro or an outro. Leave transcription errors in.
  3. Write each under How you talk as [<take folder> HH:MM:SS-HH:MM:SS], then the words.
  4. Fill in Your archive with the counts make status prints.
  5. Record the pick in creators/<id>/build/answers/persona_passages.txt (sources only, no text).
  6. Later, once the live app runs (the last step of a build), ask three questions and read the answers aloud. If an answer calls the creator "he", or sounds like a summary of them instead of them, the passages are too formal or too few.
Why not a separate style model?An earlier design had the LLM write plain content and a small local model (inmystyle) rewrite it in the creator's style. A blind judge picked out the real speaker every time, and the rewrite reversed a fact in about one answer in five. One LLM reading the persona note does better, and every claim stays tied to a real passage.

The promoted setup (optional)

How many passages to fetch and which instructions to use is the creator's promoted setup, in engines/knowledge_style/proto/harness/profiles/<creator>.json (harness is the answer loop's code). A new creator without one runs on Dr K's, which works well. Tuning one is a measure-change-measure loop over 100 test questions, written up in engines/knowledge_style/proto/RECIPE.md; it needs a set of test questions and checked answers (written by a separate recipe, question-corpus, in proto/recipes/), costs hours of LLM calls, and is not needed to start.

Things that go wrong

you seewhy, and the fix
answers talk about the creator as "he"the persona note is missing, too short, or too formal. Re-pick the passages
an answer drifts into general advicethe archive does not cover the question; the rules make it say so. Add videos on that topic and rebuild
no persona note at ...step above: the note lives in data/answers/<creator>/, not in git
401 or "no key"put the key in data/answers/.protokey
a different creator's numbers look wrongscoring one creator against another's checked answers; every script takes --creator, never assume a default