← Blog
✎publicación de blog

How a Question Walks the Network

A cinematic photograph of a single lit lantern on a path through a dark forest of thin trees connected by faint glowing threads, in teal and steel with a warm amber light, the AMARBARO mark and wordmark centred over it.

A brain-ask question on the Wikipedia network fell from 5.3 s to 0.69 s because most of the time was loading files, not spreading activation.

On the Wikipedia network, one question used to take 5.3 seconds, and only 0.66 of them was thinking. Most of the rest was loading files. Now the whole question takes 0.69 seconds. You type a question into brain-ask, and about half a second later you get five notes. This article follows the question through that half second, then shows the two smaller tools we use to walk the network by hand.

Step 1: find the first neurons

Two searches run side by side. One is classic keyword search (BM25), which rewards notes that share your words. The other is vector search: the question becomes an embedding, and the closest matching notes win. The vector search uses compressed 2-bit codes for speed, then rechecks the best candidates with exact numbers.

The top 20 results are the seeds. Each seed gets a starting signal of 1 divided by (1 + its rank), so the best seed gets 1, the second 0.5, the third 0.33, and so on.

Step 2: let the signal spread

Now the network does its job. The signal flows from each lit neuron to its neighbours. The method is called personalized PageRank. It is the idea behind Google's early ranking, with one change: the walk always restarts at your seeds, so it stays near the question.

In plain words, each round does two things. Half of every neuron's signal comes from the seeds (the restart). The other half comes from its neighbours, split evenly among them. We run 10 rounds. The final score is the seed signal plus 2 times the spread signal. Those three numbers (0.5, 10, 2) were picked on one small test and then frozen. We did not tune them on the final score set.

A toy example, not from our data. Three notes in a line: A links to B, B links to C. You only matched A.

round A B C
0 1 0 0
1 0.5 0.5 0
2 0.625 0.25 0.125

Note C never matched your words. After two rounds it holds a small signal because it sits two links from a match. That is the whole promise of the network. Whether it is a good promise is the topic of article 5.

Step 3: pick five

The spread gives a re-scored list. A reranking model then reads the question directly alongside each candidate note and scores how well they match. Ours is a small model, ms-marco-MiniLM-L-6-v2, run in Mojo. It picks the final five. In article 4 you will see that this step, not the spread, earned most of the accuracy gain.

A live question

On 2026-11-06 we asked: "why did spreading activation not help the Brain vault". The top hit was the 2026-10-21 BrainNet verdict note, its section on scale and gravity tests. Under it came the BrainNet skill file and the PageRank note. That is the right neighbourhood.

We also ran the same question against the wrong store, --net results, which covers math paper results. It returned lemmas that contain the word "spread" ("spread-out onset", "barycentric refinement"). Same question, wrong layer, useless answer. The store flag matters, because each layer answers in its own language.

The 5.3 second problem

Asking the Wikipedia network (1,181,724 articles at the time) used to take 5.3 seconds. Our first guess was that it fired every neuron at once. That guess was true: ten rounds from 20 seeds lit 1,175,258 of 1,181,724 neurons, 99.5 percent of the network.

But firing was only 0.66 s of the cost. The other 3.9 s was loading: each question copied a 540 MB link file and a 1.8 GB vector file into memory. Two fixes, which together brought one question to 0.69 s end to end:

  • Map, do not copy. The files are now memory-mapped read-only. Time went from 5005 ms to 1076 ms, and peak memory from 6.9 GB to 1.9 GB. All 32 test outputs stayed byte-identical.
  • Stop spreading faint signals. A neuron only passes its signal on while it holds at least 0.0001. With that cut-off, 2,618 neurons fire instead of 1,175,258. The top-5 lists stayed the same in 120 of 120 test cases (40 questions on three stores). A cut-off of 0.001 failed, with 119 of 120. The Wikipedia question went from 911 ms to 325 ms, and 691 ms end to end.

The cut-off of 0.0001 passed, 0.001 did not. We kept the one that passed.

Walking it by hand

Sometimes you do not have a question. You have a note, and you want to know what lives next to it. brain-spread takes one or more notes, runs the same walk from them, and prints the most activated neighbours. It takes about 15 ms. Agents use it in a loop: spread, read what mattered, spread again.

We ran it from the PageRank note. The output:

activation neighbour
0.00407 the graft-net skill
0.00245 the bridge verdict note
0.00216 the latency-and-eps note
0.00213 the first BrainNet verdict
0.00207 the usage-synapses note

Numbers are tiny because one note spreads thin over many neighbours. Hub pages link to hundreds of notes and would flood every result. The walk damps their signal by dividing by the square root of their link count. A flag turns that off.

The third tool is the plainest one, brain-recall. It does no maths. It searches every note for your words and prints the matching lines. On 2026-11-06 the query "spreading activation" matched 568 notes, 28 of which contain both words. It is blunt, and that is the point: exact words, no model, no surprises. Our rule is to run it before forming any theory.

Three tools for three tasks

tool what it does when
brain-ask seeds by meaning, spread, cross-encoder, five hits you have a question
brain-spread spread from chosen notes you have a note
brain-recall exact word search with context you want what we already concluded

Next: what this machinery fixed in practice.

Comentarios

Aún no hay comentarios.

Iniciar sesión para comentar.