Gov Watch
A search tool for the Defense Department’s daily contract announcements.
Next.js
FastAPI
Python
Gemini API
Pinecone
Beautiful Soup
Vercel
Every working day, the Defense Department posts the contracts it awarded that day. It's all public, but it's one long page of prose. There's no table and no search, and each award is a paragraph with the company, the city, the amount and what it's for. In February 2025, government spending was in the news every day, and we wanted to ask that page plain questions, like "Which companies got Navy ship repair contracts?"
Gov Watch is a search box for those announcements. The hard part was cutting those pages into pieces a search can find, and the best cut was already printed on the page.
Some of those pages are hard even for a person to read. On February 24, 2025, the first sentence named 27 companies before it got to a verb.
A search box, not a dashboard
The first frontend was a dashboard, with four stat cards: total contracts, total value, active contractors and average contract. It looked great. Every number on it was typed in by hand.
A dashboard shows only what someone decided to count. Our questions were specific: who got the contract, for what and for how much. So the next day we stripped it back to one search box, and made the question the brightest thing on the page.
The placeholder types example questions, like "Show me contracts over $10M in California last year", so you can see what kind of thing to ask.
How search works
We cut the announcements into pieces and turned each piece into a vector. When you ask a question, the backend finds the five closest pieces, and a model writes the answer from those.
A scraper reads a week of the defense.gov listing at a time and saves each day's page. Everything after that depends on how big a piece is.
Cutting the page up
A piece could be a whole day, a paragraph or a section. February 24 shows why the first two lose.
A whole day is too big. That page had environmental engineering, laser sights for the Marines and pharmacy automation for military hospitals. One vector for all of that doesn't match any one question well.
A paragraph is closer to one award, but it isn't a clean unit. That day's paragraphs ranged from a two-word footnote, "*Small business", to almost 4,000 characters.
The page already makes a good cut. Each branch or agency starts with a centered, bold heading, and everything under it is that branch's awards for the day.

So the scraper walks the page, and every centered bold heading starts a new section. On February 24, that gives five: Air Force, Navy, Army, the Uniformed Services University and the Defense Health Agency. Each section's id is the article number plus the heading, like 4076032_NAVY, so scraping a week twice overwrites the same records instead of adding copies.
What the model reads
Gemini turns each whole section into a vector. Pinecone stores it with the URL, the date, the heading and the first 1,000 characters of text. The model only ever reads that stored text, so five pieces always stay small.
For most sections, those first 1,000 characters hold a complete award. Navy's first award fits with room to spare: Envision Technology in Roanoke, $249,000,000 for Squad Aiming Laser systems for the Marine Corps.
Air Force is the other side of the trade. Its first 1,000 characters are all company names, because the verb doesn't show up until character 2,428. A question about environmental engineering still finds the section, since its vector covers the whole thing, but the model sees names and no amount. That's why every answer carries its source: the date, the heading and a link to the page with the number on it.
Answers with sources
The question goes through the same embedding model, so it lands in the same space as the sections. Pinecone returns the five closest, and Gemini writes the answer from them and nothing else. If a contract isn't in those five, it isn't in the answer. If they don't answer the question, the answer says so, and if nothing comes back at all, the model never gets called.
That's the Navy award from February 24 in the live frontend, with an answer I wrote by hand. The answer streams in first, then the sources, and dollar amounts turn green so you can scan for them.
The scraper gets blocked
A month after launch, defense.gov started turning away the scraper's plain requests. So the scraper started sending what a browser sends. The first one claimed to be Chrome on Windows. Today it claims to be a phone.
The model and the vector store came off the shelf. The hard call was the size of a piece, and someone at the Pentagon had already made it. Every working day, a centered, bold heading sits over each agency's awards. We cut where they did.



