TL;DR: I built a searchable knowledge base over 7,500+ exchange and regulatory PDFs collected over two years, with NSE circulars as the primary focus. It combines OpenAI embeddings, BM25, and Cohere reranking to retrieve relevant passages, then uses GPT-4.1-mini to answer questions with citations pointing to the exact PDF page. In my evaluation, hybrid retrieval lifted Recall@5 from 43.75% to 70.83%. Just as importantly, a claim-validation step flags when an answer isn’t actually backed by its cited passage.


The NSE publishes a steady stream of circulars covering almost every corner of the Indian market: trading operations, settlement procedures, securities eligibility, corporate actions, algorithmic trading, broker obligations, and regulatory changes. Over time, those PDFs turn into a dense knowledge base. Finding a specific circular is easy if you already know its reference number. If you don’t, things get tedious fast.

Consider a few everyday questions:

  • When does the trading suspension of Gayatri Projects get revoked?
  • Which circular introduced a change to algo trading requirements?
  • What are the new connectivity requirements for SLBM?
  • Has NSE issued any recent circulars concerning a particular company?
  • Which circular introduced a specific restriction, and when does it take effect?

You can search the exchange website, download half a dozen PDFs, and scan through annexures. But that breaks down when you remember the topic rather than the circular number, or when the answer is split across multiple notices. I wanted a system where I could ask these questions in plain English, get an answer grounded in the actual exchange documents, and verify it straight against the original PDF page.

The data: 7,500+ exchange circulars

I started with roughly 7,500 PDFs collected over a two-year window via exchangecirculars.com (extracting PDFs out of ZIP responses where needed). One qualification up front: the archive isn’t purely NSE material. It also pulls in other regulatory documents—for instance, an inspected sample included a SEBI order concerning Akar Laminators. So the corpus is best described as an exchange and regulatory collection, built around an NSE research use case.

Here is what the ingestion pipeline produced:

Stage Count
PDFs discovered 7,614
Metadata JSON files 7,612
Records loaded 7,611
Documents indexed 7,591
Documents skipped 23
Chunks created 36,853

The full run took 11 minutes and 47 seconds.

I used PyMuPDF to extract text and LlamaIndex to split each PDF into smaller chunks. A single 10-page circular often mixes trading timings, connectivity parameters, software versions, and settlement rules; embedding the whole document into one vector blurs those topics together. Chunking lets the retriever pull the specific passage that matters.

Every chunk stores its circular ID, title, publication date, category, source, PDF path, and actual PDF page number. I also injected the circular ID and title directly into the searchable text, which turns out to be critical for exact lookups.

One subtle trap I caught early: the page field in the downloaded metadata refers to the archive listing page, not the page inside the PDF. Using that for citations would send anyone opening the document to the wrong place, so actual PDF page numbers are extracted and preserved during text processing instead.

There is no OCR in the pipeline yet, so scanned or unreadable PDFs are skipped, and I haven’t run an exhaustive duplicate or identity audit across the 7,591 indexed files.

What are we trying to solve?

Before getting into the retrieval stack, look at two questions about the exact same document:

  • Question 1: Find circular 0001fd562caa1c25.
  • Question 2: When does the trading suspension of Gayatri Projects get revoked?

The first is an exact identifier lookup. The second is a semantic question where the phrasing may not match the circular’s wording at all. Most of the engineering effort went into handling both reliably, because an LLM can’t produce a trustworthy answer if the retriever hands it the wrong documents.

Dense retrieval: searching by meaning

To search by meaning, I embedded the chunks using OpenAI embeddings and stored them in a local Chroma vector index. Text with similar meaning lands close together in vector space, so a dense retriever can connect two differently worded sentences like:

  • “Trading suspension will be revoked effective April 09.”
  • “Trading in the shares will resume from April 9.”

This works well when you ask questions in your own words instead of mirroring exchange terminology. Where dense embeddings struggle is exactness. An opaque circular ID like 0001fd562caa1c25 carries no semantic meaning, and the same problem shows up with technical identifiers, reference numbers, and niche regulatory phrases.

BM25: searching by actual words

BM25 sits at the other end of the spectrum. Instead of comparing semantic vectors, it scores documents based on exact term matches—weighting how often a term appears in a document, how rare it is across the corpus, and how long the document is. A rare string like 0001fd562caa1c25 or a specific company name carries far more signal than a common word like “trading.”

