HOW AI WORKS - FRAME BOOK
VOL. 01·SEP 2026

SEARCH BY MEANING, THEN ANSWER.

A QUESTION IS TURNED INTO A VECTOR. THE CLOSEST PASSAGES FROM YOUR OWN DOCUMENTS ARE RETRIEVED AND GIVEN TO THE MODEL AS CONTEXT.

What is a black hole?
PROMPT
QWhat is a black hole?
[1]black-holes.md §1
[2]black-holes.md §2
[3]eht-2019.md
A black hole is a regionof spacetime where… [1]
black holesstarstelescopeseventstickets & shop[1][2][3]#4qqk = 3

01 EMBED02 SEARCH03 RETRIEVE04 GENERATE

01 EMBED02 SEARCH03 RETRIEVE04 GENERATE

NEAR IN ANGLE, NEAR IN MEANING.

COSINE SIMILARITY MEASURES THE ANGLE BETWEEN TWO VECTORS. THE SEARCH OPENS A CONE AROUND THE QUESTION UNTIL IT HOLDS K PASSAGES.

R=top⁡k(cos⁡(q, ei))R = \operatorname{top}_{k}\big(\cos(q,\ e_i)\big)

k = 3

01DOCUMENTS

INDEX TIME
black-holes.mdstars.mdeht-2019.mdshop-news.md
D={ d1, d2, d3, d4 }D = \{\, d_1,\ d_2,\ d_3,\ d_4 \,\}

YOUR OWN FILES, PAGES AND NOTES.

02CHUNKS

INDEX TIME
black-holes.mdc1c2overlap
chunk_size = 300 tokens
overlap = 50 tokens

SPLIT INTO SMALL, OVERLAPPING PASSAGES.

03EMBEDDINGS

INDEX TIME
c1c2c3c4c5c6
ei=femb(ci)∈R768e_i = f_{\text{emb}}(c_i) \in \mathbb{R}^{768}

EACH CHUNK BECOMES ONE VECTOR.

04VECTOR INDEX

INDEX TIME
c1c2c3c4c5c6
I={ (ei, ci) }i=1N\mathcal{I} = \{\, (e_i,\ c_i) \,\}_{i=1}^{N}
N = 6 here · millions in practice

STORED FOR FAST NEIGHBOUR SEARCH.

05QUERY

QUERY TIME
What is a black hole?qq
q=femb(x)∈R768q = f_{\text{emb}}(x) \in \mathbb{R}^{768}

SAME MODEL, SAME SPACE AS THE CHUNKS.

06TOP-K SEARCH

QUERY TIME
c1c2c3c4c6c5qq
[1]c10.89[2]c20.81[3]c30.74#4c40.71c60.32c50.21
si=cos⁡(q, ei)=q⋅ei∥q∥ ∥ei∥s_i = \cos(q,\ e_i) = \dfrac{q \cdot e_i}{\lVert q \rVert\,\lVert e_i \rVert}
k = 3

THE K SMALLEST ANGLES WIN.

07AUGMENTED PROMPT

QUERY TIME
SYSTEMAnswer only from the sources.
Cite them like [1]. If they
don't say, reply "I don't know".
[1]A black hole is a region of
spacetime where gravity is so…
[2]Its boundary is the event
horizon: once inside, nothing…
[3]In 2019 the Event Horizon
Telescope published the first…
USERWhat is a black hole?
prompt=rules⊕c[1]⊕c[2]⊕c[3]⊕x\text{prompt} = \text{rules} \oplus c_{[1]} \oplus c_{[2]} \oplus c_{[3]} \oplus x

RETRIEVED PASSAGES ARE PASTED INTO THE PROMPT.

08GROUNDED ANSWER

QUERY TIME

A black hole is a region of spacetimewhere gravity is so strong that nothing,not even light, can escape [1]. Its edgeis the event horizon [2]. The first imageof one was published in 2019 [3].

  • [1] black-holes.md §1
  • [2] black-holes.md §2
  • [3] eht-2019.md
y∼pθ(y∣x, c[1], c[2], c[3])y \sim p_\theta\big(y \mid x,\ c_{[1]},\ c_{[2]},\ c_{[3]}\big)

THE ANSWER CITES WHAT IT USED.

07AUGMENTED PROMPT

QUERY TIME
SYSTEMAnswer only from the sources.
Cite them like [1]. If they
don't say, reply "I don't know".
[1]A black hole is a region of
spacetime where gravity is so…
[2]Its boundary is the event
horizon: once inside, nothing…
[3]In 2019 the Event Horizon
Telescope published the first…
USERWhat is a black hole?
prompt=rules⊕c[1]⊕c[2]⊕c[3]⊕x\text{prompt} = \text{rules} \oplus c_{[1]} \oplus c_{[2]} \oplus c_{[3]} \oplus x

RETRIEVED PASSAGES ARE PASTED INTO THE PROMPT.

08GROUNDED ANSWER

QUERY TIME

A black hole is a region of spacetimewhere gravity is so strong that nothing,not even light, can escape [1]. Its edgeis the event horizon [2]. The first imageof one was published in 2019 [3].

  • [1] black-holes.md §1
  • [2] black-holes.md §2
  • [3] eht-2019.md
y∼pθ(y∣x, c[1], c[2], c[3])y \sim p_\theta\big(y \mid x,\ c_{[1]},\ c_{[2]},\ c_{[3]}\big)

THE ANSWER CITES WHAT IT USED.

Retrieval- Augmented Generation

Search by Meaning

A MODEL ONLY KNOWS WHAT IT WAS TRAINED ON. RETRIEVAL LETS IT READ FRESH OR PRIVATE DOCUMENTS AT ANSWER TIME — UPDATE THE INDEX, NOT THE WEIGHTS.

Q[1][2][3]
PROMPT(context)VECTOR INDEX(search)DOCUMENTS(chunks)query ↓\downarrowpassages ↑\uparrow

Three stacked plates: the documents cut into chunks at the bottom, the vector index in the middle, the prompt on top. A dotted line carries the question down into the index; three cyan lines carry the three retrieved passages up into the prompt as its context [1], [2], [3].

CHUNK

D→{ c1, …, cN }D \rightarrow \{\, c_1,\ \dots,\ c_N \,\}

EMBED

ei=femb(ci)∈Rde_i = f_{\text{emb}}(c_i) \in \mathbb{R}^{d}

d = 768 (e.g.)

SCORE

si=cos⁡(q, ei)=q⋅ei∥q∥ ∥ei∥s_i = \cos(q,\ e_i) = \dfrac{q \cdot e_i}{\lVert q \rVert\,\lVert e_i \rVert}

RETRIEVE

R=top⁡k(si),k=3R = \operatorname{top}_{k}(s_i), \quad k = 3

GENERATE

y∼pθ(y∣x, R)y \sim p_\theta(y \mid x,\ R)

WHEN IT FAILS

  • Bad chunks — the answer is cut in half or buried in noise.
  • Missed retrieval — the right passage ranks below k.
  • Stale index — the files changed, the vectors did not.