Skip to content

Latest commit

 

History

History

05-policy-changes

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

Tracking Changes in Long Policy Documents Using Contextual AI

Alt Text


Analyze complex policy documents and their evolution over time using RAG agents. This example shows you how to overcome traditional challenges of analyzing lengthy documents and identifying policy changes across multiple versions.

Why This Matters

Traditional document comparison and RAG systems often struggle with:

  • Documents spanning hundreds of pages that exceed context length limits
  • Loss of context when chunking large documents
  • Complexity in tracking changes across multiple document versions
  • Maintaining historical context while analyzing policy evolution

Quick Start

You can explore this capability in two ways:

  1. Through our intuitive UI
  2. Using python notebook provided in this repository

This repository includes the source files from FEMA in the data folder.

Example Use Case: FEMA Policy Evolution

We show this using FEMA's Public Assistance Program and Policy Guide, which has evolved significantly over multiple versions:

  • V4 (2020) - 276 pages - source
  • V3.1 (2018) - 217 pages - source
  • V2 (2017) - 207 pages - source

Source documents are included in the data folder.

Getting Started

  1. Create your RAG Agent with our specialized prompt:
You are an analyst focused on identifying differences across documents. V4 was published in 2020, V3.1 was published in 2018 and V2 was published in 2017. If retrieved, V5 is proposed for 2025. When discussing policy keep in mind the version and consider differences in other versions. 
  1. Load your documents into the Datastore
  2. Start querying for changes across versions

Example Queries for Insights

See changes over time

See how the RAG agent handles the long context and tracks changes, try these queries:

  • How has cost eligibility changed
  • What's changed with the Small Business Administration Loan Requirement
  • How has the relationship to indian tribal governments changed

Policy Recommendations

The agent can also help generate insights based on changes, try these queries:

  • How has the appeals process changed
  • Based on the appeal changes in version 4, how should we change our contracts with experts

Updating on New Information

To see how the RAG agent responds to new information, add the FEMA_2025_updates to the datastore. This is a synthetic update to show that the agent responds to new information. After loading in the datastore, try the query:

  • How has cost eligibility changed

You should now see a response incorporating the 2025 update.

Notebook

The notebook walks you through setting up your agent, ingesting your data, and making the first query. To explore more of the python capabilities check out the end-to-end notebook or the full documentation.