Version 1.1 — April 2026

The FreshContext
Specification

MIT License·Immanuel Gabriel (Prince Gabriel)·Grootfontein, Namibia

What this is

The FreshContext Specification defines a standard envelope format for AI-retrieved web data.

It exists to solve one problem: AI models present stale data with the same confidence as fresh data, and users have no way to tell the difference.

Any tool, agent, or system that implements this spec is FreshContext-compatible.

The envelope format

Every FreshContext-compatible response MUST wrap its content in the following text envelope:

[FRESHCONTEXT]
Source: <canonical_url>
Published: <content_date_or_unknown>
Retrieved: <iso8601_datetime>
Confidence: <high|medium|low>
---
<content>
[/FRESHCONTEXT]
FieldRequiredFormatDescription
SourceYesValid URLCanonical URL of the original source
PublishedYesISO 8601 date or unknownBest estimate of when the content was originally published
RetrievedYesISO 8601 datetime with timezoneExact timestamp when this data was fetched
ConfidenceYeshigh, medium, or lowConfidence level of the Published date estimate

Confidence levels

High
Date from a structured, machine-readable field — API response, HTML metadata, RSS, or official timestamp. Examples: GitHub pushed_at, arXiv submission date, HN created_at.
Medium
Date inferred from page signals — visible date strings, URL patterns, or content heuristics. Likely correct but not guaranteed.
Low
No reliable date signal found. Date is an estimate based on indirect signals or entirely unknown.

Structured JSON form

Implementations MAY additionally expose freshness metadata as structured JSON. This form can be validated against the JSON Schema.

{
  "freshcontext": {
    "source_url":          "https://github.com/owner/repo",
    "content_date":        "2026-03-05",
    "retrieved_at":        "2026-04-05T09:19:00.000Z",
    "freshness_confidence": "high",
    "freshness_score":     94,
    "adapter":             "github",
    "decay_rate":          1.0
  },
  "content": "..."
}

Validate with: npx freshcontext-validate <json_string>

Freshness score

An optional numeric freshness value 0–100:

freshness_score = max(0, 100 - (days_since_retrieved × decay_rate))
ScoreInterpretation
90–100Retrieved within hours — treat as current
70–89Retrieved within days — reliable for most uses
50–69Retrieved within weeks — verify before acting
<50Retrieved more than a month ago — use with caution

Domain-specific decay rates

CategoryDecay rateHalf-lifeAdapters
Financial data5.0~10 daysextract_finance
Job listings3.0~17 dayssearch_jobs
News / HN / Reddit2.0~25 daysextract_hackernews, extract_reddit, extract_producthunt
Gov contracts / YC1.5~33 daysextract_govcontracts, extract_yc, extract_gebiz
GitHub / packages1.0~50 daysextract_github, search_repos, package_trends, extract_changelog
Academic papers0.3~167 daysextract_scholar, extract_arxiv
Default1.5~33 daysAll unlisted adapters

Adapter contract

Any data source that feeds into a FreshContext-compatible system is called an adapter.

Adapters MUST:

  • Return raw content plus a content_date (or null if unknown)
  • Set a freshness_confidence level based on how the date was determined
  • Never fabricate or forward-date content timestamps
  • Identify the source system via the adapter field

Adapters SHOULD:

  • Prefer structured API sources over scraped content when both are available
  • Surface rate-limit or access-denied errors explicitly rather than returning empty content
  • Never silently return cached or stale data on retrieval failure

Composite adapters (v1.1)

A composite adapter combines multiple single-source adapters into one call. Composites MUST:

  • Run constituent adapters in parallel (Promise.allSettled or equivalent)
  • Handle partial failures gracefully — if one source fails, the others still return
  • Label each section with its source adapter name
  • Include a Generated: timestamp at the top of combined output
  • Support an optional min_freshness_score parameter (0–100) to filter constituent results

When min_freshness_score is set, any constituent result below the threshold is replaced with a staleness warning rather than omitted, preserving output structure.

Compatibility levels

FreshContext-scored ★★★
Full JSON form + numeric freshness_score on every result. Agents can filter by score threshold.
FreshContext-compatible ★★
Responses include the [FRESHCONTEXT] envelope OR JSON form with retrieved_at + freshness_confidence.
FreshContext-aware ★
Responses include retrieved_at without freshness_confidence. Partial implementation.

Verify: npx freshcontext-validate <response>

Implementations

freshcontext-mcp
The canonical reference implementation. 20 adapters covering GitHub, HN, arXiv, Reddit, YC, Product Hunt, finance, jobs, US federal contracts, SEC filings, GDELT global news, Singapore GeBIZ, and 5 composite landscape tools. Deployed on Cloudflare Workers global edge.
Reference
Building a FreshContext-compatible tool? Open an issue to be listed here.

Why this matters for AI agents

Large language models have no internal clock. When an agent retrieves web data, it cannot distinguish between something published this morning and something published three years ago — unless that information is explicitly surfaced.

The spec started from a concrete failure: the author asked an AI to help find a job. It returned listings. Three applications later — two roles no longer existed, one had closed two years prior. The AI presented everything with equal confidence.

FreshContext is the fix. Every piece of retrieved data carries its own timestamp. The agent can reason about data age before acting. Users can see exactly how fresh their AI’s information is.

Changelog

v1.1 — April 2026
  • Added composite adapter contract (parallel execution, graceful partial failure, section labelling)
  • Added min_freshness_score parameter spec for composite adapters
  • Added decay_rate field to JSON form
  • Formalised three compatibility levels: FreshContext-scored, compatible, aware
  • Added JSON Schema (freshcontext.schema.json) and CLI validator (npx freshcontext-validate)
  • Published spec site at freshcontext-site.pages.dev/spec.html
v1.0 — March 2026
  • Initial specification: envelope format, three confidence levels, optional JSON form, freshness_score formula, adapter contract
  • Reference implementation: freshcontext-mcp with 11 adapters