Content
<!-- mcp-name: io.github.Yarmoluk/ckg-nemotron-perplexity -->
# ckg-nemotron-perplexity
<p align="center">
<img src="https://raw.githubusercontent.com/Yarmoluk/ckg-nemotron-perplexity/main/docs/demo.png" alt="ckg-nemotron-perplexity — NVIDIA Nemotron + Perplexity Sonar as traversable knowledge graphs" width="100%"/>
</p>
<p align="center">
<a href="https://pypi.org/project/ckg-nemotron-perplexity/"><img src="https://img.shields.io/pypi/v/ckg-nemotron-perplexity?color=0f6e56&label=PyPI" alt="PyPI version"/></a>
<a href="https://pypi.org/project/ckg-nemotron-perplexity/"><img src="https://img.shields.io/pypi/pyversions/ckg-nemotron-perplexity?color=0f6e56" alt="Python"/></a>
<a href="LICENSE"><img src="https://img.shields.io/badge/data-ELv2-0f6e56" alt="Data: ELv2"/></a>
<a href="LICENSE-CODE"><img src="https://img.shields.io/badge/code-MIT-13201c" alt="Code: MIT"/></a>
<a href="https://github.com/Yarmoluk/ckg-benchmark/blob/main/paper/main.pdf"><img src="https://img.shields.io/badge/F1-0.471_%C2%B74%C3%97_RAG-0f6e56" alt="F1: 0.471 · 4× RAG"/></a>
</p>
**An auditable knowledge graph for NVIDIA Nemotron and Perplexity Sonar — deterministic agent answers with cryptographic source traceability.**
Every edge traces to a declared relationship and a SHA-256-pinned source document. Built for ML engineers, agent developers, and platform teams who need verifiable answers about Nemotron's training pipeline, Perplexity Sonar model routing, and cross-stack dependencies — not model inference.
> Not a general-purpose semantic search layer. If it's not a declared edge, the graph doesn't return it.
```bash
pip install ckg-nemotron-perplexity
# or: uvx ckg-nemotron-perplexity
```
[PyPI](https://pypi.org/project/ckg-nemotron-perplexity/) · [GitHub](https://github.com/Yarmoluk/ckg-nemotron-perplexity) · [Benchmark paper](https://github.com/Yarmoluk/ckg-benchmark/blob/main/paper/main.pdf) · [graphifymd.com](https://graphifymd.com)
---
## What it is
2 domains · 83 nodes · 83 edges · the full Nemotron training pipeline and Perplexity Sonar model stack as typed dependency graphs. Pre-structured, traversable, deterministic. Served over MCP. No inference at query time.
```
query_ckg("Synthetic Data Generation", "nemotron", depth=3)
→ Synthetic Data Generation
├─ [REQUIRES] Nemotron-4 as Judge
│ └─ [REQUIRES] Nemotron-4 340B
│ ├─ [REQUIRES] Transformer Architecture
│ ├─ [REQUIRES] Group Query Attention
│ └─ [REQUIRES] SentencePiece Tokenizer
└─ builds toward: Topic Diversity Sampling · Synthetic RLHF Data
269 tokens · declared edges only · no inference
RAG equivalent: ~2,982 tokens · probabilistic
```
```
get_prerequisites("sonar-deep-research", "perplexity-sonar")
sonar-deep-research → sonar-pro → Sonar API
Three hops. Declared chain. RAG returns three separate docs.
The graph doesn't guess — it traverses.
```
---
## Source provenance — verifiable to the byte
Every node carries a `source_url` and a `source_hash` (SHA-256 of the source document's bytes at extraction time). An edge isn't just *asserted* from a source — it's pinned to a specific version of it.
```bash
# Verify any node's source hasn't changed since extraction
curl -s https://developer.nvidia.com/nemotron | sha256sum
# expected: 9cedb8be7e92d957811ce3573a1e355158e4dcecf3033d46a0781fcfb7330a6c
```
**The full audit chain:**
```
edge answer
→ graph commit hash (git log -- nemotron.csv)
→ source_content_hash (sha256 of page bytes at extraction time)
→ knowledge_source_ref (URL — fetch hint, not trust anchor)
```
A hash mismatch means either the source changed (stale edge → re-extract) or the graph was patched without re-fetching (silent edit → investigate). No judgment required. Run `scripts/refresh_hashes.py` to recompute.
Via MCP — `verify_source("Transformer Architecture", "nemotron")`:
```
source_url: https://developer.nvidia.com/nemotron
source_hash: sha256:9cedb8be7e92d957811ce3573a1e355158e4dcecf3033d46a0781fcfb7330a6c
verify: curl -s '<url>' | sha256sum
```
Reference implementation of `knowledge_source_ref` + `source_content_hash` from [GuardrailDecisionV1](https://github.com/crewAIInc/crewAI/issues/4877).
---
## What developers are actually hitting
Signal from NVIDIA developer forums, Perplexity community, and hands-on deployments.
**01 — Model routing confusion.** Teams default to `sonar-pro` for every query. `sonar-reasoning-pro` is 3× the cost and only needed when multi-step reasoning is the bottleneck. The declared routing chain in the graph makes the decision deterministic.
**02 — "Why is my RLHF pipeline breaking?"** The Nemotron training chain has nine declared prerequisites. Teams skip Preference Data Collection or use the wrong judge model. Nemotron-4 340B is the required base — the graph surfaces every hop before you hit it at training time.
**03 — The cross-stack dependency gap.** Perplexity runs Nemotron-based models. Most documentation treats the stacks as separate. A question like "what does sonar-reasoning-pro require from the underlying model architecture?" crosses both domains — the graph traverses both in a single call.
---
## Declared relationships, not confidence scores
Every edge was extracted from a source document and given a type. No probabilistic weights, no cosine similarity scores, no confidence intervals. An edge either exists — declared, typed, sourced — or it doesn't. When the answer isn't in the graph, the traversal returns nothing rather than a hallucinated approximation.
**Edge types:**
| Type | Meaning | Example |
|------|---------|---------|
| `REQUIRES` | Hard prerequisite — A cannot function without B | `RLHF Pipeline REQUIRES Reward Model Training` |
| `ENABLES` | Capability unlock — A makes B possible | `sonar-pro ENABLES sonar-deep-research` |
| `IMPLEMENTS` | Concrete instantiation of an abstract concept | `OpenAI-Compatible Interface IMPLEMENTS Sonar API` |
| `RELATES_TO` | Conceptual proximity, no dependency direction | `PPO RELATES_TO DPO` |
**Why no confidence levels?** The edge type *is* the confidence signal. `REQUIRES` means load-bearing and sourced; `RELATES_TO` means real but weaker. A missing edge is silence from a source-grounded system — not a soft no, not a low-confidence guess.
```
✗ RAG: "RLHF Pipeline probably requires a reward model... (similarity: 0.78)"
Score is on the chunk, not the claim. The claim itself is unverified.
✓ CKG: "RLHF Pipeline REQUIRES Reward Model Training, which REQUIRES Preference Data Collection
and Supervised Fine-Tuning, which REQUIRES Nemotron-4 340B."
No score. Declared edge. Traces to NVIDIA Nemotron source doc.
```
---
## A/B test — Nemotron + Perplexity domain, local models, no GPU
30 questions on the training pipeline, model routing, and cross-domain prerequisites · CPU only · Ollama · temperature 0 · seed 42
| Category | Bare model | + CKG | Lift |
|----------|-----------|-------|------|
| Model routing F1 | 0.058 | 0.142 | **+145%** |
| Pipeline prereq F1 | 0.063 | 0.134 | **+113%** |
| Lookup F1 | 0.091 | 0.201 | **+121%** |
| Key-fact accuracy | 8.1% | 19.4% | **+11pp** |
**L01 — model routing:**
```
Q: Which Sonar model should I use for multi-step research tasks?
✗ Bare: "Use sonar-pro for all research tasks..." [misses routing distinction]
✓ CKG: "sonar-deep-research requires sonar-pro, which requires Sonar API.
For multi-step reasoning without deep research, sonar-reasoning-pro
is the declared path." [correct]
```
**P01 — prereq chain (9 hops):**
```
Q: What must be in place before running the RLHF pipeline on Nemotron-4?
✗ Bare: "You need a dataset and a base model..." [vague, misses full chain]
✓ CKG: "RLHF Pipeline → Reward Model Training → Preference Data Collection
→ Supervised Fine-Tuning → Nemotron-4 340B → Pre-training Data Pipeline
→ Transformer Architecture → Group Query Attention
→ Rotary Position Embedding → SentencePiece Tokenizer" [declared chain]
```
---
## Install
**Add to claude.ai (no install required):**
```
https://ckg-nemotron-perplexity.onrender.com/mcp
```
Settings → Connectors → Add connector → paste URL.
**Local — Claude Desktop / Claude Code:**
```bash
pip install ckg-nemotron-perplexity
# or
uvx ckg-nemotron-perplexity
```
```json
{
"mcpServers": {
"nemotron-perplexity": {
"command": "uvx",
"args": ["ckg-nemotron-perplexity"]
}
}
}
```
---
## Tools
| Tool | Description |
|------|-------------|
| `list_domains()` | Both available domains with descriptions |
| `query_ckg(concept, domain, depth)` | Typed subgraph around a concept (1–5 hops) |
| `get_prerequisites(concept, domain)` | Full ordered prerequisite chain — every dependency in order |
| `search_concepts(query, domain)` | Fuzzy search within a domain |
| `verify_source(concept, domain)` | Source URL + SHA-256 hash for any concept — full audit chain back to source bytes |
---
## What's in the graph
**2 domains · 83 nodes · 83 edges · 4 edge types: `REQUIRES` · `ENABLES` · `IMPLEMENTS` · `RELATES_TO`**
**nemotron — 48 nodes:**
| Layer | Concepts |
|-------|----------|
| Architecture | Transformer Architecture · Group Query Attention · Rotary Position Embedding · Flash Attention · SentencePiece Tokenizer |
| Models | Nemotron-4 340B · Nemotron-4 15B · Nemotron-51B · Minitron-8B · Minitron-4B |
| Training | Pre-training Data Pipeline · Nemotron-CC · Quality Filtering · SFT · Reward Model Training · RLHF Pipeline · PPO · DPO · Constitutional AI Filtering · Nemotron-4 as Judge |
| Synthetic data | Synthetic Data Generation · Topic Diversity Sampling · Response Diversity Sampling · Data Quality Score · Synthetic RLHF Data |
| Deployment | TensorRT-LLM Backend · Triton Inference Server · NVIDIA NIM · INT8 Quantization · FP8 Quantization · vLLM Backend · OpenAI-Compatible Endpoint |
| Evaluation | MMLU Benchmark · HumanEval · MT-Bench · RewardBench · Arena Hard |
| Capabilities | Code Generation · Math Reasoning · Tool Use · Long Context 128K · Multi-turn Conversation · Structured Output |
| Pruning | Structured Pruning · Knowledge Distillation · Neuron Importance Scoring · Minitron Pipeline |
**perplexity-sonar — 35 nodes:**
| Layer | Concepts |
|-------|----------|
| API | Sonar API · API Key Authentication · OpenAI-Compatible Interface · Rate Limiting · Cost Per Query |
| Models | sonar · sonar-pro · sonar-reasoning · sonar-reasoning-pro · sonar-deep-research |
| Search | Web Search Grounding · Real-time Knowledge · Citation Object · Source URL Reference · recency_filter · search_domain_filter · Search Context Size |
| Context | System Prompt · Context Window 127K · Message History · return_images · return_related_questions |
| Output | Text Response · Streaming Response · JSON Mode · Citation Inline Format |
| Use cases | Research Assistant · Fact Checking · Real-time Data Access · News Summarization · Code with Web Context |
| Advanced | Deep Research Mode · Multi-step Reasoning · Extended Thinking · Structured Research Report |
Every node traces to `developer.nvidia.com/nemotron` (Nemotron) or `docs.perplexity.ai` (Sonar). Every source is SHA-256 pinned — run `scripts/refresh_hashes.py` to verify.
---
## The dependency graph
```mermaid
graph TD
NM[Nemotron-4 340B] --> TA[Transformer Architecture]
NM --> GQA[Group Query Attention]
NM --> RoPE[Rotary Position Embedding]
NM --> SP[SentencePiece Tokenizer]
SFT[Supervised Fine-Tuning] --> NM
RMT[Reward Model Training] --> SFT
PDC[Preference Data Collection] --> SFT
RLHF[RLHF Pipeline] --> RMT
RLHF --> PDC
NMJ[Nemotron-4 as Judge] --> NM
SDG[Synthetic Data Generation] --> NMJ
SA[Sonar API] --> AKA[API Key Authentication]
SA --> RL[Rate Limiting]
SPR[sonar-pro] --> SA
SDR[sonar-deep-research] --> SPR
DRM[Deep Research Mode] --> SDR
SRR[Structured Research Report] --> DRM
style NM fill:#0f6e56,color:#fff
style SA fill:#0f6e56,color:#fff
style RLHF fill:#1a5c47,color:#fff
style SDR fill:#1a5c47,color:#fff
style SDG fill:#2d7a5e,color:#fff
style SFT fill:#2d7a5e,color:#fff
```
---
## Sources
Every node and edge traces to one of these. No probabilistic inference — declared relationships only.
| Type | Source | Coverage |
|------|--------|----------|
| Official | `developer.nvidia.com/nemotron` | Architecture, training pipeline, synthetic data, RLHF, evaluation, capabilities |
| Official | `docs.nvidia.com/nim/` | TensorRT-LLM, Triton Inference Server, NIM deployment, quantization |
| Official | `docs.perplexity.ai/` | Sonar API, model routing, web search, citations, output modes, deep research |
| Dataset | [huggingface.co/datasets/danyarm/ckg-benchmark](https://huggingface.co/datasets/danyarm/ckg-benchmark) | KRB v0.6.2 — 7,928 queries |
| Benchmark | [github.com/Yarmoluk/ckg-benchmark/paper/main.pdf](https://github.com/Yarmoluk/ckg-benchmark/blob/main/paper/main.pdf) | Full methodology, F1 0.471, RAG/GraphRAG baselines |
---
## Benchmark (KRB v0.6.2 locked)
| System | Macro F1 | Mean tokens | Cost / 1k queries |
|--------|----------|-------------|-------------------|
| **CKG** | **0.471** | **269** | **$7.81** |
| RAG | 0.123 | 2,982 | $76.23 |
| GraphRAG | 0.120 | ~3,000 | ~$76 |
7,928 queries · 5-hop F1: 0.772 (CKG) vs 0.170 (RAG) · [dataset](https://huggingface.co/datasets/danyarm/ckg-benchmark) · [full paper](https://github.com/Yarmoluk/ckg-benchmark/blob/main/paper/main.pdf)
---
## Licensing
Three layers, three licenses, one plain-English answer to each question you actually have:
| Layer | License | Plain English |
|-------|---------|---------------|
| **Server code** — `server.py`, `graph.py`, `scripts/` | MIT ([LICENSE-CODE](LICENSE-CODE)) | Do anything. Fork it, embed it, sell products built on it. No attribution required. |
| **Graph data** — `domains/nemotron.csv`, `domains/perplexity-sonar.csv` + source hashes | Elastic License 2.0 ([LICENSE](LICENSE)) | Free for all internal and commercial use. The one thing you cannot do: offer this graph as a hosted or managed service that competes with Graphify.md. |
| **Extraction pipeline, benchmark harness, curation methodology** | Proprietary — Graphify.md | Not in this repo. This is the compounding asset — how 97 domains get built and maintained, not the outputs. |
**Can I build an agent or product using this CKG?** Yes. No restrictions, no attribution required.
**Can I run this inside my company's infrastructure?** Yes. ELv2 allows all internal commercial use.
**Can I fork the server code and build my own CKG on a different domain?** Yes. Server code is MIT.
**Can I offer "Nemotron CKG as a Service" commercially?** No. That's the one thing ELv2 blocks.
**What's actually proprietary?** Not the graph topology — anyone can read the NVIDIA and Perplexity docs. What's proprietary is the extraction process that decides *which* 83 nodes out of thousands matter, *why* `RLHF Pipeline` `REQUIRES` `Reward Model Training` and not `RELATES_TO`, and the benchmark framework that proves the result is correct.
---
## EVAL
```
benchmark: ckg-benchmark v0.6.2
dataset: huggingface.co/datasets/danyarm/ckg-benchmark
benchmarked: false
rag_baseline_f1: 0.123
graphrag_baseline_f1: 0.120
mean_tokens: 269
paper: github.com/Yarmoluk/ckg-benchmark/blob/main/paper/main.pdf
```
---
Built by [Graphify.md](https://graphifymd.com) · [97 domains](https://graphifymd.com/pro/) · [PyPI](https://pypi.org/project/ckg-nemotron-perplexity/) · patent pending
*Community-built. Not affiliated with, endorsed by, or sponsored by NVIDIA Corporation or Perplexity AI, Inc. Nemotron is a trademark of NVIDIA Corporation. Perplexity and Sonar are trademarks of Perplexity AI, Inc. All referenced trademarks belong to their respective owners.*
MCP Config
Below is the configuration for this MCP Server. You can copy it directly to Cursor or other MCP clients.
mcp.json
Connection Info
You Might Also Like
everything-claude-code
Complete Claude Code configuration collection - agents, skills, hooks,...
markitdown
MarkItDown-MCP is a lightweight server for converting URIs to Markdown.
cc-switch
All-in-One Assistant for Claude Code, Codex & Gemini CLI across platforms.
servers
Model Context Protocol Servers
servers
Model Context Protocol Servers
Time
A Model Context Protocol server for time and timezone conversions.