> ## Documentation Index
> Fetch the complete documentation index at: https://docs.graphify.com/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> The PyPI package is graphifyy, with two y's. The command is graphify.
> /graphify . is typed in an assistant chat, not in a shell.
> Use only commands, flags, and endpoints shown on these pages. Do not invent one.
> Choose the surface before you open a page. Local (Graphify Local) is the graphifyy package on the machine: the skill, the CLI, and the ten-tool MCP. Its pages are the Open Source tab (/open-source/) and the Graphify Local tab on each Integrations page. Graphify is the hosted workspace and https://api.graphify.com/mcp (Streamable HTTP, OAuth, no API key). Its pages are the Graphify tab (/platform/, /concepts/) and the Graphify (hosted) tab on each Integrations page. Prefer Graphify unless the user asks for a local or offline setup. Cookbooks (/cookbooks/) and /mcp/docs-search apply to both. Each page's source frontmatter records this as surface: local, cloud, or both. Buildkite is the CI integration.
> In llms.txt, tell the surface from the page path. Graphify: /platform/ and /concepts/. Local: /open-source/. Most /integrations/ pages cover both, with a Graphify (hosted) tab and a Graphify Local tab. Everything else applies to both.
> graphifyy release notes are published at https://github.com/Graphify-Labs/graphify/releases and https://graphify.com/changelog. The current package version is on PyPI (https://pypi.org/project/graphifyy/).
> The official site is https://graphify.com. These docs are https://docs.graphify.com.
> The local MCP server is the ten tools in the MCP tool reference and reads a graph on the machine. The hosted server is https://api.graphify.com/mcp (Streamable HTTP, OAuth, no API key). The JetBrains, ChatGPT, Codex, and Dots, and Vercel pages use the hosted server, not the ten-tool list. On pages with tabs, the Graphify (hosted) tab uses the hosted server and the Graphify Local tab uses the local skill or the ten-tool server.
> Read https://docs.graphify.com/llms.txt, then open one page's .md link. Use https://docs.graphify.com/llms-full.txt only when one page is not enough.

# Load your code knowledge graph into Neo4j

> Export your Graphify code graph to Neo4j as a Cypher script or push it straight to a database, then query callers and dependencies in Cypher.