BM25 shines on circular IDs, company names, technical identifiers, and exact regulatory phrases. Its blind spot is the mirror image of dense search: if you ask “When can trading resume after a suspension?” and the circular says “revocation of trading suspension,” lexical search can miss the connection.

Hybrid retrieval: combining both

Combining dense search and BM25 is the natural next step. Both retrievers run independently, and their results are merged using Reciprocal Rank Fusion (RRF). Rather than trying to normalize incompatible raw scores from two different algorithms, RRF combines their rank positions:

Document Dense rank BM25 rank
Circular A 2 1
Circular B 1 8
Circular C 7 2

Circular A ranks near the top in both lists, so RRF pushes it to the front. Circular B is strong semantically but weak lexically; Circular C is the reverse. The combined list gets the strengths of both approaches without fragile score tuning.

Reranking: sharpening the top results

Hybrid retrieval gives us a solid pool of 20 candidates, but the ordering inside those 20 isn’t always ideal. A cross-encoder reranker evaluates the query and each candidate passage together, rather than encoding them independently, which lets it judge relevance much more directly.

I used Cohere Rerank v5 Fast on top of the fused candidates. The full pipeline looks like this:

Across all three retrieval modes (dense, hybrid, and hybrid + rerank), I kept the same 20-candidate pool and final top-5 cutoff. One detail worth keeping in mind: the reranker never searches the full corpus. It only reorders what the initial retrieval stage hands it—if the right circular isn’t in those 20 candidates, reranking can’t rescue it.

Evaluating retrieval quality

To see whether the extra moving parts were actually pulling their weight, I evaluated 24 questions split across four categories: exact circular ID lookups, keyword/phrase searches, semantic questions, and multi-circular questions. Expected circular IDs were verified against the indexed PDFs, and repeated chunks from the same circular were deduplicated before scoring.

Metric Dense Hybrid Hybrid + rerank
Recall@5 43.75% 70.83% 72.92%
MRR 0.4063 0.5708 0.7153
Average retrieval latency 0.769 s 0.698 s 1.464 s
p50 retrieval latency 0.516 s 0.521 s 1.275 s

Latency numbers come from a separate 10-query benchmark (one warm-up plus three measured runs per query and mode).

Hybrid retrieval drives the big recall jump

Moving from dense-only to hybrid pushes Recall@5 from 43.75% to 70.83%. BM25 is recovering circulars that dense search misses outright, especially when queries lean on exact identifiers and exchange terminology.

Reranking moves the right answer to the top

Adding Cohere reranking nudges Recall@5 up modestly (70.83% to 72.92%), but MRR jumps from 0.5708 to 0.7153. Reranking isn’t discovering many new circulars—it’s doing a noticeably better job of placing the right one at rank 1 instead of rank 4.

The latency trade-off

Hybrid retrieval runs at roughly the same speed as dense search (0.698 s vs. 0.769 s average). Reranking roughly doubles average retrieval latency to 1.464 seconds. That makes hybrid a sensible default, with reranking turned on when top-rank precision matters more than sub-second responses.

Reranking isn’t always better

On a semantic query about whitebox algo providers, hybrid retrieval placed the expected circular (0006c75b3e7d74a0) at rank 1. After reranking, that circular dropped out of the top five entirely, replaced by other provider notices. Aggregate metrics went up, while an individual query got worse—a useful reminder not to treat reranking as a free lunch.

Can we trust the generated answers?

Retrieving the right circular is only half the problem. An LLM can easily write a confident, fluent answer built on a passage that only mostly supports what it’s claiming.

Here is a real example from my testing. The system generated:

Trades during the November 21, 2026 SLBM mock session do not create any fund pay-in or pay-out obligations.

It cited circular cbe480f0ca976c14, page 3. The cited page really did state that trades during mock sessions do not result in fund pay-in or pay-out—except that circular was for the June 6, 2026 SLBM mock session, not November 21. The passage was semantically relevant, yet it did not establish a date-specific claim.

To surface mismatches like this, I added claim-level validation to the CLI. Each factual claim in the generated answer is tagged with one of three statuses:

  • Supported: The cited passage backs the claim.
  • Unsupported: The cited passage does not back the claim.
  • Needs review: The evidence is incomplete or potentially mismatched.

