Open Sourceendgame.io
Home

Factoid

Factoid turns documents into short facts, each pinned to the exact passage it came from. Your agents search those facts instead of re-reading the documents on every question.

  • Python 3.13+
  • MIT license
  • v0.1.34
  • updated yesterday
uv tool install factoid
  • 92% accuracyThat’s the share of questions facts got right on a 512-token budget, against 57% for chunks. The test asked 200 questions about news transcripts.examples/mediasum
  • 12.89× lower costThat’s how much less it cost to read facts than raw documents in our paper’s test. Facts were also right in 30 of 30 trials over revised and deleted documents, against 1 of 30.arXiv 2609.29661
  • CitedEvery fact carries its exact source quote or table cell, speaker, and timestamp. Factoid’s code attaches them, not a model.README, Design

What is a fact?

Example fact

fact.yaml
text: >
Samir Patel said that Kestrel Health's finance team
only approved 30 analyst seats for the initial rollout
in the morning of October 14, 2026 budget check, not 45.
class: CustomerFact
traits: [Pricing]
status: current
quotes:
- text: >
Finance only approved 30 analyst seats for the
initial rollout in this morning's budget check, not 45.
speaker: Samir Patel
at: "05:24"
entities:
- { name: Samir Patel, kind: Person, role: speaker }
- { name: Kestrel Health, kind: Company, role: about }
valid_from: 2026-10-14
expires: never

Anatomy of a fact

text
One short, self-contained sentence stating a single claim, with no pronouns or filler.
class
The kind of fact: here CustomerFact, and you can define your own Python classes.
traits
Optional domain labels you define for the model to apply: here Pricing.
status
Whether the fact still stands (current) or was superseded, ended, corrected, contradicted, or retracted.
quotes
Exact source passages attached by Factoid’s code, with speaker and timestamp: here Samir Patel at 05:24.
entities
Linked people, companies, or things, with their kinds and roles: here Samir Patel and Kestrel Health.
valid_from
When the fact became true or happened, resolved against the document’s date for as-of search.
expires
How the fact ages in search: never (history), estimated (until changed), or at_deadline (settled by a date).

How a fact is identified

1Source content goes in

Sales call: Kestrel Health4:00 – 4:30 PM · 4 people
Transcript

2Factoid pulls out facts. Here are 3 examples.

  • Elena Ortiz said that Kestrel Health planned 45 analyst seats for the initial rollout of the new analytics platform.02:05
  • Maya Lin said that Northstar Data's Enterprise tier pricing is $96,000 a year for 45 seats and includes SAML SSO and full audit logs.02:51
  • Samir Patel said that Kestrel Health's finance team only approved 30 analyst seats for the initial rollout in the morning of October 14, 2026 budget check, not 45.05:24

3Facts are available to your agents

You ask:

How many seats is Kestrel starting with?

Your agent answers:

30. Finance approved 30 analyst seats for the initial rollout, not the 45 Elena planned.

From Samir Patel’s fact at 05:24

When facts beat chunks

Classic RAG wastes token budgets on surrounding filler text that doesn’t answer the question. Compiled facts strip out the noise. They resolve speakers and pronouns into single, self-contained claims that cut query costs without sacrificing accuracy.

Large token budgets mask this bloat: on MediaSum broadcast transcripts, facts and raw chunks tie at 8,192 tokens. Tighten the budget, and chunk accuracy collapses. At 512 tokens, facts still hit 92% accuracy, while chunks drop to 57%.

FactsChunks
Facts at 512 tokens: 92%
Chunks at 512 tokens: 57%
512 tokens
Facts at 2,048 tokens: 95%
Chunks at 2,048 tokens: 87%
2,048 tokens
Facts at 8,192 tokens: 95.5%
Chunks at 8,192 tokens: 94.5%
8,192 tokens
Accuracy across 200 questions on 100 MediaSum transcripts (examples/mediasum) at matched token budgets. Prompts were tuned on 30 transcripts and evaluated on the remaining 70 with the same or better accuracy.

Research papers

Factoid is built on Endgame’s applied research and production deployments, alongside three core papers on compiling facts at ingest. Together, they demonstrate how ingest-time compilation outperforms standard RAG on accuracy, revision tracking, and cost.

Define your own traits

Use traits to tell Factoid which domain-specific facts to find and tag.

Traits are standard Python classes. Just write a one-line docstring to define what the model should look for. You can also set confidence thresholds or add hooks to react to changes. Here, we alert the deal team whenever a newer document changes a liability cap.

facts.py
# facts.py
from factoid import Fact, FactTrait
class ConsentRequired(FactTrait):
"""A named party must approve an action before it happens."""
class LiabilityCap(FactTrait):
"""A limit on how much a party can owe."""
threshold = 0.8
@classmethod
def after_supersede(cls, fact, older):
notify(fact.deal_team, f"Liability cap changed: {older.text} -> {fact.text}")
class SourceFact(Fact):
"""What a contract, a client, or the other side says."""
traits = [ConsentRequired, LiabilityCap]

© 2026 Endgame. All rights reserved.