> For the complete documentation index, see [llms.txt](https://docs.wormbrain.info/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.wormbrain.info/explore-wormbrain/04-lab/the-model.md).

# the model

<figure><img src="https://1059824729-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FJhKk8fm2HPrujdtw7SP3%2Fuploads%2FyIZsrUDpEx2w4DddDh24%2Fc302.png?alt=media&amp;token=e986a742-9a7f-447c-a7cc-df2983fbb8d1" alt=""><figcaption></figcaption></figure>

The published connectome is a phone book. WormBrain turns that phone book into a living network: each named cell, the chemical contacts, the gap junctions, then a clock that steps them forward.

## What it builds

<figure><img src="https://1059824729-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FJhKk8fm2HPrujdtw7SP3%2Fuploads%2FALmiyionOVqUsMbzKcCk%2FMyNetwork.png?alt=media&amp;token=a3444432-604b-4924-859e-7e012c95b745" alt=""><figcaption></figcaption></figure>

From the pinned hermaphrodite table we generate a network file the simulator can run. You can ask it for two cells, the pharynx, or the whole animal.

<figure><img src="https://1059824729-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FJhKk8fm2HPrujdtw7SP3%2Fuploads%2FVxgxSMrKA1ozSo5eM5YK%2FSomeCells.png?alt=media&amp;token=44414022-5b6b-4007-9048-f0899f0e59e4" alt=""><figcaption></figcaption></figure>

## Levels of detail

The same wiring can be run sloppy or fussy. We keep four parameter sets on the shelf.

| Set | What the cells are                                     | What it is good for                             |
| --- | ------------------------------------------------------ | ----------------------------------------------- |
| A   | Simple integrate-and-fire points with current inputs   | Fast sanity checks                              |
| B   | Still simple cells, often on the pharynx               | Watching a small circuit without the whole body |
| C   | Full network at the scale we use for the live observer | The persistent worm on FOMO                     |
| D   | Multicompartment cells, run in NEURON                  | When we want the 3D body, not just the graph    |

<figure><img src="https://1059824729-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FJhKk8fm2HPrujdtw7SP3%2Fuploads%2FV00XdT9dHEi5P2cYJ3ha%2Fc302_D_Full.png?alt=media&amp;token=1abdca8b-603a-42e0-a7f3-66bae43b55f3" alt=""><figcaption></figcaption></figure>

Live WormBrain sits on **set C**. Set D is how we inspect the animal as a 3D network when we need to see muscle and nerve together.

<figure><img src="https://1059824729-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FJhKk8fm2HPrujdtw7SP3%2Fuploads%2F5h6uuwno8AUXbuf0b7Ab%2Fc302_B_Pharyngeal.png?alt=media&amp;token=2cf82f87-7cfc-46c9-98a6-de82f448150f" alt=""><figcaption></figcaption></figure>

## How a step happens

1. Read the pinned connectivity tables.
2. Build a NeuroML network (who exists, who talks, how hard).
3. Write a LEMS file that says how long to run and what to record.
4. Step it in jNeuroML / pyNeuroML, or hand set D to NEURON.
5. The observer writes market currents onto sensory cells and reads AVA / AVB.

<figure><img src="https://1059824729-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FJhKk8fm2HPrujdtw7SP3%2Fuploads%2Fu1y4GTHtFnTAZsrRPKd1%2FNeuron.png?alt=media&amp;token=52998fbd-f418-497f-97c2-415a530c1afa" alt=""><figcaption></figcaption></figure>

## Twiddling a cell

<figure><img src="https://1059824729-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FJhKk8fm2HPrujdtw7SP3%2Fuploads%2FN3pQmjxeK0nfnOI6x3pb%2FchangePre.png?alt=media&amp;token=87068944-ff9f-4774-a38a-ec5f085057f3" alt=""><figcaption></figcaption></figure>

Training does not redraw edges. It changes how loudly a cell listens. The generator already lets us override a single parameter and watch the voltage move.

A current can also be a shape, not a flat shove. A sine written onto a named cell is how we test whether the body still answers.

<figure><img src="https://1059824729-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FJhKk8fm2HPrujdtw7SP3%2Fuploads%2FnndBY4HzbLGkANLNbU55%2FchangePost.png?alt=media&amp;token=24c51550-f64d-4871-b25a-1af8bb758e55" alt=""><figcaption></figcaption></figure>

## ![](https://1059824729-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FJhKk8fm2HPrujdtw7SP3%2Fuploads%2FGNvhD8MfghwP3hl3mv5S%2Fsine.png?alt=media\&token=17754119-0f44-430a-ba1b-9e4b88403b7b)

## What the live worm uses

| Piece         | Live setting                                     |
| ------------- | ------------------------------------------------ |
| Wiring        | Pinned hermaphrodite table (Cook 2019 line)      |
| Parameter set | C                                                |
| Clock         | One persistent state, not a fresh worm per token |
| Inputs        | Capped sensory currents from the book            |
| Outputs       | Command-cell voltages into the decoder           |

The pretty 3D pictures above are inspections. The FOMO wallet only sees what set C plus the cage let out. See [What's running](/explore-wormbrain/04-lab/whats-running.md) for the rest of the stack.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.wormbrain.info/explore-wormbrain/04-lab/the-model.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
