🧠 RKnowledge

Production-grade knowledge graph CLI. Extract concepts and relationships from any document using LLMs.

Inspired by rahulnyk/knowledge_graph — rewritten from scratch in Rust.

Release Language CI License
Install with one command
curl -fsSL https://raw.githubusercontent.com/Algiras/RKnowledge/main/install.sh | bash

How We Differ

rahulnyk/knowledge_graph is a brilliant ~300-line Python notebook proof of concept. RKnowledge turns that idea into a 15,500-line production CLI.

Dimension Original (Python) RKnowledge (Rust)
Interface Jupyter notebook cells Full CLI with 10 subcommands better
Language Python Rust — compiled binary, ~15x faster parsing better
LLM Providers Ollama only (Mistral 7B) Anthropic, OpenAI, Google, Ollama better
Concurrency Sequential (1 chunk at a time) Parallel LLM calls with -j flag new
Storage In-memory Pandas DataFrames Neo4j graph DB (Docker), persistent better
Incremental Builds Always from scratch --append merges into existing graph new
Input Formats PDF only PDF, Markdown, HTML, plain text better
Entity Typing 8 fixed categories Free-form LLM classification better
Graph Algorithms Degree + Louvain PageRank, Label Propagation, Dijkstra shortest path, density new
Querying None query, path, stats, communities commands new
Visualization Static Pyvis HTML Interactive: click cards, search, type legend, toggle edges better
Export None JSON, CSV, GraphML, Cypher dump new
CI/CD None GitHub Actions: lint, test, multi-platform build new
Distribution docker build + Jupyter Single binary, curl install, skills.sh better
Tests None 118 tests (107 unit + 11 integration) new

Why RKnowledge?

Everything you need to extract, store, analyze, and explore knowledge graphs from any text.

Blazing Fast

Compiled Rust binary. Parallel LLM extraction with -j concurrency. Zero runtime dependencies.

🔌

Multi-Provider LLM

Anthropic, OpenAI, Google Gemini, and Ollama for free local inference. Switch with one flag.

🏷️

Smart Entity Typing

LLM classifies each concept freely — "programming language", "database", "medical condition" — no fixed list.

📊

Graph Analytics

PageRank, community detection, shortest path, connected components, degree distribution. Built-in.

🔗

Neo4j + Incremental

Persistent Neo4j backend via Docker. --append merges new documents without rebuilding.

🌐

Interactive Visualization

Click-to-expand detail cards, entity type legend, search, toggle proximity edges, freeze physics.

Quick Start

1

Install

$ curl -fsSL https://raw.githubusercontent.com/Algiras/RKnowledge/main/install.sh | bash
2

Initialize & configure

$ rknowledge init # Start Neo4j + create config
$ rknowledge auth # Configure LLM provider
3

Build your knowledge graph

$ rknowledge build ./docs/ --provider ollama -j 8
# Extracted 40 relations from 4 chunks (8 concurrent)
# Graph: 54 nodes, 383 edges
4

Explore

$ rknowledge query "machine learning" --depth 2
$ rknowledge path "docker" "kubernetes"
$ rknowledge stats
$ rknowledge viz

Commands

Command Description
init Initialize config and start Neo4j via Docker
auth Configure LLM provider API keys (interactive)
build <path> Process documents and build knowledge graph. Flags: -j, --append, --provider
query <q> Search the graph with variable --depth or raw cypher: queries
path <from> <to> Find shortest path between two conceptsnew
stats Graph analytics: PageRank, density, degree distribution, entity typesnew
communities List detected communities and their membersnew
export Export to JSON, CSV, GraphML, or Cypher
viz Open interactive graph visualization in browser

LLM Providers

🟣

Anthropic

Claude Sonnet / Opus

API Key
🟢

OpenAI

GPT-4o / GPT-4

API Key
🔵

Google

Gemini Pro

API Key
🦙

Ollama

Mistral, Llama, etc.

Free / Local

Architecture

RKnowledge Architecture