You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Quick writeup based on our hack night discussion on 4/23 - this needs more refinement before we're ready to go, this is mostly a braindump.
Problem
Our ML experts want to be able to reference the Massachusetts General Laws (MGL) to hydrate data for our upcoming LLM-driven bill summaries. If a bill references any sections of the MGL, the model will need to fetch those sections in order to generate the prompt used to generate the summary (to ensure we aren't missing critical context).
They are currently doing so by scraping the HTML of the MGL website, but we want a less fragile solution going forward.
Proposal
At the beginning of a session, let's scrape the MGL, store text on our side, and expose it to our LLM wrapper service via a private API. We'll do this instead of relying on the MA Legislature API at runtime because <???> (missing context, are we looking for versioning on this or just speed)?
Success Criteria
Worker that scrapes the MGL and stores it in a Firestore collection, accessible by chapter + section
Maybe this doesn't need to be in Firestore? Chapter + Section -> Blob text seems like the relevant bits, let's check in with Matt V and Nathan on what they need here and whether this can be simpler.
Private API endpoint that lets a caller query by Chapter + Section
One bill can reference 50+ sections, so a batch endpoint is likely useful.
The total section text can be pretty large, we may need to chunk/stream the response.
Open Questions
What is going on with the Journal of Session Laws? Do bills reference those? Do we need to care? What exactly is the timing/process for moving a bill from the Journal of Session Laws to the MGL?
If the MGL web page and the Mass Legislature API disagree, which is correct?
The MGL web page says that it isn't the official version of the MGL - is this a major problem, or are issues caused by this covered by the disclaimer we'll have on LLM summaries anyway?
Quick diagram of my understanding from our hack night discussion on 4/23:
The text was updated successfully, but these errors were encountered:
Quick writeup based on our hack night discussion on 4/23 - this needs more refinement before we're ready to go, this is mostly a braindump.
Problem
Our ML experts want to be able to reference the Massachusetts General Laws (MGL) to hydrate data for our upcoming LLM-driven bill summaries. If a bill references any sections of the MGL, the model will need to fetch those sections in order to generate the prompt used to generate the summary (to ensure we aren't missing critical context).
They are currently doing so by scraping the HTML of the MGL website, but we want a less fragile solution going forward.
Proposal
At the beginning of a session, let's scrape the MGL, store text on our side, and expose it to our LLM wrapper service via a private API. We'll do this instead of relying on the MA Legislature API at runtime because <???> (missing context, are we looking for versioning on this or just speed)?
Success Criteria
Open Questions
Quick diagram of my understanding from our hack night discussion on 4/23:
![Screenshot 2024-04-23 at 9.09.31 PM.png](https://camo.githubusercontent.com/d99bb0c8b5308b9d73e07433bbb6adc22cb0d9d4fc9b1623565c0a3a2d78091c/68747470733a2f2f6170692e7a656e6875622e636f6d2f617474616368656446696c65732f65794a66636d467062484d694f6e73696257567a6332466e5a534936496b4a42614842424e6b394b516b453950534973496d563463434936626e56736243776963485679496a6f69596d7876596c39705a434a3966513d3d2d2d653466333538353438303831653532333062346564326134323536633931396662666537656363342f53637265656e73686f74253230323032342d30342d32332532306174253230392e30392e3331254532253830254146504d2e706e67)
The text was updated successfully, but these errors were encountered: