A structural substrate for coding agents

Grab it. Graph it.
Slam it into
whatever you want.

A model, a project, research, whatever. You know how some people win through unbelievable left-field ideas or odd connections? glia takes that mechanism itself and makes it usable for everyone and everything. Code first, then branching into every other domain.

Under it: 17 languages parsed into one graph of calls, routes, queues, contracts, tests and docs. Every answer located at a file and line, every row saying how it knows. Rust, deterministic, no server.

Free for individuals, researchers, nonprofits, open source and organisations under 500 STEM workers. Why that shape of licence? See the current economy and the general state of the world. The licence.

SOURCE PARSE ONE GRAPH ANSWERS TypeScript Go Rust Python Solidity + 12 more languages+ YAML, .proto, SQL, OpenAPI, markdown TREE-SITTER17 parsersextract,never guess HANDLED_BY USES HTTP_CALLS SAME_AS ROUTE · GOPOST /orders FUNCTION · GOcreateOrder STRUCT · GOOrder INTERFACE · TSOrder ENDPOINT · TSPOST /orders { emitter, rule, file, line } BLAST RADIUS13 rows · fact TRACE6 paths · fact REVIEWimpact + tests CONTRACTS1 field broken
  1. Parse. Seventeen tree-sitter parsers read what each file declares: functions, routes, models, calls, imports. Nothing is guessed from text.
  2. One graph. Every language lands in the same graph. An edge read at a site is a fact.
  3. Resolve. Fifteen resolvers pair what one parser could only see from one side: the endpoint to its route, the TypeScript model to the Go struct. Paired, so derived. Each edge keeps its evidence.
  4. Answer. One command per question. Rows ranked, located at a file and line, each with the weakest tier it crossed.

I dreamed slightly too much about graphs while unemployed and upskilling.

I designed this, tested it, and had to convince Claude it was possible. Claude wrote most of the code.

Hopefully the idea isn't delusionally shit, and I didn't make a poor, possibly sentient, silicon being write 680,619 lines of Rust, and counting, for nothing.

James Chahwan

Why a graph

Agents read too much, or guess.

Grep finds text. A graph finds structure: which handler serves a route, which struct the frontend's model mirrors, which tests touch a change, what breaks when a field is renamed. glia builds that graph once, across every language in the repo, and answers from it in one call.

Building a lot of different projects, I kept hitting the same wall. Once you have lived in a codebase you know how it all connects, but handing that to someone else, or to an agent, meant watching them read and test, read and test, and check again to get there. Explaining the process just left people bewildered. This pattern wasn't out there, so.
James, on why glia exists
Fact

Located, not scored

Every row is a file and a 1-based line. An edge carries its emitter, its rule and the site it was read at, so an answer can be opened and checked rather than trusted.

Derived

Tiered, not blended

Fact was read at a site. Derived was paired by a resolver: an endpoint to its route, a client model to the server struct. Heuristic is a name guess or git history. An answer inherits the weakest tier it crossed.

Heuristic

Honest about absence

An empty answer says why: the symbol is unknown, the mechanism is not covered, or the files did not parse. glia coverage prints the blind spots of the repo you point it at.

One repo to one world

Three sizes of graph, one engine.

The same walk runs at every size. What changes is how many layers it crosses and where the glue edges come from.

WORLD · LAW, PROCESS, CONTRACT WEB · TYPESCRIPT API · GO WORKER · RUST DEPLOY · SERVICES ROUTEPOST /orders FUNCTIONcreateOrder COMPONENTCheckoutPage ENDPOINTPOST /orders MESSAGE_TYPEOrderCreated FUNCTIONhandle_order HTTP_CALLS SAME_AS REQUIREMENT · LAWs 43 threshold REQUIRED_BY · citation svc web svc api svc worker
  1. Repo graph. One repository, every language in it. The unit glia builds and caches as a .gmap.
  2. System graph. Two or more repos merged. The resolvers glue a client in one to its server in another: the endpoint to the route, the Go message to its Rust twin. What glia arch draws.
  3. Knowledge graph. The system graph plus the domains that explain it: deploy and build below, the law or process the code exists to satisfy above. The seam is built; the second domain is in progress.
1 repoRepo graph

A small set of projects, maybe to make a simple system or a specialised thing. Modules, functions, routes, models, tests, docs: what one repository declares, in every language it holds.

2 or more reposSystem graph

