What If an AI Could Answer a Legal Question Based on the Law That Existed At That Time?
I've been working on a research project called Indian Constitution Temporal QA, and it started with a question that sounds simple:
Can an AI answer a question about the Indian Constitution while taking the date of the question into account?
Most question-answering systems treat a document as if it is static.
Legal documents aren't.
The Indian Constitution has been amended repeatedly. Articles can change, provisions can be inserted, modified, or removed, and the version of the law that applies can depend on when you're asking the question.
That creates a problem for AI systems.
An answer can look completely correct today while being wrong for a question about what the Constitution said 20, 30, or 50 years ago.
So instead of building another general-purpose legal chatbot, I'm trying to build a system that understands time as part of the question.
What I'm building
The project is a dataset and retrieval pipeline for temporal question answering over the Indian Constitution.
The goal is to track constitutional provisions across amendments and eventually answer questions such as:
"What did Article X provide before the relevant amendment?"
or
"Which constitutional provision was applicable in a particular year?"
The system needs to do more than retrieve a paragraph containing the right keywords.
It needs to determine:
What was the relevant provision?
Which amendment changed it?
When did that change take effect?
Which version should be used for the question being asked?
That's where the temporal part comes in.
Why I think this is interesting
A normal RAG system might retrieve the latest version of a constitutional article and confidently generate an answer.
But for historical legal questions, the latest version may be exactly the wrong evidence.
That's the failure mode I'm interested in.
I want to explore whether adding amendment history and temporal metadata can make retrieval more reliable for questions where the answer depends on a specific point in time.
What I've built so far
I'm currently working on:
- Extracting the Indian Constitution from source documents
- Parsing it into individual Articles and structured records
- Identifying constitutional amendments
- Tracking article-level changes across amendments
- Building structured amendment metadata
- Preparing the data for temporal retrieval and question answering
The current dataset tracks changes across 106 constitutional amendments from 1951–2023.
The project is still under development, so I'm treating this as a research/engineering experiment rather than claiming that the problem is solved.
The difficult part isn't the chatbot
One thing I've realized while building this is that the hardest part isn't putting an LLM behind an API.
The difficult part is creating trustworthy context.
If the underlying dataset doesn't preserve:
article → amendment → change → date
then even a very capable model can produce a convincing answer from the wrong version of the law.
That's why I'm spending much more time on data extraction, normalization, and temporal relationships than I initially expected.
What I want to test next
The next stage is to build a question-answering benchmark around these historical constitutional questions.
I'll eventually want to compare things like:
Standard retrieval vs. temporal-aware retrieval
and measure whether explicitly incorporating amendment history actually improves:
- retrieval accuracy
- temporal correctness
- evidence selection
- answer reliability
I also want to test cases where the current version of an article is deliberately misleading for a historical question.
Why I'm building this
I'm interested in the intersection of AI, information retrieval, and law, but I'm also interested in a broader question:
Can an AI system know that the most relevant information isn't necessarily the most recent information?
For legal, historical, regulatory, and policy documents, that distinction matters.
This project is my attempt to explore it through the Indian Constitution.
The project is still evolving, but I'll be documenting the dataset, pipeline, experiments, and results as I go.
GitHub: Coming soon — I'm currently developing the dataset and retrieval pipeline.
If you've worked on temporal retrieval, legal NLP, RAG, or historical document QA, I'd genuinely love to hear how you approached it.
Top comments (0)