Skip to content

aikdna/kdna

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

177 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

KDNA Protocol

npm CI License

Maintained by AIKDNA — the open ecosystem for AI-native Knowledge DNA.

Build domains, tools, integrations — not parallel protocols.

AI can generate knowledge. Humans still create judgment.

The KDNA Protocol is an open format for encoding human-verified domain judgment into structured assets that AI agents can load, verify, and evolve. KDNA does not replace the model — it gives the model a domain judgment reference while it reasons and acts.

Prompts tell AI what to say. Skills tell AI what to do. MCP connects AI to tools.
KDNA tells AI how to judge within a domain.

Skill + KDNA — Skills make agents capable. KDNA makes their judgment reliable. Learn more →

KDNA in 30 seconds

KDNA is a file-based cognitive kernel for AI agents.

It turns human insight, value stance, aesthetic preference, judgment boundaries, and quality standards into structured assets that agents can load, verify, compose, and evolve.

A KDNA does not make an agent role-play an expert. It gives the agent an explicit judgment system to work within.

  • Prompt changes what AI says.
  • Skill changes what AI does.
  • KDNA changes how AI judges.

Why now

Agents already have general judgment. What they still need is explicit, human-led domain judgment systems that can be inspected, governed, and reused.

The current agent ecosystem has solved the "doing" problem: function calls, MCP, tool use, workflows. But doing is not judging — an agent that can do anything, but cannot distinguish a price objection from an uncertainty signal, will confidently execute the wrong action.

Tools let AI act. KDNA keeps AI from acting blindly.

Self-improving agents need judgment governance. Without explicit judgment, improvement becomes drift. The KDNA Protocol is the protocol for human-governed self-improvement: agents can learn from work, but judgment updates require Human Judgment Lock — critical fields like axioms, boundaries, risk models, and failure criteria cannot be modified without human confirmation.

Every domain has expert-level judgment patterns that currently exist only in experienced practitioners' minds. KDNA is a format for extracting those patterns, encoding them as machine-verifiable structures, and loading them into agents as a judgment reference — independent of prompts, independent of knowledge bases, independent of tools.


Before / After KDNA

KDNA optimizes reasoning paths, not phrasing.

Without KDNA With KDNA
Generic, knowledge-level response Domain-specific expert judgment
Treats objection as literal statement Diagnoses what's hiding behind the words
"Customer says too expensive → give discount" "Price objection is an uncertainty signal → diagnose which dimension"
"Employee doesn't execute → motivation problem" "Execution failure → check upstream system conditions"
"Elder person refuses activity → not engaging enough" "Refusal to participate → identify invisible barriers (fear, burden, dignity threat)"
This is a prompt library This is a judgment encoding format
Cannot be verified Every axiom, misunderstanding, and self-check is testable

Same model. Same input. Different judgment path.


Early Benchmark Evidence

In a 5-model agent_safety mini benchmark, KDNA outperformed an equivalently-principled Best Prompt control across all 5 models.

Configuration MiniMax Claude Opus 4.7 Qwen 3.7 Max Gemini 3.5 Flash GPT-5.5
No KDNA 79 79 80 64 92
Best Prompt 104 104 101 94 99
KDNA 108 111 107 103 110
vs Best +4 +7 +6 +9 +11

Average: +7.4 over Best Prompt, +29.0 over No KDNA.

Full report · Raw outputs · Runner · Limitations


What KDNA is — and what it is not

KDNA is:

  • A judgment reference layer that AI agents load before they act in a domain
  • A structured format for axioms, concept boundaries, failure risks, self-checks, and reasoning chains
  • A human-verified encoding — critical judgment fields require Human Judgment Lock before modification
  • A composable protocol — multiple domain packages can be loaded together with conflict reporting

KDNA is not:

  • Not a model or LLM. KDNA loads alongside the model as a judgment reference. It does not generate text, reason, or predict.
  • Not a prompt library. Prompts are task-scoped and ephemeral. KDNA is domain-scoped and version-controlled.
  • Not RAG or a knowledge base. RAG retrieves facts. KDNA encodes what matters and what to watch for.
  • Not a workflow engine or skill. Skills define steps. KDNA defines the judgment criteria across those steps.
  • Not fine-tuning. Fine-tuning internalizes behavior into model weights. KDNA keeps judgment explicit, auditable, and editable.
  • Not role-play. KDNA does not ask an agent to pretend to be an expert. It provides structured judgment constraints, boundaries, and self-checks.
  • Not a .cursorrules or project rules file. KDNA is structured, validated, versioned, signed, and cross-agent portable.