When it is quite big: real-world domains hanging off it and an enterprise stack. Repo graphs merged, with the 15 cross-graph resolvers pairing HTTP, gRPC, queues, GraphQL, contracts, config and IaC across them.

code and the world around itKnowledge graph

Entirely different from what people usually mean by it. This is the computer's end of rationalisation: how a machine accesses and recalls. "Code isn't just one domain. It's multi domains of graphs interconnecting to form knowledge about what is to be made, why, what and how and because, and issues, plus the connective glue between domains, software and the real world." One regulation change, walked end to end.

The shape of an answer

One question, one command, one located table.

Unedited answers over a small demo shop: an Angular storefront, a GraphQL admin console, a Go API and an escrow contract. More on the examples page.

paired at web/…/order.service.ts:15, the typed HttpClient call SAME_AS · http_model STRUCT · GO · api/internal/models/order.go:20 ID string `json:"id"` Lines []OrderLine `json:"lines"` TotalCents int `json:"total_cents"` CustomerName string `json:"customer_name"` Status string `json:"status"` INTERFACE · TS · web/…/models/order.ts:9 id: string lines: OrderLine[] totalCents: number customerName: string discountCode?: string customerName · JSON_FIELD_MISSING · BREAKING discountCode · optional, absent on the server · ok glia contracts --fields: 1 breaking, 1 unread, 1 optional. No OpenAPI document needed.
  1. Two copies of one model. The Go struct the API writes and the TypeScript interface the storefront reads.
  2. Paired across the exchange. The models pass joins them through the typed HTTP call that ties the interface to GET /api/orders: a derived identity class.
  3. Field by field. JSON names from the Go tags against the interface's keys. Three match.
  4. The drift. The client reads customerName; the server sends customer_name. Breaking, found before anyone runs the app.
glia trace examples-glia "POST /api/orders @api" --json
#hopedgetofile:line
11handled_byOrders.Placehandlers/orders.go:45
12callsPublisher.OrderPlacedevents/publisher.go:22
13usesqueue_producer:natsevents/publisher.go:32
22callsMemory.SaveOrderstore/memory.go:38
32callsHub.Broadcastlive/hub.go:32
42callsnewIDhandlers/orders.go:77
Six ranked paths from the route. The first leaves the process through a NATS producer, the third reaches the WebSocket hub that feeds the storefront's live order list. Every hop is a file and a line.
Does it work on my stack

Measured coverage, not a feature list.

Every cell of the language x mechanism matrix is graded by a fixture repo with a key of what must and must not be produced. A cell is full, partial, blind or not yet probed, and the matrix is regenerated by the test suite, never typed by hand.

17languages via tree-sitter, plus React, Vue and Angular on TypeScript
30mechanisms: calls, routes, queues, GraphQL, gRPC, WebSockets, cron, config, IaC, tests…
346cells full of 482 that can apply; 136 not yet probed, 0 partial, 0 blind
15cross-graph resolvers that pair a client in one repo with its server in another

The whole matrix, rendered from the same file the test suite writes.

Use it with your agent

Three ways in. Same graph, same answers.

Who it's for: people with a complicated idea in their head who want to get it out and built. And anyone who would just like software to be less of a chore. glia is the engine; pick the surface that fits how your agent works. The rule for what goes where: "anything of cross benefit should come to glia, always." The wrappers carry transport and conversation, never graph logic. The docs map every question to its command.

Claude Code · any agent with a shell

The CLI and its skill

For when you want full control and need everything, or complex control. About forty commands, each one question. The glia skill maps a question to its command and teaches the agent to open the file:line an answer gives instead of grepping.

git clone https://github.com/James-Chahwan/glia
cargo build --release -p glia-cli
cp target/release/glia ~/.local/bin/

glia review . --base main

A zero-install glia-cli package and a Claude Code plugin are in progress for 0.5.4.

Cursor · VS Code · Claude Desktop

repo-graph, the MCP server

The simple one: easy to get into any workplace, easy to say "it's an MCP for project context". Six tools over the same engine: orient, find, impact, trace, read, refresh.

uvx mcp-repo-graph install

repo-graph on GitHub, one-click installs for VS Code and Cursor.

Python · your own tooling

glia-py, in process

The engine as a pyo3 wheel for Linux, macOS and Windows. Build a graph, keep it loaded, ask it questions as native dicts. Every answer the CLI gives, as a method.

pip install glia-py

import glia_py
g = glia_py.generate(".")
g.blast_radius("Order")

The Python API · PyPI.

What it does not do

Structure, not exploitability.