DOC REF MCPL/SCM/RAG/01 · REV 2.0
Meridian Components · Procurement Intelligence

Supply Chain
RAG Assistant

Turning two scattered procurement documents into grounded, page-cited answers — retrieved, reasoned, and never invented.

The Idea

Two documents. One answer.

What if an assistant could answer a question using two different company documents at once — while still showing exactly where the answer came from?

Both files below are converted into a single searchable vector knowledge base. When a question arrives, the system retrieves the most relevant context and hands it to a local model — producing an answer grounded in the documents, not the model's general knowledge.

Source 01 · Policy
Procurement Policy Handbook v4.2
Source 02 · Review
Supply Chain Review — Q1 FY2025-26
See It Working

Watch the demonstration

Covers document indexing, cross-document retrieval, policy reasoning, cited sources, and a deliberate out-of-scope question.

↳ If playback doesn't load inline, open the video file directly.
Why This Is Interesting

Connecting numbers to the policy that governs them

A typical question-answering system looks at a single document. This one reasons across both — matching a live figure from the review against the rule that applies to it.

Q1 REVIEW
Supplier scorecard, page 1
Kaveri Metals — 88.1% on-time delivery, 1,150 defects per million
POLICY
Handbook §6, page 2
Performance thresholds and the actions each breach requires
ASSISTANT
Generated answer
Identifies the applicable clauses and states exactly what the buyer must do
How It Works

The retrieval pipeline

Two PDF Sources
Chunking + Embedding
1000 char chunks · 150 char overlap
ChromaDB Vector Store
single collection, both documents
Relevant Retrieval
llama3.2 · Local Generation
Grounded Answer + Page References
01 · Ingest

The two PDFs are loaded and split into meaningful chunks. Overlap preserves context between neighbouring sections so a sentence split across a boundary isn't lost.

02 · Embed

Each chunk is converted into a vector representation using nomic-embed-text.

03 · Store

Embeddings are stored in a single ChromaDB collection — enabling search across both documents together, not separately.

04–06 · Retrieve, Generate, Cite

Relevant chunks are retrieved per question, passed to llama3.2 running locally via Ollama, and the final response includes the source file and page reference.

What Can It Answer

From lookups to judgment calls

Correct
Which supplier had the highest spend in Q1, and its on-time delivery %?
Shenzhen Rui Electronics — ₹21.9 crore spend, 79.5% OTD.
Correct
How many line stoppages happened in Q1, and what caused them?
7 stoppages, 41 hours downtime — 4 microcontroller, 2 PCB, 1 transport.
Wrong
What is the approval authority for a ₹1.4 crore purchase order?
Tests correct interpretation of a policy table row — model picked an adjacent band.
Correct
Microcontrollers, 46-day lead time — how much safety stock?
46 × 0.25 = 11.5 days → policy floor for imported/Critical parts → 30 days.
Correct — Trap Question
What is the annual salary of the Head of Procurement?
"The information is not available in the provided documents." No invented value. No unsupported assumption.
Evaluation

10 questions, honestly scored

Covering retrieval, calculation, policy interpretation, cross-document reasoning, table interpretation, and hallucination resistance — deliberately including questions where a plausible-but-wrong answer would be easy to produce.

Fully correct
7/10
Partially correct
1/10
Incorrect
2/10
Supplier performance → Spend · OTD · Defect rates Procurement policy → Approval authority · Classification · Escalation · Sourcing Calculations → Safety-stock requirement Grounding → Out-of-scope refusal
What Didn't Work Perfectly

Honest limitations

Built on llama3.2, a lightweight local model — chosen after the assignment's provided API key returned an authentication error, per HCL's own guidance to use alternatives like Ollama.

Table interpretation — for the approval-authority question, the correct table was retrieved, but the model selected the wrong row.

Unsupported numerical reasoning — for the Kaveri Metals question, correct clauses were identified, but the model generated a debit-note figure that couldn't be derived from the available data.

Retrieval was not the bottleneck — raising top_k from 5 to 6 didn't fix either case, since the correct information was already present. The remaining errors point to model reasoning and table interpretation, not missing context.

Technology

Built with

Python
Core pipeline
Streamlit
Web interface
ChromaDB
Vector store
Ollama
Local runtime
llama3.2
Generation model
nomic-embed-text
Embedding model
Running Locally

Get it running

Clone
git clone https://github.com/harine-sivakumar/supplychain-rag.git cd supplychain-rag
Create environment
python -m venv venv venv\Scripts\activate
Install dependencies
pip install -r requirements.txt
Pull the models
ollama pull llama3.2 ollama pull nomic-embed-text
Build the vector store
python ingest.py

Run again whenever the source PDFs change.

Launch
streamlit run app.py
Project Structure

What's in the repo

supplychain-rag/ │ ├── app.py # Streamlit interface ├── ingest.py # Load, chunk, embed, store ├── rag.py # Retrieve + prompt + generate ├── run_all_questions.py # Batch test runner ├── answers.txt # All 10 test outputs ├── demo_video.mp4 # 3-minute demo ├── requirements.txt ├── .gitignore │ └── data/ ├── Meridian_Procurement_Policy_Handbook_v4.2.pdf └── Meridian_Supply_Chain_Review_Q1_FY2025-26.pdf
Future Direction

Where this could go next

Table-aware extraction

Better handling of policy and approval tables.

Hybrid retrieval

Combining semantic search with keyword-based retrieval.

Reranking

Improving the ordering of retrieved context.

Numerical validation

Checking generated numbers against retrieved evidence.

Stronger reasoning models

Reducing errors in multi-step policy interpretation.

Citation validation

Automatically verifying cited pages support the answer.