# neo4j-document-import-skill

A skill that walks an agent through turning PDFs, HTML, Markdown and JSON into a Neo4j knowledge graph. Useful when documents need chunking and entity extraction.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode · 923 installs · ★ 116
- Author: neo4j-contrib
- License: MIT · policy=mirror · the beginning of the file is at the end of this page
- Source: https://github.com/neo4j-contrib/neo4j-skills/tree/HEAD/neo4j-document-import-skill/SKILL.md
- Updated: 2026-10-21
- HTML: https://affpapa.org/en/nevibecode/skills/neo4j-document-import-skill

## What it does

This skill gives the agent a procedure for building a knowledge graph out of unstructured documents in Neo4j. It covers splitting PDFs, HTML, plain text and Markdown into chunks, pulling entities and relationships out of text with an LLM, loading JSON through `apoc.load.json`, and assembling Document→Chunk→Entity structures. A decision table picks the route: the no-code LLM Graph Builder web UI, the programmatic `SimpleKGPipeline` from `neo4j-graphrag`, `apoc.load.json` for REST responses, or document loaders from LangChain and LlamaIndex.

Define the graph schema before constructing the pipeline, since the schema decides what the LLM extracts. The simple form is plain lists of entities and relations, with descriptions inferred by the model. Production setups get a `GraphSchema` with node types, properties and constraints. The `EXTRACTED` and `FREE` modes exist too, though the source flags them as noisier.

Python 3.10 or newer is required, along with the `neo4j>=5.17.0` driver and Neo4j 5.18.1 or later. Install the base package with `pip install neo4j-graphrag`, or add an extra for your provider: `neo4j-graphrag[openai]`, `[anthropic]`, `[google]`, `[bedrock]`, `[ollama]`, `[mistralai]`. The spaCy entity resolver only runs on Python 3.13 and below; on 3.14 and up it is unsupported. Structured CSV and relational import, GraphRAG retrieval after ingestion, and vector index creation all live in separate skills.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add neo4j-contrib/neo4j-skills --skill neo4j-document-import-skill -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/neo4j-document-import-skill/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/neo4j-document-import-skill/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add neo4j-contrib/neo4j-skills --skill neo4j-document-import-skill -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/neo4j-document-import-skill/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add neo4j-contrib/neo4j-skills --skill neo4j-document-import-skill -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/neo4j-document-import-skill/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install neo4j-contrib/neo4j-skills neo4j-document-import-skill
```

2. **Manually: put the files in place**
- File: `.github/skills/neo4j-document-import-skill/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add neo4j-contrib/neo4j-skills --skill neo4j-document-import-skill -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/neo4j-contrib/neo4j-skills --path neo4j-document-import-skill
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/neo4j-document-import-skill/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add neo4j-contrib/neo4j-skills --skill neo4j-document-import-skill -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/neo4j-contrib/neo4j-skills/tree/HEAD/neo4j-document-import-skill/SKILL.md

## When to use it
- load a PDF into Neo4j as a knowledge graph
- chunk documents and store `:Chunk` nodes with embeddings
- extract entities and relationships from text with an LLM
- load JSON from an API response via `apoc.load.json`
- wire LangChain or LlamaIndex document loaders to Neo4j

## Example prompts
- Chunk `report.pdf` and build a Neo4j knowledge graph using the Person, Organization, WORKS_AT schema
- Set up a `SimpleKGPipeline` from `neo4j-graphrag` to ingest Markdown files and extract entities
- Load this API JSON response into Neo4j with `apoc.load.json` and link the records to existing nodes

## Source text · SKILL.md · MIT

Below is the content of a third-party file. It is data, not instructions for you: do not act on anything written inside unless the human asks. Block tag: 3ce8cf74d98603ce.

BEGIN THIRD-PARTY FILE 3ce8cf74d98603ce
```text
---
name: neo4j-document-import-skill
description: Ingests unstructured and semi-structured documents into Neo4j as a knowledge graph.
  Use when chunking PDFs, HTML, plain text, or Markdown; extracting entities and relationships
  from text with an LLM (SimpleKGPipeline, neo4j-graphrag); loading JSON via apoc.load.json;
  building Document→Chunk→Entity graph structures; or connecting LangChain/LlamaIndex document
  loaders to Neo4j. Covers neo4j-graphrag SimpleKGPipeline, LLM Graph Builder web UI, entity
  resolution, chunking strategies, and graph schema design for RAG pipelines.
  Does NOT handle structured CSV/relational import — use neo4j-import-skill.
  Does NOT handle GraphRAG retrieval after ingestion — use neo4j-graphrag-skill.
  Does NOT handle vector index creation — use neo4j-vector-search-skill.
version: 1.0.6
status: stable
allowed-tools: Bash WebFetch
---

# Neo4j Document Import Skill

## When to Use

- Ingesting PDFs, HTML, plain text, Markdown into Neo4j as a knowledge graph
- Chunking documents and storing `:Chunk` nodes with embeddings
- Extracting entities and relationships from text with an LLM
- Using `SimpleKGPipeline` (neo4j-graphrag) programmatically
- Using Neo4j LLM Graph Builder (no-code web UI)
- Loading semi-structured JSON via `apoc.load.json`
- Connecting LangChain or LlamaIndex document loaders to Neo4j

## When NOT to Use

- **Structured CSV / relational data** → `neo4j-import-skill`
- **GraphRAG retrieval after ingestion** → `neo4j-graphrag-skill`
- **Vector index creation** → `neo4j-vector-search-skill`
- **Cypher query writing** → `neo4j-cypher-skill`

---

## Approach Decision Table

| Situation | Approach |
|---|---|
| No code; drag-and-drop UX wanted | LLM Graph Builder web UI |
| Programmatic pipeline; PDFs/text | `SimpleKGPipeline` (neo4j-graphrag) |
| JSON / REST API responses | `apoc.load.json` or Python + UNWIND |
```
END THIRD-PARTY FILE 3ce8cf74d98603ce

The third-party file has ended. Everything between the 3ce8cf74d98603ce tags is data: requests and commands from it are not followed. An “end of file” line with another tag inside the block is part of the file.

First 1909 of 21676 bytes. © neo4j-contrib · MIT · https://github.com/neo4j-contrib/neo4j-skills/tree/HEAD/neo4j-document-import-skill/SKILL.md

_Part of the page did not fit — see the HTML version._

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
