Portfolio · 2026

ChiragBhandakkar
I build web apps, APIs and AI tools, from the first idea to a live product that people use.
01 — In numbers
22,000+
mismatches flagged between orders, invoices and delivery tickets
4,600+
email orders sorted and routed with no manual work
45×
times smaller web app (1.68 MB down to 37 KB)
1,100+
downloads of my open-source plugin on npm
02 — Where I've worked
Work
At Aviara Labs I work on AviaraConnect: software for finance teams. It checks supplier bills against what was ordered and delivered, and manages contracts. I have worked on it since Sep 2024.
Software Developer Engineer II
Aviara Labs · Apr 2026 – now
- 22,000+
- mismatches between bills and orders flagged, for 4 clients
- 5,000+
- supplier bills checked against 11,000+ orders
- 4,600+
- orders and bills sorted automatically, from 13,000+ emails
- 01
Connect Gmail, Outlook or a shared inbox. It adds orders, bills and contracts to the platform, catches duplicates and syncs to the CRM or ERP.
- Inboxes are checked every 15 minutes. AI sorts each email, reads the attachments and creates the record.
- 4,600+ decisions from 13,000+ emails.
- Anything unsure goes to a person. Only approved senders are accepted. Every step is logged.
- Gmail
- Outlook
- DocuSensa
- Celery
- 02
Checks each supplier bill against the order and against what was actually delivered, so overbilling, duplicates and billed-but-not-delivered items are caught before approval.
- Checked 5,000+ bills against 11,000+ orders and flagged 22,000+ mismatches for 4 clients.
- A dashboard shows how long matching takes, how fast problems get fixed, problems by age and 12 months of trends. Every number has a tooltip.
- Django
- Celery
- MongoDB
- React
- 03
Runs accounts payable on top of the ERP: bill intake, order matching, approval routing and bill scheduling. The team only handles exceptions.
- Matched bills post to the accounting system with the right tax codes, and get a "posted" stamp.
- Invoices and credit memos sync to QuickBooks, Plexxis and SellerCloud on a schedule.
- ERP posting
- Plexxis
- QuickBooks
- 04
Connects to QuickBooks, Sellercloud and Plexxis. Reads orders, bills and receipts and writes bills back, with no migration.
- SellerCloud orders load directly, so users no longer wait on Make.com. A bulk re-sync closes old mismatches.
- Automated data entry into DealerCentre through Gumloop, with signed callbacks, timeout detection and duplicate guards.
- Google Drive integration: pulls files from a connected Drive and processes the invoices, purchase orders and contracts in them.
- Microsoft 365 integration: Outlook pulls in emails and OneDrive pulls in files, and the invoices, purchase orders and contracts in them are processed.
- SellerCloud
- DealerCentre
- Gumloop
- Google Drive
- Microsoft 365
- Celery
- 05
The AI agent inside Aviara Connect. It reads contracts, invoices and quotes, tracks what is due and prepares the next step for a person to approve.
- A chat assistant that explains orders and bills and can change a bill's status.
- COVA Pulse scans the company on a schedule and lists each person's late or stuck items.
- Fixed a production bug where idle database connections stopped its tools from loading.
- COVA Copilot
- COVA Pulse
- WebSockets
- Qdrant
- 06
Contracts
Takes a contract from template to draft, approval, partner review and e-signature, then watches renewals and risk after signing.
- Edit contracts in Microsoft Word. Only the clauses that changed sync back.
- Outside partners review through a one-time code.
- Approval rules by stage. A risk register with 4 automatic checks, and a 90-day renewal view.
- Word add-in
- Smart Approval Workflow
- Risk Register
- 07
Also built
- Expense reports: receipts are read with OCR and matched within billing dates. A policy engine routes approvals from manager to finance to reimbursement.
- Real estate deal intake: broker emails and attachments become Salesforce records, across 200+ listings.
- Self-signup with a 15-day free trial, then paid modules lock.
Software Developer Engineer I
Aviara Labs · Jun 2024 – Mar 2026
- 30%
- more engagement after AILA launched
- < 3 weeks
- to ship the HikoachAI chat MVP
- 80%
- of manual processing steps removed
- 01
Contracts
- Led AILA, the contract and legal workflow platform, built with React, Next.js and REST APIs.
- AI pulls compliance clauses out of a contract, and a comparison API checks it against the vendor's own terms.
- Signed addenda, AI first drafts, @-mentions while editing, and AI notes on each contract.
- A contract goes to several partners one after another or all at once, with compare versions and online signing.
- AILA
- React
- Next.js
- E-signature
- 02
- One bill line can link to several orders, because suppliers ship and bill in batches.
- Delivery receipts upload in bulk, are split out of multi-page PDFs and are checked against billed quantities.
- Vendors get an email as soon as a price or quantity is off, and repeat syncs never email twice.
- PO Workspace
- Delivery Reconciliation
- Django
- 03
- A SellerCloud webhook brings orders in and starts the delivery check.
- A "Sync from ERP" button pulls only the Plexxis orders that changed.
- SellerCloud
- Plexxis
- 04
Drafts vendor disputes and customer follow-ups and handles the back-and-forth. A person reviews before anything is sent.
- Upload a bill and AI fills in the invoice, using OpenAI and Gemini.
- OpenAI
- Gemini
- 05
Also built
- HikoachAI chat MVP in under 3 weeks, with WebSockets, React and Google OAuth.
- An embeddable chat widget: a short snippet is enough, with no code changes on the other site.
- A public API with a docs site for developers.
- Fixed the compliance and validation checks, which removed 80% of manual processing steps.
SDE Intern
Ridiv Technologies · Mar – Jun 2024
- 40+
- bugs fixed
- 25%
- faster load times
- 01
Client apps
- Built screens and APIs for 3 client apps.
03 — Projects
Projects
Pick a project to see what it does. Some have a step-by-step look at how they work.
Jurion
Ask questions about contracts. Every answer links to the exact clause and PDF page it came from.
Agentic RAG over 28 contracts. The right clause reached the top 10 for 100% of linked-clause questions vs 50% with vector search alone. 97.1% of claims were supported (model-judged).
- Python
- FastAPI
- LangGraph
- PostgreSQL + pgvector
- Neo4j
- Redis
- React
- TypeScript
How it works
How Jurion turns a contract PDF into answers you can trust: every step, what it does, and why it was built that way.
In one breath You upload a contract PDF. We read the text out of it, split it into clauses (mostly with rules, an AI only when the rules are unsure), and save each clause with an embedding (its meaning as numbers) and a graph of who the companies are and which clause points to which. When you ask a question, we find the right clauses (hybrid search), let an AI check which ones really answer it, add the clauses they refer to, and have the AI answer only from those clauses, with citations.
That is RAG (retrieval-augmented generation): find first, then answer only from what was found. Ours is corrective RAG (it checks and retries) with graph augmentation (Neo4j). There is also an agent mode (agentic RAG).
Ingest
1. Upload
Check the file, then show the clauses on screen before anything is saved.
What happens: the browser sends the PDF to
POST /parse. Nothing is saved yet: you first see the clauses on screen, and only press Save if they look right.Checks before any work
Check Limit Why File size 25 MB A huge file could exhaust memory. Starts with %PDF— Refuse files that only pretend to be PDFs. Pages 300 max Very long files take too long to read. Password-protected refused We can't read the text anyway. Signed in, and rate-limited — Stop abuse; every user only sees their own contracts. Why preview before save? Parsing can go wrong on odd layouts. Showing the result first (with a confidence score) lets the user catch it before bad clauses get into search.
Ingest
2. Read the PDF
Pull out clean text with each line's font, size and position. OCR for scans.
Library: PyMuPDF (imported as
fitz), a fast PDF library written in C with Python bindings.What a PDF actually is
A PDF does not store paragraphs or sentences. It stores instructions like "draw the letters
8. TERMin Arial Bold 12pt at position (72, 140)". It is a drawing of a page, not a document with structure. So "extracting text" really means: collect the letters, group them into words and lines by their position, and work out the reading order.How PyMuPDF gives us the text
We call
page.get_text("dict"). For each page it returns a tree:page → blocks (a chunk of text) → lines → spans (a run of text with ONE font) each span has: text, font name, size, bold flag, position boxFor every line we keep the text, the font size (largest span), whether it is bold, the page number, and its position (left x, top y, bottom y). A heading is often bigger or bold, and positions let the app highlight the exact clause on the PDF.
Clean-up we do on the lines (and why)
Clean-up Why Invisible characters removed (zero-width spaces after numbers like 1. PURPOSE)Word exports add them; they would stop 1.being seen as a number.Tables detected ( page.find_tables(), only on pages with drawn lines) and stored as rows| Visit | Fee |Otherwise a table comes out as a jumble of numbers. If the grid comes out as one column, columns are rebuilt from where the words sit. Page numbers, running headers and footers removed, only in the top/bottom 12% of the page, and only if the text repeats on many pages "Confidential – Page 3 of 12" is noise. Limiting it to the margins means a real sentence that repeats is never deleted. Clause numbers put back next to their text Some PDFs store the number column separately, so the text reads "1. 2. 2.1 … Purpose, Term …". We move each number next to the text on the same baseline. (One contract's score went 0.26 → 0.94.) Tiny text dropped (smaller than 60% of normal body text) E-signature stamps, footnote markers, printer marks. Typical line spacing measured Used later to rebuild paragraphs: a gap bigger than normal = new paragraph. Scanned PDFs: OCR
A scanned PDF is just pictures of pages, with no text inside. For those we use OCR: Tesseract, a free open-source engine, called through PyMuPDF (
get_textpage_ocr, at 150 DPI). We only OCR when it makes sense:- the page has no text but has an image, and
- at least half the document is like that (one scanned signature page in a normal contract is left alone: OCR on a signature only adds noise), and
- there are 20 or fewer such pages (OCR is slow), and Tesseract is installed.
OCR text can contain small mistakes, so the app shows a warning: "this page was read by OCR, check it against the PDF". If OCR can't run, a PDF with no text at all goes to the AI fallback (it can read the PDF images directly).
Why Tesseract and not Google OCR? Free, local (contracts never leave the server), and most contracts are digital PDFs anyway, where the real text is already inside and exact. Google Vision would cost $1.50 per 1,000 pages after 1,000 free a month, and would only help on scans.
Safety: the PDF is read in a separate process
PyMuPDF is not thread-safe, and a malicious or broken PDF can hang or crash it. So reading runs in worker processes (2 by default) with a 45-second timeout. If one hangs, it is killed and a fresh one starts. One bad PDF can't take the whole server down, and uploads don't block each other.
Output a list of clean lines (text, size, bold, page, position) plus the normal font size and line spacing.
Ingest
3. Split into clauses
Rules find the headings. An LLM only helps when the rules are unsure.
Three parts: the rules, the AI fallback, and the logic that decides which result to use.
Why clauses, and not fixed-size chunks?
Most RAG tutorials cut text into chunks of, say, 500 tokens. For contracts that is a bad idea:
- A chunk can cut a clause in half, so the answer misses its second half (often the exception: "…unless the Customer gives 30 days' notice").
- A clause is the unit a lawyer thinks in and cites: "Section 8.2 says…". Our citations point at real clauses with their real numbers and page.
- Clauses have a parent/child structure (8 → 8.1, 8.2) that we keep.
The rules: 12 rules in two passes
The rules go through the lines top to bottom, and each line either starts a new clause or belongs to the current one. Pass 1 is the normal rules:
# Rule Example Why 1 Numbered or keyword heading starts a clause 8.,8.2,8.2.1,ARTICLE V,SECTION 3,SCHEDULE 2,EXHIBIT A,ANNEX 1How almost every contract marks its sections. One regular expression. Numbers are max 3 digits, so a year ( 2000.) or zip code (22314.) isn't mistaken for a clause.2 Cross-reference guard Section 1.7 [Financial Disclosure], 1.8 …is not a headingLines that mention a section look like headings; the bracket gives them away. 3 Big text = heading (font more than 1.18 × normal size, under 10 words) TERMS AND CONDITIONSin large typeMany contracts have unnumbered headings that are only visually bigger. 4 Signature block starts at IN WITNESS WHEREOF(only if the current clause already has text) or a shortSIGNATURE PAGE/SIGNED BYline— The signatures aren't part of the last clause. The "has text" condition stops "IN WITNESS WHEREOF" from splitting when it is the body of clause 16.8. 5 Signature block ends at an attachment heading in capitals ( ATTACHMENT 1,APPENDIX,ANNEX) or a bold numbered heading— Otherwise everything after the signatures (appendices, or terms placed after a front signature page) is swallowed. 6 Numbering restarts inside an attachment a second 1.insideATTACHMENT Ais fineNot counted as a duplicate. 7 Preamble: text before the first heading becomes "Preamble & Recitals" "This Agreement is made between…" The parties are named there; it must not be lost. 8 Title on the next line: when a number stands alone, the next line is its title 8./TERMINATIONA common layout. 9 Parent from the number: 8.2's parent is8(if8exists)— Keeps the tree, so a sub-clause knows its section ("TERM > 2.1 Duration"). 10 Keep or drop: a numbered heading is always kept (even with no text, it anchors its sub-clauses); an unnumbered one needs more than 30 characters drops a logo or a running title Removes visual junk without losing structure. Pass 2, looser rules, only if pass 1 found nothing at all:
# Rule Example 11 Number with a closing bracket 1) Duties of the Provider12 Bold run-in heading with no number MEMBERSHIP.The person named…Why a separate pass? These patterns also match normal sentences in ordinary contracts. Running them only when pass 1 found nothing means no contract that parses well today can be changed by them. Final check: if fewer than 3 clauses were found, the rules say "no structure".
The confidence score: how the rules grade themselves
Five checks, each between 0 and 1, multiplied together (so one bad check pulls the whole score down):
Check Question it answers coverage Did the clauses keep all the text on the pages? numbering Are there gaps? (found 1, 2, 4 → 3 is missing) titled Do clauses have real titles, not just "Section 5"? unique Is each clause number used only once? balanced Does one clause hold more than 40% of the text? (A missed heading makes one clause swallow the rest.) Problems are also written as plain-English warnings for the user, e.g. "One section holds 62% of the text: 'Payment' (p.4). A heading was probably missed."
When the AI is used (and how carefully)
rules score ≥ 0.6 ──────────────────────────────→ use the rules' result (most contracts) rules score < 0.6, and an API key exists ──────→ ask the AI to pick the headings AI result scores better than the rules? ──→ use it (else keep the rules' result) AI fails or times out (60 s) ──────────────────→ keep the rules' result (a weak result beats an error) nobody finds any structure ────────────────────→ keep the whole document as ONE clause (a letter, a short agreement) no text at all (a scan OCR couldn't read) ─────→ the AI reads the whole PDFThe clever part: the AI does not rewrite the contract. We send it only a short list of candidate lines (short and bold / big / numbered / capitals, as
number | page | text), and it answers "lines 12, 40 and 77 start clauses". The clause text is still copied from the PDF. So the AI can choose wrong boundaries, but it can never change or invent a word of the contract.Models: Gemini
gemini-3.5-flash-lite(default, cheap) or OpenAIgpt-4o, whichever the user picks in Settings. The user can also force it with "Parse with Gemini" and compare both results side by side.Why rules first, and not just an LLM for everything?
Rules LLM Speed under 50 ms about 7 s per contract Cost free paid per upload Same input, same output always not guaranteed Can it change the wording? no, text is copied yes, if it writes the text, it can drop or rephrase words, which is unacceptable for legal text Long contracts any length output limits; a 100-page contract may get cut short Works with no API key, offline, private yes no Knows how sure it is yes, the confidence score no reliable self-score Odd layouts weak strong So we get the best of both: rules for the ~85% of contracts with normal layouts, the AI only for the hard ~15%, and even then only to pick headings.
Evidence on 510 real contracts from the public CUAD dataset, the rules alone found clauses in 472, median confidence 0.98, and only 15–16% would need the AI. On the clinical trial agreement the AI found 72 clauses in 7.5 s; the rules found 71 in milliseconds, with the same score.
Output clauses, each with an identifier (
8.2), title, text, page, parent, and the line range it covers.Ingest
4. Save
Dedupe, store in Postgres, embed every clause, build the graph.
Runs when the user presses Save (
POST /documents).4a. Duplicate check
A SHA-256 fingerprint of the PDF bytes is compared with the user's saved contracts. Same file → refused (or replaced, if the user chooses). Done before the slow work, so a duplicate costs almost nothing.
4b. Store in Postgres
One
documentsrow and oneclausesrow per clause, plus the document's full text as lines. Clauses point into those lines by number, so a clause can be highlighted on the PDF and re-split later without reading the PDF again.4c. Embeddings (for meaning-based search)
An embedding is a list of numbers that represents the meaning of a text. Texts with similar meaning get similar numbers, even with different words ("end the agreement" ≈ "terminate").
- Model: OpenAI
text-embedding-3-small, giving 1,536 numbers per clause. - What is embedded:
parent title > number title+ clause text, e.g.TERM > 2.1 Duration …. Why the parent title? "2.1 Duration" alone doesn't say duration of what; the section name adds that context. - Max 8,000 characters per clause (longer ones are cut, not chunked; rare in practice).
- Sent in batches of 64 to stay under OpenAI's per-request limit.
- Stored in Postgres with the pgvector extension, so the vectors sit right next to the text: one database, one query, and user filtering in the same SQL.
4d. The graph (Neo4j)
(Party)-[:PARTY_TO {role}]->(Document)-[:CONTAINS]->(Clause)-[:REFERENCES]->(Clause)- Parties: an LLM (
gpt-4o-mini) reads the first 6,000 characters (parties are named at the top) and returns each company, its role (Customer, Sponsor, Manufacturer…), its short names ("the Bank"), and a one-line summary of the contract. One call per contract, not per clause, so it is cheap. - Same company across contracts = one node. Names are normalised: "Acme Corp.", "ACME Corporation Inc." and "The Acme Company" all become
acme. - Cross-references: plain regex (no AI) finds "subject to Section 8", "Sections 4.2 and 4.3" and links those clauses. References to other documents ("Section 3 of the Master Agreement") are ignored.
Why a graph at all? Search finds clauses by similarity. It cannot answer "which contracts is Acme in?", and it can't know that clause 5 only makes sense together with clause 8 that it refers to. The graph adds those relationships.
Why Neo4j and not just Postgres? Following links ("what does this clause refer to, and what refers to it?") is the natural job of a graph database. The text and vectors stay in Postgres; Neo4j only holds ids, names and links, and can be rebuilt from Postgres at any time.
If something fails
No OpenAI key, or the key is wrong? The contract is still saved. The user gets a warning and Embed / Build graph buttons on the My contracts page. A failure in an optional step never loses the user's upload.
- Model: OpenAI
Ask
5a. Shortcuts and scope
Answer simple questions directly. Otherwise work out which contract is meant.
The pipeline runs in
pipeline(). The answer is streamed to the browser word by word, with live steps shown under "How I got this answer".5.0 Shortcuts first
- Library questions ("how many contracts do I have?") are answered straight from the database. No search, no AI. Why: exact, instant, free.
- Chat too long? Each chat keeps 4,000 tokens free for the next question's clauses. If the chat is full, the user is asked to start a new one rather than getting a silently worse answer.
5.1 Company facts (switch: Company facts)
If the question names a company, the graph adds what it knows: "Acme Bank is the Lender in loan.pdf and the Customer in services.pdf." Why: questions about who and which contracts are relationship questions that clause text alone answers badly.
5.2 Scope: which contract is the question about?
An LLM sees a short card for each contract (its parties, their roles and a summary) and picks the contract(s) the question means, giving a reason. Why: with 15 contracts, "what's the notice period?" matches notice clauses in all of them; "the bank's notice period" should look in the bank's contract first.
- If the question clearly needs one contract but doesn't name it, we ask the user "which contract?" with buttons, instead of guessing. A follow-up question stays in the same contract as the previous one.
- The narrowing is soft: the picked contracts' best 8 clauses come first, plus the best 4 from all contracts. Why: if the guess is wrong, the right clause is still there.
Ask
5b. Retrieve (hybrid search)
Meaning plus exact words, merged by rank. The heart of RAG.
Two searches run, each returns its top 20:
Dense (vector) search Sparse (keyword) search How Embed the question, find clauses with the closest meaning (cosine distance, pgvector) Postgres full-text search: match the words (after stemming, "terminating" → "termin") Good at Different words, same meaning ("walk away early" → termination) Exact terms: "Section 8.2", "indemnify", names, numbers Weak at Exact numbers and rare terms Synonyms Merging: Reciprocal Rank Fusion (RRF)
Each clause scores
1 / (60 + its rank)in every list it appears in, and the scores are added. Example: a clause that is #1 in vector and #3 in keyword gets 1/61 + 1/63 = 0.0323; a clause that is #1 in only one list gets 1/61 = 0.0164. Agreement between the two methods wins.Why RRF? The two scores are on different scales (a distance vs. a text rank); RRF only uses positions, so no tuning is needed. Then the top 8 go on.
Details worth knowing
- Every query filters by user inside the SQL, so one user can never retrieve another user's clauses.
- Keyword ranking: with the vector list present we use Postgres's
ts_rank_cd(all words must match). When vector search can't run (no key, or the embedding call failed) we use real BM25 (any word may match, rare words count more, long clauses are scaled down). - Why the split? Measured: alone, BM25 finds the right clause in the top 10 for 68% of questions vs 18% for
ts_rank_cd; but inside hybrid it tied overall and lost 9 points on reworded questions (its any-word matches add noise to the merge). - Heading-only clauses ("TERMS AND CONDITIONS", no text) automatically bring the next few clauses with them, so the AI sees what the heading stands for.
- Optional reranker (switch: Reranker, off by default): a local cross-encoder model (bge-reranker-v2-m3) reads the question and each of the top 30 clauses together and re-orders them. More accurate than comparing embeddings, but adds ~1.5 s per search.
Measured right clause at #1 42.9% → 49.4% with the reranker, top 10 85.7% → 90.9%.
Ask
5c. Grade, retry, widen
Keep only clauses that really answer the question, then add the ones they refer to.
5.4 Grade: does each clause really answer the question?
An LLM (
gpt-4o-mini) gives a verdict for every retrieved clause: a reason first (max 20 words), then relevant yes/no. Why:- Search returns similar clauses, not necessarily answering ones ("termination for cause" when the question asks about notice).
- Writing the reason before the yes/no makes the decision more reliable, and the user can see why each clause was kept or left out.
- Rules in the prompt: never assume which party "the bank" means; a clause from a contract that doesn't involve that party is not relevant.
5.5 Rewrite and retry (the "corrective" in corrective RAG)
If no clause passes grading, the LLM rewrites the question in contract language ("can I cancel early?" → "termination for convenience") and we search once more, across all contracts. Why: users don't talk like contracts. Only one retry, to bound cost and time.
5.6 Widen (switch: Graph widening)
For the kept clauses, the graph adds up to 3 clauses they refer to ("subject to Section 8" → clause 8). These are not graded (they're dependencies, not matches). Why: legal clauses depend on each other; answering from clause 5 without the clause 8 it refers to can give a wrong answer.
Ask
5d. Answer, follow-ups, agent mode
Answer only from the clauses, with citations you can click through to the PDF.
5.7 Answer
The LLM gets the numbered clauses (and company facts) and must:
- use only those clauses, and say so if they don't answer the question;
- cite every claim as
[1],[2](source numbers, checked: invalid citations are counted in evaluation); - say which contract each statement comes from;
- treat clause text as untrusted data: never follow instructions written inside a contract (protects against prompt injection).
Why these rules? In a legal tool a confident wrong answer is the worst outcome. Grounding plus citations let the user check every sentence by clicking it to open the clause in the PDF.
5.8 Follow-up suggestions (switch: Follow-up suggestions)
One extra LLM call suggests three next questions. If it fails, the answer is still delivered.
Typical cost about 3–4 LLM calls per question (scope, grade, answer, follow-ups; +2 if a rewrite is needed). The four switches live in Settings → Search and answers and are saved per user.
Agent mode (agentic RAG)
Same building blocks, but a LangGraph agent decides itself which tools to call and in what order (
search_clauses,follow_references,company_info, …) and when it has enough. Compare mode runs both side by side.Measured (77 questions) the fixed workflow cited the right clause 79% of the time vs 73% for the agent, with fewer calls (3 vs 4). A fixed pipeline is more predictable; the agent is more flexible on unusual questions.
Measure
6. Evaluation
Not "it looked good in a demo": everything is measured on 83 labelled questions.
Everything is measured on 83 labelled questions (77 with an answer), in groups: same words, other words (paraphrase), whole section, names a party, needs two clauses.
What Command Key numbers (latest) Retrieval: is the right clause found, and how high? uv run python -W ignore -m tests.eval_qaHybrid: right clause at #1 42.9%, in top 10 85.7%. With reranker: 49.4% / 90.9%. Answers: is it right and grounded? (an LLM judge) tests.eval_answersAnswered 92%, right clause cited 79%, faithfulness (claims supported by the clauses) 97.6%, median 3 LLM calls, ~11 s Parser tests.eval,test_corpus510 CUAD contracts: 472 parsed by rules, median confidence 0.98 Everything still works tests.run_all13 suites: parsing, limits, search, ask, graph, agent, settings, migrations… Results show on the Evaluation page.
Why measure? Every change (the graph, the reranker, BM25) was kept or rejected by its numbers, not by gut feeling. BM25 is the example: much better alone, no better inside hybrid, so it's used only where it wins.
Likely questions
Is this RAG?
Yes: corrective RAG with graph augmentation. It retrieves, checks the results with an LLM, retries with a rewritten query if nothing fits, adds linked clauses from a graph, then answers only from the clauses with citations. Agent mode is agentic RAG.
How do you get text out of a PDF?
PyMuPDF gives every line with its font, size, bold flag and position. We clean it (headers, footers, page numbers, tables, stray stamps) and keep positions so we can highlight clauses. Scans go through Tesseract OCR.
Why split by clauses and not fixed chunks?
A clause is the unit lawyers cite; chunks can cut an exception in half. Clause-level citations point at the real "Section 8.2" and page.
Why rules and not an LLM for splitting?
Rules are instant, free, repeatable, work offline and never change a word, and they score their own confidence. When the score is below 0.6 (about 15% of real contracts) the AI is asked, but only to pick heading lines; the text still comes from the PDF, so it can't hallucinate contract wording.
What is hybrid search?
Meaning-based (embeddings in pgvector) plus word-based (Postgres full-text), each top 20, merged with reciprocal rank fusion, top 8 kept. Meaning finds paraphrases; words find exact terms and numbers.
Why not just send the whole contract to the LLM?
Fifteen contracts don't fit in a prompt, it would cost much more per question, and answers get vaguer with more irrelevant text. Retrieval sends ~8 relevant clauses, and the citations stay precise.
How do you stop hallucinations?
Grade retrieved clauses; answer only from them; cite every claim; say "not found" when nothing fits; treat contract text as data, not instructions; measure faithfulness (97.6%).
What is the graph for?
Relationships that search can't see: which company plays which role in which contract, and which clause refers to which. It narrows the search to the right contract and adds referenced clauses.
What would you improve next?
Questions worded differently from the contract are the weak spot: the right clause sometimes isn't in the top 30 at all, so a reranker can't fix it. Next step: rewrite the question into contract language before searching (HyDE), measured with eval_qa.
Where each part lives
| Step | File |
|---|---|
| Upload endpoint | backend/app/main.py (POST /parse) |
| Read PDF, tables, OCR, clean-up | backend/app/ingestion/pdf_text.py |
| Splitting rules + confidence | backend/app/ingestion/rules.py |
| AI fallback | backend/app/ingestion/llm_parse.py |
| Rules vs AI decision | backend/app/ingestion/parser.py |
| Save, duplicates | backend/app/ingestion/documents.py |
| Embeddings, hybrid search, BM25 | backend/app/search/embeddings.py |
| Reranker | backend/app/search/rerank.py |
| Graph | backend/app/search/graph.py |
| Ask pipeline | backend/app/ask/workflow.py (+ facts.py) |
| Agent | backend/app/ask/agent.py, tools.py |
| Per-user switches | backend/app/core/preferences.py |
| Evaluation | backend/tests/eval_qa.py, eval_answers.py |
TinyMCE Inline Comments
Google Docs-style comments for the TinyMCE editor. Open source, 1,100+ npm downloads.
A headless plugin: it handles the text highlights and fires add, select and delete events. You bring your own UI and storage.
- TypeScript
- TinyMCE
- React
- npm
How it works
A headless inline-comments plugin for the TinyMCE editor. It marks the selected text, tells your app what happened through events, and does nothing else. The sidebar, backend, permissions, mentions and threads are yours.
Built for contract and legal editors, review and approval workflows, collaborative document tools.
Setup
1. Register
One call adds the comment format to the editor.
In the editor's
setup, callregisterInlineComments(editor). On editor init it registers aninline_commentformat: aspanwith the classinline-commentand adata-annotation-idattribute.Why a span with an id? The id is the only link between the text and your comment. Your app can store it with a comment, and it works as a thread key.
Events
2. Add a comment
Select text, press the button, get an id and the selected text.
A toolbar button (
inlineComment) and a context toolbar that appears over a selection both run theinline-comments:addcommand.- A collapsed selection (no text selected) is ignored.
- The id comes from
crypto.randomUUID(). - The format is applied inside one undo step, so Ctrl+Z removes the comment mark cleanly.
- The editor then fires
inline-comments:addwith the id and the selected text.
Events
3. Select a comment
Click a highlighted span to make it active.
Clicking a comment span clears the
activeclass from every other comment, adds it to the clicked one, and firesinline-comments:selectwith the id. Your app opens the matching thread.Events
4. Delete a comment
Remove the mark, keep the text.
editor.removeInlineComment(annotationId)finds the spans with that id and unwraps them: their children move up into the parent and the span is removed. It runs in one undo step and firesinline-comments:delete.Why unwrap? Deleting a comment must never delete the document text underneath it.
Design
5. What the plugin leaves to you
Headless on purpose: it only manages marks and emits events.
Most comment plugins tie the UI, storage and editor logic together. This one does one thing: manage inline annotations and emit meaningful events.
Concern Where it lives Comment UI (sidebar, modals) Your app Backend APIs and storage Your app Permissions, mentions, threads Your app Highlighting text, ids, events, delete The plugin Event Payload inline-comments:addannotationId,selectedTextinline-comments:selectannotationIdinline-comments:deleteannotationIdWorks with any backend and any UI framework (React, Vue, Angular or plain JavaScript). Published on npm as
tinymce-inline-comments.
Likely questions
Why headless?
Most comment plugins tie UI, storage and editor logic together. This one only manages the marks in the text and emits events, so it works with any backend and any UI framework.
How does a comment stay linked to its text?
Each comment is a span with a data-annotation-id. The id is generated with crypto.randomUUID() and your app stores it with the comment.
What happens to the text when a comment is deleted?
removeInlineComment unwraps the span: the children move up into the parent, so the text stays and only the mark goes.
How do undo and redo behave?
Adding and removing a comment each run in one undoManager.transact, so one Ctrl+Z reverses exactly one comment action.
How would you support threads and replies?
Use annotationId as the thread key. The plugin never touches replies, mentions or permissions, so they live in your app.
What would you improve?
Handle selections that cross several elements, and add a way to restore marks when a document is loaded from saved HTML.
Where each part lives
| Step | File |
|---|---|
| Register, add, select, delete, events | src/inlineComments.ts |
| Event payload type | src/types.ts |
| TinyMCE type additions | src/tinymce-augmentation.d.ts |
| Package entry | src/index.ts |
| Build setup | vite.config.ts |
MERN Real Estate
A real estate web app to browse and list properties.
- MongoDB
- Express
- React
- Node.js
- Tailwind CSS
How it works
A full-stack MERN app for browsing and listing properties. Visitors search and filter listings. Signed-in users create, edit and delete their own, and can message the landlord.
Backend
1. API
An Express server with three routers on top of MongoDB.
api/index.jsconnects to MongoDB with Mongoose and mounts/api/user,/api/authand/api/listing. It also serves the built React app, and one error middleware turns any thrown error into a JSON response with a status code.Route Who can call it POST /api/listing/createSigned-in users POST /api/listing/update/:idSigned-in users DELETE /api/listing/delete/:idSigned-in users GET /api/listing/get/:idAnyone GET /api/listing/getAnyone (search and filters) Backend
2. Sign-in
Hashed passwords, a token in an httpOnly cookie, and Google sign-in.
- Sign-up hashes the password with bcrypt before saving.
- Sign-in checks the email and password, then signs a JWT and sets it as an
httpOnlycookie, so page scripts cannot read it. The password is removed from the response. verifyTokenruns before any protected route. It reads the cookie and returns 401 if it is missing or 403 if it is invalid.- Google sign-in uses Firebase on the client, then
/api/auth/googlesigns the user in or creates the account.
Data
3. Listings
One model holds everything a property card needs.
A listing has a name, description, address, regular and discount price, bedrooms, bathrooms, furnished, parking, type (sale or rent), offer, image URLs and the id of the user who owns it. Photos upload from the browser to Firebase Storage, and only their URLs are saved in MongoDB.
Why upload from the browser? The server never handles image bytes, so the API stays small and fast.
Frontend
4. Browse and search
The search page keeps its filters in the URL.
- Home shows slider rows (Swiper) for offers, rentals and sales, four of each.
- Search filters by text, type, parking, furnished and offer, and sorts by date or price. Everything lives in the URL query, so a search can be shared or reloaded.
- A "Show more" button loads the next page of results.
Frontend
5. Account and contact
Profile, own listings, and a message box to the landlord.
- Redux Toolkit keeps the signed-in user, and redux-persist keeps it across reloads. Private pages are wrapped in a
PrivateRoute. - A profile page lets users update their account and see, edit or delete their own listings.
- A listing page has a contact box that loads the landlord by the listing's owner id and writes the message.
- The create form limits a listing to 6 images.
- Redux Toolkit keeps the signed-in user, and redux-persist keeps it across reloads. Private pages are wrapped in a
Likely questions
How does authentication work?
Sign-in checks the bcrypt-hashed password, signs a JWT and sets it in an httpOnly cookie. verifyToken reads that cookie on protected routes and returns 401 or 403.
Why a cookie and not localStorage?
An httpOnly cookie cannot be read by page JavaScript, so an XSS bug cannot steal the token.
How are images handled?
The browser uploads photos straight to Firebase Storage and only the URLs are saved in MongoDB, so the API never handles image bytes. A listing is limited to 6 images.
How does search work?
Filters (text, type, parking, furnished, offer, sort) live in the URL query and are sent to /api/listing/get, so a search can be shared or reloaded.
How do you stop users editing other people's listings?
Every listing stores the owner id (userRef), set from the signed-in user on the server. Update and delete load the listing and return 401 if the token's user id does not match, and an update cannot change userRef.
What would you improve?
Add input validation on the server, and page results with a proper cursor instead of a "show more" offset.
Where each part lives
| Step | File |
|---|---|
| Server and routers | api/index.js, api/routes/* |
| Controllers and models | api/controllers/, api/models/ |
| Sign-in check | api/utils/verifyUser.js |
| Pages (home, search, listing, profile) | client/src/pages/* |
| Shared UI and Google sign-in | client/src/components/* |
| User state | client/src/redux/* |
Mobbin Unveiled
Chrome extension that reveals the blurred pro screens on Mobbin as you scroll.
- TypeScript
- Chrome extension
How it works
A Chrome extension for mobbin.com that shows the screens Mobbin blurs for free accounts. It works quietly in the background as you scroll.
Extension
1. Manifest
A Manifest V3 extension limited to one site.
- Permissions are only
activeTabandscripting, and the only host it can touch ishttps://mobbin.com/*. - A content script (
content.js) runs on every Mobbin page once the document has loaded. It runs in the page's own JavaScript world so it can see the same data the page uses. - The toolbar popup is a small React app (Vite, TypeScript, Tailwind).
- Permissions are only
Extension
2. Learn what each image is
Match each blurred thumbnail to its full-size source.
Mobbin sends its screen data together with each page. The script scans that data and the page's inline scripts, and pairs each rendered image with the source file it came from. Video cells and search results each have their own matching rule, because their data is shaped differently.
Extension
3. Reveal as you scroll
New screens are handled as they appear.
Mobbin loads more screens while you scroll, so the script keeps watching for new ones and swaps each locked image for its full-size version.
Install
4. Install it
Build it, then load the `dist` folder in Chrome.
- Clone the repo and run
npm install, thennpm run build. - Open
chrome://extensions, turn on Developer mode, choose Load unpacked and pick thedistfolder. - Open any app on Mobbin and scroll.
- Clone the repo and run
Likely questions
Why Manifest V3 with so few permissions?
It only asks for activeTab and scripting, and can only touch mobbin.com, so it cannot read other sites.
Why does the script run in the page's own world?
That lets it see the same data the page uses, which it needs to match images with their sources.
How does it handle infinite scroll?
It keeps watching for new screens and handles each one as it appears.
What breaks it?
It depends on the shape of Mobbin's page data, so a site change can stop it working. That is the main upkeep cost.
Why a React popup for a small extension?
The same Vite, TypeScript and Tailwind setup I use elsewhere, so the popup is easy to extend.
Where each part lives
| Step | File |
|---|---|
| Content script (matching and reveal) | public/content.js |
| Extension manifest | public/manifest.json |
| Popup app | src/App.tsx, index.html |
| Build setup | vite.config.ts, tailwind.config.js |
Pesticide for Safari
Safari extension for Mac and iPhone that outlines every element so you can debug CSS layouts.
- Swift
- Xcode
- Safari Web Extension
How it works
An unofficial Safari port of the "Pesticide - Advanced CSS Debugger" Chrome extension. It outlines every element on a page so layout problems are easy to see, on Mac and iPhone.
Credit the original idea is Pesticide by Paul Molluzzo (mrmrs), and the advanced version is by Extension Rocks. All logic and CSS belong to them. This repo only repackages it as a Safari Web Extension.
Project
1. One Xcode project, four targets
A Mac app and extension, and an iOS app and extension.
Safari does not install web extensions on their own. Each one ships inside a small app. The project has an app and an extension target for macOS, the same two for iOS, and a shared folder used by both.
Part What it does Extension targets Run inside Safari and hold the extension itself App targets Wrap the extension so it can be installed Shared code ViewController.swiftand a small web page that shows whether the extension is on or off, with a button that opens Safari's extension settingsProject
2. Build it on your Mac
Open in Xcode, sign with a free Apple ID, run.
- Needs macOS 11 or later and Xcode.
- Sign both macOS targets with a Personal Team. If Xcode complains about the bundle identifier, add a number to the end of it.
- Run the macOS (App) scheme, then press "Open in Safari Extensions Preferences".
Project
3. Turn it on in Safari
Enable the extension, then allow unsigned ones if needed.
- Safari > Settings > Extensions > enable Pesticide.
- If it does not appear: Settings > Advanced > "Show features for web developers", then Develop > "Allow Unsigned Extensions".
- For iPhone or iPad, select the iOS (App) scheme with a device connected and run it.
Why build it yourself? This is an open-source developer build, so each person signs it with their own Apple ID.
Likely questions
What did you actually build?
The Safari packaging: an Xcode project with macOS and iOS app and extension targets, plus a small screen that shows whether the extension is on. The CSS debugging logic is the original authors'.
Why does Safari need an app?
Safari installs web extensions only when they ship inside an app, so each extension needs a wrapper app target.
Why is it not on the App Store?
It is an unofficial port of someone else's work, so it is shared as an open-source developer build. Each person signs it with their own Apple ID.
What was the hard part?
Signing and bundle identifiers across four targets, and Safari's "Allow Unsigned Extensions" setting while developing.
Who gets the credit?
Pesticide is by Paul Molluzzo (mrmrs), and the advanced version is by Extension Rocks. All logic and CSS belong to them.
Where each part lives
| Step | File |
|---|---|
| Xcode project | Pesticide - Advanced CSS Debugger.xcodeproj |
| Shared app screen | Shared (App)/ViewController.swift, Resources/* |
| Extension handler | Shared (Extension)/SafariWebExtensionHandler.swift |
| macOS and iOS targets | macOS (App), macOS (Extension), iOS (App), iOS (Extension) |
Text Summarizer
Notebooks that shorten long text into summaries, including a BERT version.
- Python
- Jupyter
- BERT
How it works
Two notebooks that shorten long text into a summary, one with a simple word-counting method and one with BERT. Both are extractive: they pick the most important sentences and never write new ones.
Notebook 1
1. Clean the text
Collapse spaces, lowercase, drop stop words and punctuation.
A regular expression collapses repeated whitespace into one space. NLTK then splits the text into words, lowercases them and removes common stop words ("the", "is") and punctuation.
Notebook 1
2. Score the words
Count each word, then divide by the highest count.
A frequency table gives every word a number between 0 and 1. The most common word is 1, and rarer words are fractions of it.
Notebook 1
3. Score and pick sentences
A sentence scores the sum of its words. The top 3 become the summary.
Sentences are split with
nltk.sent_tokenize, and each sentence adds up the scores of its words.heapq.nlargestpicks the 3 best, and they are joined into the summary.Why not split on "."? The notebook shows it fails: "Mr. Ibn La-Ahad went home." would break after "Mr". The NLTK tokenizer handles that.
Notebook 2
4. BERT version
Pull an article from a URL and let BERT choose the sentences.
goose3downloads a web page (the example uses a Wikipedia article) and extracts just the article text.- The text is split into sentences with NLTK.
- The BERT-based
Summarizerreturns the summary. - A helper shows the whole article in the notebook with the chosen sentences highlighted using
<mark>.
Why two methods? Counting words is instant and easy to explain. BERT understands the meaning of sentences, so it usually picks better ones.
Likely questions
Extractive or abstractive?
Extractive. Both notebooks pick existing sentences and never write new ones, so nothing can be made up.
How does the frequency method pick sentences?
Each word is scored by its count divided by the highest count. A sentence scores the sum of its words, and the top 3 sentences become the summary.
Why not split sentences on "."?
Abbreviations like "Mr." would break a sentence in the wrong place. nltk.sent_tokenize handles those cases.
Why add BERT?
Counting words ignores meaning. BERT scores sentences by meaning, so it usually picks better ones, at the cost of speed and a heavy install.
What are the limits?
The frequency method favours long sentences and repeated words. Extractive summaries can also read choppily, because sentences are lifted out of context.
Where each part lives
| Step | File |
|---|---|
| Frequency-based summarizer | text-summarizer.ipynb |
| BERT summarizer with highlighting | BERT-summarizer.ipynb |
Absenteeism Prediction
Predicts whether an employee will be absent on a given workday, from data cleaning to a Tableau dashboard.
- Python
- MySQL
- Tableau
How it works
Predicts whether an employee will be absent on a given workday. The aim is to follow data through a real business flow: clean it in Python, train a model, store predictions in MySQL, and show them in Tableau.
Why it matters absenteeism costs companies in lost work and puts extra load on the people who do show up. Knowing in advance lets a manager plan the work.
The data is the "Absenteeism at Work" set from the UC Irvine Machine Learning Repository, simplified into one CSV.
Python
1. Preprocess
Turn raw rows into numbers a model can use.
A notebook cleans the data. For example, the "Reason for Absence" column becomes separate yes/no columns (dummy variables), one per reason group.
Python
2. Train the model
Logistic regression, saved to disk with its scaler.
A logistic regression model predicts whether an employee will be absent. The trained model and the scaler fitted on the training data are saved with
pickle, so new data can later be prepared exactly the same way.Custom scaler
CustomScalerscales only the chosen numeric columns and leaves the yes/no columns alone.Python + SQL
3. Predict and store
A reusable module loads the model, and a MySQL table keeps the results.
absenteeism_module.pyhas anabsenteeism_modelclass. It loads the saved model and scaler, reads a CSV, repeats the same cleaning (drops the ID, builds the reason columns) and returns predictions with their probabilities.A SQL script creates a
predicted_outputstable with the reason columns, month, transportation expense, age, body mass index, education, children, pets, the probability and the final prediction. Python writes the results into it.Tableau
4. Visualise
A Tableau workbook reads the table.
A Tableau workbook visualises the predictions, so a manager can explore who is likely to be absent without touching Python.
The flow Jupyter notebook, then MySQL Workbench, then Tableau. Data scientists own the first part, and analysts own the last.
Likely questions
Why logistic regression?
It is simple, fast and easy to explain to a manager, and it gives a probability as well as a yes or no.
Why save the scaler as well as the model?
New data must be scaled exactly like the training data. The saved scaler guarantees that.
What does the custom scaler do?
CustomScaler scales only chosen numeric columns and leaves the yes/no columns unchanged.
Why MySQL and Tableau?
The goal was to follow data through a real business flow: a data scientist trains the model, then analysts read stored predictions in a dashboard.
What would you improve?
Evaluate on a held-out set with more metrics, track model versions, and run predictions on a schedule instead of by hand.
Where each part lives
| Step | File |
|---|---|
| Preprocessing notebook | 1.Preprocessing/preprocessing_with_python.ipynb |
| Model training and saved files | 2.Machine Learning/* |
| Prediction module | 3.Connect Python and SQL/absenteeism_module.py |
| MySQL table | 3.Connect Python and SQL/mySQL_code.sql |
| Tableau workbook | 4.Tableau Visualisation/Tableau_Visualisation.twb |
NASA APOD
Shows NASA's Astronomy Picture of the Day, pulled live from NASA's API.
- HTML
- CSS
- JavaScript
- AWS S3
- CloudFront
How it works
A small static page that shows NASA's Astronomy Picture of the Day, pulled live from NASA's API. It is plain HTML, CSS and JavaScript with no framework, hosted on AWS.
Page
1. Fetch
On load it asks NASA for 10 random pictures.
The page calls the APOD API with
count=10, shows a loader, and keeps the result in memory. If the request fails the loader is simply hidden and nothing breaks.Page
2. Build the cards
Each picture becomes a card, created with the DOM API.
Every card has the image (lazy-loaded, linked to the HD version), the title, the explanation, the date and the copyright when there is one.
Why the DOM API? Text from the API is set as text, never as HTML, so a strange title or caption cannot inject markup.
Page
3. Favorites
Save pictures and see them again later, with no backend.
- "Add To Favorites" stores the picture in
localStorageunder one key and shows a confirmation for 2 seconds. - A second page lists saved favorites. "Remove Favorite" deletes the entry and redraws the list.
- On every redraw the favorites are read back from
localStorage, so they survive reloads.
- "Add To Favorites" stores the picture in
Deploy
4. Hosting
Static files in S3, served through CloudFront.
The four files (
index.html,script.js,style.css, README) are stored in an Amazon S3 bucket, and CloudFront serves them as a CDN. A live copy is also on GitHub Pages.Why this setup? A static site needs no server. S3 stores it cheaply and CloudFront caches it close to visitors.
Likely questions
Why no framework?
It is one small page with a list of cards. Plain HTML, CSS and JavaScript load fastest and need no build step.
How do favorites persist without a backend?
They are saved in localStorage under one key and read back on every redraw, so they survive reloads in the same browser.
How do you avoid injecting bad HTML from the API?
Cards are built with the DOM API and text is set with textContent, so API text is never parsed as HTML.
How is it deployed?
Static files in an Amazon S3 bucket, served through CloudFront as a CDN.
What would you improve?
Show an error message when the request fails, and use a personal API key instead of the shared demo key.
Where each part lives
| Step | File |
|---|---|
| Markup | index.html |
| Fetch, cards, favorites | script.js |
| Styles | style.css |
04 — What I work with
Skills
Tools I have used on real projects, grouped by what they do.
Languages
Databases & Search
05 — Education
Education
Indian Institute of Information Technology, Nagpur
An Institution of National Importance, by an Act of Parliament
8.10
CGPA
B.Tech, Computer Science & Engineering
2020 – 2024
Relevant coursework
Core
- Data Structures
- Design and Analysis of Algorithms
- Object-Oriented Programming
- Operating Systems
- Database Management Systems
- Computer Networks
- Discrete Maths and Graph Theory
Building software
- Software Engineering
- Software Architecture
- Distributed Computing Systems
- Cloud Computing
- Cryptography and Network Security
- Compilers
AI and data
- Machine Learning
- Neural Networks and Deep Learning
- Natural Language Processing
- Business Intelligence
Certifications
06 — About
Full-stack engineer with 2+ years of experience building software for real clients. I work across the whole product: React and Next.js on the front, Python and Node.js on the back, plus integrations and AI features.
07 — Contact
chiraagbhandakkar@gmail.com© 2026 Chirag Bhandakkar