Skip to content
System One

jexp/neo4jev

Navigates a Neo4j graph one hop at a time: the outgoing relationships of each node become Choice options and Jev returns a distribution over which to follow, with a Noul question about reaching the goal riding in the same call. Top-k over summed log-probabilities makes it a beam search, drawn in an interactive graph.

jexp/neo4jev on GitHub

Stars
129
Forks
16
Language
Jupyter Notebook
License
MIT
Last push
18 Sep 2026

Read from GitHub on . Counts change daily.

neo4jev walks a Neo4j graph one hop at a time, replacing free-text LLM generation with a single structured API call at each step. At the node it’s currently on, the outgoing relationships become Choice options, described by relationship type, relationship properties, and the label and properties of the node on the other end, and Jev returns a full probability distribution over which one to follow next. A Noul question, has the goal been reached, rides along in the same call, so each hop costs exactly one round trip no matter how many questions are being asked.

Top-k selection over the returned probabilities turns this into a beam search: at each step the walk can branch into several candidate next hops, and the chain with the best summed log-probability becomes the path taken. Results render as an interactive graph showing the path alongside its surrounding neighborhood. The demo targets a public Neo4j sample graph by default, but discovers labels, relationship types and property names live rather than hardcoding them, so it isn’t tied to that one schema.

Without a TypeSafe API key configured, each call is still attempted and its failure shown as-is rather than faked, and the author notes nothing in the demo is ever presented as real TypeSafe output when it isn’t.

How it uses Jev

state = _node_state(node, view, hop_index=hop_index, path=path, schema=settings.schema)
response = await client.system_one(state, questions, model=model or settings.model)

choice_answer = response.choices.get(CHOICE_QUESTION)
probabilities = dict(choice_answer.probabilities) if choice_answer else {}
noul_answer = response.nouls.get(NOUL_QUESTION)

View in src/neo4jev/navigator.py

Open on GitHub

PrimitivesChoiceNoul

More like this

Keep browsing