selfhost.directory

The index of self-hostable projects — ranked, categorized and served with live updates.
Own your data and stop giving it to big tech.

knowledge-graph-extractor logo

Self-host knowledge-graph-extractor

Extract knowledge graphs from docs with a self-hosted LLM

AlphaOpen SourceMIT
Updated4 months ago
LanguagePython
Setup difficultyAdvanced
Stars
221
CPU
8 vCPU (GCP g2-standard-8)
RAM
32 GB system RAM (implied by g2-standard-8)
Storage
~20 GB for model + data
Port
3000 (FastAPI app UI and extraction API)
Requires
Jina AI API (Jina Reader)
Install with Docker Compose
Animated demo of the knowledge graph extractor UI showing interactive force-directed graphHero screenshot of the knowledge graph extractor interface

What is knowledge-graph-extractor?

Knowledge Graph Extractor is a self-hosted application that converts unstructured text — pasted content, fetched URLs, or zip archives of documents — into an interactive knowledge graph. It uses a self-hosted Qwen3.6-35B-A3B-MTP model running on llama.cpp with CUDA on a single NVIDIA L4 24GB GPU. The pipeline chunks oversized documents instead of truncating, extracts atomic (subject, predicate, object) triples with canonicalized entities, applies optional semantic deduplication via jina-embeddings-v5-text-nano on CPU, and visualizes the resulting graph in a force-directed UI where edges show evidence spans and confidence scores. A single-slot job scheduler with foreground preemption and auto-backfill persists jobs to disk so they survive restarts. Results can be downloaded as JSONL. The stack runs via Docker Compose with two services: llama-server (port 8080) serving the OpenAI-compatible LLM API, and a FastAPI app (port 3000) handling extraction, scheduling, deduplication, and the UI. Configuration is via a .env file requiring a Jina AI API key for URL-to-markdown conversion. The project is MIT-licensed with no paid tiers.

Should you self-host knowledge-graph-extractor?

knowledge-graph-extractor scores 39/100 on selfhost.directory (how scoring works) and ranks #32 of 42 in Knowledge Management. It has 221 GitHub stars.

There was no stable release in the past 12 months, so check the repository's recent activity before you rely on it.

Setup is advanced: plan for several services and some ongoing maintenance. It is MIT-licensed and written mostly in Python.

Its closest alternative on selfhost.directory is Project N.O.M.A.D. (85/100, 41 087 stars). It scores higher overall, so compare the two before you pick. See knowledge-graph-extractor vs Project N.O.M.A.D. side by side.

Features

  • Document chunking (no truncation)
  • Interactive force-directed graph visualization
  • Job queue with preemption and persistence
  • JSONL Export
  • Knowledge graph extraction from documents
  • MTP speculative decoding
  • Multiple input formats
  • OpenAI-compatible LLM API
  • Semantic DeduplicationEnabled by default

knowledge-graph-extractor README

How to install knowledge-graph-extractor

Install knowledge-graph-extractor with Docker Compose

Environment variables
JINA_API_KEY (required), LLAMA_URL, JOBS_DIR, PREEMPT_FOREGROUND, AUTO_BACKFILL

git clone https://github.com/hanxiao/knowledge-graph-extractor.git cd knowledge-graph-extractor

cp .env.example .env # add your JINA_API_KEY (https://jina.ai/api-key) bash scripts/setup.sh # downloads the model (~17GB) and starts both services

Requires NVIDIA L4 24GB GPU, Docker, and NVIDIA Container Toolkit

How to configure knowledge-graph-extractor

  • AUTO_BACKFILL1Enable auto-backfill of paused jobs when slot is free (1=on, 0=off)

    Enable auto-backfill of paused jobs when slot is free (1=on, 0=off)

    values: 0 or 1

  • JINA_API_KEYAPI key for Jina Reader to fetch URLs as markdown

    API key for Jina Reader to fetch URLs as markdown

    values: jina_xxxx

  • JOBS_DIR./data/jobsDirectory where job data (meta, facts.jsonl, input) is persisted

    Directory where job data (meta, facts.jsonl, input) is persisted

  • LLAMA_URLhttp://localhost:8080URL of the llama-server OpenAI-compatible endpoint

    URL of the llama-server OpenAI-compatible endpoint

  • PREEMPT_FOREGROUND1Enable foreground preemption of running jobs (1=on, 0=off)

    Enable foreground preemption of running jobs (1=on, 0=off)

    values: 0 or 1

More in Data Extraction

Rate this project

Click to rate — no account needed.

0 comments

Posting as guest
Loading comments…