Repository navigation
Add find_circuit_paths (VFBquery#114) - #23
Conversation
Ranked multi-hop pathways between neuron classes or neurons, per connectome, from the class graphs built with each release. Ids only (labels are refused with a pointer to search_terms), numeric options range-checked, 503 reported as unavailable rather than empty. VFBQUERY_CIRCUIT_BASE points it at another circuit server. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Tested against the live service (release 20261115) with
Responses are small, so compact JSON with no paging is fine. ORN_DA1 → MBON01 also shows what connectome-curation#2 costs. In male CNS the top route is ORN_DA1 → DA1_lPN → KCg-m → MBON01 (0.002). FlyWire's DA1 lPNs also carry a female fruitless type, so they are left out, and FlyWire's best route goes via TC-LN → VA1d_adPN at 0.0001. Ready for review. |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Tested against the live 20261115 graphs (
I've also added a line to the tool description, README and LLM_GUIDANCE about neurons outside the class graph. In neuron-level paths they have |
Robbie1977
left a comment
There was a problem hiding this comment.
Code and tests look good (40 pass, builds; id validation, the 503 message and the v3-cached routing all work). Tested against the live 20261115 graphs, one thing needs changing before merge: instance_graph is much slower than the description says.
- LC12 → giant fibre: class paths 1.5 s;
instance_graph=truewith defaults 22.5 s; at the tool's maximums (k=20, instance_k=10) it hadn't finished after 90 s, past the handler's 60 s timeout. - The server keeps computing after the client gives up: that request was still using a full CPU on one
vfbquery-circuitpod afterwards. With two workers per pod, a few such calls can tie up the whole service.
Could you:
- Change the description to say
instance_graphcan take tens of seconds on the large connectomes, and to use it only when the user asks about individual neurons. - Cap
kat 5 andinstance_kat 3 wheninstance_graphis true, until the server has a time limit.
On the server side (VFBquery#114) we need a time budget per search, or cancellation when the client disconnects. I'll raise that separately.
|
Thanks. Both done in cfa4a78:
Agreed on a per-search time budget or cancellation on disconnect for VFBquery#114. |
instance_graph takes tens of seconds on the large connectomes, and the server keeps working after the client times out. Say so in the description and guidance, and refuse k > 5 or instance_k > 3 with it until the server has a time limit (review on #23). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Adds
find_circuit_paths, which calls VFBquery's/circuit_paths(VirtualFlyBrain/VFBquery#114, VirtualFlyBrain/VFBquery#147). It returns the strongest multi-hop pathways from one neuron class (or neuron) to another, searched separately in each connectome from the class graphs built with each release.Changes
src/circuitPaths.tsbuilds the request. Unit tests are intests/circuitPaths.test.js(7 tests).search_terms, because the endpoint reports a label as "not found in any searched dataset", which reads like "no connection".k(max 20),min_synapses,min_inprop(0–1),normalise(input/output) andinstance_k(max 10) are checked against the endpoint's limits.exclude_dbsis left out, the endpoint's default (hb,fafb) applies.[]searches every dataset.src/index.ts:query_connectivitywithgroup_by_class.VFBQUERY_CIRCUIT_BASEpoints the tool at another circuit server, e.g. a local one or p3.Testing
npm test: 40 pass.instance_graph(Kenyon cell → MBON01);exclude_dbsname passed back as the endpoint's error;Before merging
🤖 Generated with Claude Code