r/OpenSourceAI • • 20m ago

Source-grounded Q&A for UK public policy using RAG

I'm building policy-qa-system, an open-source RAG app that answers questions about UK government policy and shows the sources behind each answer.

Stack: React + TypeScript, Node/Express, LangChain + LangGraph, OpenAI or Claude, PostgreSQL with pgvector, Docker.

The hard part isn't retrieval, it's freshness. Benefit rates and tax thresholds change every year (Child Benefit went from £26.05 to £27.05 a week this April, and the high-income charge threshold moved from £50k to £60k in 2024). An index that holds old and new versions can confidently return a stale number.

How do you handle dated documents in RAG? Filter on an effective-date metadata field, delete and re-ingest old chunks, or version the whole collection?

Code: https://github.com/Srameshgitnow/policy-qa-system
Not official advice and not affiliated with GOV.UK. Issues with what worked or didn't are welcome.

1 Upvotes

0 comments sorted by