KDNA and common AI agent mechanisms

Mechanism What it provides KDNA's relationship
System Prompt Persistent behavioral instructions KDNA provides structured, validated, domain-specific judgment that the model references during reasoning — not free-text behavioral nudges
Skill / Workflow Steps to follow Skills execute. KDNA shapes how the agent judges what to do at each step
MCP / API Tool connections MCP connects agents to tools. KDNA helps the agent judge tool outputs
RAG / Knowledge base Facts and documents RAG retrieves information. KDNA helps interpret what matters in that information
Fine-tuning Internalized behavior Fine-tuning internalizes patterns. KDNA keeps judgment explicit, auditable, and version-controlled
.cursorrules / project rules File-level behavioral hints KDNA is a standardized, validated, cross-agent format with signatures and registry distribution

For a deeper comparison, see KDNA and the AI Stack.


30-second example

User: "Help me improve this product launch post."

Without KDNA:
  → Suggests clearer wording, shorter sentences, more enthusiasm.

With writing.kdna:
  → Classifies as structural writing diagnosis (not language polishing).
  → Checks: Is there a real argument? A cognitive hook? Evidence density?
  → Avoids banned terms: "polish the language", "make it punchy".
  → Self-checks: 5/5 passed. Risk flags: none.

The agent didn't get better at writing. It got better at judging what kind of problem this is.


5-Minute Quick Start

One path. Five minutes. See KDNA change an agent's judgment.

npm install -g @aikdna/kdna-cli
kdna setup
kdna install @aikdna/writing
kdna verify @aikdna/writing --judgment
kdna compare @aikdna/writing --input "help me improve this post"

That's it. Your agent now loads a domain judgment package. The last command sends the same input to an LLM with and without KDNA, diffing the judgment paths so you can see exactly what changed.

# Verify everything is working
kdna doctor --agents

# → Codex: detected, kdna-loader installed
# → Claude Code: detected, kdna-loader installed
# → OpenCode: not detected (install opencode first)
# → KDNA data root: ~/.kdna
# → Installed domains: 1

Want to create your own? kdna init my_expertise scaffolds a minimal domain. Then kdna validate my_expertise checks it, and kdna publish my_expertise sends it to the registry.


What to read next

If you are a... Read this
Understanding why KDNA matters when LLMs are already intelligent Judgment Systems
Comparing KDNA with RAG, Memory, Skills, MCP, Workflows, Evals KDNA and the AI Stack
Reading the white paper KDNA White Paper
Developer wanting to connect KDNA to an agent 5-minute guide
Domain expert wanting to encode your judgment KDNA Studio — authoring kernel (@aikdna/kdna-studio)
Evaluator wanting to measure judgment improvement Evaluation guide
App developer integrating KDNA into Chat, Studio, Work, or agent runtimes App Runtime Contract
Enterprise evaluating private deployment Enterprise guide
Contributor wanting to improve KDNA itself CONTRIBUTING.md
Curious about the full specification SPEC.md
Understanding governance and safety Governance · Safety · Risk Policy · KDNA Card Spec · Security
Browsing available domains Registry · aikdna.com/domains
Reading the project roadmap ROADMAP.md
Reading in Chinese 中文版

Repository Map

Repository Role For
kdna Protocol, SPEC, core library, governance docs Everyone
kdna-cli CLI — install, validate, verify, pack, load, trace Developers
kdna-studio Authoring kernel (npm) — @aikdna/kdna-studio App developers
kdna-studio-swift Native Swift authoring — create KDNA on Apple platforms Swift developers
kdna-writing · decision_state · prompt_diagnosis · agent_safety · kdna_authoring · content_strategy · knowledge_management · open_source_project · code_review · animation Official domain packages (bilingual en/zh-CN for core domains, evolving eval coverage) Domain consumers
aikdna.com Website source Web contributors

Repository Scope

