Version 1.2 — May 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 and a temporal correction layer that scores it.

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. MCP is one interface over the methodology; the envelope and structured metadata are the compatibility contract.

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. Verify before acting.
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. The canonical FreshContext model is exponential Decay-Adjusted Relevancy:

R_t = R_0 · e^(-λt)

For envelope-level freshness, R_0 may be normalised to 100. For ranked intelligence feeds, R_0 may be semantic or profile relevance. λ is the source-specific decay constant and t is signal age.

Context-conditioned utility: FreshContext can rank the same signal differently depending on the requesting user, query, agent, or workflow. That context shapes R_0; DAR then applies source-specific temporal decay through R_t = R_0 · e^(-λt). Core utility primitives may model this as U(q, s, t) = R(q, s) · e^(-λt) · C_date · C_status.

If no reliable timestamp exists, implementations SHOULD set freshness_score to null and confidence to low. Missing, invalid, or future timestamps beyond clock-skew tolerance MUST NOT be treated as fresh.

ScoreInterpretation
90–100Very recent for its source class — treat as current
70–89Still fresh enough for most uses
50–69Decayed but potentially useful — verify before acting
<50Low temporal utility — use with caution

Reference decay classes

These are reference/default classes. Implementations may tune them by source, profile, or deployment while preserving the exponential DAR model.

Source classλ per hourHalf-lifeExamples
Fast discussion0.050~14 hoursHacker News front-page stories
News cycle0.020~35 hoursGDELT global news
Community / launch signals0.010~3 daysReddit, Product Hunt
Jobs / material events0.005~6 daysJob listings, SEC 8-K filings
Procurement / market context0.001~29 daysStooq quotes, gov contracts, YC data
Package / changelog cadence0.0005~58 daysnpm/PyPI, GitHub Releases
Repository activity0.0002~5 monthsGitHub repositories
Academic work0.00005~1.6 yearsarXiv, Google Scholar

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
  • Surface retrieval failures explicitly

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

Failure honesty

Adapters MUST NOT wrap failed, empty, blocked, timeout, rate-limited, access-denied, or malformed output as high-confidence fresh context.

If adapter output looks like an error, implementations SHOULD downgrade confidence to low, set freshness_score to null, preserve enough error context for diagnosis, and avoid presenting the result as successful current context.

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.

MCP is one interface, not the whole FreshContext model. FreshContext-compatible systems may be MCP servers, APIs, CLIs, npm packages, dashboards, agents, or internal services.

Verify: npx freshcontext-validate <response>

Core-backed implementation status

FreshContext Core now owns freshness scoring, envelope generation, confidence metadata, failure guards, shared types, and rank/explain primitives in the reference implementation.

The live MCP Worker uses Core-backed envelope generation while Cloudflare-specific runtime behavior, MCP transport, cache policy, rate limits, and deployment concerns remain outside Core.

Claude Desktop is a supported MCP client, but FreshContext Core is not Claude-dependent. MCP is one interface over the methodology.

Implementations

freshcontext-mcp
The canonical reference implementation: freshcontext-mcp@0.3.17 with 21 read-only MCP tools / reference adapters covering GitHub, HN, arXiv, Reddit, YC, Product Hunt, Stooq 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 addresses this. Retrieved data can carry timestamp, confidence, provenance, and freshness metadata. The agent can reason about data age before acting, and users can inspect how fresh the provided context appears to be.

Changelog

v1.2 — May 2026
  • Clarified exponential DAR scoring as the canonical freshness model
  • Added missing/invalid/future timestamp handling guidance
  • Added failure-honesty requirements for adapter output
  • Added Core-backed envelope/scoring implementation status
  • Clarified MCP as one interface over the FreshContext methodology
  • Updated reference implementation language for freshcontext-mcp@0.3.17 and 21 read-only tools/reference adapters
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 initial adapter set