LLMs receive knowledge context primarily as natural language, lacking provenance, confidence, and temporal validity. They cannot distinguish "verbatim Wikipedia text" from "some LLM's inference."
Factum's solution: Each fact carries 7-tuple metadata, injected into context via MCP. Canonical form saves 62% tokens vs JSON.
LLM-generated structured output lacks syntactic constraints. Ambiguous parsing introduces uncertainty. Errors are uncategorized, preventing self-correction.
Factum's solution: Fully parenthesized S-expressions guarantee unique parse trees. 7 error classes enable LLM self-correction.
LLM "thinking" lives in implicit weights. There is no structured knowledge representation for auditable reasoning.
Factum's solution: factum-l encodes knowledge as continuous thought vectors (M3 research), targeting semantic round-trip ≥ 0.95.
7-tuple: (id, predicate, validity, provenance, confidence, authority, permissions) + deps + status
1. Full Parenthesization
Eliminates operator precedence ambiguity. All nesting is expressed through explicit parentheses — no infix expressions.
2. Named-Arg Ordering Constraint
Named arguments must follow positional arguments. Eliminates ambiguity between :keyword prefixes and symbols.
Extracted provenance must carry a model reference (name + version). This is enforced in the parser, not a documentation convention. The same text extracted by GPT-4 vs a small model has vastly different reliability — extracted knowledge without a model reference is a broken audit chain.
If the system retrieves all matches first and filters afterward, aggregate queries themselves leak information: "returned 10 but filtered 3" → the caller now knows 3 confidential nodes exist.
When a source node is retracted, all Derived dependents are automatically cascade-retracted. Soft delete preserves audit history.
BPE tokenizers split JSON delimiters ({ } " :) into separate tokens, while S-expression parens and spaces frequently merge with adjacent tokens.
✓ All token counts measured with real o200k_base tokenizer via tiktoken-rs (issue #9 resolved)
| Tool | Purpose | Required params |
|---|---|---|
| factum_query | Query the knowledge graph | query (S-expr) |
| factum_insert | Insert a new node | node (S-expr) |
| factum_retract | Retract a node (cascade) | node_id |
Client declares capabilities.factum → server returns 24-morpheme ID/name/kind table → compact form uses u32 indices instead of string names. Clients that don't declare it gracefully fall back to string names.
| Format | Positioning | How Factum Differs |
|---|---|---|
| RDF / JSON-LD | W3C triples | 7-tuple; provenance/confidence/permissions are first-class. RDF requires reification. |
| CUE | Config validation | Different domain. Factum validates knowledge claims with temporal validity and conflict arbitration. |
| Datalog | Deductive queries | Factum supports pattern matching but adds temporal validity, confidence arbitration, and provenance. |
| Markdown | Human-readable text | Human-oriented vs LLM-oriented. Factum trades readability for verifiability. |
| JSON | General data interchange | JSON has no schema/provenance/validity. Factum compact form uses JSON as transport encoding. |