Lesson 12 of 20

Memory & Knowledge

Knowledge Cutoffs & Updates

2 min read

Every LLM has a knowledge cutoff date—the point where its training data ends. For agents handling real-world tasks, bridging this gap is essential.

Current Knowledge Cutoffs (April 2026)

ModelKnowledge CutoffNotes
GPT-5.4~October 2025Has web search capability
Claude Sonnet 4.6~Mid 2025Also Opus 4.7 and Haiku 4.5 available
Gemini 3.1 Pro~Mid 2025Has grounding/search
Llama 3.3~December 2023Open weights model

Important: Cutoff dates change frequently with model updates. Always check official documentation for current values. Many models now include real-time search capabilities that supplement their training data.

Strategies for Current Information

1. Real-time Search Integration

from langchain_community.tools import DuckDuckGoSearchRun

search = DuckDuckGoSearchRun()

def get_current_info(query):
    """Fetch current information for time-sensitive queries"""
    # Check if query needs current info
    needs_current = llm.generate(f"""
    Does this query require information after the model's knowledge cutoff?
    Query: {query}
    Answer (yes/no):
    """).strip().lower() == "yes"

    if needs_current:
        search_results = search.run(query)
        return f"Current information (as of today): {search_results}"
    return None

2. Scheduled Knowledge Updates

class KnowledgeUpdater:
    def __init__(self, vectorstore, sources):
        self.vectorstore = vectorstore
        self.sources = sources

    async def update(self):
        """Run daily to keep knowledge current"""
        for source in self.sources:
            # Fetch new content
            new_docs = await source.fetch_updates()

            # Check for changes
            for doc in new_docs:
                existing = self.vectorstore.similarity_search(
                    doc.content, k=1
                )
                if self.is_significantly_different(doc, existing):
                    # Update the knowledge base
                    self.vectorstore.add_documents([doc])
                    self.vectorstore.delete(existing[0].id)

# Schedule daily updates
schedule.every().day.at("02:00").do(updater.update)

3. Source Attribution

Always tell users where information comes from:

def answer_with_attribution(query):
    # Get from knowledge base
    docs = retriever.get_relevant_documents(query)

    response = llm.generate(f"""
    Based on these sources, answer the question.
    Always cite your sources.

    Sources:
    {format_sources(docs)}

    Question: {query}
    """)

    return {
        "answer": response,
        "sources": [{"title": d.metadata["title"],
                    "date": d.metadata["date"],
                    "url": d.metadata["url"]} for d in docs]
    }

Handling Outdated Information

def check_freshness(query, response):
    """Warn users when information might be outdated"""

    # Topics that change frequently
    volatile_topics = [
        "stock price", "weather", "news",
        "latest", "current", "today"
    ]

    if any(topic in query.lower() for topic in volatile_topics):
        return f"""
        {response}

        ⚠️ Note: This information may have changed.
        Last verified: {get_source_date()}
        Consider checking current sources for the latest data.
        """

    return response

Best Practices

PracticeImplementation
Declare limitations"My knowledge was last updated..."
Use real-time toolsSearch, APIs for current data
Date your sourcesInclude when info was retrieved
Update regularlySchedule knowledge base refreshes
Validate critical infoCross-reference important facts

Key Takeaways

  1. Know your model's cutoff and communicate it
  2. Use tools to bridge knowledge gaps
  3. Attribute sources to build trust
  4. Update proactively for time-sensitive domains

Test your memory and knowledge understanding in the quiz! :::

Quick check: how does this lesson land for you?

Quiz

Module 3: Memory & Knowledge

Take Quiz
FREE WEEKLY NEWSLETTER

Stay on the Nerd Track

One email per week — courses, deep dives, tools, and AI experiments.

No spam. Unsubscribe anytime.