Skip to content

Conversation

@jankrepl
Copy link
Collaborator

@jankrepl jankrepl commented Oct 10, 2025

What was done

I only implemented graphql for morphology metrics. But actually it will be quite easy to do it for all types of metrics. At this point there are 2 main advantages over the REST endpoint

  • You request whatever subset of the output data you want (by default the huge values lists won't be included)
  • Batch mode (multiple morphologies at the same time)

How to test

  1. Checkout (POC) - GraphQL morpho metrics obi-one#399 locally and make run-local
  2. In backend/.env set NEUROAGENT_TOOLS__OBI_ONE__URL=http://localhost:8100
  3. Ask the question. See below a couple of examples

Can you run graphql morhpmetrics on the id: afa2434f-1ccc-4fff-a047-d399e59768c9

Can you get me some morphologies in the thalamus region (5 of them) and then run morpometrics graql on all of them? but just the aspect ratio and circularity and std and mean of section lengths

What to do next?

  • We don't have to merge. It is an exploratory PR. However, if we happen to like it we can actually support more kind of metrics in OBI and just have "one big endpoint" that does it all (but in a lazy way - never overfeteches/overcomputes - it just gets what the user wants)

TODO

  • Find official ways to force only "subqueries" (querying just a fixed subjson of the schema) - done - added variables to tool input
  • Understand what exactly the datamodel-codegen does and whether it could be helpful - done - prompt engineered id

@jankrepl jankrepl marked this pull request as ready for review October 17, 2025 14:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants