← All projects

04 · GM sponsored · 2025

Policy analytics

An on-device AI analyst for congressional data

For a General Motors-sponsored capstone, I owned the backend and built PolicyAI: an AI analyst that answers plain-English questions about congressional bills, lobbying and campaign finance. It draws on curated data, runs entirely on one machine and never sends a question to the cloud.

Complete · Fall 2025

Program
Wayne State capstone
Sponsor
General Motors
My role
Owned the backend; built the AI analyst
When
Sep – Dec 2025

Every answer starts in the data

Two pipelines meet at the model. On the left, public records are cleaned and curated into Gold tables. On the right, each question becomes a search that pulls only the Gold rows it needs. A language model on the same machine answers from those rows and cites them.

Try an example question

 

Gold · billsBill summaryLatest action

At a glance

Plain-English answers, fully on device

3public data sources: Congress.gov, Senate lobbying filings and the FEC
7curated Gold tables it can search
20Bparameter language model, running on device
0cloud calls per question

Our capstone team built a web app that tracks congressional bills, lobbyist spending and campaign contributions. I owned the backend and built PolicyAI, the assistant that lets anyone question that data in plain English instead of writing SQL or building a report. It sits on every page of the app as a chat window.

The journey

From a chat box to an analyst that knows the data

  1. September 2025

    The problem: the data was there, the answers weren't

    Policy teams run on fast answers: what a bill does, who is lobbying on it, how much a campaign has raised. The app already held all of it, but getting an answer out meant knowing exactly where to look or writing SQL.

    My brief: anyone asks a question in plain English and gets a correct answer drawn from the data.

  2. The foundation

    Curated data to stand on

    The app's data follows a Medallion design. Bronze holds raw pulls from public APIs: Congress.gov for bills, members and laws, the Senate's lobbying disclosures, and the FEC for campaign finance. Silver cleans and types them. Gold joins them into tables an analyst can trust. For example, each bill appears once with its summary, whether it became law, its latest action and a readable ID like “H.R. 10-119”.

    I built the assistant to answer from that Gold layer alone, so the model only ever sees clean, curated records.

  3. Late September

    A fluent model that knew nothing about us

    Version one was a plain chat model. It could talk about Congress in general, but it had never seen our database, so it had nothing to base an answer on. Retrieval closes that gap: find the right rows first, then answer only from them.

  4. October

    The bug that looked like a bad model

    I built a first retrieval prototype over exported tables, then upgraded to a stronger embedding model. Search still came back wrong: a query for bill H.R. 3746 returned S. 3949.

    Swapping the model would have been the obvious guess, and the wrong one. The stored vectors and the question's vector came from differently sized embeddings. Once I made both sides match, H.R. 3746 ranked first out of 715 bills.

    What I foundWhen search looks random, check the pipeline before the model. Make sure both sides were embedded the same way.

  5. November

    Nothing leaves the machine

    I set one firm rule for the stack: every model runs locally, and nothing touches the network when someone asks a question. A 20-billion-parameter open language model and the embedding model run through Ollama, in Docker alongside Postgres, the API and the web app.

    The whole system runs on one machine. Questions, data and answers never leave it.

    What I foundPrivacy is an architecture decision, not a trade-off. Public data flows in through ingestion; when someone asks a question, nothing flows out.

  6. December 2025

    From prototype to client demo

    The finished assistant sits on every page of the app and answers plain-English questions about bills, lobbying and campaign finance from the Gold tables, entirely on device. We demoed it to the client as part of the capstone. Five versions got it there:

    1. v1 · ChatA plain chat model. Fluent, but it had never seen our data.
    2. v2 · CSV searchFirst retrieval prototype over exported tables.
    3. v3 · Better embeddingsA stronger embedding model, and the mismatch that made search look random.
    4. v4 · Gold searchSearch moved into the Gold tables in Postgres, one row per source.
    5. v5 · On deviceModel, search, data and app in Docker on one machine.

What's next

Where it goes from here

  • A benchmark of real analyst questions with known answers, to score accuracy on every change.
  • A vector index on every Gold table, so search stays fast as the data grows.
  • Make every remaining Gold table searchable, so anything the app tracks is one question away.

Contact

Hiring? Let's talk.

I'm looking for full-time engineering roles in software, robotics and applied AI. Email is the fastest way to reach me.

pranch555@gmail.com