PrimeForge (Research Repo)
PrimeForge is an ongoing research project exploring a deterministic alternative to LLM-only language understanding by converting natural language into an explicit semantic meaning graph using Semantic Primes, Residential Grammar (RG) Trees, and rule-based semantic compilation.
The core goal is simple:
Take a sentence, parse its structure, compile its meaning into explicit relations, and store that meaning in a form that stays true over time.
This repo currently represents the research and architecture direction, not a finished product.
Research Motivation
Large Language Models (LLMs) are extremely strong at fluent generation, but fluency is not the same thing as grounded meaning.
In real systems, LLMs often fail in predictable ways:
- They produce answers that sound correct but are not supported by a stable internal truth model.
- They struggle with persistent, queryable memory.
- They do not provide a clear explanation of why an answer is true.
- They are non-deterministic and can drift across sessions.
PrimeForge is designed to solve those issues by building a pipeline that produces deterministic, inspectable meaning.
Core Research Idea
PrimeForge treats language understanding like a compiler.
Instead of “predicting the next token,” the system attempts to:
- extract syntactic structure,
- enforce compositional constraints,
- and write meaning as explicit relationships.
The result is intended to be used in two ways:
- As a standalone semantic truth/query layer for users or applications.
- As a grounding payload that can be fed into an LLM to reduce hallucinations and improve consistency.
Current Research Pipeline (Conceptual)
1) Sentence Input
A single natural language sentence is provided as input.
Example:
“Dustin has brown hair.”
2) Residential Grammar Tree (Syntax Tree)
A “Residential Grammar Tree” is treated as a standard syntax tree / parse tree that represents the hierarchical structure of the sentence:
- Nodes (constituents like NP/VP or dependency relations)
- Branches (parent-child grammatical structure)
- Terminal words at the bottom
- Phrase structure boundaries
This syntax tree exists as a required intermediate representation and is meant to be explicit and inspectable.
3) RG Tree Representation
The syntax tree is transformed into a machine-friendly RG Tree JSON representation that captures:
- verbs (tense, aspect, voice)
- subjects
- direct objects
- complements / verb complements
- modifiers (adjectives, adverbs)
This RG Tree becomes the canonical input to the semantic system.
4) Semantic Prime Compilation
The semantic engine uses Semantic Primes as minimal meaning operators and types.
Instead of embedding meaning implicitly, PrimeForge models meaning explicitly through:
- typed semantic relationships (edges)
- entity typing (node classifications)
- story instances (events and actions)
Semantics are applied using deterministic rule objects called Prime Scripts.
Semantic Primes (Current Inventory Direction)
Semantic Primes are grouped in categories that serve as the project’s semantic vocabulary foundation, including:
- Substantives (I, YOU, SOMEONE, THING)
- Mental predicates (THINK, KNOW, WANT)
- Actions/events/movement (DO, HAPPEN, MOVE)
- Time and space primitives (WHEN, WHERE)
- Logical operators (NOT, IF, BECAUSE, MAYBE)
- Existence and possession patterns (BE, HAVE)
This inventory is the conceptual foundation for building compositional meaning instead of statistical approximation.
Prime Molecules and Interaction Atoms
In addition to minimal primes, PrimeForge research includes “Prime Molecules” and “Physical Interaction Atoms” as compositional building blocks.
Examples under consideration include decompositions like:
- WALK (MOVE + legs + ground contact)
- DRINK (MOVE liquid into mouth/body)
- CUT (CONTACT + tool + material separation)
These molecules are intended to bridge the gap between ultra-minimal primes and real-world language coverage.
Prime Scripts (Executable Semantics)
Prime Scripts are deterministic semantics rules that combine:
- conditions: syntactic requirements (subject exists, complement exists, complement type is noun, etc.)
- actions: semantic writes (create links, add story instances, add types)
Prime Scripts are designed to allow meaning extraction to be:
- deterministic
- auditable
- testable
- explainable
This transforms semantics into an engineering system rather than a prompting strategy.
Prime Story Storage (Current Meaning Output Format)
The research currently targets a human-readable, fact-like output form called Prime Story Storage.
Example sentence:
“Dustin is human, he has brown hair.”
Example semantic storage output:
IS: {Dustin, Human}
HAS: {Dustin, Hair}
DESCRIPTOR: {Hair, Brown}
This format demonstrates the intended direction:
- stable relationships
- explicit meaning links
- queryable truth
StoryInstance Direction (Events + Micro-Stories)
PrimeForge research is not limited to simple triples.
The system is also designed to represent event-level meaning using StoryInstances, including:
- verb/event identity
- argument roles (actor, object, target)
- optional time chunk
- optional location chunk
- optional source/provenance metadata
This supports expanding from static facts into actions, consequences, and narratives.
Semantic Time and Location Management (Planned Subsystems)
Two major subsystems are planned as dedicated semantic layers:
Semantic Time Management
- timestamps and time anchoring
- “yesterday / tomorrow / last week” normalization
- duration and ordering
- time arithmetic
- timezone and calendar edge cases
Semantic Location Management
- geographic hierarchy
- containment and adjacency
- distance and proximity operators
- spatial relationships (in/on/under/etc.)
These are not fully implemented yet, but are considered required for “real world meaning.”
Why This Matters (Compared to LLM-Only Systems)
PrimeForge is designed to beat LLM-only approaches in specific, high-value dimensions:
Pros
- Deterministic output
- Explicit meaning representation
- Strong memory consistency
- Queryable fact base
- Explainability and traceability (provenance)
- Debuggable failures (rule missing, parse incomplete, ambiguity unresolved)
Cons
- Coverage is earned through engineering (scripts and molecules), not pretraining
- Word sense routing is hard (prepositions and polysemy)
- Scaling scripts requires careful design to avoid rule explosion
- Requires reliable parsing and structure extraction
This is not meant to replace LLMs as generators.
It is meant to be a semantic backbone that provides truth and structure.
Current Research Goals
The next milestones for the research are:
Build a deterministic pipeline:
- sentence → syntax tree → RG tree → semantic compilation
Implement v1 semantics:
- “is” linking
- “has/have” possession
- adjective descriptors
- “of” possessive relationships
Persist meaning to a graph database:
- Neo4j node/edge structure for IS/HAS/DESCRIPTOR
- provenance stored on every semantic edge
Support user questions and LLM grounding:
- answer queries directly from the graph
- export compact grounding payloads for an LLM
Status
This repository currently represents:
- the research direction
- the semantic modeling strategy
- the planned implementation architecture
It is expected to evolve rapidly as Prime Scripts, prime molecules, and semantic subsystems mature.
Author
Dustin Hendrickson