Metadata-Version: 2.4
Name: ckg-nvidia-guardrails
Version: 0.1.0
Summary: NeMo Guardrails as a traversable knowledge graph — 50 nodes, MCP-native, free
Project-URL: Homepage, https://graphifymd.com
Project-URL: Repository, https://github.com/Yarmoluk/ckg-nvidia-guardrails
Project-URL: Bug Tracker, https://github.com/Yarmoluk/ckg-nvidia-guardrails/issues
Author-email: Daniel Yarmoluk <daniel.yarmoluk@gmail.com>
License: MIT
Keywords: ai-agents,colang,guardrails,knowledge-graph,llm-safety,mcp,nemo,nvidia
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Python: >=3.11
Requires-Dist: mcp[cli]>=1.0.0
Description-Content-Type: text/markdown

# ckg-nvidia-guardrails

**NeMo Guardrails as a traversable knowledge graph.**

50 nodes · MCP-native · free · [Graphify.md](https://graphifymd.com)

```bash
pip install ckg-nvidia-guardrails
uvx ckg-nvidia-guardrails
```

---

## The problem this solves

NeMo Guardrails rails govern **conversation flow** — but the tool fleet executes entirely outside the railed channel. There is no mutual visibility between `config.yml` rails configuration and tool/action bindings.

This means:
- Auto-approved shell-capable tools bypass guardrails entirely
- Outgoing responses from tool calls leave un-railed
- Rails config and tool config exist as separate files with no declared relationship

This knowledge graph maps those relationships explicitly. Query the **Tool Authorization Gap** node to traverse what's railed vs what isn't:

```python
query_ckg('Tool Authorization Gap', 'nvidia-guardrails', 3)
```

---

## What's covered (50 nodes)

| Domain | Nodes |
|---|---|
| Rails Architecture | NeMo Guardrails · Dialog Flow Manager · Input/Output/Dialog/Retrieval Rails |
| Colang Language | Colang 1.0 · Colang 2.0 · Flow · Message · Context Variables · Event System |
| Configuration | config.yml · Models · Rails · Actions · Prompts · Generation Options |
| Actions & Tools | Custom Actions · Python Actions · Action Server · Tool Bindings · **Tool Authorization Gap** |
| Rail Implementations | Jailbreak Detection · Hallucination Detection · Sensitive Data · Moderation · Topical Rails |
| Integrations | LangChain · LlamaIndex · NIM · Custom LLM Provider · OpenAI-Compatible API |
| Observability | Logging · Colang Tracing · Rail Testing · NemoGuardrails CLI |
| Deployment | Guardrails Server · REST API · Streaming Support |

---

## MCP tools

| Tool | Description |
|---|---|
| `list_domains()` | List available domains |
| `search_concepts(query)` | Find concepts by keyword |
| `query_ckg(concept, depth)` | Traverse from any concept outward |
| `get_prerequisites(concept)` | Full upstream dependency chain |
| `ask_guardrails(question)` | Natural-language Q&A (requires local Ollama) |

---

## Add to Claude Desktop

```json
{
  "mcpServers": {
    "nvidia-guardrails": {
      "command": "uvx",
      "args": ["ckg-nvidia-guardrails"]
    }
  }
}
```

---

## Benchmark

11× fewer tokens than RAG · F1 0.471 vs RAG 0.123 · 269 tokens/query vs 2,982

Full paper: [github.com/Yarmoluk/ckg-benchmark/blob/main/paper/main.pdf](https://github.com/Yarmoluk/ckg-benchmark/blob/main/paper/main.pdf)

---

## 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) · MIT License · Patent pending