Graphify stores its graph as `graph.json`, but you can load it into [Neo4j](https://neo4j.com) to query it in Cypher, join it with other data, or view it in Neo4j Browser and Bloom. You can write a Cypher script and import it, or push the graph straight to a running database.

## What you'll build

* A `cypher.txt` import script for your graph.
* The graph loaded into Neo4j, with indexes on node ids.
* Cypher queries for callers, hubs and dependencies.

## Setup

```bash theme={"theme":{"light":"github-light-default","dark":"github-dark-default"}}
uv tool install "graphifyy[neo4j]"
cd your-repo
graphify extract . --code-only
```

The `neo4j` extra adds the Python driver used by `--push`. The script export doesn't need it. You need a Neo4j 5 database, local or hosted.

## Step 1: Write a Cypher script

```bash theme={"theme":{"light":"github-light-default","dark":"github-dark-default"}}
graphify export neo4j
```

This writes `graphify-out/cypher.txt`. Nodes come first, labeled by type, then relationships:

```text theme={"theme":{"light":"github-light-default","dark":"github-dark-default"}}
// Neo4j Cypher import - generated by /graphify
MERGE (n:Code {id: 'tests_fixtures_typescript_advanced_userservice', label: 'UserService'});
MATCH (a {id: '...'}), (b {id: 'injectable'}) MERGE (a)-[:REFERENCES {confidence: 'EXTRACTED'}]->(b);
```

For the open-source [Graphify-Labs/graphify](https://github.com/Graphify-Labs/graphify) repository the script has about 64,000 statements. Node labels include `Code`, `Rationale` and `Concept`. Relationship types are the graph's relations in upper case, such as `CALLS`, `CONTAINS`, `IMPORTS` and `REFERENCES`, and each carries its `confidence`.

## Step 2: Import the script

```bash theme={"theme":{"light":"github-light-default","dark":"github-dark-default"}}
cypher-shell -u neo4j -p "$NEO4J_PASSWORD" < graphify-out/cypher.txt
```

Relationship statements match nodes by `id`. On a large graph, create an index for each node label first so the import doesn't scan every node:

```cypher theme={"theme":{"light":"github-light-default","dark":"github-dark-default"}}
CREATE INDEX IF NOT EXISTS FOR (n:Code) ON (n.id);
CREATE INDEX IF NOT EXISTS FOR (n:Rationale) ON (n.id);
CREATE INDEX IF NOT EXISTS FOR (n:Concept) ON (n.id);
```

## Step 3: Or push directly

```bash theme={"theme":{"light":"github-light-default","dark":"github-dark-default"}}
export NEO4J_PASSWORD="$(your-secret-tool get neo4j)"
graphify export neo4j --push bolt://localhost:7687 --user neo4j
```

`--push` creates an index on `id` for each node label, then upserts nodes and relationships with `MERGE`, so you can push again after a rebuild without duplicates. Pushed nodes carry every scalar property from the graph, including `source_file`, `source_location` and `community`. The script from Step 1 only sets `id` and `label`, so use `--push` when you want file and line in your query results. Set the password in `NEO4J_PASSWORD` rather than `--password`, so it stays out of your shell history and process list.

## Step 4: Query in Cypher

The most connected functions:

```cypher theme={"theme":{"light":"github-light-default","dark":"github-dark-default"}}
MATCH (n:Code)-[r]-()
RETURN n.label AS node, count(r) AS degree
ORDER BY degree DESC LIMIT 10;
```

Everything that calls a function:

```cypher theme={"theme":{"light":"github-light-default","dark":"github-dark-default"}}
MATCH (caller)-[:CALLS]->(f:Code {label: '_rebuild_code()'})
RETURN caller.label, caller.source_file, caller.source_location;
```

Callers up to three hops away:

```cypher theme={"theme":{"light":"github-light-default","dark":"github-dark-default"}}
MATCH p = (caller)-[:CALLS*1..3]->(f:Code {label: '_rebuild_code()'})
RETURN DISTINCT caller.label LIMIT 50;
```

## When it goes wrong

**`neo4j driver not installed`.** Install the extra: `uv tool install "graphifyy[neo4j]"`.

**The import is very slow.** Create the indexes in Step 2 before running the script, or use `--push`, which creates them for you.

**Labels have odd names.** Graphify strips characters Neo4j can't use in a label, falling back to `Entity`. Relationship names are upper-cased, with spaces and dashes turned into underscores.

## Production patterns

* Rebuild and push from CI on the default branch, so the database matches what shipped.
* Use [FalkorDB](https://www.falkordb.com) the same way with `graphify export falkordb` and `--push`.
* For other tools, `graphify export graphml` writes GraphML for Gephi and similar.
* In Graphify, the hosted product, you query the graph from your agent over MCP with no database to run.

## Complete example

```bash theme={"theme":{"light":"github-light-default","dark":"github-dark-default"}}
uv tool install "graphifyy[neo4j]"
cd your-repo
graphify extract . --code-only
export NEO4J_PASSWORD="$(your-secret-tool get neo4j)"
graphify export neo4j --push bolt://localhost:7687 --user neo4j
cypher-shell -u neo4j -p "$NEO4J_PASSWORD" \
  "MATCH (n:Code)-[r]-() RETURN n.label, count(r) AS d ORDER BY d DESC LIMIT 10;"
```

## What you built

Your code graph lives in Neo4j, indexed and queryable in Cypher, and you can refresh it after every rebuild.

## Next steps

> **[Exports](https://docs.graphify.com/guides/exports.md)**
>
> Every export format: wiki, HTML, GraphML, Neo4j and more.

> **[Postgres schema graph](https://docs.graphify.com/cookbooks/postgres-schema-graph.md)**
>
> Add your database schema before you export.

> **[Try it in Graphify](https://docs.graphify.com/platform/quickstart.md)**
>
> We build and host the graph for you. Start with a 14-day Pro trial, then keep up to 3 repositories on Free. No card required.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.