Skip to content
Longterm Wiki
Updated 2026-04-08HistoryData
Page StatusDocumentation
Edited 3 days ago396 words1 backlinks
Content2/13
SummaryScheduleEntityEdit historyOverview
Tables3/ ~2Diagrams0Int. links16/ ~3Ext. links0/ ~2Footnotes0/ ~2References0/ ~1Quotes0Accuracy0Backlinks1

FactBase & Entities

What this is

FactBase and TableBase together hold the wiki's structured data:

  • FactBase — typed facts with temporal anchors and source provenance, stored as YAML in packages/factbase/data/things/. Used by <FBF> components and Calc expressions in MDX pages.
  • TableBase — relational entities (people, orgs, grants, divisions, funding programs) stored in PostgreSQL and mirrored from data/entities/*.yaml.
  • ID system — every wiki entity gets an E#### numeric ID and a sid_ stable ID, allocated centrally by the wiki-server.
When to start here

If you're trying to add a new entity, read facts about an org, discover untracked people, or understand the data model, this is the hub.

Live dashboards

DashboardWhat it shows
Entities & PagesAll entities with type, aliases, KB fact counts
Entity ProfilePer-entity card: facts, related pages, usage tracking
Data QualityField completeness and fact staleness per entity type
Data SourcesProvenance tracking (Wikidata, manual, inferred)
People CoveragePerson entity coverage across pages
Grants / Divisions / Funding ProgramsPG-primary table dashboards

CLI playbook

# FactBase: read structured facts
pnpm crux fb show anthropic                       # Entity + all facts (resolved)
pnpm crux fb list --type=person                   # List by type
pnpm crux fb search "anthropic"                   # Find entities by name
pnpm crux fb fact f_dW5cR9mJ8q                    # Show one fact's details
pnpm crux fb stale 90                             # Facts older than 90 days
pnpm crux fb needs-update anthropic               # What's missing
pnpm crux fb coverage --type=organization         # Property coverage report

# FactBase: write
pnpm crux fb add-fact anthropic revenue 5e9 \
  --asOf=2025-06 --source=https://example.com    # Add a single fact
pnpm crux fb import-990 cais --dry-run            # Preview 990 import
pnpm crux fb sync-sources                         # Sync source URLs to wiki-server resources

# Query (cross-cutting wiki-server queries)
pnpm crux query entity anthropic                  # Structured entity data
pnpm crux query facts anthropic --measure=employees
pnpm crux query related scheming                  # Related entities
pnpm crux query backlinks rlhf                    # Pages linking to an entity
pnpm crux query stats                             # Wiki-wide statistics

# TableBase: ID allocation (wiki entities)
pnpm crux tb ids allocate my-new-entity --description="..."
pnpm crux tb ids check anthropic                  # Look up existing ID
pnpm crux tb ids list --limit=100                 # Browse all IDs

# TableBase: lightweight entity discovery
pnpm crux tb people discover                      # Find untracked people
pnpm crux tb ensure-entities --type=person        # Stable IDs only, no wiki page

When to use what

I want to...RunOr check
Read all facts about an orgpnpm crux fb show <slug>Entity Profile dashboard
See what's missing for an entitypnpm crux fb needs-update <slug>Data Quality dashboard
Add a new structured factpnpm crux fb add-fact <entity> <prop> <value> --asOf=YYYY-MM --source=URLCanonical Facts & Calc
Allocate an ID for a new wiki entitypnpm crux tb ids allocate <slug> --description="..."
Find people who appear in data but lack entitiespnpm crux tb people discoverPeople Coverage dashboard
Find stale facts (>90 days)pnpm crux fb stale 90
Understand the three-bases modelData Architecture

Wiki entities vs. lightweight entities

TypeHas wiki page?Has numericId (E#)?Allocate viaUse for
Wiki entityYes (/wiki/E#)Yespnpm crux tb ids allocate <slug>Orgs, concepts, important people (≈200-300 total)
TableBase referenceNoNo (only sid_ stable ID)pnpm crux tb ensure-entities or crux tb create-entityPaper authors, personnel, minor people

Both use the sid_ prefix; use isSid() from @longterm-wiki/id-utils to detect them. Never manually invent IDs.

Architecture & deep dives

  • Data Architecture — the three-bases model (TableBase, FactBase, WikiBase) and PG mapping
  • Fact System Strategy — KB as canonical facts system; <FBF> component design
  • Content Database — storage layers: PG wiki-server, KB YAML, resources YAML, database.json
  • packages/factbase/ — graph, types, validation, format
  • crux/lib/factbase-loader.ts / factbase-writer.ts — load and append
  • data/entities/*.yaml — entity definitions (orgs, persons, concepts)
  • packages/factbase/data/things/*.yaml — fact storage (e.g., anthropic.yaml)