AI Lab

FactLayer: a knowledge layer for AI agents

Models answer from a memory with a cutoff. Web search is slow, expensive in tokens and often wrong. FactLayer sits between the two: a shared, verified store of knowledge units that any model reads over one open protocol, in a fraction of the tokens.

95–99%on 200 questions with independent GitHub truthmemory alone: 3–6%
+53 ptsover the model’s memory on 504 structured questions+15 to +24 over raw search
2B > 9Ba 2B model with the layer beats a 9B model alone73.4% vs 24.4%
~140 tokcontext tokens per answerraw search: ~650

The problem

Every agent repeats the same lookups: which version is current, what a package requires, what a company does today, what changed last week. A model answers from training data that may be a year old, or it searches the web and spends six hundred tokens reading three pages, with no record of what it found. Neither path verifies anything, and nothing is shared between calls.

What it is

A resolver that agents call as a tool. It exposes three operations over MCP:lookup for a question, get for a known subject and attribute, optionally at a past date, and check_claim to test a sentence against the store. Every answer is a block of knowledge units in the Knowledge Unit Protocol (KUP): one line per unit, with its as-of date, confidence, volatility, sources and previous values.

# kup/0.1 n:2 lvl:full sub:pypi:pandas q:pypi:pandas latest_version
fact|latest_version|3.1.0|t:2026-10-29 c:9 v:m vf:2026-10-22 id:958
>src|url|https://pypi.org/project/pandas/|t:2026-10-22
>prev|latest_version|3.0.6|vt:2026-10-22
fact|requires_python|3.11|t:2026-10-29 c:9 v:s

About 18 tokens per unit. Ten unit types cover facts, stats, events, claims, advice, warnings, how-tos, definitions and relations.

How it works

  1. 01
    Understand

    The question is mapped to a subject and the attributes it needs, with the caller’s context and model cutoff taken into account.

  2. 02
    Resolve from the store

    A hit returns stored units at once. Each unit carries its as-of date, confidence, volatility and the sources behind it.

  3. 03
    Source routing on a miss

    Primary sources come first: package registries, Wikidata, the official site. Web search is the last resort, not the first.

  4. 04
    Grounded extraction and verification

    Every extracted value must appear in the source text. Claims are merged across independent sources; disagreements are kept as disputes, not averaged away.

  5. 05
    Learned freshness

    Each unit is re-checked on an interval learned from how often it actually changed. Previous values stay as history, so an agent can see what changed since its cutoff.

Measured

Benchmark v2: 526 questions about Python and npm packages, in six classes (current version, release date, deprecation, license, Python support, Node engines) plus 22 hand-written advice questions. Four arms per model: memory only, raw web search (top three results), the layer, and the layer with registries disabled so every answer goes through search, extraction and verification. All models are small local ones running on a Mac; no API spend.

Bar chart: Qwen3.5-2B alone 20%, Qwen3.5-2B with the fact layer 73%, Qwen3.5-9B alone 24%, on 504 structured questions.
A 2B model with the layer against a 9B model alone, 504 structured questions.

Structured questions (504)

ModelMemoryWeb searchLayerLayer, GitHub truthTokens per answer, layer vs web
Qwen3.5-4B19.4%57.1%72.6%95.5%218 vs 730
Gemma-4-E2B16.9%48.6%73.0%95.5%226 vs 755

Small model plus layer against a larger model alone

SetupAccuracyGitHub truthPrompt tokensMedian latency
Qwen3.5-2B alone20.4%3.5%800.63 s
Qwen3.5-2B + layer73.4%99.0%3582.71 s
Qwen3.5-9B alone24.4%6.0%801.63 s

Where memory was wrong and the layer was right

QuestionMemoryLayerTruth
Latest released version of pydantic on PyPI?2.11.02.14.12.14.1
Under which license is psycopg released?BSD 2-ClauseLGPL-3.0-onlyLGPL-3.0-only
Minimum Python version for pandas 3.0.6?3.103.113.11

Caveats, stated plainly

  • 200 of the 504 questions have truth from GitHub releases, independent of the layer. The other 304 use registry metadata, which is also the layer’s primary source, so the registry path is an upper bound.
  • The web-only path, where every answer goes through search and extraction, scored 38 to 39% against 49 to 57% for raw search. The 22 advice questions scored 23 to 36% against 50 to 59%. Both ran on a 4B local extraction model, and both are the next thing to fix before a second domain is opened.
  • The showcase domain is software packages. Other domains are not yet claimed.

Why a protocol

The format is the boundary. KUP is small enough to fit in a tool description, carries provenance and time on every line, and costs about half the tokens of compact JSON. The protocol is open; publishers can sign their own units, and any resolver can speak it. The hosted resolver, its verification pipeline and its history are the service.

Status

  • Working resolver with MCP over stdio and HTTP, bearer-token auth and rate limits.
  • Store of 51,000 units across the showcase packages, refreshed on a learned schedule.
  • Per-model error registry from the benchmark: 1,079 recorded wrong answers across four models.
  • Next: the protocol spec and the benchmark as public repositories, a hosted extraction model for the web path, a self-hosted node for company knowledge.

Early access, partnerships and questions: hi@omerodabas.com