---
title: "Build Knowledge Graphs with txt2kg"
publisher: "nvidia"
type: "playbook"
updated: "2026-08-06T18:38:26.214Z"
description: "Extract triples with Ollama or vLLM, store them in a graph database, and explore them in a GPU-accelerated web UI"
canonical: "https://build.nvidia.com/playbooks/txt2kg.md"
---

# Basic idea

Transform unstructured text into a structured knowledge graph you can explore and query. This playbook extracts subject–predicate–object triples with a local LLM, stores them in a graph database, and renders the graph in an interactive GPU-accelerated web UI.

The workflow covers:

- **Knowledge triple extraction** — local LLM inference (Ollama or vLLM) to extract relationships from documents
- **Graph database storage** — ArangoDB or Neo4j for storing and traversing triples
- **GPU-accelerated visualization** — Three.js WebGPU for interactive 2D/3D exploration
- **Web interface** — Next.js app for document upload, graph editing, and graph-based queries

# What you'll accomplish

A running, containerized system that:

- Processes uploaded documents (markdown, text, CSV)
- Generates and stores knowledge triples
- Lets you visualize and query the graph through a browser

# What to know before starting

**Required:**

- Basic Docker container usage
- Familiarity with command-line operations

**Optional:**

- Familiarity with knowledge graphs and graph databases

# Supported hardware platforms

Use the matrix below to confirm your hardware platform, OS, memory, and whether multi-node applies. The same base workflow applies across supported hardware platforms; `./start.sh` always starts the default ArangoDB + Ollama stack.

| Hardware platform | OS | Memory  | Multi-node capable hardware |
| :---- | :---- | :---- | :---- |
| **DGX Spark** | DGX OS (Linux) | 128 GB Unified Memory | — |
| **DGX Station** | DGX OS (Linux) | Large HBM + Grace DRAM | — |

### Stack options by hardware platform

| Hardware platform | Default start command | Other stack options |
| ----------------- | --------------------- | ------------------- |
| **DGX Spark** | `./start.sh` → ArangoDB + Ollama | `./start.sh --neo4j` → Neo4j + Ollama; `./start.sh --vllm` → Neo4j + vLLM |
| **DGX Station** | `./start.sh` → ArangoDB + Ollama | `./start.sh --neo4j` → Neo4j + Ollama; `./start.sh --vllm` → Neo4j + vLLM |

> [!IMPORTANT]
> The 64 KB page-size issue is specific to DGX Station; DGX Spark is not affected. On affected DGX Station systems, prefer `./start.sh --neo4j`. Some upstream ArangoDB and Qdrant container images can abort at startup with `<jemalloc>: Unsupported system page size`; the Neo4j + Ollama stack preserves the fast local Ollama flow while avoiding ArangoDB.

> [!NOTE]
> Larger models generally produce higher-quality triples. Choose a model that fits the memory available on your hardware platform. See **Instructions → Step 3** for defaults and links to explore more models.

# Prerequisites

**Hardware requirements**

- Supported hardware platform — see Supported hardware platforms matrix above
- Sufficient memory for your chosen LLM

**Software requirements**

- Docker installed and configured with the NVIDIA Container Toolkit
- Docker Compose
- Network access for container image and model downloads

**Ancillary files** (in `nvidia/playbook-txt2kg/assets` after Step 1):

- `start.sh` / `stop.sh` — launch and shut down services
- `deploy/compose/` — Docker Compose configurations

# Time & risk

- **Estimated time:** 30 MIN (longer on first run while models download; vLLM model load can take 30+ minutes)
- **Risk level:** Low
- GPU memory needs depend on the chosen model
- Document processing time scales with document size and complexity
- **Rollback:** Stop and remove containers; optionally delete downloaded models (see Instructions)
- **Last Updated:** 08/05/2026
- Added explicit Neo4j + Ollama stack option; model defaults and explore links live in Instructions Step 3

## More

- [Instructions](/playbooks/txt2kg/instructions.md)
- [Troubleshooting](/playbooks/txt2kg/troubleshooting.md)