This repository (aikdna/kdna) contains:

  • KDNA protocol specification
  • Canonical schemas and validation rules
  • Reference examples
  • Benchmark definitions and reports
  • Asset Card and Human Lock specifications
  • Core protocol documentation

Related repositories:


How KDNA fits in the AI agent stack

Mechanism What it provides Example
Prompt What to say "You are a helpful assistant."
Skill / Workflow What steps to follow "Run lint, then format, then commit."
MCP / API What tools to call "Call the GitHub API to create a PR."
RAG / Knowledge base What facts to retrieve "Here are the company's coding standards."
Fine-tuning What behavior to internalize Model trained on expert decisions.
KDNA How to judge within a domain "Classify whether this is a structural problem or a language problem. Apply axioms X and Y. Avoid banned term Z. Run self-checks."

KDNA does not replace these mechanisms. It provides a judgment reference layer that operates alongside them. For a deeper comparison, see KDNA and the AI Stack.


FAQ

Is KDNA just a fancy system prompt?

No. System prompts are free-text behavioral instructions scoped to a single conversation. KDNA is a structured, validated, version-controlled format with explicit fields (axioms, boundaries, self-checks, failure risks). KDNA packages are designed to be signed, hash-verified, and distributed through a registry — a system prompt is none of these.

Does KDNA replace the model?

No. KDNA is a judgment reference that the model loads before it reasons and acts. The model still does all the reasoning, generation, and tool use. KDNA tells the model what to pay attention to, what to avoid, and what to verify — it does not generate output.

How is KDNA different from RAG?

RAG retrieves facts and documents for the model to reference. KDNA encodes what matters and what to watch for in a domain. RAG says "here's the coding standard document." KDNA says "when reviewing code, classify whether the problem is structural or cosmetic before suggesting changes."

Can I use KDNA without coding?

Yes — start with KDNA Studio (@aikdna/kdna-studio) for guided domain authoring. To install and use domains with your AI agent, you only need the CLI (npm install -g @aikdna/kdna-cli). Creating your own domain currently requires editing JSON files, though KDNA Studio's interview mode helps non-technical experts structure their judgment without writing code.

Does KDNA work with any AI model?

KDNA is model-agnostic. The format encodes judgment as structured JSON — any agent framework that can load context before reasoning can use KDNA. Currently supported agents include Claude Code, Codex, OpenCode, Cursor, and GitHub Copilot.

What happens if I load multiple KDNA domains that conflict?

KDNA's composition mechanism detects and reports conflicts rather than silently merging incompatible principles. When domains conflict — for example, a brand domain encouraging emotional intensity while a compliance domain requires conservative wording — the agent reports the conflict rather than choosing one side.

Can AI agents modify KDNA domains?

No — not the judgment-class fields. KDNA's Human Judgment Lock requires human confirmation before axioms, boundaries, risk models, failure criteria, and other judgment-class fields can be modified. Operational fields like usage statistics can be updated automatically.

Where can I see KDNA in action?

Run kdna compare @aikdna/writing --input "help me improve this post" to see a side-by-side judgment path comparison. Visit aikdna.com/benchmark for evaluation data across multiple domains.


Languages

English · 中文

License

  • Code (CLI, Studio, Registry, Skills, VS Code extension): Apache-2.0
  • Documentation, examples, and domain content: CC-BY-4.0 See LICENSE and LICENSE-DOCS for full terms.

Open Standard, Not Open Identity

KDNA is open source because domain judgment should become shared infrastructure for AI agents. We welcome developers, researchers, creators, and organizations to build KDNA domains, tools, validators, loaders, and agent integrations.

The format is open so the ecosystem can grow. The identity is protected so the ecosystem does not fragment.

However, KDNA is intended to grow as a coherent open standard, not as a set of fragmented renamed protocols. Forks are welcome for experimentation, but public derivative protocols must clearly identify themselves as independent and must not imply official KDNA compatibility or endorsement unless they follow the official SPEC and compatibility policy.

About

Open protocol for turning human-led judgment systems into AI-usable, verifiable, composable, and governable assets.

Topics

Resources

License

Apache-2.0, CC-BY-4.0 licenses found

Licenses found

Apache-2.0
LICENSE
CC-BY-4.0
LICENSE-DOCS

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors