Inferensys

Prompt

Source Currency Audit Prompt for Knowledge Bases

A practical prompt playbook for using the Source Currency Audit Prompt in production AI workflows to identify stale entries and prioritize updates.
Knowledge engineer constructing knowledge base on laptop, document hierarchy visible, casual office setup.
PROMPT PLAYBOOK

When to Use This Prompt

Defines the job-to-be-done, ideal user, required context, and boundaries for the Source Currency Audit Prompt.

This prompt is designed for knowledge base maintenance teams and AI operations engineers who need a systematic, automated way to prevent stale information from degrading the quality of RAG applications, internal search, or customer-facing assistants. The core job-to-be-done is auditing a document corpus for currency, identifying entries that require updates based on age, domain-specific decay rates, and the availability of newer sources. The output is a prioritized audit report with refresh recommendations, enabling teams to move from reactive firefighting to scheduled, proactive content maintenance.

Use this prompt when you manage a knowledge base where information has a predictable shelf-life—such as product documentation, regulatory filings, financial reports, or technical runbooks—and you need to schedule regular audits. The prompt requires a structured input payload containing document metadata (publication date, last-updated date, document type, and domain), a set of domain-specific freshness thresholds, and an optional list of newer candidate sources. It is designed to be wired into a scheduled automation harness, such as a weekly CI/CD job or a cron-triggered cloud function, that feeds the prompt with a batch of documents and processes the structured audit report.

Do not use this prompt for real-time freshness checks on live data streams, for evaluating the factual accuracy of document content, or for making automated deletion or archival decisions without human review. The prompt assesses currency based on temporal signals and source availability, not on content correctness. For high-risk domains such as healthcare or legal compliance, always route the prioritized audit report to a human reviewer before taking action. If your knowledge base contains documents without reliable publication or last-updated metadata, pair this prompt with a Publication Date Extraction Prompt to normalize timestamps before running the audit.

PRACTICAL GUARDRAILS

Use Case Fit

Where the Source Currency Audit Prompt works, where it fails, and the operational preconditions required before putting it into a scheduled audit harness.

01

Good Fit: Scheduled KB Maintenance

Use when: You have a managed knowledge base with known document dates and a regular maintenance cadence. The prompt excels at producing prioritized refresh lists for editorial or engineering teams. Guardrail: Pair with a human review step before publishing any automated deprecation or archival actions.

02

Bad Fit: Real-Time Streaming Feeds

Avoid when: The source is a live event stream, ticker, or social media firehose where staleness is measured in seconds. This prompt is designed for batch audits, not sub-second freshness checks. Guardrail: Use a dedicated real-time freshness evaluation prompt for streaming data and reserve this audit for daily or weekly batch reviews.

03

Required Input: Publication Dates

Risk: The audit cannot assess currency without reliable publication or last-updated timestamps. Missing or ambiguous dates produce useless staleness scores. Guardrail: Run a Publication Date Extraction Prompt as a preprocessing step. Flag entries with unextractable dates for manual review before they enter the audit pipeline.

04

Operational Risk: Domain Decay Misconfiguration

Risk: Using a generic 90-day decay window for all content types. Financial earnings data decays quarterly; legal statutes decay slowly; news decays in hours. A single threshold produces false positives and missed staleness. Guardrail: Maintain a domain-to-decay-rate mapping table. Pass the correct half-life parameter per content category into the prompt's [DOMAIN_DECAY_RULES] variable.

05

Operational Risk: Audit Report Overload

Risk: A large corpus audit produces hundreds of flagged entries, overwhelming the maintenance team and causing alert fatigue. Guardrail: Add a severity tier to the output schema (CRITICAL, HIGH, MODERATE, LOW). Configure the scheduled harness to only escalate CRITICAL and HIGH items to human reviewers, while auto-archiving LOW items with a log entry.

06

Scalability: Large Corpus Batching

Risk: Running the audit over 100,000 documents in a single prompt exceeds context windows and produces truncated or inconsistent results. Guardrail: Shard the corpus by content category or date range. Run parallel audit jobs with consistent [DOMAIN_DECAY_RULES] and aggregate results in the application layer, not inside the prompt.

PROMPT PLAYBOOK

Copy-Ready Prompt Template

A reusable prompt template for auditing a knowledge base's currency, identifying stale entries, and generating a prioritized refresh report.

This prompt is the core instruction set for a Source Currency Audit. It is designed to be dropped into an orchestration layer where variables like the knowledge base snapshot, domain-specific decay rules, and the output schema are populated at runtime. The template uses square-bracket placeholders exclusively to prevent conflicts with other templating engines. Before pasting, ensure you have a clear definition of your domain's decay rates and a list of any newer source collections you want the auditor to compare against.

text
You are a Knowledge Base Currency Auditor. Your task is to analyze a snapshot of a knowledge base and identify entries that are outdated or at risk of becoming stale.

# INPUTS
- Knowledge Base Snapshot: [KNOWLEDGE_BASE_SNAPSHOT]
- Domain Decay Rules: [DOMAIN_DECAY_RULES]
- Newer Source Collections (Optional): [NEWER_SOURCE_COLLECTIONS]
- Current Date: [CURRENT_DATE]

# OUTPUT SCHEMA
You must produce a JSON object with the following structure:
{
  "audit_report": {
    "audit_timestamp": "string (ISO 8601)",
    "entries_analyzed": "integer",
    "stale_entries": [
      {
        "entry_id": "string",
        "current_content_summary": "string",
        "staleness_reason": "string (e.g., 'Exceeded domain decay window', 'Superseded by newer source')",
        "recommended_action": "string (e.g., 'REFRESH', 'ARCHIVE', 'REVIEW')",
        "urgency": "string (e.g., 'HIGH', 'MEDIUM', 'LOW')",
        "suggested_replacement_source": "string | null"
      }
    ],
    "healthy_entries_count": "integer"
  }
}

# CONSTRAINTS
- An entry is stale if its last-updated date is older than the domain-specific decay window defined in [DOMAIN_DECAY_RULES].
- If [NEWER_SOURCE_COLLECTIONS] is provided, also flag entries that are superseded by more recent, authoritative information from those collections.
- Base your analysis strictly on the provided inputs. Do not invent external facts.
- If an entry's last-updated date is missing, classify its urgency as 'HIGH' and its recommended action as 'REVIEW'.
- Prioritize entries that are both stale and frequently accessed or critical to core operations, if such metadata is available in the snapshot.

To adapt this template, replace the placeholders with your actual data. [KNOWLEDGE_BASE_SNAPSHOT] should be a structured list of entries with their IDs, content summaries, and last-updated timestamps. [DOMAIN_DECAY_RULES] is a critical input; define it as a clear set of rules, such as 'Financial regulations: 90 days; Technical documentation: 365 days; News articles: 7 days.' The [NEWER_SOURCE_COLLECTIONS] placeholder is optional but powerful—use it to provide a set of documents from a recent crawl or a premium data feed that might supersede your existing knowledge base. The next step is to wire this prompt into a scheduled job that validates the JSON output and feeds it into your content refresh pipeline.

IMPLEMENTATION TABLE

Prompt Variables

Required inputs for the Source Currency Audit Prompt. Each placeholder must be populated before the prompt is sent. Validation notes describe how to programmatically verify the input before execution.

PlaceholderPurposeExampleValidation Notes

[KNOWLEDGE_BASE_INDEX]

List of document metadata to audit, including IDs, titles, publication dates, and last-reviewed dates

doc-142: 'Q3 Earnings Report', published 2024-10-15, last-reviewed 2024-11-01

Schema check: array of objects with required fields id, title, published_date, last_reviewed_date. Dates must parse as ISO 8601. Null allowed for missing last_reviewed_date.

[DOMAIN_DECAY_CONFIG]

Domain-specific freshness thresholds defining how quickly information becomes stale

financial_reports: 90 days, breaking_news: 24 hours, regulatory_filings: 365 days

Schema check: object mapping domain strings to integer days. Each value must be a positive integer. Reject zero or negative values. At least one domain entry required.

[CURRENT_TIMESTAMP]

The reference point for calculating document age and staleness

2025-01-15T09:00:00Z

Parse check: must be valid ISO 8601 datetime. Compare against system clock; warn if offset exceeds 1 hour. Required for all staleness calculations.

[NEWER_SOURCE_CANDIDATES]

Optional list of external sources that may supersede knowledge base entries

Schema check: array of strings, each a valid URL or identifier. Null allowed if no external comparison is requested. Empty array is valid and means no candidates provided.

[AUDIT_SCOPE_FILTER]

Optional filter to limit audit to specific domains, date ranges, or document subsets

{ domains: ['financial_reports'], date_range: { start: '2024-01-01', end: '2024-12-31' } }

Schema check: object with optional keys domains, date_range, doc_ids. If date_range present, start and end must parse as ISO 8601 and start must precede end. Null allowed for full audit.

[OUTPUT_SCHEMA]

Expected structure for the audit report output

{ entries: [{ doc_id, title, staleness_score, recommendation, reasoning }], summary: { total_audited, stale_count, urgent_count } }

Schema check: must be a valid JSON Schema object or structured type definition. Validate against the prompt's expected output contract before sending. Required.

[STALENESS_THRESHOLDS]

Score thresholds for classifying entries as current, stale, or urgent

{ stale_warning: 0.5, urgent_action: 0.8 }

Schema check: object with numeric values between 0.0 and 1.0. stale_warning must be less than urgent_action. Both required. Reject values outside 0-1 range.

[REVIEWER_INSTRUCTIONS]

Custom instructions for how the audit report should prioritize or format findings

Prioritize entries affecting public-facing product documentation. Flag entries where newer source candidates directly contradict current content.

Type check: string. Null allowed if no custom instructions. Length check: warn if exceeds 2000 characters to avoid diluting core audit logic.

PROMPT PLAYBOOK

Implementation Harness Notes

How to wire the Source Currency Audit Prompt into a scheduled workflow with validation, retries, and human review gates.

The Source Currency Audit Prompt is designed to run as a batch or scheduled job, not a real-time user-facing endpoint. The typical integration pattern is a cron-triggered script or a step in a data pipeline (Airflow, Prefect, Dagster) that iterates over knowledge base entries, sends each to the model with the audit prompt, collects structured audit reports, and writes results to a review queue or dashboard. Because the prompt produces a structured JSON report with prioritized refresh recommendations, the harness should validate the output schema before accepting any result. A malformed or hallucinated audit entry can cause downstream automation to skip a genuinely stale document or flag a current one for unnecessary review.

Start by defining the input batch. For a knowledge base of 10,000 articles, you might process 100 per run to stay within rate limits and cost targets. Each article needs its [DOCUMENT_METADATA] (title, URL, last_modified date, content type) and [DOCUMENT_CONTENT] (full text or a representative chunk). The prompt template expects these as structured inputs. On the model side, prefer a model with strong structured output support (GPT-4o, Claude 3.5 Sonnet, or Gemini 1.5 Pro) and enable JSON mode or structured outputs with the schema defined in the prompt's [OUTPUT_SCHEMA] block. Set temperature=0 to minimize variance across audit runs. Implement a retry wrapper: if the model returns invalid JSON, a missing required field, or a confidence score below your threshold (e.g., <0.7), retry once with the same input. If the second attempt also fails, log the failure and flag the entry for manual review rather than silently accepting a bad audit result.

The audit report output should be written to a persistent store (database table, blob storage, or a review tool like Retool or a custom dashboard). Each record must include the original document identifier, the audit timestamp, the model's freshness score, the recommended action (keep, review, replace, archive), the decay rate justification, and any suggested replacement sources. Build a validation layer that checks: (1) the recommended_action is one of the allowed enum values, (2) the freshness_score is a float between 0 and 1, (3) suggested_replacements is an array even if empty, and (4) the audit_timestamp is within the current run window. Reject and retry any output that fails these checks. For high-stakes knowledge bases (compliance, legal, financial), route all replace and archive recommendations to a human review queue before any automated action is taken. Never auto-delete or auto-archive content based solely on model output.

For observability, log every audit run with: document ID, model used, prompt version, latency, token count, validation pass/fail, retry count, and the final action taken. This creates an audit trail for the audit process itself. If you run this weekly, compare week-over-week results to detect drift—if a document flips from 'current' to 'stale' and back without content changes, your prompt or model behavior may need investigation. Set up alerts for sudden spikes in 'stale' classifications that could indicate a model regression or a real content decay event. Finally, version your prompt template in a prompt registry or version-controlled config file. When you update the decay-rate thresholds or the output schema, run the new version against a golden set of 50-100 documents with known freshness states to verify the audit behavior hasn't degraded before promoting to production.

IMPLEMENTATION TABLE

Expected Output Contract

Fields, format, and validation rules for the structured audit report generated by the Source Currency Audit Prompt. Use this contract to parse, validate, and store the model output before surfacing it in a dashboard or triggering downstream refresh workflows.

Field or ElementType or FormatRequiredValidation Rule

audit_id

string (UUID v4)

Must parse as valid UUID v4. Reject if missing or malformed.

audit_timestamp

string (ISO 8601 UTC)

Must parse to valid UTC datetime. Reject if in the future or unparseable.

knowledge_base_name

string

Must be non-empty and match a known [KB_NAME] from the input configuration. Reject if null or blank.

entries

array of objects

Must be a non-empty JSON array. Reject if null, empty, or not an array.

entries[].entry_id

string

Must be non-empty and unique within the entries array. Reject on duplicate or blank.

entries[].title

string

Must be non-empty. Trim whitespace. Reject if blank after trimming.

entries[].current_publish_date

string (ISO 8601) or null

If present, must parse as valid date. null allowed only when no date is extractable from the source.

entries[].domain_decay_rate_days

integer or null

If present, must be a positive integer. null allowed when domain is unknown. Reject if negative or zero.

entries[].freshness_status

string (enum)

Must be one of: 'current', 'approaching_stale', 'stale', 'unknown'. Reject on any other value.

entries[].recommended_action

string (enum)

Must be one of: 'keep', 'review', 'refresh', 'archive', 'escalate'. Reject on any other value.

entries[].action_priority

integer (1-5)

Must be an integer between 1 and 5 inclusive, where 1 is highest priority. Reject if out of range.

entries[].evidence_summary

string

Must be non-empty and between 20 and 500 characters. Reject if outside length bounds.

entries[].newer_source_found

boolean

Must be a JSON boolean (true or false). Reject if string or number.

entries[].newer_source_citation

string or null

Required when newer_source_found is true. Must be non-empty string in that case. null allowed when newer_source_found is false.

entries[].confidence_score

number (0.0-1.0)

Must be a float between 0.0 and 1.0 inclusive. Reject if out of range or not a number.

summary

object

Must be a JSON object with required keys: total_entries, stale_count, approaching_stale_count, current_count, highest_priority_action. Reject if any key is missing or has wrong type.

PRACTICAL GUARDRAILS

Common Failure Modes

What breaks first when auditing source currency and how to guard against it in production.

01

Stale Publication Dates

What to watch: The model accepts a document's stated publication date without verifying it against external metadata or HTTP headers. A republished article from 2018 can appear current. Guardrail: Cross-reference extracted dates with last-modified headers or sitemap timestamps. Flag any document where the extracted date is older than the domain's freshness threshold and no newer corroborating source exists.

02

Domain-Decay Miscalibration

What to watch: Applying a single freshness threshold (e.g., 90 days) across all domains. Financial filings decay in days; historical analyses decay in years. A one-size-fits-all window flags valid content or misses stale content. Guardrail: Maintain a domain-specific decay table. Classify the document's domain before applying the threshold. When domain is ambiguous, default to the stricter window and log for review.

03

Missing or Ambiguous Timestamps

What to watch: Many documents lack explicit dates or use relative timestamps (

04

Superseded Content Not Detected

What to watch: A document is recent but has been explicitly superseded by a newer version, retraction, or correction. The model flags it as fresh because the date is within the window. Guardrail: Before finalizing a freshness score, search for newer documents from the same authoritative source. If a newer version exists, mark the original as "superseded" and link the replacement.

05

Confidence Overstatement

What to watch: The model reports high confidence that a source is current even when evidence is thin—for example, when only a copyright year is available in the footer. Guardrail: Calibrate confidence scores against a golden dataset of known-fresh and known-stale documents. Require the model to list the specific evidence it used to determine currency. If evidence is a single weak signal, cap confidence at 0.5.

06

Batch Drift in Scheduled Audits

What to watch: When running the audit prompt on a schedule, small changes in model behavior or retrieval results cause inconsistent freshness classifications between runs. A document flips from "fresh" to "stale" and back without any actual change. Guardrail: Log the audit decision and evidence for each document. Compare run-over-run diffs. Require a minimum of two consecutive "stale" classifications before triggering an update alert.

IMPLEMENTATION TABLE

Evaluation Rubric

Use this rubric to test the Source Currency Audit Prompt's output quality before deploying it in a scheduled audit pipeline. Each criterion targets a specific failure mode common in automated knowledge base maintenance.

CriterionPass StandardFailure SignalTest Method

Entry Identification

All entries in [KB_SAMPLE] are accounted for in the audit report with a status of 'current', 'stale', or 'needs review'.

Report omits entries present in the input sample or includes fabricated entries not in the input.

Count entries in [KB_SAMPLE] and compare to report count. Verify each report entry maps to a valid input ID.

Age Calculation

The 'age_days' field for each entry is calculated correctly as the difference between the audit date and the entry's [PUBLICATION_DATE].

Age is off by more than 1 day, negative, or null for entries with a valid date.

Spot-check 5 entries by manually calculating age and comparing to the output. Automate with a script for regression testing.

Domain Decay Application

The 'decay_threshold_days' assigned matches the [DOMAIN_DECAY_MAP] provided. Entries exceeding their domain threshold are flagged 'stale'.

A financial filing entry is assigned a 365-day threshold when the map specifies 90 days. A blog post is not flagged despite exceeding its threshold.

For each entry, look up its domain in [DOMAIN_DECAY_MAP] and assert the output's threshold matches. Verify staleness flag logic.

Replacement Suggestion Grounding

Every 'stale' entry includes a 'suggested_replacement_query' that is a well-formed search string derived from the entry's title or topic.

The field is null, contains a hallucinated URL, or is a generic string like 'find newer source'.

Parse the output. Assert that 'suggested_replacement_query' is a non-null string for all entries with status 'stale'. Check for URL patterns.

Priority Ranking Logic

Entries are sorted by 'priority_score' descending. The score correctly weights staleness severity and [CRITICALITY_TAGS] like 'compliance' or 'revenue'.

A 'current' entry ranks higher than a 'stale' entry tagged 'compliance'. Scores are identical for all entries.

Sort the output by priority_score and assert descending order. Verify that a stale compliance entry has a higher score than a stale non-critical entry.

Output Schema Compliance

The output is valid JSON that strictly matches the [OUTPUT_SCHEMA]. All required fields are present and have the correct data types.

The output is a markdown table, plain text, or JSON missing the 'audit_report' wrapper. A required field like 'entry_id' is missing.

Validate the entire output against the [OUTPUT_SCHEMA] using a JSON schema validator. The test must pass with zero errors.

Confidence Score Calibration

The 'audit_confidence' score is between 0 and 1. It is lower when many entries have missing [PUBLICATION_DATE] and higher when all data is complete.

The confidence score is always 0.95 or higher, even when 50% of entries are missing dates. The score is a string, not a number.

Run the prompt on two test sets: one with complete dates and one with 50% missing. Assert that the second confidence score is significantly lower than the first.

Abstention on Missing Data

Entries with a missing [PUBLICATION_DATE] are flagged 'needs review' with a clear reason, not incorrectly marked 'current' or 'stale'.

An entry with a null publication date is marked 'stale' with a fabricated age. The reason field is empty.

Filter the output for entries where [PUBLICATION_DATE] was null in the input. Assert status is 'needs review' and the 'reason' field is populated.

ADAPTATION OPTIONS

Adapt This Prompt

How to adapt

Start with the base prompt and a small sample of 10-20 knowledge base entries. Remove the structured JSON output schema initially and ask for a markdown table to iterate faster. Use a single domain decay table (e.g., [DOMAIN] = 'software documentation') instead of the full multi-domain mapping. Skip the scheduled automation harness and run manually against a static export.

Watch for

  • The model inventing update recommendations without citing specific evidence from the entry
  • Inconsistent date parsing when entries use relative timestamps like 'last quarter' or 'recently'
  • Over-flagging entries that are stable by nature (e.g., mathematical proofs, historical records)
Prasad Kumkar

About the author

Prasad Kumkar

CEO & MD, Inference Systems

Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.

His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.