Skip to main content
NVIDIA
Explore
Models
Skills
Blueprints
GPUs
Docs
Help Center
Getting Started
  1. Create and verify your account to unlock full access to NVIDIA NIM APIs.
ResourcesDeveloper ForumsContact Support
FAQs
  • Build Knowledge Graphs with txt2kg

    30 MIN

    Extract triples with Ollama or vLLM, store them in a graph database, and explore them in a GPU-accelerated web UI

    • Application
    • DGX Spark
    • DGX Station
    • Ollama
    • vLLM
    View on GitHub
    OverviewOverviewInstructionsInstructionsTroubleshootingTroubleshooting

    Step 1
    Clone the repository

    In a terminal, clone the playbook repository and navigate to the project assets directory.

    git clone https://github.com/NVIDIA/dgx-spark-playbooks
    cd dgx-spark-playbooks/nvidia/playbook-txt2kg/assets
    

    Step 2
    Start the txt2kg services

    Use the provided start script. By default, ./start.sh starts the ArangoDB + Ollama stack. Use one stack flag when you want a different graph database or LLM backend.

    ./start.sh
    

    Common options:

    # Stack flags
    ./start.sh --neo4j     # Neo4j + Ollama
    ./start.sh --vllm      # Neo4j + vLLM
    
    # Optional flags
    ./start.sh --vector-search   # Add Qdrant + Sentence Transformers
    ./start.sh --help            # Full option list
    

    DGX Spark is not affected by the 64 KB page-size issue. On affected DGX Station systems, start with ./start.sh --neo4j to use Neo4j + Ollama.

    The script will:

    • Check for GPU availability
    • Start Docker Compose services for the selected stack
    • For the vLLM stack, start the backend container; model load can take 30+ minutes, and progress is available with docker logs vllm-service -f
    • Print the web UI URL when ready

    Step 3
    Choose and load a model

    Triple extraction quality depends on the LLM behind Ollama or vLLM. Start with the stack default below, then explore other models to trade quality vs. speed and memory.

    Defaults by stack

    StackDefault modelNotes
    ArangoDB + Ollamallama3.1:8bPull with docker exec ollama-compose ollama pull llama3.1:8b
    Neo4j + Ollamallama3.1:8bPull with docker exec ollama-compose ollama pull llama3.1:8b
    Neo4j + vLLMnvidia/Llama-3_3-Nemotron-Super-49B-v1_5-FP8Loaded by the vLLM container; first start can take 30+ minutes

    Ollama stacks

    Pull a language model for knowledge extraction (skip if the default was already pulled on start):

    docker exec ollama-compose ollama pull <model-name>
    

    Examples:

    docker exec ollama-compose ollama pull llama3.1:8b
    

    Then select the model in the web UI.

    Explore more models: browse the Ollama model library. Prefer models that fit the memory available on your hardware platform.

    vLLM stack

    The model is loaded automatically by the vLLM container from VLLM_MODEL in deploy/compose/docker-compose.vllm.yml.

    To try a different Hugging Face checkpoint:

    1. Set VLLM_MODEL to another handle (for example from Hugging Face Models or vLLM Recipes).
    2. Restart: ./stop.sh then start again with your stack flags (for example ./start.sh --vllm).
    3. Confirm readiness: docker logs vllm-service -f

    Explore more models: vLLM Recipes — DGX Spark · vLLM Recipes — DGX Station · Hugging Face

    NOTE

    Larger models generally produce higher-quality triples but need more memory and load time. If you hit memory limits, choose a smaller or quantized model.

    Step 4
    Access the web interface

    Open your browser and navigate to:

    http://localhost:3001
    

    You can also access stack-specific services:

    ServiceURLStack
    Web UIhttp://localhost:3001All
    ArangoDB Web Interfacehttp://localhost:8529ArangoDB + Ollama
    Neo4j Browserhttp://localhost:7474Neo4j + Ollama or Neo4j + vLLM
    Ollama APIhttp://localhost:11434ArangoDB + Ollama or Neo4j + Ollama
    vLLM APIhttp://localhost:8001Neo4j + vLLM

    Step 5
    Upload documents and build knowledge graphs

    If the LLM backend is still loading, the UI may show an initializing banner until the backend is ready.

    5.1. Document upload

    • Upload text documents (markdown, text, and CSV are supported)
    • Documents are chunked and processed for triple extraction

    5.2. Knowledge graph generation

    • The system extracts subject–predicate–object triples using the selected LLM (Ollama or vLLM)
    • Triples are stored in the selected graph database: ArangoDB for the default stack, or Neo4j when started with --neo4j or --vllm

    5.3. Interactive visualization

    • View the knowledge graph in 2D or 3D with GPU-accelerated rendering
    • Explore nodes and relationships interactively

    5.4. Graph-based queries

    • Ask questions about your documents in the query interface
    • Graph traversal enriches context with entity relationships
    • The LLM generates responses using the enriched graph context

    Step 6
    Cleanup and rollback

    Stop services with the same stack flags you used to start:

    # Stop services (match the stack you started)
    ./stop.sh
    # If you started with Neo4j + Ollama: ./stop.sh --neo4j
    # If you started with Neo4j + vLLM: ./stop.sh --vllm
    
    # Remove containers and volumes (optional)
    # Ollama stack:
    # docker compose -f deploy/compose/docker-compose.yml down -v
    # Neo4j + Ollama stack:
    # docker compose -f deploy/compose/docker-compose.neo4j.yml down -v
    # Neo4j + vLLM stack:
    # docker compose -f deploy/compose/docker-compose.vllm.yml down -v
    
    # Remove downloaded Ollama models (Ollama stacks only, optional)
    # docker exec ollama-compose ollama rm <model-name>
    

    Step 7
    Next steps

    • Experiment with different models (Step 3 links) for extraction quality vs. speed
    • Customize triple extraction prompts for domain-specific knowledge
    • Explore advanced graph querying and visualization features

    Resources

    • Ollama Documentation
    • ArangoDB Documentation
    • Neo4j Documentation
    • vLLM Documentation
    • DGX Spark Documentation
    • DGX Spark Forum
    • DGX Station Support
    • NVIDIA Developer Forums
    Terms of Use
    Privacy Policy
    Your Privacy Choices
    Contact

    Copyright © 2026 NVIDIA Corporation