DEV Community

NKTgAI
NKTgAI

Posted on

NKTg AI – A deterministic text decoding layer replacing vector-RAG before LLMs

We built NKTg AI, a structural text-decoding system designed to address a fundamental limitation we found in traditional RAG (Retrieval-Augmented Generation).

The Problem with Standard RAG

Standard RAG relies on vector embeddings and cosine similarity to retrieve text chunks. While effective for matching keywords or general semantic similarity, it treats all retrieved text equally, passing raw context—including conditional noise, exceptions, and irrelevant details—directly to the LLM. The LLM is then expected to read, parse, and synthesize the answer simultaneously, which frequently leads to hallucinations or altered original intent.

How NKTg AI Differs from RAG

Instead of probabilistic vector retrieval, NKTg AI acts as a deterministic pre-processing brain between the raw text and the LLM:

  1. Physics-Based Semantic Energy (NKTg Law): Rather than measuring vector distance, NKTg AI evaluates semantic energy ($AMP$ for actions/results vs. $DAMP$ for conditions/exceptions) using variable inertia algorithms.

  2. Verbatim Core Content Extraction: It extracts the exact original sentence with the highest action density without generating, interpreting, or altering the author's original wording.

  3. Decoupled Architecture (Decode → Generate):

  4. NKTg AI: Strips context noise, isolates core actions, and standardizes the logical framework.

  • LLM (Local/Cloud): Serves strictly as a natural language interface to render the already-decoded framework, rather than reasoning over unrefined raw context.

Architecture & Security

  • Browser-Native / Zero-Server: Runs 100% client-side via WebAssembly and WebGPU (WebLLM). Your text never leaves your browser (localStorage only).

  • Cloud Option: Includes a free cloud generation mode for low-spec devices without WebGPU capability.

Try it out here: https://nktg.org

We would love to hear your feedback on using deterministic energy scoring versus vector embeddings for context optimization before LLMs. How are you currently handling context noise in your RAG pipelines?

Top comments (0)