In the November SLBM case, the validator correctly flagged the claim as Needs review. Alongside each status, the CLI prints the circular ID, title, publication date (when available), actual PDF page, and the exact cited passage. In a manual check of five generated answers, four claims were properly supported and the November SLBM claim was caught for review. Automated validation can still miss nuances, so the goal isn’t to replace checking the PDF—it’s to make questionable claims obvious instead of hiding them behind confident prose.

What it looks like in practice

With retrieval and verification in place, here are four ways the assistant handles real NSE queries:

1. Researching stock-specific announcements

Ask “What happened to Gayatri Projects, and when was its trading suspension revoked?” and the system pulls circular 0001fd562caa1c25 (Revocation of Trading Suspension in Equity Shares of Gayatri Projects Limited), pointing to PDF page 1: suspension revoked effective April 09, 2026.

In the benchmark, dense search missed this circular completely, hybrid retrieval found it at rank 2, and reranking moved it to rank 1. The same workflow handles corporate name changes and segment shifts—for example, locating circular 00b388f1536c50c4 covering the rename from Hercules Hoists Limited to Hercules Investments Limited, effective November 24, 2025.

2. Tracking algo trading requirements

For algo developers and brokerage tech teams, questions like “Which providers were provisionally empanelled for whitebox and blackbox solutions?” or “Which circular set a specific implementation deadline?” can be answered directly from the indexed notices—such as retrieving the circular on the provisional empanelment of Stockwiz Technologies LLP for whitebox and blackbox algo solutions.

3. Pulling specifics from dense operational circulars

The SLBM mock trading circular issued on June 5, 2026 packs in session timings, Primary/DR site schedules, NEAT Adapter version requirements, gateway ports, CA certificate rules, and financial obligations. Ask “Do trades during the SLBM mock session create any fund pay-in or pay-out obligations?” and the assistant pulls the exact line from page 3:

Trades during mock sessions will not result in any fund pay-in or pay-out.

No scrolling through annexures required.

4. Following regulatory and connectivity changes

Questions spanning multiple circulars—required NEAT Adapter versions, NNF user requirements, or when a market connectivity instruction becomes mandatory—can pull passages across several documents at once. Treat it as a fast research layer rather than a compliance sign-off; the original circulars and any subsequent amendments still need a human read.

What does it cost?

Running this over a two-year archive turned out to be surprisingly cheap:

  • Initial embeddings (~11.8M tokens): ~$0.24
  • Answer generation (GPT-4.1-mini): Five sampled answers used 7,270 input tokens and 228 output tokens, costing an estimated $0.00327 total—roughly $0.000655 per answer.

These are estimates derived from recorded token usage and published API pricing rather than billed invoices. The existing wrapper also didn’t expose Cohere token/search usage, so reranking costs aren’t included in that figure, nor are hosting or ongoing ingestion. Even with those caveats, the core embedding and generation economics are tiny.

Limitations and what’s next

A few gaps still need work before this becomes a daily-driver tool:

  • OCR: Scanned PDFs are currently skipped.
  • Metadata filtering: Consistent date/category filters across both dense and BM25 retrieval aren’t implemented yet.
  • Corpus hygiene: No exhaustive duplicate or document-identity audit has been run.
  • Scope: There is no live market data (prices, volumes, or order book) and no automated ingestion of newly published circulars yet.

Once continuous ingestion is wired up, the same index can support more targeted workflows:

  • Stock-specific timelines: Pull every exchange announcement for a company or symbol in chronological order.
  • Circular change tracking: Diff related circulars over time to highlight amended dates and updated rules.
  • Regulatory deadline extraction: Turn implementation dates and member obligations into a searchable compliance calendar.
  • Targeted monitoring: Ingest new circulars automatically and alert when one touches a watched stock, strategy, or operational workflow.

Wrapping up

I started with a simple question: can I search thousands of NSE circulars in plain English and get verifiable answers without manually digging through PDFs?

Yes—as long as you respect where each piece of the stack breaks. Dense search alone misses exact identifiers and exchange jargon; pairing it with BM25 fixes most of that gap. Reranking sharpens the top results at the cost of extra latency and the occasional regression. And showing the circular ID, actual PDF page, supporting quote, and claim-validation status turns the output from a black-box summary into something you can actually verify.

Hook this up to continuous circular ingestion and change tracking, and it stops being a search box over old PDFs—it becomes a working research layer over exchange operations and regulation.

Further reading