DEDUPED Hot AI repos. Real use cases. What people build. Get the Monday 5

How to build a search index for Senate rules and acts with PAKGOV RAG Project

Extract, chunk, and embed a folder of Senate PDFs into a FAISS index using the repo's pipeline commands.

Short answer: Place the Senate PDFs in data/raw/senate/ inside the cloned repository; then run python ingestion/extract.py --input data/raw/senate --output data/interim/senate_raw.jsonl; run python ingestion/chunking/chunk_documents.py --input data/interim/senate_raw.jsonl --output data/processed/senate_chunks.jsonl. All steps.

  • Research
  • Advanced
  • 1 hour
  • From the README
  • Any agent

Who it is forA developer or legislative researcher who wants to search Senate rules, salary acts, or secretariat acts with the same pipeline used for the Constitution.

The problemSenate rules and acts are spread across many PDFs, and some are scanned images with no extractable text, so keyword search alone misses content.

The outcomeA chunked JSONL file and a FAISS index with one vector per chunk, built from the Senate PDFs in data/raw/senate, ready for the retrieval pipeline.

What you need first

  • Python installed (the README lists Python 3.14)
  • Ability to clone the GitHub repository and run commands in a terminal
  • Internet access for the first download of the sentence-transformers embedding model (inferred from the model being loaded by name)
  • Constitution of Pakistan PDFs or the committed data files for the demo and evaluation

Steps

  1. Place the Senate PDFs in data/raw/senate/ inside the cloned repository.
  2. Run python ingestion/extract.py --input data/raw/senate --output data/interim/senate_raw.jsonl.
  3. Run python ingestion/chunking/chunk_documents.py --input data/interim/senate_raw.jsonl --output data/processed/senate_chunks.jsonl.
  4. Run python retrieval/embed.py --input data/processed/senate_chunks.jsonl --output data/processed/senate_faiss.
  5. Check the log for the line Saved FAISS index with <N> vectors and compare N with the chunk count. (inferred, check the README)

Prompt for your agent

In the cloned salikhussain71-code/PAKGOV-RAG-project repo, place the PDFs from <folder of Senate PDFs> in data/raw/senate/ and run the extract, chunk, and embed commands from the README in order. Report the number of chunks saved and the number of FAISS vectors saved. Verify that scanned PDFs that produced placeholder text are listed, since OCR is pending for them.

Caveat. The README's Senate run produced 1080 chunks, but two scanned PDFs yielded only placeholder text because OCR via Tesseract is still pending, so those documents are not searchable yet.

Use this in your AI agent

Ask your agent

Using the Deduped MCP, get the setup steps for salikhussain71-code/PAKGOV-RAG-project and "Build a search index for Senate rules and acts"

Add Deduped to Claude Code once

claude mcp add --transport http deduped https://dedupedai.com/mcp

Cursor, ChatGPT, others

Share: X LinkedIn Hacker News Email Copy link

Third-party repos we don't own. AI-written use cases can be wrong. Disclaimer