graphlore

v0.7.0
io.github.yasinyaman/graphlore Checked 5 days ago Published 13 days ago

Navigate a codebase through a code graph it builds itself: semantic locate, impact, source spans.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

graphlore_project

Show which project this server reads, or switch it to another directory. Every tool works on ONE project, the directory holding graphify-out/graph.json; it starts as GRAPHLORE_PROJECT_DIR. Pass ``path`` to point the server at another repository (for example one just built with graphlore_build) until the next switch or a restart; no file is changed. The reply also names the server version: a schema that lacks a parameter this version documents means the client loaded it before an update. Refused while GRAPHLORE_RESTRICT_PATHS is on (always over HTTP). The opt-in watcher keeps syncing only the…

ParameterTypeDescription
as_jsonbooleanTrue -> the reply is one JSON object (the same payload the result's structuredContent carries); False -> readable text.
pathstringDirectory to switch to, absolute or relative to the current project. Empty -> only report the active project.

graphlore_build

Build or update the knowledge graph of a folder (writes graphify-out/). The graph is written INSIDE the folder read: building another folder than the active project leaves it where this server does not look, and the reply names the graphlore_project call that switches to it. The reply is the build's counts and warnings. GRAPHLORE_ENGINE picks the extractor: ``auto`` (default) uses graphlore's native engine when installed (14 languages, all local) and the deprecated graphify CLI otherwise. A graph.html view is written beside graph.json unless ``no_viz``.

ParameterTypeDescription
cluster_onlybooleanTrue -> detect communities again, without re-reading files.
code_onlybooleanTrue -> code only, no document extraction (no LLM key needed; forced under GRAPHLORE_OFFLINE).
modestring"deep" -> more INFERRED edges (graphify only, deprecated).
no_vizbooleanTrue -> do not write graph.html.
pathstringFolder to read, relative to the project or absolute.
updatebooleanTrue -> re-read only the files changed since the last build.
verbosebooleanTrue -> the full build log instead of counts and warnings.

graphlore_overview

One-shot orientation: call this FIRST. Returns graph size, top god nodes, community count, surprise-edge count and suggested starting questions — enough to plan further exploration cheaply.

ParameterTypeDescription
as_jsonbooleanTrue -> the reply is one JSON object (the same payload the result's structuredContent carries); False -> readable text.
top_nintegerHow many god nodes and communities to list.

graphlore_communities

Summarize Leiden communities: size, name and their most connected members. A community carries a ``name`` when it has one: set with graphlore_set_labels / graphlore_label_communities (``graphify-out/.graphify_labels.json``), else the one graphify wrote on the nodes.

ParameterTypeDescription
as_jsonbooleanTrue -> the reply is one JSON object (the same payload the result's structuredContent carries); False -> readable text.
limitintegerCommunities listed, largest first. ``total`` is how many there are.
membersintegerMember labels shown per community, most connected first; ``size`` is the full count and ``members_left_out`` the rest.

graphlore_neighbors

List the direct (1-hop) neighbors of a node, with relations. Production code is listed before tests, most connected first. Includes the calls and imports graphlore resolves from the source (a call through an imported module, ``mod.func()``), which graph.json alone does not carry. A hub has more neighbors than fit a reply: past ``limit`` the result says how many there are (``total``) and how they split by relation (``counts``).

ParameterTypeDescription
node *stringThe node (id, label or bare name). When several nodes match, the result says which one was used and lists the others with their ids.
as_jsonbooleanTrue -> the reply is one JSON object (the same payload the result's structuredContent carries); False -> readable text.
limitintegerCap on listed neighbors.
scopestringWhich neighbors to list — path prefixes / globs, ``!pattern``, ``-tests``, ``-external``, ``-vendored``. Empty leaves nothing out.

graphlore_subgraph

Extract a BFS subgraph around a node, capped at a token budget. This is the token-cheap way to hand the model just the relevant slice of a large codebase instead of the whole graph. Each node's neighbors are walked production code first, most connected first, so a hub function's budget goes to its real callers before its tests; when the budget cuts the walk short the result says how many direct neighbors were left out and how many were tests.

ParameterTypeDescription
node *stringCenter node (id, label or bare name). When several nodes match, the result says which one was used and lists the others with their ids.
as_jsonbooleanTrue -> the reply is one JSON object (the same payload the result's structuredContent carries); False -> readable text.
budget_tokensintegerApproximate cap on returned size; expansion stops when hit. ``approx_tokens`` is a conservative estimate (~3.5 chars/token, ±~20%); set ``GRAPHLORE_TOKENIZER=tiktoken`` (with the ``[tiktoken]`` extra…
hopsintegerBFS depth from the center.
scopestringWhich part of the graph to walk — path prefixes / globs, ``!pattern``, ``-tests``, ``-external``, ``-vendored``. Empty leaves nothing out.

graphlore_impact

Blast radius: what is affected if ``node`` changes (or what it depends on). direction="dependents" (default) walks what references the node, "dependencies" what it references, "both" either way by nearest hop. Rows are ordered by hop distance, production code before tests, under a token budget; each carries its edge's ``relation``, ``confidence`` (INFERRED edges are included; ``strict=True`` walks only extracted ones) and one recorded ``site``. ``truncated`` / ``dropped`` / ``beyond_hops`` say what was left out. Docstring nodes are not dependents; shared state (``reads`` / ``writes``) is foll…

ParameterTypeDescription
node *stringThe node: an id, a label or a bare name (fuzzy match, reported).
as_jsonbooleanTrue -> the reply is one JSON object (the same payload the result's structuredContent carries); False -> readable text.
budget_tokensintegerApproximate cap on the reply; rows past it are counted.
directionstring"dependents" | "dependencies" | "both".
hopsintegerHow many dependency hops to walk out.
relationsstringEdges that may be walked: "all", presets "code" / "calls" / "imports" / "types" / "state" / "http", or relation names ("calls,inherits"); a class's members stay reachable.
scopestringPart of the graph to walk: path prefixes / globs, "!pattern", "-tests", "-external", "-vendored". Empty leaves nothing out.
shared_statebooleanTrue -> also walk writer -> what it writes -> its readers.
strictbooleanTrue -> walk only EXTRACTED edges (proof, not leads).

graphlore_locate

Code search -> graph structure in one call: find code by what it does. Maps the best hit for ``query`` to its graph node and returns the token-budgeted subgraph around it, plus ``semantic_cousins``: similar code elsewhere, the ones with ``linked: false`` first (similar but not connected: duplication or hidden coupling). ``calls_into`` lists what the seed calls in other files, ``also_matched`` the other top hits by definition. ``backend`` says which search answered: semble, else the built-in index (BM25; the [embed] extra adds embeddings for questions in other words than the code's). The first…

ParameterTypeDescription
query *stringA natural-language question or code phrase ("where are redirects followed").
as_jsonbooleanTrue -> the reply is one JSON object (the same payload the result's structuredContent carries); False -> readable text.
budget_tokensintegerApproximate cap on the subgraph part of the reply.
hopsintegerGraph hops of the subgraph around the top hit.
related_kintegerSemantic cousins to list.
top_kintegerSearch hits to read.

graphlore_node_details

Show a node's full metadata: type, source file/line, docstring, community. On a native graph, ``state`` says what the node reads and writes (variables, fields, constants, resources) and ``shared_with`` the other definitions that touch the same state, each with how: the code this one affects, or is affected by, without a call between them. For a variable or field it lists its readers and writers instead.

ParameterTypeDescription
node *stringThe node: an id, a label or a bare name.
as_jsonbooleanTrue -> the reply is one JSON object (the same payload the result's structuredContent carries); False -> readable text.

graphlore_fetch

Hydrate graph nodes into their real source code, under one token budget. The code half of graphlore_locate / graphlore_subgraph: for each node, the lines of the definition that holds it (± ``context_lines``). One budget is shared: nodes past it are named in ``not_fetched`` with ``truncated`` set (the first is always returned); a definition longer than 8,000 tokens is cut at a line and says so (``cut``). Names resolve like everywhere else (``matched``; a miss goes to ``not_found`` with ``did_you_mean``). ``file_changed_since_build`` and ``span_mismatch`` warn when the file moved on since the…

ParameterTypeDescription
nodes *arrayNode names, labels or ids (e.g. ["Client._send_single_request"]).
as_jsonbooleanTrue -> the reply is one JSON object (the same payload the result's structuredContent carries); False -> readable text.
budget_tokensintegerApproximate shared cap on the code returned.
context_linesintegerExtra lines above and below each definition.

graphlore_freshness

Check whether graph.json is stale relative to the current git HEAD. Prefers the commit graphify recorded the graph was built from (``built_at_commit``) over the file mtime — robust across checkouts where mtime is reset — and flags both modified and newly-added (untracked) files. Returns a ``recommended_action`` (fresh / update / rebuild) with a ``reason``: deletions, renames, or a large change set call for a full rebuild, since incremental update can't drop nodes for code that no longer exists. If ``built_at_commit`` is recorded but unreachable in this clone (shallow clone, gc, rebase or…

ParameterTypeDescription
as_jsonbooleanTrue -> the reply is one JSON object (the same payload the result's structuredContent carries); False -> readable text.