launchthat
Search the Session, Keep the Record in Postgres
Session Desk is a committee bill desk on ASP.NET Core and Angular. OpenSearch answers the header. A model can draft a brief. A person still decides what becomes a note.
Session Desk is the committee desk I wanted a .NET and Angular portfolio piece to be. Staff sign in, pick a committee, and work the bills referred there: agenda, notes, hearings, and an audit log. They can also search the whole fictional session, including bills they are not allowed to act on.
It is live at session-desk.apps.onpoint.host. The bills are invented. The architecture is the part I care about showing.
A legislative session is a few kinds of data that do not want the same store. The official record is small, relational, and permissioned. The text people search is larger, and the useful queries are awkward in SQL. A staff brief is text from a model, and it should not become a note by itself.
The record stays in PostgreSQL
Bills, hearings, notes, and audit events are EF Core rows in PostgreSQL. Every API call except health and login requires a signed-in user and an X-Committee-Id header for a committee they belong to. Recording an action loads the bill only if it belongs to that committee. A miss is a 404.
That is the desk. Appropriations does not get to file a note on an Education bill because search happened to find it.
The live API uses EF Core only. The same four bill operations also exist in a public companion, session-desk-orm, once on NHibernate 5.5 and once on EF Core 8. Both talk to Postgres. The tests load a bill with its actions, list a single committee, add a note, and record an action plus a note in one transaction that rolls back together when the note is too long. NHibernate keeps an ISession for the operation, treats the action collection as an inverse lazy bag, and initializes that bag before the session closes. EF Core uses DbContext and Include. The deployed desk did not grow a second ORM.
Search being down does not take the desk down. If OpenSearch is unset or unreachable, GET /api/search returns 503. The bills list, the hearing, and the audit log still read from Postgres.
Why the header is not a LIKE filter
The first version of the header filtered the current committee with a case-insensitive contains check on number, title, and sponsor. For five bills that is honest and fast enough. It is also LIKE '%term%', which a normal B-tree will not serve, and it cannot highlight a citation inside a paragraph.
A session is a different shape. People search a bill number fragment, a phrase from the text, and a statute citation, and they expect the hit to show where the words matched. The Florida Senate's own search tips are about that kind of lookup. I did not need their corpus to take the requirement seriously. I needed enough bills that a committee list and a session search are obviously different screens.
Submitting the header now opens /search?q=. The API asks OpenSearch. Number is a keyword, and a term that looks like a number or an SB / HB token also wildcard-matches it, so 12 returns SB 1200 and SB 1204. Citation is a keyword, so 120.54 matches the citation rather than a fuzzy substring of the title. Title, sponsor, and body are text fields. The response includes the bill, the committee, the citation, and a highlighted snippet.
The Angular page splits the highlight markers into marked text. It does not bind the cluster's HTML.
OpenSearch stays inside the cluster
The cluster is one OpenSearch node: single-node discovery, security plugin off, about 512MB of heap, ClusterIP on port 9200. It has no NodePort and no public route. The API is the only caller, and that caller already required a signed-in committee member.
Turning the security plugin off is a deployment convenience for a single internal node. It is acceptable only because nothing outside the cluster can open port 9200. The moment that service had a public address, the plugin would have to come back on.
On startup, after the database migrates and the bills are seeded, a background service creates the session-bills index if it is missing and bulk-loads every bill. Tests use a fake search client. They never start OpenSearch.
A few hundred fictional bills
Five documents in an index is a demo of a client library. A committee with dozens of referred bills, plus other committees the user cannot act on, is a demo of the boundary.
The original five bills, their hearing, and their actions stay. Three hundred more are generated from a fixed seed so the set does not change between starts. They spread across Appropriations, Rules, Education, Health Policy, Judiciary, and Agriculture. Each one has a number, a sponsor, a status, a citation such as 120.54, and a short body that includes that citation. Nothing is copied from the live Senate site, and the model is not used to invent the corpus.
Demo users sit on Appropriations and Rules. Search can still open an Education bill. That screen shows the text. It does not offer Record action or Draft brief.
The brief is a fixed call, then a person
I wanted a staff brief in the product, and I did not want a chatbot with tools. Tools would let the model schedule a hearing or write a note. Those are human actions, and the audit log is the record of them.
The API sends one chat completion. The request asks for a low reasoning effort, a short completion, and no tools. The visible reply is the draft. Reasoning text from the provider is dropped and never stored. I used HttpClient for that body instead of Microsoft.Extensions.AI, because the request has to stay exact: the reasoning setting, the absence of tools, and the decision to throw away reasoning content.
Before the draft is shown, C# scans it for bill numbers. If it cites an SB or HB the committee does not have, the API returns 422, does not return the draft, and writes ai.draft_withheld. A viewer gets 403 before any of that runs.
Accept writes the person's note, flags it if they edited the text, and records bill.note_added with the same trace id as ai.briefing_requested. Discard records ai.draft_discarded and leaves the bill's last action alone. The model draft is not overwritten into the note field of the bill. The note is whatever the person submitted.
Two traces, one id
Postgres is the official record. Langfuse is the engineering trace: retrieve, prompt, generate, and the citation check, exported over OpenTelemetry when a public key, a secret key, and a base URL are all set. On the live cluster the export is skipped because those keys are empty. The audit row still has the trace id, so a later Langfuse project can be joined to the same briefing without changing what staff see.
What I left off on purpose
I did not clone the Senate's bill-text pages, and I did not index real statutes. The body on each bill is a short fictional paragraph so search has something to match. Filed HTML and PDF are a publication system. This app is the desk in front of that publication.
The live site is Session Desk. The project write-up, including the decision list, is on the Session Desk project page.
Want to see how this was built?
Browse all posts