nkrdn

neuro-kernel relational data nexus
Your codebase as a queryable knowledge graph.
Deterministic structure extraction. Zero hallucination. Three-layer neuro-symbolic architecture. 13+ CLI commands.
Private repository
Python RDF/SPARQL Neo4j AWS Bedrock
nkrdn
$ nkrdn details AuthService

class AuthService
  inherits  BaseService
  contains  3 methods
  depends   TokenStore, UserRepo
  used by   7 consumers

  "Token-based auth lifecycle."
Text Search + Raw LLMs
Finds strings. Invents the rest.
Grep matches text, misses relationships
LLMs hallucinate dependencies and hierarchies
No verifiable ground truth for structure
Accuracy degrades as codebases grow
NKRDN
Verified structure. Intelligent reasoning.
Every fact traced to a line of source code
LLM reasoning grounded in deterministic graph
SPARQL queries for complex graph patterns
Scales without accuracy loss
The Three Layers
Each layer has a distinct role. Structure is extracted deterministically. Stored as a standards-based graph. Enriched with intelligent reasoning. The layers never cross: structure is always provable, reasoning is always grounded.
Layer 1
Deterministic Kernel
Parses source code into structural facts using Python AST and tree-sitter. Extracts symbols, inheritance, composition, call graphs, and dependency resolution. Every edge in the graph traces to a line of source code. Zero hallucination by design.
Python AST tree-sitter Symbol Resolution Dependency Analysis
structures ↓
Layer 2
RDF Knowledge Graph
Structural facts stored as RDF triples with a custom ontology defining typed edges: contains, inheritsFrom, calls, dependsOn. Three swappable backends: Neo4j for scale, rdflib for zero-config local use, Jena Fuseki for SPARQL federation.
Neo4j rdflib Jena Fuseki SPARQL Custom Ontology
triples ↓
Layer 3
Agentic LLM Reasoning
Bottom-up enrichment: the LLM summarises methods first, then uses those summaries to understand classes, then modules, then packages. Context builds upward, never hallucinated downward. Generates semantic descriptions, detects architectural patterns, and answers natural-language queries against the graph.
AWS Bedrock Claude LangChain Bottom-Up Enrichment
The CLI in Action
STEP01
Find What You Need
search crosses the symbol-documentation boundary. Finds code elements by meaning, not just name matching. Results come back as URIs you can pipe into other commands.
STEP02
See the Full Picture
Every relationship is deterministic, extracted from source. Inheritance, composition, dependencies, consumers. The summary at the bottom is LLM-generated, grounded in the structure above it.
STEP03
Trace Dependencies
"What breaks if I change this?" Answered in milliseconds. Real call sites from parsed source. No grep guessing. No LLM invention.
STEP04
Navigate Hierarchies
Full inheritance chains, composition graphs, containment trees. Every edge is verifiable. Every path is real. Structure the parser found, not patterns the LLM guessed.
What Makes It Different
Zero Hallucination Guarantee
AST parsing gives provably correct structural facts. The LLM adds understanding on top of verified structure but can never override what the parser found. Structure is sacred.
Composable CLI
13+ commands that pipe into each other. search finds symbols semantically. lookup, usages, details, and tree query structure with zero LLM latency.
Three Graph Backends
Neo4j for million-node scale. rdflib for zero-config local use. Jena Fuseki for SPARQL federation. Same interface, pick your trade-off.
Bottom-Up Enrichment
Methods → classes → modules → packages. Context builds upward. The LLM window stays small while understanding scales to thousands of files.
Design Decisions
Why RDF over a simpler graph model?

RDF is a W3C standard with decades of tooling. SPARQL gives us a declarative query language that can express graph patterns like "find all classes that inherit from X and override method Y" in a single query. The ontology can be composed with existing ontologies without schema migration.

Why deterministic kernel + LLM enrichment?

Structure must be correct. A wrong inheritance edge or a phantom dependency will cascade into wrong answers everywhere downstream. AST parsing gives provably correct structural facts. The LLM layer adds understanding on top of verified structure. It can summarise, pattern-match, and reason, but it can never override what the parser found.

Why bottom-up enrichment?

Methods are small enough for an LLM to summarise accurately from source. Classes are understood by composing method summaries, so the LLM never needs to hold an entire class in context. Modules from class summaries. Each level's summary is grounded in the verified summaries below it. The context window stays small while understanding scales.

Three Domains. One Compounding Skillset.
1
MSc Dissertation: Researched neuro-symbolic architectures combining knowledge graphs with LLM reasoning. Demonstrated that grounding intelligent reasoning in deterministic structure produces more accurate, verifiable results than either approach alone.
2
Amazon: Applied knowledge graph and LLM patterns in production at scale. Different project, different domain. Same core architectural insight: verified structure first, intelligent reasoning second.
3
NKRDN: Built a code intelligence tool on those compounded skills. Knowledge graphs, LLM orchestration, and production engineering, all focused on making codebases understandable.